Tiva Driver Lib
|
Functions | |
void | PWMGenConfigure (uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32Config) |
void | PWMGenPeriodSet (uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32Period) |
uint32_t | PWMGenPeriodGet (uint32_t ui32Base, uint32_t ui32Gen) |
void | PWMGenEnable (uint32_t ui32Base, uint32_t ui32Gen) |
void | PWMGenDisable (uint32_t ui32Base, uint32_t ui32Gen) |
void | PWMPulseWidthSet (uint32_t ui32Base, uint32_t ui32PWMOut, uint32_t ui32Width) |
uint32_t | PWMPulseWidthGet (uint32_t ui32Base, uint32_t ui32PWMOut) |
void | PWMDeadBandEnable (uint32_t ui32Base, uint32_t ui32Gen, uint16_t ui16Rise, uint16_t ui16Fall) |
void | PWMDeadBandDisable (uint32_t ui32Base, uint32_t ui32Gen) |
void | PWMSyncUpdate (uint32_t ui32Base, uint32_t ui32GenBits) |
void | PWMSyncTimeBase (uint32_t ui32Base, uint32_t ui32GenBits) |
void | PWMOutputState (uint32_t ui32Base, uint32_t ui32PWMOutBits, bool bEnable) |
void | PWMOutputInvert (uint32_t ui32Base, uint32_t ui32PWMOutBits, bool bInvert) |
void | PWMOutputFaultLevel (uint32_t ui32Base, uint32_t ui32PWMOutBits, bool bDriveHigh) |
void | PWMOutputFault (uint32_t ui32Base, uint32_t ui32PWMOutBits, bool bFaultSuppress) |
void | PWMGenIntRegister (uint32_t ui32Base, uint32_t ui32Gen, void(*pfnIntHandler)(void)) |
void | PWMGenIntUnregister (uint32_t ui32Base, uint32_t ui32Gen) |
void | PWMFaultIntRegister (uint32_t ui32Base, void(*pfnIntHandler)(void)) |
void | PWMFaultIntUnregister (uint32_t ui32Base) |
void | PWMGenIntTrigEnable (uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32IntTrig) |
void | PWMGenIntTrigDisable (uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32IntTrig) |
uint32_t | PWMGenIntStatus (uint32_t ui32Base, uint32_t ui32Gen, bool bMasked) |
void | PWMGenIntClear (uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32Ints) |
void | PWMIntEnable (uint32_t ui32Base, uint32_t ui32GenFault) |
void | PWMIntDisable (uint32_t ui32Base, uint32_t ui32GenFault) |
void | PWMFaultIntClear (uint32_t ui32Base) |
uint32_t | PWMIntStatus (uint32_t ui32Base, bool bMasked) |
void | PWMFaultIntClearExt (uint32_t ui32Base, uint32_t ui32FaultInts) |
void | PWMGenFaultConfigure (uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32MinFaultPeriod, uint32_t ui32FaultSenses) |
void | PWMGenFaultTriggerSet (uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32Group, uint32_t ui32FaultTriggers) |
uint32_t | PWMGenFaultTriggerGet (uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32Group) |
uint32_t | PWMGenFaultStatus (uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32Group) |
void | PWMGenFaultClear (uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32Group, uint32_t ui32FaultTriggers) |
#define PWM_GEN_EXT_BADDR | ( | _mod_, | |
_gen_ | |||
) |
void PWMDeadBandDisable | ( | uint32_t | ui32Base, |
uint32_t | ui32Gen | ||
) |
Disables the PWM dead band output.
ui32Base | is the base address of the PWM module. |
ui32Gen | is the PWM generator to modify. This parameter must be one of PWM_GEN_0, PWM_GEN_1, PWM_GEN_2, or PWM_GEN_3. |
This function disables the dead band mode for the specified PWM generator. Doing so decouples the OutA and OutB signals.
void PWMDeadBandEnable | ( | uint32_t | ui32Base, |
uint32_t | ui32Gen, | ||
uint16_t | ui16Rise, | ||
uint16_t | ui16Fall | ||
) |
Enables the PWM dead band output and sets the dead band delays.
ui32Base | is the base address of the PWM module. |
ui32Gen | is the PWM generator to modify. This parameter must be one of PWM_GEN_0, PWM_GEN_1, PWM_GEN_2, or PWM_GEN_3. |
ui16Rise | specifies the width of delay from the rising edge. |
ui16Fall | specifies the width of delay from the falling edge. |
This function sets the dead bands for the specified PWM generator, where the dead bands are defined as the number of PWM clock ticks from the rising or falling edge of the generator's OutA signal. Note that this function causes the coupling of OutB to OutA.
void PWMFaultIntClear | ( | uint32_t | ui32Base | ) |
Clears the fault interrupt for a PWM module.
ui32Base | is the base address of the PWM module. |
This function clears the fault interrupt by writing to the appropriate bit of the interrupt status register for the selected PWM module.
This function clears only the FAULT0 interrupt and is retained for backwards compatibility. It is recommended that PWMFaultIntClearExt() be used instead because it supports all fault interrupts supported on devices with and without extended PWM fault handling support.
void PWMFaultIntClearExt | ( | uint32_t | ui32Base, |
uint32_t | ui32FaultInts | ||
) |
Clears the fault interrupt for a PWM module.
ui32Base | is the base address of the PWM module. |
ui32FaultInts | specifies the fault interrupts to clear. |
This function clears one or more fault interrupts by writing to the appropriate bit of the PWM interrupt status register. The parameter ui32FaultInts must be the logical OR of any of PWM_INT_FAULT0, PWM_INT_FAULT1, PWM_INT_FAULT2, or PWM_INT_FAULT3.
When running on a device supporting extended PWM fault handling, the fault interrupts are derived by performing a logical OR of each of the configured fault trigger signals for a given generator. Therefore, these interrupts are not directly related to the four possible FAULTn inputs to the device but indicate that a fault has been signaled to one of the four possible PWM generators. On a device without extended PWM fault handling, the interrupt is directly related to the state of the single FAULT pin.
void PWMFaultIntRegister | ( | uint32_t | ui32Base, |
void(*)(void) | pfnIntHandler | ||
) |
Registers an interrupt handler for a fault condition detected in a PWM module.
ui32Base | is the base address of the PWM module. |
pfnIntHandler | is a pointer to the function to be called when the PWM fault interrupt occurs. |
This function ensures that the interrupt handler specified by pfnIntHandler is called when a fault interrupt is detected for the selected PWM module. This function also enables the PWM fault interrupt in the NVIC; the PWM fault interrupt must also be enabled at the module level using PWMIntEnable().
void PWMFaultIntUnregister | ( | uint32_t | ui32Base | ) |
Removes the PWM fault condition interrupt handler.
ui32Base | is the base address of the PWM module. |
This function removes the interrupt handler for a PWM fault interrupt from the selected PWM module. This function also disables the PWM fault interrupt in the NVIC; the PWM fault interrupt must also be disabled at the module level using PWMIntDisable().
void PWMGenConfigure | ( | uint32_t | ui32Base, |
uint32_t | ui32Gen, | ||
uint32_t | ui32Config | ||
) |
Configures a PWM generator.
ui32Base | is the base address of the PWM module. |
ui32Gen | is the PWM generator to configure. This parameter must be one of PWM_GEN_0, PWM_GEN_1, PWM_GEN_2, or PWM_GEN_3. |
ui32Config | is the configuration for the PWM generator. |
This function is used to set the mode of operation for a PWM generator. The counting mode, synchronization mode, and debug behavior are all configured. After configuration, the generator is left in the disabled state.
A PWM generator can count in two different modes: count down mode or count up/down mode. In count down mode, it counts from a value down to zero, and then resets to the preset value, producing left-aligned PWM signals (that is, the rising edge of the two PWM signals produced by the generator occur at the same time). In count up/down mode, it counts up from zero to the preset value, counts back down to zero, and then repeats the process, producing center-aligned PWM signals (that is, the middle of the high/low period of the PWM signals produced by the generator occurs at the same time).
When the PWM generator parameters (period and pulse width) are modified, their effect on the output PWM signals can be delayed. In synchronous mode, the parameter updates are not applied until a synchronization event occurs. This mode allows multiple parameters to be modified and take effect simultaneously, instead of one at a time. Additionally, parameters to multiple PWM generators in synchronous mode can be updated simultaneously, allowing them to be treated as if they were a unified generator. In non-synchronous mode, the parameter updates are not delayed until a synchronization event. In either mode, the parameter updates only occur when the counter is at zero to help prevent oddly formed PWM signals during the update (that is, a PWM pulse that is too short or too long).
The PWM generator can either pause or continue running when the processor is stopped via the debugger. If configured to pause, it continues to count until it reaches zero, at which point it pauses until the processor is restarted. If configured to continue running, it keeps counting as if nothing had happened.
The ui32Config parameter contains the desired configuration. It is the logical OR of the following:
Setting PWM_GEN_MODE_FAULT_MINPER allows an application to set the minimum duration of a PWM fault signal. Faults are signaled for at least this time even if the external fault pin deasserts earlier. Care should be taken when using this mode because during the fault signal period, the fault interrupt from the PWM generator remains asserted. The fault interrupt handler may, therefore, reenter immediately if it exits prior to expiration of the fault timer.
void PWMGenDisable | ( | uint32_t | ui32Base, |
uint32_t | ui32Gen | ||
) |
Disables the timer/counter for a PWM generator block.
ui32Base | is the base address of the PWM module. |
ui32Gen | is the PWM generator to be disabled. This parameter must be one of PWM_GEN_0, PWM_GEN_1, PWM_GEN_2, or PWM_GEN_3. |
This function blocks the PWM clock from driving the timer/counter for the specified generator block.
void PWMGenEnable | ( | uint32_t | ui32Base, |
uint32_t | ui32Gen | ||
) |
Enables the timer/counter for a PWM generator block.
ui32Base | is the base address of the PWM module. |
ui32Gen | is the PWM generator to be enabled. This parameter must be one of PWM_GEN_0, PWM_GEN_1, PWM_GEN_2, or PWM_GEN_3. |
This function allows the PWM clock to drive the timer/counter for the specified generator block.
void PWMGenFaultClear | ( | uint32_t | ui32Base, |
uint32_t | ui32Gen, | ||
uint32_t | ui32Group, | ||
uint32_t | ui32FaultTriggers | ||
) |
Clears one or more latched fault triggers for a given PWM generator.
ui32Base | is the base address of the PWM module. |
ui32Gen | is the PWM generator for which fault trigger states are being queried. This parameter must be one of PWM_GEN_0, PWM_GEN_1, PWM_GEN_2, or PWM_GEN_3. |
ui32Group | indicates the subset of faults that are being queried. This parameter must be PWM_FAULT_GROUP_0 or PWM_FAULT_GROUP_1. |
ui32FaultTriggers | is the set of fault triggers which are to be cleared. |
This function allows an application to clear the fault triggers for a given PWM generator. This function is only required if PWMGenConfigure() has previously been called with flag PWM_GEN_MODE_FAULT_LATCHED in parameter ui32Config.
void PWMGenFaultConfigure | ( | 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.
ui32Base | is the base address of the PWM module. |
ui32Gen | is the PWM generator for which fault configuration is being set. This function must be one of PWM_GEN_0, PWM_GEN_1, PWM_GEN_2, or PWM_GEN_3. |
ui32MinFaultPeriod | is the minimum fault active period expressed in PWM clock cycles. |
ui32FaultSenses | indicates which sense of each FAULT input should be considered the ``asserted'' state. Valid values are logical OR combinations of PWM_FAULTn_SENSE_HIGH and PWM_FAULTn_SENSE_LOW. |
This function configures the minimum fault period for a given generator along with the sense of each of the 4 possible fault inputs. The minimum fault period is expressed in PWM clock cycles and takes effect only if PWMGenConfigure() is called with flag PWM_GEN_MODE_FAULT_PER set in the ui32Config parameter. When a fault input is asserted, the minimum fault period timer ensures that it remains asserted for at least the number of clock cycles specified.
uint32_t PWMGenFaultStatus | ( | uint32_t | ui32Base, |
uint32_t | ui32Gen, | ||
uint32_t | ui32Group | ||
) |
Returns the current state of the fault triggers for a given PWM generator.
ui32Base | is the base address of the PWM module. |
ui32Gen | is the PWM generator for which fault trigger states are being queried. This parameter must be one of PWM_GEN_0, PWM_GEN_1, PWM_GEN_2, or PWM_GEN_3. |
ui32Group | indicates the subset of faults that are being queried. This parameter must be PWM_FAULT_GROUP_0 or PWM_FAULT_GROUP_1. |
This function allows an application to query the current state of each of the fault trigger inputs to a given PWM generator. The current state of each fault trigger input is returned unless PWMGenConfigure() has previously been called with flag PWM_GEN_MODE_FAULT_LATCHED in the ui32Config parameter, in which case the returned status is the latched fault trigger status.
If latched faults are configured, the application must call PWMGenFaultClear() to clear each trigger.
uint32_t PWMGenFaultTriggerGet | ( | uint32_t | ui32Base, |
uint32_t | ui32Gen, | ||
uint32_t | ui32Group | ||
) |
Returns the set of fault triggers currently configured for a given PWM generator.
ui32Base | is the base address of the PWM module. |
ui32Gen | is the PWM generator for which fault triggers are being queried. This parameter must be one of PWM_GEN_0, PWM_GEN_1, PWM_GEN_2, or PWM_GEN_3. |
ui32Group | indicates the subset of faults that are being queried. This parameter must be PWM_FAULT_GROUP_0 or PWM_FAULT_GROUP_1. |
This function allows an application to query the current set of inputs that contribute to the generation of a fault condition to a given PWM generator.
void PWMGenFaultTriggerSet | ( | uint32_t | ui32Base, |
uint32_t | ui32Gen, | ||
uint32_t | ui32Group, | ||
uint32_t | ui32FaultTriggers | ||
) |
Configures the set of fault triggers for a given PWM generator.
ui32Base | is the base address of the PWM module. |
ui32Gen | is the PWM generator for which fault triggers are being set. This parameter must be one of PWM_GEN_0, PWM_GEN_1, PWM_GEN_2, or PWM_GEN_3. |
ui32Group | indicates the subset of possible faults that are to be configured. This parameter must be PWM_FAULT_GROUP_0 or PWM_FAULT_GROUP_1. |
ui32FaultTriggers | defines the set of inputs that are to contribute towards generation of the fault signal to the given PWM generator. For PWM_FAULT_GROUP_0, this is the logical OR of PWM_FAULT_FAULT0, PWM_FAULT_FAULT1, PWM_FAULT_FAULT2, or PWM_FAULT_FAULT3. For PWM_FAULT_GROUP_1, this is the logical OR of PWM_FAULT_DCMP0, PWM_FAULT_DCMP1, PWM_FAULT_DCMP2, PWM_FAULT_DCMP3, PWM_FAULT_DCMP4, PWM_FAULT_DCMP5, PWM_FAULT_DCMP6, or PWM_FAULT_DCMP7. |
This function allows selection of the set of fault inputs that is combined to generate a fault condition to a given PWM generator. By default, all generators use only FAULT0 (for backwards compatibility) but if PWMGenConfigure() is called with flag PWM_GEN_MODE_FAULT_SRC in the ui32Config parameter, extended fault handling is enabled and this function must be called to configure the fault triggers.
The fault signal to the PWM generator is generated by ORing together each of the signals specified in the ui32FaultTriggers parameter after having adjusted the sense of each FAULTn input based on the configuration previously set using a call to PWMGenFaultConfigure().
void PWMGenIntClear | ( | uint32_t | ui32Base, |
uint32_t | ui32Gen, | ||
uint32_t | ui32Ints | ||
) |
Clears the specified interrupt(s) for the specified PWM generator block.
ui32Base | is the base address of the PWM module. |
ui32Gen | is the PWM generator to query. This parameter must be one of PWM_GEN_0, PWM_GEN_1, PWM_GEN_2, or PWM_GEN_3. |
ui32Ints | specifies the interrupts to be cleared. |
This function clears the specified interrupt(s) by writing a 1 to the specified bits of the interrupt status register for the specified PWM generator. The ui32Ints parameter is the logical OR of PWM_INT_CNT_ZERO, PWM_INT_CNT_LOAD, PWM_INT_CNT_AU, PWM_INT_CNT_AD, PWM_INT_CNT_BU, or PWM_INT_CNT_BD.
void PWMGenIntRegister | ( | uint32_t | ui32Base, |
uint32_t | ui32Gen, | ||
void(*)(void) | pfnIntHandler | ||
) |
Registers an interrupt handler for the specified PWM generator block.
ui32Base | is the base address of the PWM module. |
ui32Gen | is the PWM generator in question. This parameter must be one of PWM_GEN_0, PWM_GEN_1, PWM_GEN_2, or PWM_GEN_3. |
pfnIntHandler | is a pointer to the function to be called when the PWM generator interrupt occurs. |
This function ensures that the interrupt handler specified by pfnIntHandler is called when an interrupt is detected for the specified PWM generator block. This function also enables the corresponding PWM generator interrupt in the interrupt controller; individual generator interrupts and interrupt sources must be enabled with PWMIntEnable() and PWMGenIntTrigEnable().
uint32_t PWMGenIntStatus | ( | uint32_t | ui32Base, |
uint32_t | ui32Gen, | ||
bool | bMasked | ||
) |
Gets interrupt status for the specified PWM generator block.
ui32Base | is the base address of the PWM module. |
ui32Gen | is the PWM generator to query. This parameter must be one of PWM_GEN_0, PWM_GEN_1, PWM_GEN_2, or PWM_GEN_3. |
bMasked | specifies whether masked or raw interrupt status is returned. |
If bMasked is set as true, then the masked interrupt status is returned; otherwise, the raw interrupt status is returned.
void PWMGenIntTrigDisable | ( | uint32_t | ui32Base, |
uint32_t | ui32Gen, | ||
uint32_t | ui32IntTrig | ||
) |
Disables interrupts for the specified PWM generator block.
ui32Base | is the base address of the PWM module. |
ui32Gen | is the PWM generator to have interrupts and triggers disabled. This parameter must be one of PWM_GEN_0, PWM_GEN_1, PWM_GEN_2, or PWM_GEN_3. |
ui32IntTrig | specifies the interrupts and triggers to be disabled. |
This function masks the specified interrupt(s) and trigger(s) by clearing the specified bits of the interrupt/trigger enable register for the specified PWM generator. The ui32IntTrig parameter is the logical OR of PWM_INT_CNT_ZERO, PWM_INT_CNT_LOAD, PWM_INT_CNT_AU, PWM_INT_CNT_AD, PWM_INT_CNT_BU, PWM_INT_CNT_BD, PWM_TR_CNT_ZERO, PWM_TR_CNT_LOAD, PWM_TR_CNT_AU, PWM_TR_CNT_AD, PWM_TR_CNT_BU, or PWM_TR_CNT_BD.
void PWMGenIntTrigEnable | ( | uint32_t | ui32Base, |
uint32_t | ui32Gen, | ||
uint32_t | ui32IntTrig | ||
) |
Enables interrupts and triggers for the specified PWM generator block.
ui32Base | is the base address of the PWM module. |
ui32Gen | is the PWM generator to have interrupts and triggers enabled. This parameter must be one of PWM_GEN_0, PWM_GEN_1, PWM_GEN_2, or PWM_GEN_3. |
ui32IntTrig | specifies the interrupts and triggers to be enabled. |
This function unmasks the specified interrupt(s) and trigger(s) by setting the specified bits of the interrupt/trigger enable register for the specified PWM generator. The ui32IntTrig parameter is the logical OR of PWM_INT_CNT_ZERO, PWM_INT_CNT_LOAD, PWM_INT_CNT_AU, PWM_INT_CNT_AD, PWM_INT_CNT_BU, PWM_INT_CNT_BD, PWM_TR_CNT_ZERO, PWM_TR_CNT_LOAD, PWM_TR_CNT_AU, PWM_TR_CNT_AD, PWM_TR_CNT_BU, or PWM_TR_CNT_BD.
void PWMGenIntUnregister | ( | uint32_t | ui32Base, |
uint32_t | ui32Gen | ||
) |
Removes an interrupt handler for the specified PWM generator block.
ui32Base | is the base address of the PWM module. |
ui32Gen | is the PWM generator in question. This parameter must be one of PWM_GEN_0, PWM_GEN_1, PWM_GEN_2, or PWM_GEN_3. |
This function unregisters the interrupt handler for the specified PWM generator block. This function also disables the corresponding PWM generator interrupt in the interrupt controller; individual generator interrupts and interrupt sources must be disabled with PWMIntDisable() and PWMGenIntTrigDisable().
uint32_t PWMGenPeriodGet | ( | uint32_t | ui32Base, |
uint32_t | ui32Gen | ||
) |
Gets the period of a PWM generator block.
ui32Base | is the base address of the PWM module. |
ui32Gen | is the PWM generator to query. This parameter must be one of PWM_GEN_0, PWM_GEN_1, PWM_GEN_2, or PWM_GEN_3. |
This function gets the period of the specified PWM generator block. The period of the generator block is defined as the number of PWM clock ticks between pulses on the generator block zero signal.
If the update of the counter for the specified PWM generator has yet to be completed, the value returned may not be the active period. The value returned is the programmed period, measured in PWM clock ticks.
void PWMGenPeriodSet | ( | uint32_t | ui32Base, |
uint32_t | ui32Gen, | ||
uint32_t | ui32Period | ||
) |
Sets the period of a PWM generator.
ui32Base | is the base address of the PWM module. |
ui32Gen | is the PWM generator to be modified. This parameter must be one of PWM_GEN_0, PWM_GEN_1, PWM_GEN_2, or PWM_GEN_3. |
ui32Period | specifies the period of PWM generator output, measured in clock ticks. |
This function sets the period of the specified PWM generator block, where the period of the generator block is defined as the number of PWM clock ticks between pulses on the generator block zero signal.
void PWMIntDisable | ( | uint32_t | ui32Base, |
uint32_t | ui32GenFault | ||
) |
Disables generator and fault interrupts for a PWM module.
ui32Base | is the base address of the PWM module. |
ui32GenFault | contains the interrupts to be disabled. This parameter must be a logical OR of any of PWM_INT_GEN_0, PWM_INT_GEN_1, PWM_INT_GEN_2, PWM_INT_GEN_3, PWM_INT_FAULT0, PWM_INT_FAULT1, PWM_INT_FAULT2, or PWM_INT_FAULT3. |
This function masks the specified interrupt(s) by clearing the specified bits of the interrupt enable register for the selected PWM module.
void PWMIntEnable | ( | uint32_t | ui32Base, |
uint32_t | ui32GenFault | ||
) |
Enables generator and fault interrupts for a PWM module.
ui32Base | is the base address of the PWM module. |
ui32GenFault | contains the interrupts to be enabled. This parameter must be a logical OR of any of PWM_INT_GEN_0, PWM_INT_GEN_1, PWM_INT_GEN_2, PWM_INT_GEN_3, PWM_INT_FAULT0, PWM_INT_FAULT1, PWM_INT_FAULT2, or PWM_INT_FAULT3. |
This function unmasks the specified interrupt(s) by setting the specified bits of the interrupt enable register for the selected PWM module.
uint32_t PWMIntStatus | ( | uint32_t | ui32Base, |
bool | bMasked | ||
) |
Gets the interrupt status for a PWM module.
ui32Base | is the base address of the PWM module. |
bMasked | specifies whether masked or raw interrupt status is returned. |
If bMasked is set as true, then the masked interrupt status is returned; otherwise, the raw interrupt status is returned.
void PWMOutputFault | ( | uint32_t | ui32Base, |
uint32_t | ui32PWMOutBits, | ||
bool | bFaultSuppress | ||
) |
Specifies the state of PWM outputs in response to a fault condition.
ui32Base | is the base address of the PWM module. |
ui32PWMOutBits | are the PWM outputs to be modified. This parameter must be the logical OR of any of PWM_OUT_0_BIT, PWM_OUT_1_BIT, PWM_OUT_2_BIT, PWM_OUT_3_BIT, PWM_OUT_4_BIT, PWM_OUT_5_BIT, PWM_OUT_6_BIT, or PWM_OUT_7_BIT. |
bFaultSuppress | determines if the signal is suppressed or passed through during an active fault condition. |
This function sets the fault handling int8_tacteristics of the selected PWM outputs. The outputs are selected using the parameter ui32PWMOutBits. The parameter bFaultSuppress determines the fault handling chacteristics for the selected outputs. If bFaultSuppress is true, then the selected outputs are made inactive. If bFaultSuppress is false, then the selected outputs are unaffected by the detected fault.
On devices supporting extended PWM fault handling, the state the affected output pins are driven to can be configured with PWMOutputFaultLevel(). If not configured, or if the device does not support extended PWM fault handling, affected outputs are driven low on a fault condition.
void PWMOutputFaultLevel | ( | uint32_t | ui32Base, |
uint32_t | ui32PWMOutBits, | ||
bool | bDriveHigh | ||
) |
Specifies the level of PWM outputs suppressed in response to a fault condition.
ui32Base | is the base address of the PWM module. |
ui32PWMOutBits | are the PWM outputs to be modified. This parameter must be the logical OR of any of PWM_OUT_0_BIT, PWM_OUT_1_BIT, PWM_OUT_2_BIT, PWM_OUT_3_BIT, PWM_OUT_4_BIT, PWM_OUT_5_BIT, PWM_OUT_6_BIT, or PWM_OUT_7_BIT. |
bDriveHigh | determines if the signal is driven high or low during an active fault condition. |
This function determines whether a PWM output pin that is suppressed in response to a fault condition is driven high or low. The affected outputs are selected using the parameter ui32PWMOutBits. The parameter bDriveHigh determines the output level for the pins identified by ui32PWMOutBits. If bDriveHigh is true then the selected outputs are driven high when a fault is detected. If it is false, the pins are driven low.
In a fault condition, pins which have not been configured to be suppressed via a call to PWMOutputFault() are unaffected by this function.
void PWMOutputInvert | ( | uint32_t | ui32Base, |
uint32_t | ui32PWMOutBits, | ||
bool | bInvert | ||
) |
Selects the inversion mode for PWM outputs.
ui32Base | is the base address of the PWM module. |
ui32PWMOutBits | are the PWM outputs to be modified. This parameter must be the logical OR of any of PWM_OUT_0_BIT, PWM_OUT_1_BIT, PWM_OUT_2_BIT, PWM_OUT_3_BIT, PWM_OUT_4_BIT, PWM_OUT_5_BIT, PWM_OUT_6_BIT, or PWM_OUT_7_BIT. |
bInvert | determines if the signal is inverted or passed through. |
This function is used to select the inversion mode for the selected PWM outputs. The outputs are selected using the parameter ui32PWMOutBits. The parameter bInvert determines the inversion mode for the selected outputs. If bInvert is true, this function causes the specified PWM output signals to be inverted or made active low. If bInvert is false, the specified outputs are passed through as is or made active high.
void PWMOutputState | ( | uint32_t | ui32Base, |
uint32_t | ui32PWMOutBits, | ||
bool | bEnable | ||
) |
Enables or disables PWM outputs.
ui32Base | is the base address of the PWM module. |
ui32PWMOutBits | are the PWM outputs to be modified. This parameter must be the logical OR of any of PWM_OUT_0_BIT, PWM_OUT_1_BIT, PWM_OUT_2_BIT, PWM_OUT_3_BIT, PWM_OUT_4_BIT, PWM_OUT_5_BIT, PWM_OUT_6_BIT, or PWM_OUT_7_BIT. |
bEnable | determines if the signal is enabled or disabled. |
This function enables or disables the selected PWM outputs. The outputs are selected using the parameter ui32PWMOutBits. The parameter bEnable determines the state of the selected outputs. If bEnable is true, then the selected PWM outputs are enabled, or placed in the active state. If bEnable is false, then the selected outputs are disabled or placed in the inactive state.
uint32_t PWMPulseWidthGet | ( | uint32_t | ui32Base, |
uint32_t | ui32PWMOut | ||
) |
Gets the pulse width of a PWM output.
ui32Base | is the base address of the PWM module. |
ui32PWMOut | is the PWM output to query. This parameter must be one of PWM_OUT_0, PWM_OUT_1, PWM_OUT_2, PWM_OUT_3, PWM_OUT_4, PWM_OUT_5, PWM_OUT_6, or PWM_OUT_7. |
This function gets the currently programmed pulse width for the specified PWM output. If the update of the comparator for the specified output has yet to be completed, the value returned may not be the active pulse width. The value returned is the programmed pulse width, measured in PWM clock ticks.
void PWMPulseWidthSet | ( | uint32_t | ui32Base, |
uint32_t | ui32PWMOut, | ||
uint32_t | ui32Width | ||
) |
Sets the pulse width for the specified PWM output.
ui32Base | is the base address of the PWM module. |
ui32PWMOut | is the PWM output to modify. This parameter must be one of PWM_OUT_0, PWM_OUT_1, PWM_OUT_2, PWM_OUT_3, PWM_OUT_4, PWM_OUT_5, PWM_OUT_6, or PWM_OUT_7. |
ui32Width | specifies the width of the positive portion of the pulse. |
This function sets the pulse width for the specified PWM output, where the pulse width is defined as the number of PWM clock ticks.
void PWMSyncTimeBase | ( | uint32_t | ui32Base, |
uint32_t | ui32GenBits | ||
) |
Synchronizes the counters in one or multiple PWM generator blocks.
ui32Base | is the base address of the PWM module. |
ui32GenBits | are the PWM generator blocks to be synchronized. This parameter must be the logical OR of any of PWM_GEN_0_BIT, PWM_GEN_1_BIT, PWM_GEN_2_BIT, or PWM_GEN_3_BIT. |
For the selected PWM module, this function synchronizes the time base of the generator blocks by causing the specified generator counters to be reset to zero.
void PWMSyncUpdate | ( | uint32_t | ui32Base, |
uint32_t | ui32GenBits | ||
) |
Synchronizes all pending updates.
ui32Base | is the base address of the PWM module. |
ui32GenBits | are the PWM generator blocks to be updated. This parameter must be the logical OR of any of PWM_GEN_0_BIT, PWM_GEN_1_BIT, PWM_GEN_2_BIT, or PWM_GEN_3_BIT. |
For the selected PWM generators, this function causes all queued updates to the period or pulse width to be applied the next time the corresponding counter becomes zero.