![]() |
MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
Files | |
file | fsl_wtimer.h |
Driver version | |
Wake timers provide wakeup capabilities in sleep modes where 32KHz clock is kept active. Wake timer 0 is a 48bit based counter while wake timer 1 is 32bit based counter. A special API functions WTIMER_StartTimerLarge(0 and WTIMER_StartTimerLarge() are provided to access the 48bit counter. The Wake timer 1 is to be used bu the PWRM framework. It shall not be used by the Application directly. API provides the capability to enable and disable interrupts. The application shall implement the Wake timer ISR on its side. The wake timer ISR prototypes are : void WAKE_UP_TIMER0_IRQHandler(void); and void WAKE_UP_TIMER1_IRQHandler(void); The Application shall correctly the 32KHz source amoung the FRO32 or Crystal 32KHz using CLOCK_EnableClock() API in fsl_clock.h The APi provides the capability to calibrate the 32KHz clock versus a high reference clock (32MHz crystal). | |
#define | FSL_WTIMER_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) |
Version 2.0.0. | |
Initialization and deinitialization | |
void | WTIMER_Init (void) |
Enable the clocks to the peripheral (functional clock and AHB clock) More... | |
void | WTIMER_DeInit (void) |
Disable the clocks to the peripheral (functional clock and AHB clock) More... | |
void | WTIMER_EnableInterrupts (WTIMER_timer_id_t timer_id) |
Enable the selected Timer interrupts. More... | |
WTIMER_status_t | WTIMER_GetStatusFlags (WTIMER_timer_id_t timer_id) |
Gets the Timer status flags. More... | |
void | WTIMER_ClearStatusFlags (WTIMER_timer_id_t timer_id) |
Clears the Timer status flags if expired and clear the pendng interrupt if active it needs to be called in ISR. More... | |
void | WTIMER_StartTimer (WTIMER_timer_id_t timer_id, uint32_t count) |
Starts the Timer counter. More... | |
void | WTIMER_StopTimer (WTIMER_timer_id_t timer_id) |
Stops the Timer counter. More... | |
uint32_t | WTIMER_CalibrateTimer (void) |
Calibrate the 32KHz clock to be used by the wake timer versus the 32MHz crystal clock source The Applicaton shall switches OFF the 32MHz clock if no longer used by the chip using CLOCK_DisableClock() in fsl_clock.h. More... | |
uint32_t | WTIMER_ReadTimer (WTIMER_timer_id_t timer_id) |
Read the LSB counter of the wake timer This API is unsafe. More... | |
uint32_t | WTIMER_ReadTimerSafe (WTIMER_timer_id_t timer_id) |
Read the LSB counter of the wake timer API checks the next counter update (next 32KHz clock edge) so the value is uptodate Important note : The counter shall be running otherwise, the API gets locked and never return. More... | |
void WTIMER_Init | ( | void | ) |
void WTIMER_DeInit | ( | void | ) |
void WTIMER_EnableInterrupts | ( | WTIMER_timer_id_t | timer_id | ) |
The application shall implement the Wake timer ISR
timer_id | Wtimer Id |
WTIMER_status_t WTIMER_GetStatusFlags | ( | WTIMER_timer_id_t | timer_id | ) |
timer_id | Wtimer Id |
void WTIMER_ClearStatusFlags | ( | WTIMER_timer_id_t | timer_id | ) |
timer_id | Wtimer Id |
void WTIMER_StartTimer | ( | WTIMER_timer_id_t | timer_id, |
uint32_t | count | ||
) |
The function performs: -stop the timer if running, clear the status and interrupt flag if set (WTIMER_ClearStatusFlags()) -set the counter value -start the timer
timer_id | Wtimer Id |
count | number of 32KHz clock periods before expiration |
void WTIMER_StopTimer | ( | WTIMER_timer_id_t | timer_id | ) |
timer_id | Wtimer Id |
uint32_t WTIMER_CalibrateTimer | ( | void | ) |
uint32_t WTIMER_ReadTimer | ( | WTIMER_timer_id_t | timer_id | ) |
If the counter has just been started, the counter value may not be up to date until the next 32KHz clock edge. Use WTIMER_ReadTimerSafe() instead
timer_id | Wtimer Id |
uint32_t WTIMER_ReadTimerSafe | ( | WTIMER_timer_id_t | timer_id | ) |
timer_id | Wtimer Id |