2021-01-18 15:08:58 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2021-01-28 12:30:31 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2021-01-18 15:08:58 +00:00
|
|
|
/* Initialize timebase
|
|
|
|
* Configure and start tick timer
|
|
|
|
*/
|
|
|
|
void api_hal_timebase_init();
|
|
|
|
|
|
|
|
/* Get current insomnia level
|
|
|
|
* @return insomnia level: 0 - no insomnia, >0 - insomnia, bearer count.
|
|
|
|
*/
|
|
|
|
uint16_t api_hal_timebase_insomnia_level();
|
|
|
|
|
|
|
|
/* Enter insomnia mode
|
|
|
|
* Prevents device from going to sleep
|
|
|
|
* @warning Internally increases insomnia level
|
|
|
|
* Must be paired with api_hal_timebase_insomnia_exit
|
|
|
|
*/
|
|
|
|
void api_hal_timebase_insomnia_enter();
|
|
|
|
|
|
|
|
/* Exit insomnia mode
|
|
|
|
* Allow device to go to sleep
|
|
|
|
* @warning Internally decreases insomnia level.
|
|
|
|
* Must be paired with api_hal_timebase_insomnia_enter
|
|
|
|
*/
|
2021-01-28 12:30:31 +00:00
|
|
|
void api_hal_timebase_insomnia_exit();
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|