Microchip® Advanced Software Framework

sleep.h File Reference

Sleep mode access.

Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.

#include <compiler.h>

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)