Tiva Driver Lib
|
Functions | |
void | TimerEnable (uint32_t ui32Base, uint32_t ui32Timer) |
void | TimerDisable (uint32_t ui32Base, uint32_t ui32Timer) |
void | TimerConfigure (uint32_t ui32Base, uint32_t ui32Config) |
void | TimerControlLevel (uint32_t ui32Base, uint32_t ui32Timer, bool bInvert) |
void | TimerControlTrigger (uint32_t ui32Base, uint32_t ui32Timer, bool bEnable) |
void | TimerControlEvent (uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Event) |
void | TimerControlStall (uint32_t ui32Base, uint32_t ui32Timer, bool bStall) |
void | TimerControlWaitOnTrigger (uint32_t ui32Base, uint32_t ui32Timer, bool bWait) |
void | TimerRTCEnable (uint32_t ui32Base) |
void | TimerRTCDisable (uint32_t ui32Base) |
void | TimerPrescaleSet (uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value) |
uint32_t | TimerPrescaleGet (uint32_t ui32Base, uint32_t ui32Timer) |
void | TimerPrescaleMatchSet (uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value) |
uint32_t | TimerPrescaleMatchGet (uint32_t ui32Base, uint32_t ui32Timer) |
void | TimerLoadSet (uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value) |
uint32_t | TimerLoadGet (uint32_t ui32Base, uint32_t ui32Timer) |
void | TimerLoadSet64 (uint32_t ui32Base, uint64_t ui64Value) |
uint64_t | TimerLoadGet64 (uint32_t ui32Base) |
uint32_t | TimerValueGet (uint32_t ui32Base, uint32_t ui32Timer) |
uint64_t | TimerValueGet64 (uint32_t ui32Base) |
void | TimerMatchSet (uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value) |
uint32_t | TimerMatchGet (uint32_t ui32Base, uint32_t ui32Timer) |
void | TimerMatchSet64 (uint32_t ui32Base, uint64_t ui64Value) |
uint64_t | TimerMatchGet64 (uint32_t ui32Base) |
void | TimerIntRegister (uint32_t ui32Base, uint32_t ui32Timer, void(*pfnHandler)(void)) |
void | TimerIntUnregister (uint32_t ui32Base, uint32_t ui32Timer) |
void | TimerIntEnable (uint32_t ui32Base, uint32_t ui32IntFlags) |
void | TimerIntDisable (uint32_t ui32Base, uint32_t ui32IntFlags) |
uint32_t | TimerIntStatus (uint32_t ui32Base, bool bMasked) |
void | TimerIntClear (uint32_t ui32Base, uint32_t ui32IntFlags) |
void | TimerSynchronize (uint32_t ui32Base, uint32_t ui32Timers) |
void TimerConfigure | ( | uint32_t | ui32Base, |
uint32_t | ui32Config | ||
) |
Configures the timer(s).
ui32Base | is the base address of the timer module. |
ui32Config | is the configuration for the timer. |
This function configures the operating mode of the timer(s). The timer module is disabled before being configured and is left in the disabled state. The timer can be configured to be a single full-width timer by using the TIMER_CFG_* values or a pair of half-width timers using the TIMER_CFG_A_* and TIMER_CFG_B_* values passed in the ui32Config parameter.
The configuration is specified in ui32Config as one of the following values:
When configured for a pair of half-width timers, each timer is separately configured. The first timer is configured by setting ui32Config to the result of a logical OR operation between one of the following values and ui32Config:
Similarly, the second timer is configured by setting ui32Config to the result of a logical OR operation between one of the corresponding TIMER_CFG_B_* values and ui32Config.
void TimerControlEvent | ( | uint32_t | ui32Base, |
uint32_t | ui32Timer, | ||
uint32_t | ui32Event | ||
) |
Controls the event type.
ui32Base | is the base address of the timer module. |
ui32Timer | specifies the timer(s) to be adjusted; must be one of TIMER_A, TIMER_B, or TIMER_BOTH. |
ui32Event | specifies the type of event; must be one of TIMER_EVENT_POS_EDGE, TIMER_EVENT_NEG_EDGE, or TIMER_EVENT_BOTH_EDGES. |
This function configures the signal edge(s) that triggers the timer when in capture mode.
void TimerControlLevel | ( | uint32_t | ui32Base, |
uint32_t | ui32Timer, | ||
bool | bInvert | ||
) |
Controls the output level.
ui32Base | is the base address of the timer module. |
ui32Timer | specifies the timer(s) to adjust; must be one of TIMER_A, TIMER_B, or TIMER_BOTH. |
bInvert | specifies the output level. |
This function configures the PWM output level for the specified timer. If the bInvert parameter is true, then the timer's output is made active low; otherwise, it is made active high.
void TimerControlStall | ( | uint32_t | ui32Base, |
uint32_t | ui32Timer, | ||
bool | bStall | ||
) |
Controls the stall handling.
ui32Base | is the base address of the timer module. |
ui32Timer | specifies the timer(s) to be adjusted; must be one of TIMER_A, TIMER_B, or TIMER_BOTH. |
bStall | specifies the response to a stall signal. |
This function controls the stall response for the specified timer. If the bStall parameter is true, then the timer stops counting if the processor enters debug mode; otherwise the timer keeps running while in debug mode.
void TimerControlTrigger | ( | uint32_t | ui32Base, |
uint32_t | ui32Timer, | ||
bool | bEnable | ||
) |
Enables or disables the ADC trigger output.
ui32Base | is the base address of the timer module. |
ui32Timer | specifies the timer to adjust; must be one of TIMER_A, TIMER_B, or TIMER_BOTH. |
bEnable | specifies the desired ADC trigger state. |
This function controls the ADC trigger output for the specified timer. If the bEnable parameter is true, then the timer's ADC output trigger is enabled; otherwise it is disabled.
void TimerControlWaitOnTrigger | ( | uint32_t | ui32Base, |
uint32_t | ui32Timer, | ||
bool | bWait | ||
) |
Controls the wait on trigger handling.
ui32Base | is the base address of the timer module. |
ui32Timer | specifies the timer(s) to be adjusted; must be one of TIMER_A, TIMER_B, or TIMER_BOTH. |
bWait | specifies if the timer should wait for a trigger input. |
This function controls whether or not a timer waits for a trigger input to start counting. When enabled, the previous timer in the trigger chain must count to its timeout in order for this timer to start counting. Refer to the part's data sheet for a description of the trigger chain.
void TimerDisable | ( | uint32_t | ui32Base, |
uint32_t | ui32Timer | ||
) |
Disables the timer(s).
ui32Base | is the base address of the timer module. |
ui32Timer | specifies the timer(s) to disable; must be one of TIMER_A, TIMER_B, or TIMER_BOTH. |
This function disables operation of the timer module.
void TimerEnable | ( | uint32_t | ui32Base, |
uint32_t | ui32Timer | ||
) |
Enables the timer(s).
ui32Base | is the base address of the timer module. |
ui32Timer | specifies the timer(s) to enable; must be one of TIMER_A, TIMER_B, or TIMER_BOTH. |
This function enables operation of the timer module. The timer must be configured before it is enabled.
void TimerIntClear | ( | uint32_t | ui32Base, |
uint32_t | ui32IntFlags | ||
) |
Clears timer interrupt sources.
ui32Base | is the base address of the timer module. |
ui32IntFlags | is a bit mask of the interrupt sources to be cleared. |
The specified timer interrupt sources are cleared, so that they no longer assert. This function must be called in the interrupt handler to keep the interrupt from being triggered again immediately upon exit.
The ui32IntFlags parameter has the same definition as the ui32IntFlags parameter to TimerIntEnable().
void TimerIntDisable | ( | uint32_t | ui32Base, |
uint32_t | ui32IntFlags | ||
) |
Disables individual timer interrupt sources.
ui32Base | is the base address of the timer module. |
ui32IntFlags | is the bit mask of the interrupt sources to be disabled. |
This function disables the indicated timer interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
The ui32IntFlags parameter has the same definition as the ui32IntFlags parameter to TimerIntEnable().
void TimerIntEnable | ( | uint32_t | ui32Base, |
uint32_t | ui32IntFlags | ||
) |
Enables individual timer interrupt sources.
ui32Base | is the base address of the timer module. |
ui32IntFlags | is the bit mask of the interrupt sources to be enabled. |
This function enables the indicated timer interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
The ui32IntFlags parameter must be the logical OR of any combination of the following:
void TimerIntRegister | ( | uint32_t | ui32Base, |
uint32_t | ui32Timer, | ||
void(*)(void) | pfnHandler | ||
) |
Registers an interrupt handler for the timer interrupt.
ui32Base | is the base address of the timer module. |
ui32Timer | specifies the timer(s); must be one of TIMER_A, TIMER_B, or TIMER_BOTH. |
pfnHandler | is a pointer to the function to be called when the timer interrupt occurs. |
This function registers the handler to be called when a timer interrupt occurs. In addition, this function enables the global interrupt in the interrupt controller; specific timer interrupts must be enabled via TimerIntEnable(). It is the interrupt handler's responsibility to clear the interrupt source via TimerIntClear().
uint32_t TimerIntStatus | ( | uint32_t | ui32Base, |
bool | bMasked | ||
) |
Gets the current interrupt status.
ui32Base | is the base address of the timer module. |
bMasked | is false if the raw interrupt status is required and true if the masked interrupt status is required. |
This function returns the interrupt status for the timer module. Either the raw interrupt status or the status of interrupts that are allowed to reflect to the processor can be returned.
void TimerIntUnregister | ( | uint32_t | ui32Base, |
uint32_t | ui32Timer | ||
) |
Unregisters an interrupt handler for the timer interrupt.
ui32Base | is the base address of the timer module. |
ui32Timer | specifies the timer(s); must be one of TIMER_A, TIMER_B, or TIMER_BOTH. |
This function unregisters the handler to be called when a timer interrupt occurs. This function also masks off the interrupt in the interrupt controller so that the interrupt handler is no longer called.
uint32_t TimerLoadGet | ( | uint32_t | ui32Base, |
uint32_t | ui32Timer | ||
) |
Gets the timer load value.
ui32Base | is the base address of the timer module. |
ui32Timer | specifies the timer; must be one of TIMER_A or TIMER_B. Only TIMER_A should be used when the timer is configured for full-width operation. |
This function gets the currently programmed interval load value for the specified timer.
uint64_t TimerLoadGet64 | ( | uint32_t | ui32Base | ) |
Gets the timer load value for a 64-bit timer.
ui32Base | is the base address of the timer module. |
This function gets the currently programmed interval load value for the specified 64-bit timer.
void TimerLoadSet | ( | uint32_t | ui32Base, |
uint32_t | ui32Timer, | ||
uint32_t | ui32Value | ||
) |
Sets the timer load value.
ui32Base | is the base address of the timer module. |
ui32Timer | specifies the timer(s) to adjust; must be one of TIMER_A, TIMER_B, or TIMER_BOTH. Only TIMER_A should be used when the timer is configured for full-width operation. |
ui32Value | is the load value. |
This function configures the timer load value; if the timer is running then the value is immediately loaded into the timer.
void TimerLoadSet64 | ( | uint32_t | ui32Base, |
uint64_t | ui64Value | ||
) |
Sets the timer load value for a 64-bit timer.
ui32Base | is the base address of the timer module. |
ui64Value | is the load value. |
This function configures the timer load value for a 64-bit timer; if the timer is running, then the value is immediately loaded into the timer.
uint32_t TimerMatchGet | ( | uint32_t | ui32Base, |
uint32_t | ui32Timer | ||
) |
Gets the timer match value.
ui32Base | is the base address of the timer module. |
ui32Timer | specifies the timer; must be one of TIMER_A or TIMER_B. Only TIMER_A should be used when the timer is configured for full-width operation. |
This function gets the match value for the specified timer.
uint64_t TimerMatchGet64 | ( | uint32_t | ui32Base | ) |
Gets the timer match value for a 64-bit timer.
ui32Base | is the base address of the timer module. |
This function gets the match value for the specified timer.
void TimerMatchSet | ( | uint32_t | ui32Base, |
uint32_t | ui32Timer, | ||
uint32_t | ui32Value | ||
) |
Sets the timer match value.
ui32Base | is the base address of the timer module. |
ui32Timer | specifies the timer(s) to adjust; must be one of TIMER_A, TIMER_B, or TIMER_BOTH. Only TIMER_A should be used when the timer is configured for full-width operation. |
ui32Value | is the match value. |
This function configures the match value for a timer. This value is used in capture count mode to determine when to interrupt the processor and in PWM mode to determine the duty cycle of the output signal. On some Tiva devices, match interrupts can also be generated in periodic and one-shot modes.
void TimerMatchSet64 | ( | uint32_t | ui32Base, |
uint64_t | ui64Value | ||
) |
Sets the timer match value for a 64-bit timer.
ui32Base | is the base address of the timer module. |
ui64Value | is the match value. |
This function configures the match value for a timer. This value is used in capture count mode to determine when to interrupt the processor and in PWM mode to determine the duty cycle of the output signal.
uint32_t TimerPrescaleGet | ( | uint32_t | ui32Base, |
uint32_t | ui32Timer | ||
) |
Get the timer prescale value.
ui32Base | is the base address of the timer module. |
ui32Timer | specifies the timer; must be one of TIMER_A or TIMER_B. |
This function gets the value of the input clock prescaler. The prescaler is only operational when in half-width mode and is used to extend the range of the half-width timer modes. The prescaler provides the least significant bits when counting down in periodic and one-shot modes; in all other modes, the prescaler provides the most significant bits.
uint32_t TimerPrescaleMatchGet | ( | uint32_t | ui32Base, |
uint32_t | ui32Timer | ||
) |
Get the timer prescale match value.
ui32Base | is the base address of the timer module. |
ui32Timer | specifies the timer; must be one of TIMER_A or TIMER_B. |
This function gets the value of the input clock prescaler match value. When in a half-width mode that uses the counter match and prescaler, the prescale match effectively extends the range of the match. The prescaler provides the least significant bits when counting down in periodic and one-shot modes; in all other modes, the prescaler provides the most significant bits.
void TimerPrescaleMatchSet | ( | uint32_t | ui32Base, |
uint32_t | ui32Timer, | ||
uint32_t | ui32Value | ||
) |
Set the timer prescale match value.
ui32Base | is the base address of the timer module. |
ui32Timer | specifies the timer(s) to adjust; must be one of TIMER_A, TIMER_B, or TIMER_BOTH. |
ui32Value | is the timer prescale match value which must be between 0 and 255 (inclusive) for 16/32-bit timers and between 0 and 65535 (inclusive) for 32/64-bit timers. |
This function configures the value of the input clock prescaler match value. When in a half-width mode that uses the counter match and the prescaler, the prescale match effectively extends the range of the match. The prescaler provides the least significant bits when counting down in periodic and one-shot modes; in all other modes, the prescaler provides the most significant bits.
void TimerPrescaleSet | ( | uint32_t | ui32Base, |
uint32_t | ui32Timer, | ||
uint32_t | ui32Value | ||
) |
Set the timer prescale value.
ui32Base | is the base address of the timer module. |
ui32Timer | specifies the timer(s) to adjust; must be one of TIMER_A, TIMER_B, or TIMER_BOTH. |
ui32Value | is the timer prescale value which must be between 0 and 255 (inclusive) for 16/32-bit timers and between 0 and 65535 (inclusive) for 32/64-bit timers. |
This function configures the value of the input clock prescaler. The prescaler is only operational when in half-width mode and is used to extend the range of the half-width timer modes. The prescaler provides the least significant bits when counting down in periodic and one-shot modes; in all other modes, the prescaler provides the most significant bits.
void TimerRTCDisable | ( | uint32_t | ui32Base | ) |
Disable RTC counting.
ui32Base | is the base address of the timer module. |
This function causes the timer to stop counting when in RTC mode.
void TimerRTCEnable | ( | uint32_t | ui32Base | ) |
Enable RTC counting.
ui32Base | is the base address of the timer module. |
This function causes the timer to start counting when in RTC mode. If not configured for RTC mode, this function does nothing.
void TimerSynchronize | ( | uint32_t | ui32Base, |
uint32_t | ui32Timers | ||
) |
Synchronizes the counters in a set of timers.
ui32Base | is the base address of the timer module. This parameter must be the base address of Timer0 (in other words, TIMER0_BASE). |
ui32Timers | is the set of timers to synchronize. |
This function synchronizes the counters in a specified set of timers. When a timer is running in half-width mode, each half can be included or excluded in the synchronization event. When a timer is running in full-width mode, only the A timer can be synchronized (specifying the B timer has no effect).
The ui32Timers parameter is the logical OR of any of the following defines:
uint32_t TimerValueGet | ( | uint32_t | ui32Base, |
uint32_t | ui32Timer | ||
) |
Gets the current timer value.
ui32Base | is the base address of the timer module. |
ui32Timer | specifies the timer; must be one of TIMER_A or TIMER_B. Only TIMER_A should be used when the timer is configured for full-width operation. |
This function reads the current value of the specified timer.
uint64_t TimerValueGet64 | ( | uint32_t | ui32Base | ) |
Gets the current 64-bit timer value.
ui32Base | is the base address of the timer module. |
This function reads the current value of the specified timer.