Sleep timer implementation.
Copyright (c) 2018 Microchip Technology Inc. and its subsidiaries.
Functions | |
uint32_t | SleepTimerGetElapsedTime (void) |
Calculate the Elapsed Time from the previous call of this function. More... | |
void | SleepTimerInit (void) |
Initializes the sleep timer module. More... | |
void | SleepTimerStart (uint32_t sleepTicks, void(*cb)(void)) |
Initializes the sleep timer. More... | |
void | SleepTimerStop (void) |
Stop the sleep timer. More... | |
Variables | |
struct rtc_module | rtc |
uint32_t SleepTimerGetElapsedTime | ( | void | ) |
Calculate the Elapsed Time from the previous call of this function.
Elapsed | time in ticks |
References rtc, and rtc_count_get_count().
Referenced by PMM_Wakeup().
void SleepTimerInit | ( | void | ) |
Initializes the sleep timer module.
References COMPARE_COUNT_MAX_VALUE, rtc_count_config::compare_values, rtc_count_config::prescaler, rtc, rtc_count_enable(), rtc_count_get_config_defaults(), rtc_count_init(), and RTC_COUNT_PRESCALER_OFF.
void SleepTimerStart | ( | uint32_t | sleepTicks, |
void(*)(void) | cb | ||
) |
Initializes the sleep timer.
Start the sleep timer.
References rtc, RTC_COUNT_CALLBACK_COMPARE_0, RTC_COUNT_COMPARE_0, rtc_count_enable_callback(), rtc_count_register_callback(), rtc_count_set_compare(), and rtc_count_set_count().
Referenced by PMM_Sleep().
void SleepTimerStop | ( | void | ) |
Stop the sleep timer.
References rtc, RTC_COUNT_CALLBACK_COMPARE_0, and rtc_count_disable_callback().
Referenced by PMM_Wakeup().
struct rtc_module rtc |
Referenced by SleepTimerGetElapsedTime(), SleepTimerInit(), SleepTimerStart(), and SleepTimerStop().