4.24.3.1.4 Module Documentation
TMR2
This file contains the API Prototypes and other data types for the TMR2 driver.
Module description
This file contains the API Prototypes and other data types for the TMR2 driver.
Functions
void TMR2_Initialize (void)
Initializes the TMR2 module. This routine must be called before any other timer routines.
void TMR2_Start (void)
Starts TMR2.
void TMR2_Stop (void)
Stops TMR2.
uint8_t TMR2_Read (void)
Reads the 8-bit from the TMR2 register.
void TMR2_Write (uint8_t timerVal)
Writes the 8-bit value to the TMR2 register.
void TMR2_PeriodCountSet (size_t periodVal)
Loads the 8-bit value to the PR2 register.
void TMR2_ISR (void)
Interrupt Service Routine (ISR) for TMR2 overflow interrupt.
void TMR2_Tasks (void)
Performs the tasks to be executed on timer overflow event if interrupts are not enabled.
void TMR2_OverflowCallbackRegister (void(*InterruptHandler)(void))
Setter function for the TMR2 overflow callback.
Function Documentation
TMR2_Initialize()
void TMR2_Initialize (void )
Initializes the TMR2 module. This routine must be called before any other timer routines.
Section: Macro Declarations Section: TMR2 APIs
None. |
None. |
Section: TMR2 APIs
TMR2_ISR()
void TMR2_ISR (void )
Interrupt Service Routine (ISR) for TMR2 overflow interrupt.
None. |
None. |
TMR2_OverflowCallbackRegister()
void TMR2_OverflowCallbackRegister (void(*)(void) InterruptHandler)
Setter function for the TMR2 overflow callback.
CallbackHandler |
- Pointer to the custom callback. |
None. |
TMR2_PeriodCountSet()
void TMR2_PeriodCountSet (size_t periodVal)
Loads the 8-bit value to the PR2 register.
The TMR2 should be initialized with TMR2_Initialize() before calling this API. |
periodVal |
- 8-bit value written to the PR2 register. |
None. |
TMR2_Read()
uint8_t TMR2_Read (void )
Reads the 8-bit from the TMR2 register.
The TMR2 should be initialized with TMR2_Initialize() before calling this API. |
None. |
8-bit data from the TMR2 register. |
TMR2_Start()
void TMR2_Start (void )
Starts TMR2.
The TMR2 should be initialized with TMR2_Initialize() before calling this API. |
None. |
None. |
TMR2_Stop()
void TMR2_Stop (void )
Stops TMR2.
The TMR2 should be initialized with TMR2_Initialize() before calling this API. |
None. |
None. |
TMR2_Tasks()
void TMR2_Tasks (void )
Performs the tasks to be executed on timer overflow event if interrupts are not enabled.
None. |
None. |
TMR2_Write()
void TMR2_Write (uint8_t timerVal)
Writes the 8-bit value to the TMR2 register.
The TMR2 should be initialized with TMR2_Initialize() before calling this API. |
timerVal |
- 8-bit value written to the TMR2 register. |
None. |