

To enter into EM4 call SLEEP_ForceSleepInEM4().Įnergy Mode that was entered. This function will not go lower than EM3 because leaving EM4 requires resetting MCU. It allows the system to go into the lowest possible energy mode that the device can be set into at the time of the call of this function. This function takes care of the system states protected by the sleep block provided by SLEEP_SleepBlockBegin() / SLEEP_SleepBlockEnd(). To enter into EM4 call SLEEP_ForceSleepInEM4(). Sets the system to sleep into the lowest possible energy mode. SLEEP_SleepBlockEnd ( SLEEP_EnergyMode_t eMode)Įnd sleep block in the requested energy mode.

SLEEP_SleepBlockBegin ( SLEEP_EnergyMode_t eMode)īegin sleep block in the requested energy mode. Gets the lowest energy mode that the system is allowed to be set to.

SLEEP_Init ( SLEEP_CbFuncPtr_t pSleepCb, SLEEP_CbFuncPtr_t pWakeUpCb)

SLEEP_LOWEST_ENERGY_MODE_DEFAULT sleepEM3įorce the device to go to EM4 without doing any checks. This semaphore has limit set to maximum 255 locks. A counting semaphore is available for each low energy mode (EM2/EM3) to protect certain system states from being corrupted. Users could set up callbacks that are being called before and after each and every sleep. The module allows the system to always sleep in the lowest possible energy mode. The main purpose of the module is to ease energy optimization with a simple API. This is a energy modes management module consisting of sleep.c and sleep.h source files.
