![]() |
![]() |
Advanced 16-bit timer with precision PWM support and capture/compare capabilities. More...
Advanced 16-bit timer with precision PWM support and capture/compare capabilities.
This peripheral API handles Timer A hardware peripheral.
TimerA features include:
TimerA Interrupts may be generated on counter overflow conditions and during capture compare events.
The TimerA may also be used to generate PWM outputs. PWM outputs can be generated by initializing the compare mode with TimerA_initCompare() and the necessary parameters. The PWM may be customized by selecting a desired timer mode (continuous/up/upDown), duty cycle, output mode, timer period etc. The library also provides a simpler way to generate PWM using TimerA_generatePWM() API. However the level of customization and the kinds of PWM generated are limited in this API. Depending on how complex the PWM is and what level of customization is required, the user can use TimerA_generatePWM() or a combination of TimerA_initCompare and timer start APIs.
The TimerA API provides a set of functions for dealing with the TimerA module. Functions are provided to configure and control the timer, along with functions to modify timer/counter values, and to manage interrupt handling for the timer.
Control is also provided over interrupt sources and events. Interrupts can be generated to indicate that an event has been captured.
Below is a very brief code example showing how to generate a PWM signal using the TimerA DriverLib module.
Below is the configuration parameter for the TimerA PWM config API:
The next snippet of code is used to actually configure the PWM signal: