This is a stub on the SAM Power Manager Control (PMC) for the sleepmgr service.
- Note
- To minimize the code overhead, these functions do not feature interrupt-protected access since they are likely to be called inside interrupt handlers or in applications where such protection is not necessary. If such protection is needed, it must be ensured by the calling code.
#define SAM_PM_SMODE_ACTIVE 0 |
Sets the MCU in the specified sleep mode.
- Parameters
-
sleep_mode | Sleep mode to set.Active |
#define SAM_PM_SMODE_BACKUP 5 |
#define SAM_PM_SMODE_SLEEP_WFE 1 |
#define SAM_PM_SMODE_SLEEP_WFI 2 |
#define SAM_PM_SMODE_WAIT 4 |
#define SAM_PM_SMODE_WAIT_FAST 3 |
Wait Mode, startup fast (in 3ms)
#define SCR_SLEEPDEEP (0x1 << 2) |
typedef void(* pmc_callback_wakeup_clocks_restored_t)(void) |
bool pmc_is_wakeup_clocks_restored |
( |
void |
| ) |
|
Check if clocks are restored after wakeup (For WAIT mode.
In WAIT mode, clocks are switched to FASTRC. After wakeup clocks should be restored, before that some of the ISR should not be served, otherwise there may be timing or clock issue.)
void pmc_sleep |
( |
int |
sleep_mode | ) |
|
Enter sleep mode.
- Parameters
-
sleep_mode | Sleep mode to enter |
- Returns
- true if start waiting