Atmel Software Framework

Power Manager (PM)

This is a stub on the SAM Power Manager Control (PMC) for the sleepmgr service.

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.


 Sets the MCU in the specified sleep mode. More...
 Backup Mode. More...
 Wait for Events. More...
 Wait for Interrupts. More...
#define SAM_PM_SMODE_WAIT   4
 Wait Mode. More...
 Wait Mode, startup fast (in 3ms) More...
#define SCR_SLEEPDEEP   (0x1 << 2)
 (SCR) Sleep deep bit More...


typedef void(* pmc_callback_wakeup_clocks_restored_t) (void)
 Clocks restored callback function type. More...


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)


Sets the MCU in the specified sleep mode.

sleep_modeSleep mode to set.Active

Backup Mode.

Referenced by pmc_sleep().


Wait for Events.

Referenced by pmc_sleep().


Wait for Interrupts.

Referenced by pmc_sleep().

#define SAM_PM_SMODE_WAIT   4

Wait Mode.

Referenced by pmc_sleep().


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_wait_wakeup_clocks_restore ( pmc_callback_wakeup_clocks_restored_t  callback)
true if start waiting

References cpu_irq_disable.