Main and Backup Regulators configuration functions.
More...
Main and Backup Regulators configuration functions.
Low Power modes configuration functions.
===============================================================================
##### Main and Backup Regulators configuration functions #####
===============================================================================
[..]
(+) The backup domain includes 4 Kbytes of backup SRAM accessible only from
the CPU, and address in 32-bit, 16-bit or 8-bit mode. Its content is
retained even in Standby or VBAT mode when the low power backup regulator
is enabled. It can be considered as an internal EEPROM when VBAT is
always present. You can use the PWR_BackupRegulatorCmd() function to
enable the low power backup regulator and use the PWR_GetFlagStatus
(PWR_FLAG_BRR) to check if it is ready or not.
(+) When the backup domain is supplied by VDD (analog switch connected to VDD)
the backup SRAM is powered from VDD which replaces the VBAT power supply to
save battery life.
(+) The backup SRAM is not mass erased by an tamper event. It is read
protected to prevent confidential data, such as cryptographic private
key, from being accessed. The backup SRAM can be erased only through
the Flash interface when a protection level change from level 1 to
level 0 is requested.
-@- Refer to the description of Read protection (RDP) in the Flash
programming manual.
(+) The main internal regulator can be configured to have a tradeoff between
performance and power consumption when the device does not operate at
the maximum frequency. This is done through PWR_MainRegulatorModeConfig()
function which configure VOS bit in PWR_CR register:
(++) When this bit is set (Regulator voltage output Scale 1 mode selected)
the System frequency can go up to 168 MHz.
(++) When this bit is reset (Regulator voltage output Scale 2 mode selected)
the System frequency can go up to 144 MHz.
Refer to the datasheets for more details.
===============================================================================
##### 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 correspondant 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.
Enables or disables the Backup Regulator.
- Parameters
-
NewState | new state of the Backup Regulator. This parameter can be: ENABLE or DISABLE. |
- Return values
-
Definition at line 310 of file stm32f4xx_pwr.c.
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
-
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.
- Parameters
-
- Return values
-
Definition at line 438 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
-
Definition at line 391 of file stm32f30x_pwr.c.
void PWR_MainRegulatorModeConfig |
( |
uint32_t |
PWR_Regulator_Voltage | ) |
|
Configures the main internal regulator output voltage.
- Parameters
-
PWR_Regulator_Voltage | specifies the regulator output voltage to achieve a tradeoff between performance and power consumption when the device does not operate at the maximum frequency (refer to the datasheets for more details). This parameter can be one of the following values:
- PWR_Regulator_Voltage_Scale1: Regulator voltage output Scale 1 mode, System frequency up to 168 MHz.
- PWR_Regulator_Voltage_Scale2: Regulator voltage output Scale 2 mode, System frequency up to 144 MHz.
- PWR_Regulator_Voltage_Scale3: Regulator voltage output Scale 3 mode, System frequency up to 120 MHz
|
- Return values
-
Definition at line 332 of file stm32f4xx_pwr.c.