Microchip® Advanced Software Framework

sleep_timer.c File Reference

Sleep timer implementation.

Copyright (c) 2018 Microchip Technology Inc. and its subsidiaries.

#include "sleep_timer.h"
#include <rtc_count.h>
#include <rtc_count_interrupt.h>

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.

Return values
Elapsedtime in ticks

References rtc, and rtc_count_get_count().

Referenced by PMM_Wakeup().

void SleepTimerStart ( uint32_t  sleepTicks,
void(*)(void)  cb 
)
void SleepTimerStop ( void  )

Stop the sleep timer.

References rtc, RTC_COUNT_CALLBACK_COMPARE_0, and rtc_count_disable_callback().

Referenced by PMM_Wakeup().