Low Power modes configuration functions.
More...
Low Power modes configuration functions.
===============================================================================
##### Low Power modes configuration functions #####
===============================================================================
[..]
The devices feature 3 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: 1.2V domain powered off.
*** Sleep mode ***
==================
[..]
(+) Entry:
(++) The Sleep mode is entered by using the __WFI() or __WFE() functions.
(+) 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 1.2V 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.
To minimize the consumption In Stop mode, FLASH can be powered off before
entering the Stop mode. It can be switched on again by software after exiting
the Stop mode using the PWR_FlashPowerDownCmd() function.
(+) Entry:
(++) The Stop mode is entered using the PWR_EnterSTOPMode(PWR_MainRegulator_ON)
function with:
(+++) Main regulator ON.
(+++) Low Power regulator ON.
(+) Exit:
(++) Any EXTI Line (Internal or External) configured in Interrupt/Event mode.
*** 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 1.2V domain is consequently powered off. The PLL, the HSI oscillator and
the HSE oscillator are also switched off. SRAM and register contents are lost
except for the RTC registers, RTC backup registers, backup SRAM 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, an RTC
Wakeup 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 21 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.
(++) To wake up from the Stop mode with an RTC WakeUp event, it is necessary to:
(+++) Configure the EXTI Line 22 to be sensitive to rising edges (Interrupt
or Event modes) using the EXTI_Init() function.
(+++) Enable the RTC WakeUp Interrupt using the RTC_ITConfig() function
(+++) Configure the RTC to generate the RTC WakeUp event using the RTC_WakeUpClockConfig(),
RTC_SetWakeUpCounter() and RTC_WakeUpCmd() 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.
(++) To wake up from the Standby mode with an RTC WakeUp event, it is necessary to:
(+++) Enable the RTC WakeUp Interrupt using the RTC_ITConfig() function
(+++) Configure the RTC to generate the RTC WakeUp event using the RTC_WakeUpClockConfig(),
RTC_SetWakeUpCounter() and RTC_WakeUpCmd() functions.
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 tamper, time-stamp, RTC Alarm out, or RTC clock calibration out.
- RTC_AF2 pin (PI8) if configured for tamper or time-stamp.
- WKUP pin 1 (PA0) if enabled.
- Parameters
-
- Return values
-
Definition at line 757 of file stm32f4xx_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_MainRegulator_ON: STOP mode with regulator ON
- PWR_LowPowerRegulator_ON: STOP mode with low power regulator ON
|
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
-
Definition at line 645 of file stm32f4xx_pwr.c.
void PWR_EnterUnderDriveSTOPMode |
( |
uint32_t |
PWR_Regulator, |
|
|
uint8_t |
PWR_STOPEntry |
|
) |
| |
Enters in Under-Drive STOP mode.
- Note
- This mode is only available for STM32F42xxx/STM3243xxx devices.
-
This mode can be selected only when the Under-Drive is already active
-
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_MainRegulator_UnderDrive_ON: Main Regulator in under-drive mode and Flash memory in power-down when the device is in Stop under-drive mode
- PWR_LowPowerRegulator_UnderDrive_ON: Low Power Regulator in under-drive mode and Flash memory in power-down when the device is in Stop under-drive 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
-
Definition at line 709 of file stm32f4xx_pwr.c.