Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Space_Invaders_Demo neopixels gpio_test_stm32f3_discovery gpio_test_systimer ... more
Low Power modes configuration functions
[PWR_Private_Functions]
Low Power modes configuration functions. More...
Functions | |
void | PWR_EnterSleepMode (uint8_t PWR_SLEEPEntry) |
Enters Sleep mode. | |
void | PWR_EnterSTOPMode (uint32_t PWR_Regulator, uint8_t PWR_STOPEntry) |
Enters STOP mode. | |
void | PWR_EnterSTANDBYMode (void) |
Enters STANDBY mode. |
Detailed Description
Low Power modes configuration functions.
=============================================================================== ##### Low Power modes configuration functions ##### ============================================================================== [..] The devices feature three low-power modes: (+) Sleep mode: Cortex-M4 core stopped, peripherals kept running. (+) Stop mode: all clocks are stopped, regulator running, regulator in low power mode (+) Standby mode: VCORE domain powered off *** Sleep mode *** ================== [..] (+) Entry: (++) The Sleep mode is entered by executing the WFE() or WFI() instructions. (+) Exit: (++) Any peripheral interrupt acknowledged by the nested vectored interrupt controller (NVIC) can wake up the device from Sleep mode. *** Stop mode *** ================= [..] In Stop mode, all clocks in the VCORE domain are stopped, the PLL, the HSI, and the HSE RC oscillators are disabled. Internal SRAM and register contents are preserved. The voltage regulator can be configured either in normal or low-power mode. (+) Entry: (++) The Stop mode is entered using the PWR_EnterSTOPMode(PWR_Regulator_LowPower,) function with regulator in LowPower or with Regulator ON. (+) Exit: (++) Any EXTI Line (Internal or External) configured in Interrupt/Event mode or any internal IPs (I2C or UASRT) wakeup event. *** Standby mode *** ==================== [..] The Standby mode allows to achieve the lowest power consumption. It is based on the Cortex-M4 deepsleep mode, with the voltage regulator disabled. The VCORE domain is consequently powered off. The PLL, the HSI, and the HSE oscillator are also switched off. SRAM and register contents are lost except for the Backup domain (RTC registers, RTC backup registers and Standby circuitry). [..] The voltage regulator is OFF. (+) Entry: (++) The Standby mode is entered using the PWR_EnterSTANDBYMode() function. (+) Exit: (++) WKUP pin rising edge, RTC alarm (Alarm A and Alarm B), RTC wakeup, tamper event, time-stamp event, external reset in NRST pin, IWDG reset. *** Auto-wakeup (AWU) from low-power mode *** ============================================= [..] The MCU can be woken up from low-power mode by an RTC Alarm event, a tamper event, a time-stamp event, or a comparator event, without depending on an external interrupt (Auto-wakeup mode). (+) RTC auto-wakeup (AWU) from the Stop mode (++) To wake up from the Stop mode with an RTC alarm event, it is necessary to: (+++) Configure the EXTI Line 17 to be sensitive to rising edges (Interrupt or Event modes) using the EXTI_Init() function. (+++) Enable the RTC Alarm Interrupt using the RTC_ITConfig() function (+++) Configure the RTC to generate the RTC alarm using the RTC_SetAlarm() and RTC_AlarmCmd() functions. (++) To wake up from the Stop mode with an RTC Tamper or time stamp event, it is necessary to: (+++) Configure the EXTI Line 19 to be sensitive to rising edges (Interrupt or Event modes) using the EXTI_Init() function. (+++) Enable the RTC Tamper or time stamp Interrupt using the RTC_ITConfig() function. (+++) Configure the RTC to detect the tamper or time stamp event using the RTC_TimeStampConfig(), RTC_TamperTriggerConfig() and RTC_TamperCmd() functions. (+) RTC auto-wakeup (AWU) from the Standby mode (++) To wake up from the Standby mode with an RTC alarm event, it is necessary to: (+++) Enable the RTC Alarm Interrupt using the RTC_ITConfig() function. (+++) Configure the RTC to generate the RTC alarm using the RTC_SetAlarm() and RTC_AlarmCmd() functions. (++) To wake up from the Standby mode with an RTC Tamper or time stamp event, it is necessary to: (+++) Enable the RTC Tamper or time stamp Interrupt using the RTC_ITConfig() function. (+++) Configure the RTC to detect the tamper or time stamp event using the RTC_TimeStampConfig(), RTC_TamperTriggerConfig() and RTC_TamperCmd() functions. (+) Comparator auto-wakeup (AWU) from the Stop mode (++) To wake up from the Stop mode with a comparator wakeup event, it is necessary to: (+++) Configure the correspondent comparator EXTI Line to be sensitive to the selected edges (falling, rising or falling and rising) (Interrupt or Event modes) using the EXTI_Init() function. (+++) Configure the comparator to generate the event.
Function Documentation
void PWR_EnterSleepMode | ( | uint8_t | PWR_SLEEPEntry ) |
Enters Sleep mode.
- Note:
- In Sleep mode, all I/O pins keep the same state as in Run mode.
- Parameters:
-
PWR_SLEEPEntry,: specifies if SLEEP mode in entered with WFI or WFE instruction. This parameter can be one of the following values: - PWR_SLEEPEntry_WFI: enter SLEEP mode with WFI instruction
- PWR_SLEEPEntry_WFE: enter SLEEP mode with WFE instruction
- Return values:
-
None
Definition at line 351 of file stm32f30x_pwr.c.
void PWR_EnterSTANDBYMode | ( | void | ) |
Enters STANDBY mode.
- Note:
- In Standby mode, all I/O pins are high impedance except for:
- Reset pad (still available)
- RTC_AF1 pin (PC13) if configured for Wakeup pin 2 (WKUP2), tamper, time-stamp, RTC Alarm out, or RTC clock calibration out.
- WKUP pin 1 (PA0) and WKUP pin 3 (PE6), if enabled.
- The Wakeup flag (WUF) need to be cleared at application level before to call this function.
- Parameters:
-
None
- Return values:
-
None
Definition at line 441 of file stm32f30x_pwr.c.
void PWR_EnterSTOPMode | ( | uint32_t | PWR_Regulator, |
uint8_t | PWR_STOPEntry | ||
) |
Enters STOP mode.
- Note:
- In Stop mode, all I/O pins keep the same state as in Run mode.
- When exiting Stop mode by issuing an interrupt or a wakeup event, the HSI RC oscillator is selected as system clock.
- When the voltage regulator operates in low power mode, an additional startup delay is incurred when waking up from Stop mode. By keeping the internal regulator ON during Stop mode, the consumption is higher although the startup time is reduced.
- Parameters:
-
PWR_Regulator,: specifies the regulator state in STOP mode. This parameter can be one of the following values: - PWR_Regulator_ON: STOP mode with regulator ON
- PWR_Regulator_LowPower: STOP mode with regulator in low power mode
PWR_STOPEntry,: specifies if STOP mode in entered with WFI or WFE instruction. This parameter can be one of the following values: - PWR_STOPEntry_WFI: enter STOP mode with WFI instruction
- PWR_STOPEntry_WFE: enter STOP mode with WFE instruction
- Return values:
-
None
Definition at line 393 of file stm32f30x_pwr.c.
Generated on Tue Jul 12 2022 17:34:46 by
