Actions

EmSys

Tm4clib-pwm

From EdWiki

Introduction

Each instance of a Tiva PWM module provides up to four instances of a PWM generator block, and an output control block. Each generator block has two PWM output signals, which can be operated independently or as a pair of signals with dead band delays inserted. Each generator block also has an interrupt output and a trigger output. The control block determines the polarity of the PWM signals and which signals are passed through to the pins.

Some of the features of the Tiva PWM module are:

  • Up to four generator blocks, each containing
    • One 16-bit down or up/down counter
    • Two comparators
    • PWM generator
    • Dead band generator
  • Control block
    • PWM output enable
    • Output polarity control
    • Synchronization
    • Fault handling
    • Interrupt status

API Functions

  • void pwm_gen_enable(uint32_t ui32Base, uint32_t ui32Gen)
    Enables the timer/counter for a PWM generator block. More ...
  • void pwm_gen_disable(uint32_t ui32Base, uint32_t ui32Gen)
    Disables the timer/counter for a PWM generator block. More ...
  • void pwm_dead_band_disable(uint32_t ui32Base, uint32_t ui32Gen)
    Disables the PWM dead band output. More ...
  • void pwm_sync_update(uint32_t ui32Base, uint32_t ui32GenBits)
    Synchronizes all pending updates. More ...
  • void pwm_sync_time_base(uint32_t ui32Base, uint32_t ui32GenBits)
    Synchronizes the counters in one or multiple PWM generator blocks. More ...
  • void pwm_gen_enable_int_trig(uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32IntTrig)
    Enables interrupts and triggers for the specified PWM generator block. More ...
  • void pwm_gen_disable_int_trig(uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32IntTrig)
    Disables interrupts for the specified PWM generator block. More ...
  • uint32_t pwm_gen_get_int_status(uint32_t ui32Base, uint32_t ui32Gen, bool bMasked)
    Gets interrupt status for the specified PWM generator block. More ...
  • void pwm_gen_clear_int(uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32Ints)
    Clears the specified interrupt(s) for the specified PWM generator block. More ...
  • void pwm_enable_int(uint32_t ui32Base, uint32_t ui32GenFault)
    Enables generator and fault interrupts for a PWM module. More ...
  • void pwm_disable_int(uint32_t ui32Base, uint32_t ui32GenFault)
    Disables generator and fault interrupts for a PWM module. More ...
  • void pwm_clear_fault_int(uint32_t ui32Base)
    Clears the fault interrupt for a PWM module. More ...
  • uint32_t pwm_get_int_status(uint32_t ui32Base, bool bMasked)
    Gets the interrupt status for a PWM module. More ...
  • void pwm_clear_fault_int_ext(uint32_t ui32Base, uint32_t ui32FaultInts)
    Clears the fault interrupt for a PWM module. More ...
  • void pwm_gen_configure(uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32Config)
    Configures a PWM generator. More ...
  • void pwm_gen_set_period(uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32Period)
    Sets the period of a PWM generator. More ...
  • uint32_t pwm_gen_get_period(uint32_t ui32Base, uint32_t ui32Gen)
    Gets the period of a PWM generator block. More ...
  • void pwm_set_pulse_width(uint32_t ui32Base, uint32_t ui32PWMOut, uint32_t ui32Width)
    Sets the pulse width for the specified PWM output. More ...
  • uint32_t pwm_get_pulse_width(uint32_t ui32Base, uint32_t ui32PWMOut)
    Gets the pulse width of a PWM output. More ...
  • void pwm_dead_band_enable(uint32_t ui32Base, uint32_t ui32Gen, uint16_t ui16Rise, uint16_t ui16Fall)
    Enables the PWM dead band output and sets the dead band delays. More ...
  • void pwm_output_state(uint32_t ui32Base, uint32_t ui32PWMOutBits, bool bEnable)
    Enables or disables PWM outputs. More ...
  • void pwm_output_invert(uint32_t ui32Base, uint32_t ui32PWMOutBits, bool bInvert)
    Selects the inversion mode for PWM outputs. More ...
  • void pwm_output_fault_level(uint32_t ui32Base, uint32_t ui32PWMOutBits, bool bDriveHigh)
    Specifies the level of PWM outputs suppressed in response to a fault condition. More ...
  • void pwm_output_fault(uint32_t ui32Base, uint32_t ui32PWMOutBits, bool bFaultSuppress)
    Specifies the state of PWM outputs in response to a fault condition. More ...
  • void pwm_gen_configure_fault(uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32MinFaultPeriod, uint32_t ui32FaultSenses)
    Configures the minimum fault period and fault pin senses for a given PWM generator. More ...
  • void pwm_gen_set_fault_trigger(uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32Group, uint32_t ui32FaultTriggers)
    Configures the set of fault triggers for a given PWM generator. More ...
  • uint32_t pwm_gen_get_fault_trigger(uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32Group)
    Returns the set of fault triggers currently configured for a given PWM generator. More ...
  • uint32_t pwm_gen_get_fault_status(uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32Group)
    Returns the current state of the fault triggers for a given PWM generator. More ...
  • void pwm_gen_clear_fault(uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32Group, uint32_t ui32FaultTriggers)
    Clears one or more latched fault triggers for a given PWM generator. More ...
  • void pwm_output_update_mode(uint32_t ui32Base, uint32_t ui32PWMOutBits, uint32_t ui32Mode)
    Sets the update mode or synchronization mode to the PWM outputs. More ...

See Also