This is a stub on the SAM Power Manager Control (PMC) for the sleepmgr service.
Macros | |
#define | SAM_PM_SMODE_ACTIVE 0 |
Sets the MCU in the specified sleep mode. More... | |
#define | SAM_PM_SMODE_BACKUP 5 |
Backup Mode. More... | |
#define | SAM_PM_SMODE_SLEEP_WFE 1 |
Wait for Events. More... | |
#define | SAM_PM_SMODE_SLEEP_WFI 2 |
Wait for Interrupts. More... | |
#define | SAM_PM_SMODE_WAIT 4 |
Wait Mode. More... | |
#define | SAM_PM_SMODE_WAIT_FAST 3 |
Wait Mode, startup fast (in 3ms) More... | |
#define | SCR_SLEEPDEEP (0x1 << 2) |
(SCR) Sleep deep bit More... | |
Typedefs | |
typedef void(* | pmc_callback_wakeup_clocks_restored_t )(void) |
Clocks restored callback function type. More... | |
Functions | |
bool | pmc_is_wakeup_clocks_restored (void) |
Check if clocks are restored after wakeup (For WAIT mode. More... | |
void | pmc_sleep (int sleep_mode) |
Enter sleep mode. More... | |
void | pmc_wait_wakeup_clocks_restore (pmc_callback_wakeup_clocks_restored_t callback) |
#define SAM_PM_SMODE_ACTIVE 0 |
Sets the MCU in the specified sleep mode.
sleep_mode | Sleep mode to set.Active |
#define SAM_PM_SMODE_BACKUP 5 |
Backup Mode.
Referenced by pmc_sleep().
#define SAM_PM_SMODE_SLEEP_WFE 1 |
Wait for Events.
Referenced by pmc_sleep().
#define SAM_PM_SMODE_SLEEP_WFI 2 |
Wait for Interrupts.
Referenced by pmc_sleep().
#define SAM_PM_SMODE_WAIT 4 |
Wait Mode.
Referenced by pmc_sleep().
#define SAM_PM_SMODE_WAIT_FAST 3 |
Wait Mode, startup fast (in 3ms)
Referenced by pmc_sleep().
#define SCR_SLEEPDEEP (0x1 << 2) |
(SCR) Sleep deep bit
Referenced by pmc_sleep().
typedef void(* pmc_callback_wakeup_clocks_restored_t)(void) |
Clocks restored callback function type.
Registered by routine pmc_wait_wakeup_clocks_restore() Callback called when all clocks are restored.
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.)
References b_is_sleep_clock_used.
void pmc_sleep | ( | int | sleep_mode | ) |
Enter sleep mode.
sleep_mode | Sleep mode to enter |
References callback_clocks_restored, cpu_irq_disable, cpu_irq_enable, pmc_enable_waitmode(), pmc_restore_clock_setting(), pmc_save_clock_settings(), pmc_set_flash_in_wait_mode(), SAM_PM_SMODE_BACKUP, SAM_PM_SMODE_SLEEP_WFE, SAM_PM_SMODE_SLEEP_WFI, SAM_PM_SMODE_WAIT, SAM_PM_SMODE_WAIT_FAST, SCR_SLEEPDEEP, and SUPC_CR_KEY_PASSWD.
Referenced by sleepmgr_sleep().
void pmc_wait_wakeup_clocks_restore | ( | pmc_callback_wakeup_clocks_restored_t | callback | ) |
References cpu_irq_disable.