Module to declare HAL Sleep API.
More...
|
#define | DAYS_TO_MS(d) ((d) * 3600L * 24L * 1000L ) |
| Converts days to milliseconds.
|
|
#define | HOURS_TO_MS(h) ((h) * 3600L * 1000L ) |
| Converts hours to milliseconds.
|
|
#define | MINS_TO_MS(m) ((m) * 60L * 1000L ) |
| Converts minutes to milliseconds.
|
|
#define | SEC_TO_MS(s) ((s) * 1000L ) |
| Converts seconds to milliseconds.
|
|
Module to declare HAL Sleep API.
The Sleep module implements the only hal_sleep() routine to put the hardware to the sleep mode for some milliseconds. The user can use convenient macros DAYS_TO_MS(), HOURS_TO_MS(), MINS_TO_MS(), and SEC_TO_MS() to convert different time periods into milliseconds. Please note that this module requires a call to hal_sleep_init() which is in turn called by sys_init() before using any module routines. This module is only used to implement the System Sleep interface. The hal_sleep() routine is not assumed to be used by the user explicitly.
Information, provided by the HAL, in order to explain the reason, which caused the system to wake up.
Enumerator |
---|
UNKNOWN_INTERRUPT |
HAL can't define a wake up reason
|
RTC_CC_INTERRUPT |
RTC interrupt was the awakening reason
|
Puts hardware into the sleep mode for some milliseconds.
- Parameters
-
[in] | sleep_time_ms | Time to sleep in ms |
- Return values
-
wakeup_reason | Specifies reason of awakening |
void hal_sleep_init |
( |
void |
| ) |
|
Initialization of the sleep module.