STM32F103xB HAL User Manual
|
Low Power modes configuration functions. More...
Functions | |
void | HAL_PWR_ConfigPVD (PWR_PVDTypeDef *sConfigPVD) |
Configures the voltage threshold detected by the Power Voltage Detector(PVD). | |
void | HAL_PWR_EnablePVD (void) |
Enables the Power Voltage Detector(PVD). | |
void | HAL_PWR_DisablePVD (void) |
Disables the Power Voltage Detector(PVD). | |
void | HAL_PWR_EnableWakeUpPin (uint32_t WakeUpPinx) |
Enables the WakeUp PINx functionality. | |
void | HAL_PWR_DisableWakeUpPin (uint32_t WakeUpPinx) |
Disables the WakeUp PINx functionality. | |
void | HAL_PWR_EnterSLEEPMode (uint32_t Regulator, uint8_t SLEEPEntry) |
Enters Sleep mode. | |
void | HAL_PWR_EnterSTOPMode (uint32_t Regulator, uint8_t STOPEntry) |
Enters Stop mode. | |
void | HAL_PWR_EnterSTANDBYMode (void) |
Enters Standby mode. | |
void | HAL_PWR_EnableSleepOnExit (void) |
Indicates Sleep-On-Exit when returning from Handler mode to Thread mode. | |
void | HAL_PWR_DisableSleepOnExit (void) |
Disables Sleep-On-Exit feature when returning from Handler mode to Thread mode. | |
void | HAL_PWR_EnableSEVOnPend (void) |
Enables CORTEX M3 SEVONPEND bit. | |
void | HAL_PWR_DisableSEVOnPend (void) |
Disables CORTEX M3 SEVONPEND bit. | |
void | HAL_PWR_PVD_IRQHandler (void) |
This function handles the PWR PVD interrupt request. | |
__weak void | HAL_PWR_PVDCallback (void) |
PWR PVD interrupt callback. |
Low Power modes configuration functions.
=============================================================================== ##### Peripheral Control functions ##### =============================================================================== *** PVD configuration *** ========================= [..] (+) The PVD is used to monitor the VDD power supply by comparing it to a threshold selected by the PVD Level (PLS[2:0] bits in the PWR_CR). (+) A PVDO flag is available to indicate if VDD/VDDA is higher or lower than the PVD threshold. This event is internally connected to the EXTI line16 and can generate an interrupt if enabled. This is done through __HAL_PVD_EXTI_ENABLE_IT() macro. (+) The PVD is stopped in Standby mode. *** WakeUp pin configuration *** ================================ [..] (+) WakeUp pin is used to wake up the system from Standby mode. This pin is forced in input pull-down configuration and is active on rising edges. (+) There is one WakeUp pin: WakeUp Pin 1 on PA.00. [..] *** Low Power modes configuration *** ===================================== [..] The device features 3 low-power modes: (+) Sleep mode: CPU clock off, all peripherals including Cortex-M3 core peripherals like NVIC, SysTick, etc. are kept running (+) Stop mode: All clocks are stopped (+) Standby mode: 1.8V domain powered off *** Sleep mode *** ================== [..] (+) Entry: The Sleep mode is entered by using the HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFx) functions with (++) PWR_SLEEPENTRY_WFI: enter SLEEP mode with WFI instruction (++) PWR_SLEEPENTRY_WFE: enter SLEEP mode with WFE instruction (+) Exit: (++) WFI entry mode, Any peripheral interrupt acknowledged by the nested vectored interrupt controller (NVIC) can wake up the device from Sleep mode. (++) WFE entry mode, Any wakeup event can wake up the device from Sleep mode. (+++) Any peripheral interrupt w/o NVIC configuration & SEVONPEND bit set in the Cortex (HAL_PWR_EnableSEVOnPend) (+++) Any EXTI Line (Internal or External) configured in Event mode *** Stop mode *** ================= [..] The Stop mode is based on the Cortex-M3 deepsleep mode combined with peripheral clock gating. The voltage regulator can be configured either in normal or low-power mode. In Stop mode, all clocks in the 1.8 V domain are stopped, the PLL, the HSI and the HSE RC oscillators are disabled. SRAM and register contents are preserved. In Stop mode, all I/O pins keep the same state as in Run mode. (+) Entry: The Stop mode is entered using the HAL_PWR_EnterSTOPMode(PWR_REGULATOR_VALUE, PWR_SLEEPENTRY_WFx ) function with: (++) PWR_REGULATOR_VALUE= PWR_MAINREGULATOR_ON: Main regulator ON. (++) PWR_REGULATOR_VALUE= PWR_LOWPOWERREGULATOR_ON: Low Power regulator ON. (++) PWR_SLEEPENTRY_WFx= PWR_SLEEPENTRY_WFI: enter STOP mode with WFI instruction (++) PWR_SLEEPENTRY_WFx= PWR_SLEEPENTRY_WFE: enter STOP mode with WFE instruction (+) Exit: (++) WFI entry mode, Any EXTI Line (Internal or External) configured in Interrupt mode with NVIC configured (++) WFE entry mode, Any EXTI Line (Internal or External) configured in Event mode. *** Standby mode *** ==================== [..] The Standby mode allows to achieve the lowest power consumption. It is based on the Cortex-M3 deepsleep mode, with the voltage regulator disabled. The 1.8 V 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 registers in the Backup domain and Standby circuitry (+) Entry: (++) The Standby mode is entered using the HAL_PWR_EnterSTANDBYMode() function. (+) Exit: (++) WKUP pin rising edge, RTC alarm event rising edge, external Reset in NRSTpin, IWDG Reset *** Auto-wakeup (AWU) from low-power mode *** ============================================= [..] (+) The MCU can be woken up from low-power mode by an RTC Alarm event, without depending on an external interrupt (Auto-wakeup mode). (+) RTC auto-wakeup (AWU) from the Stop and Standby modes (++) To wake up from the Stop mode with an RTC alarm event, it is necessary to configure the RTC to generate the RTC alarm using the HAL_RTC_SetAlarm_IT() function. *** PWR Workarounds linked to Silicon Limitation *** ==================================================== [..] Below the list of all silicon limitations known on STM32F1xx prouct. (#)Workarounds Implemented inside PWR HAL Driver (##)Debugging Stop mode with WFE entry - overloaded the WFE by an internal function
void HAL_PWR_ConfigPVD | ( | PWR_PVDTypeDef * | sConfigPVD | ) |
Configures the voltage threshold detected by the Power Voltage Detector(PVD).
sConfigPVD,: | pointer to an PWR_PVDTypeDef structure that contains the configuration information for the PVD. |
None |
Definition at line 316 of file stm32f1xx_hal_pwr.c.
References __HAL_PWR_PVD_EXTI_DISABLE_EVENT, __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE, __HAL_PWR_PVD_EXTI_DISABLE_IT, __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE, __HAL_PWR_PVD_EXTI_ENABLE_EVENT, __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE, __HAL_PWR_PVD_EXTI_ENABLE_IT, __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE, assert_param, IS_PWR_PVD_LEVEL, IS_PWR_PVD_MODE, PWR_PVDTypeDef::Mode, PVD_FALLING_EDGE, PVD_MODE_EVT, PVD_MODE_IT, PVD_RISING_EDGE, and PWR_PVDTypeDef::PVDLevel.
void HAL_PWR_DisablePVD | ( | void | ) |
Disables the Power Voltage Detector(PVD).
None |
Definition at line 369 of file stm32f1xx_hal_pwr.c.
References CR_PVDE_BB.
void HAL_PWR_DisableSEVOnPend | ( | void | ) |
Disables CORTEX M3 SEVONPEND bit.
None |
Definition at line 567 of file stm32f1xx_hal_pwr.c.
void HAL_PWR_DisableSleepOnExit | ( | void | ) |
Disables Sleep-On-Exit feature when returning from Handler mode to Thread mode.
None |
Definition at line 541 of file stm32f1xx_hal_pwr.c.
void HAL_PWR_DisableWakeUpPin | ( | uint32_t | WakeUpPinx | ) |
Disables the WakeUp PINx functionality.
WakeUpPinx,: | Specifies the Power Wake-Up pin to disable. This parameter can be one of the following values:
|
None |
Definition at line 397 of file stm32f1xx_hal_pwr.c.
References assert_param, CSR_EWUP_BB, and IS_PWR_WAKEUP_PIN.
void HAL_PWR_EnablePVD | ( | void | ) |
Enables the Power Voltage Detector(PVD).
None |
Definition at line 359 of file stm32f1xx_hal_pwr.c.
References CR_PVDE_BB.
void HAL_PWR_EnableSEVOnPend | ( | void | ) |
Enables CORTEX M3 SEVONPEND bit.
None |
Definition at line 554 of file stm32f1xx_hal_pwr.c.
void HAL_PWR_EnableSleepOnExit | ( | void | ) |
Indicates Sleep-On-Exit when returning from Handler mode to Thread mode.
None |
Definition at line 528 of file stm32f1xx_hal_pwr.c.
void HAL_PWR_EnableWakeUpPin | ( | uint32_t | WakeUpPinx | ) |
Enables the WakeUp PINx functionality.
WakeUpPinx,: | Specifies the Power Wake-Up pin to enable. This parameter can be one of the following values:
|
None |
Definition at line 382 of file stm32f1xx_hal_pwr.c.
References assert_param, CSR_EWUP_BB, and IS_PWR_WAKEUP_PIN.
void HAL_PWR_EnterSLEEPMode | ( | uint32_t | Regulator, |
uint8_t | SLEEPEntry | ||
) |
Enters Sleep mode.
Regulator,: | Regulator state as no effect in SLEEP mode - allows to support portability from legacy software |
SLEEPEntry,: | Specifies if SLEEP mode is entered with WFI or WFE instruction. When WFI entry is used, tick interrupt have to be disabled if not desired as the interrupt wake up source. This parameter can be one of the following values:
|
None |
Definition at line 417 of file stm32f1xx_hal_pwr.c.
References assert_param, IS_PWR_SLEEP_ENTRY, and PWR_SLEEPENTRY_WFI.
void HAL_PWR_EnterSTANDBYMode | ( | void | ) |
Enters Standby mode.
None |
Definition at line 503 of file stm32f1xx_hal_pwr.c.
void HAL_PWR_EnterSTOPMode | ( | uint32_t | Regulator, |
uint8_t | STOPEntry | ||
) |
Enters Stop mode.
Regulator,: | Specifies the regulator state in Stop mode. This parameter can be one of the following values:
|
STOPEntry,: | Specifies if Stop mode in entered with WFI or WFE instruction. This parameter can be one of the following values:
|
None |
Definition at line 463 of file stm32f1xx_hal_pwr.c.
References assert_param, IS_PWR_REGULATOR, IS_PWR_STOP_ENTRY, PWR_OverloadWfe(), and PWR_STOPENTRY_WFI.
void HAL_PWR_PVD_IRQHandler | ( | void | ) |
This function handles the PWR PVD interrupt request.
None |
Definition at line 580 of file stm32f1xx_hal_pwr.c.
References __HAL_PWR_PVD_EXTI_CLEAR_FLAG, __HAL_PWR_PVD_EXTI_GET_FLAG, and HAL_PWR_PVDCallback().
void HAL_PWR_PVDCallback | ( | void | ) |
PWR PVD interrupt callback.
None |
Definition at line 597 of file stm32f1xx_hal_pwr.c.
Referenced by HAL_PWR_PVD_IRQHandler().