HAL PWR Functions ¶
Wakeup pins management functions ¶
- group PWR_Exported_Functions_Group1
-
This section provides functions allowing to configure the wakeup pins:
-
Call HAL_PWR_LP_SetConfigWakeupPin() function to configure wakeup pin.
-
Call HAL_PWR_LP_GetConfigWakeupPin() function to get wakeup pin configuration.
-
Call HAL_PWR_LP_EnableWakeupPin() function to enable wakeup pin.
-
Call HAL_PWR_LP_DisableWakeupPin() function to disable wakeup pin.
-
Call HAL_PWR_LP_IsEnabledWakeupPin() function to check that wakeup pin is enabled.
Functions
-
hal_status_t
HAL_PWR_LP_SetConfigWakeupPin
(
uint32_t
wakeup_pin
,
const
hal_pwr_wakeup_pin_config_t
*
p_config
)
¶
-
Set wakeup pin configuration.
- Parameters :
-
-
wakeup_pin – This parameter can be one or a combination of HAL_PWR_WAKEUP_PIN_x where x can be (1..8).
-
p_config – Pointer to a hal_pwr_wakeup_pin_config_t structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – p_config pointer is NULL.
-
HAL_OK – Wakeup pin has been correctly configured.
-
-
void
HAL_PWR_LP_GetConfigWakeupPin
(
uint32_t
wakeup_pin
,
hal_pwr_wakeup_pin_config_t
*
p_config
)
¶
-
Get wakeup pin configuration.
- Parameters :
-
-
wakeup_pin – This parameter can be one of HAL_PWR_WAKEUP_PIN_x where x can be (1..8).
-
p_config – Pointer to a hal_pwr_wakeup_pin_config_t structure.
-
-
void
HAL_PWR_LP_EnableWakeupPin
(
uint32_t
wakeup_pin
)
¶
-
Enable the wakeup pin configuration.
Note
Wakeup pins are used to wake up the system from Stop 3, Standby and Shutdown modes.
- Parameters :
-
wakeup_pin – This parameter can be one or a combination of HAL_PWR_WAKEUP_PIN_x where x can be (1..8).
-
void
HAL_PWR_LP_DisableWakeupPin
(
uint32_t
wakeup_pin
)
¶
-
Disable the wakeup pin configuration.
Note
Wakeup pins are used to wake up the system from Stop 3, Standby and Shutdown modes.
- Parameters :
-
wakeup_pin – This parameter can be one or a combination of HAL_PWR_WAKEUP_PIN_x where x can be (1..8).
-
hal_pwr_wakeup_pin_status_t
HAL_PWR_LP_IsEnabledWakeupPin
(
uint32_t
wakeup_pin
)
¶
-
Check that wakeup pin is enabled.
- Parameters :
-
wakeup_pin – This parameter can be one of HAL_PWR_WAKEUP_PIN_x where x can be (1..8).
- Return values :
-
hal_pwr_wakeup_pin_status_t – The wakeup pin status.
-
- group PWR_Exported_Functions_Group1
-
This section provides functions allowing to configure the wakeup pins:
-
Call HAL_PWR_LP_SetConfigWakeupPin() function to configure wakeup pin.
-
Call HAL_PWR_LP_GetConfigWakeupPin() function to get wakeup pin configuration.
-
Call HAL_PWR_LP_EnableWakeupPin() function to enable wakeup pin.
-
Call HAL_PWR_LP_DisableWakeupPin() function to disable wakeup pin.
-
Call HAL_PWR_LP_IsEnabledWakeupPin() function to check that wakeup pin is enabled.
Functions
-
hal_status_t
HAL_PWR_LP_SetConfigWakeupPin
(
uint32_t
wakeup_pin
,
const
hal_pwr_wakeup_pin_config_t
*
p_config
)
-
Set wakeup pin configuration.
- Parameters :
-
-
wakeup_pin – This parameter can be one or a combination of HAL_PWR_WAKEUP_PIN_x where x can be (1..8).
-
p_config – Pointer to a hal_pwr_wakeup_pin_config_t structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – p_config pointer is NULL.
-
HAL_OK – Wakeup pin has been correctly configured.
-
-
void
HAL_PWR_LP_GetConfigWakeupPin
(
uint32_t
wakeup_pin
,
hal_pwr_wakeup_pin_config_t
*
p_config
)
-
Get wakeup pin configuration.
- Parameters :
-
-
wakeup_pin – This parameter can be one of HAL_PWR_WAKEUP_PIN_x where x can be (1..8).
-
p_config – Pointer to a hal_pwr_wakeup_pin_config_t structure.
-
-
void
HAL_PWR_LP_EnableWakeupPin
(
uint32_t
wakeup_pin
)
-
Enable the wakeup pin configuration.
Note
Wakeup pins are used to wake up the system from Stop 3, Standby and Shutdown modes.
- Parameters :
-
wakeup_pin – This parameter can be one or a combination of HAL_PWR_WAKEUP_PIN_x where x can be (1..8).
-
void
HAL_PWR_LP_DisableWakeupPin
(
uint32_t
wakeup_pin
)
-
Disable the wakeup pin configuration.
Note
Wakeup pins are used to wake up the system from Stop 3, Standby and Shutdown modes.
- Parameters :
-
wakeup_pin – This parameter can be one or a combination of HAL_PWR_WAKEUP_PIN_x where x can be (1..8).
-
hal_pwr_wakeup_pin_status_t
HAL_PWR_LP_IsEnabledWakeupPin
(
uint32_t
wakeup_pin
)
-
Check that wakeup pin is enabled.
- Parameters :
-
wakeup_pin – This parameter can be one of HAL_PWR_WAKEUP_PIN_x where x can be (1..8).
- Return values :
-
hal_pwr_wakeup_pin_status_t – The wakeup pin status.
-
- group PWR_Exported_Functions_Group1
-
This section provides functions allowing to configure the wakeup pins:
-
Call HAL_PWR_LP_SetConfigWakeupPin() function to configure wakeup pin.
-
Call HAL_PWR_LP_GetConfigWakeupPin() function to get wakeup pin configuration.
-
Call HAL_PWR_LP_EnableWakeupPin() function to enable wakeup pin.
-
Call HAL_PWR_LP_DisableWakeupPin() function to disable wakeup pin.
-
Call HAL_PWR_LP_IsEnabledWakeupPin() function to check that wakeup pin is enabled.
Functions
-
hal_status_t
HAL_PWR_LP_SetConfigWakeupPin
(
uint32_t
wakeup_pin
,
const
hal_pwr_wakeup_pin_config_t
*
p_config
)
-
Set wakeup pin configuration.
- Parameters :
-
-
wakeup_pin – This parameter can be one or a combination of HAL_PWR_WAKEUP_PIN_x where x can be (1..8).
-
p_config – Pointer to a hal_pwr_wakeup_pin_config_t structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – p_config pointer is NULL.
-
HAL_OK – Wakeup pin has been correctly configured.
-
-
void
HAL_PWR_LP_GetConfigWakeupPin
(
uint32_t
wakeup_pin
,
hal_pwr_wakeup_pin_config_t
*
p_config
)
-
Get wakeup pin configuration.
- Parameters :
-
-
wakeup_pin – This parameter can be one of HAL_PWR_WAKEUP_PIN_x where x can be (1..8).
-
p_config – Pointer to a hal_pwr_wakeup_pin_config_t structure.
-
-
void
HAL_PWR_LP_EnableWakeupPin
(
uint32_t
wakeup_pin
)
-
Enable the wakeup pin configuration.
Note
Wakeup pins are used to wake up the system from Stop 3, Standby and Shutdown modes.
- Parameters :
-
wakeup_pin – This parameter can be one or a combination of HAL_PWR_WAKEUP_PIN_x where x can be (1..8).
-
void
HAL_PWR_LP_DisableWakeupPin
(
uint32_t
wakeup_pin
)
-
Disable the wakeup pin configuration.
Note
Wakeup pins are used to wake up the system from Stop 3, Standby and Shutdown modes.
- Parameters :
-
wakeup_pin – This parameter can be one or a combination of HAL_PWR_WAKEUP_PIN_x where x can be (1..8).
-
hal_pwr_wakeup_pin_status_t
HAL_PWR_LP_IsEnabledWakeupPin
(
uint32_t
wakeup_pin
)
-
Check that wakeup pin is enabled.
- Parameters :
-
wakeup_pin – This parameter can be one of HAL_PWR_WAKEUP_PIN_x where x can be (1..8).
- Return values :
-
hal_pwr_wakeup_pin_status_t – The wakeup pin status.
-
RTC domain write protection management functions ¶
- group PWR_Exported_Functions_Group2
-
This section provides functions allowing to manage RTC domain write protection:
-
Call HAL_PWR_EnableRTCDomainWriteProtection() to enable the RTC domain write protection.
-
Call HAL_PWR_DisableRTCDomainWriteProtection() to disable the RTC domain write protection.
-
Call HAL_PWR_IsEnabledRTCDomainWriteProtection() to check if the RTC domain write protection is enabled.
Functions
-
void
HAL_PWR_EnableRTCDomainWriteProtection
(
void
)
¶
-
Enable the RTC domain write protection (RCC Backup domain control register RCC_BDCR, RTC registers, TAMP registers, backup registers and backup SRAM).
Note
After a system reset, the RTC domain is protected against possible unwanted write accesses.
-
void
HAL_PWR_DisableRTCDomainWriteProtection
(
void
)
¶
-
Disable the RTC domain write protection (RCC Backup domain control register RCC_BDCR, RTC registers, TAMP registers, backup registers and backup SRAM).
-
hal_pwr_rtc_domain_wrp_status_t
HAL_PWR_IsEnabledRTCDomainWriteProtection
(
void
)
¶
-
Check if the RTC domain write protection is enabled.
- Return values :
-
hal_pwr_rtc_domain_wrp_status_t – The RTC domain write protection status.
-
- group PWR_Exported_Functions_Group2
-
This section provides functions allowing to manage RTC domain write protection:
-
Call HAL_PWR_EnableRTCDomainWriteProtection() to enable the RTC domain write protection.
-
Call HAL_PWR_DisableRTCDomainWriteProtection() to disable the RTC domain write protection.
-
Call HAL_PWR_IsEnabledRTCDomainWriteProtection() to check if the RTC domain write protection is enabled.
Functions
-
void
HAL_PWR_EnableRTCDomainWriteProtection
(
void
)
-
Enable the RTC domain write protection (RCC Backup domain control register RCC_BDCR, RTC registers, TAMP registers, backup registers and backup SRAM).
Note
After a system reset, the RTC domain is protected against possible unwanted write accesses.
-
void
HAL_PWR_DisableRTCDomainWriteProtection
(
void
)
-
Disable the RTC domain write protection (RCC Backup domain control register RCC_BDCR, RTC registers, TAMP registers, backup registers and backup SRAM).
-
hal_pwr_rtc_domain_wrp_status_t
HAL_PWR_IsEnabledRTCDomainWriteProtection
(
void
)
-
Check if the RTC domain write protection is enabled.
- Return values :
-
hal_pwr_rtc_domain_wrp_status_t – The RTC domain write protection status.
-
- group PWR_Exported_Functions_Group2
-
This section provides functions allowing to manage RTC domain write protection:
-
Call HAL_PWR_EnableRTCDomainWriteProtection() to enable the RTC domain write protection.
-
Call HAL_PWR_DisableRTCDomainWriteProtection() to disable the RTC domain write protection.
-
Call HAL_PWR_IsEnabledRTCDomainWriteProtection() to check if the RTC domain write protection is enabled.
Functions
-
void
HAL_PWR_EnableRTCDomainWriteProtection
(
void
)
-
Enable the RTC domain write protection (RCC Backup domain control register RCC_BDCR, RTC registers, TAMP registers, backup registers and backup SRAM).
Note
After a system reset, the RTC domain is protected against possible unwanted write accesses.
-
void
HAL_PWR_DisableRTCDomainWriteProtection
(
void
)
-
Disable the RTC domain write protection (RCC Backup domain control register RCC_BDCR, RTC registers, TAMP registers, backup registers and backup SRAM).
-
hal_pwr_rtc_domain_wrp_status_t
HAL_PWR_IsEnabledRTCDomainWriteProtection
(
void
)
-
Check if the RTC domain write protection is enabled.
- Return values :
-
hal_pwr_rtc_domain_wrp_status_t – The RTC domain write protection status.
-
Main regulator management functions ¶
- group PWR_Exported_Functions_Group3
-
This section provides functions allowing to control power supply.
-
Call HAL_PWR_SetMainRegulatorVoltageScalingRange() function to configure voltage scaling range.
-
Call HAL_PWR_GetMainRegulatorVoltageScalingRange() function to get voltage scaling range configuration.
-
Call HAL_PWR_SetMainRegulatorSupply() function to configure the main regulator supply.
-
Call HAL_PWR_GetMainRegulatorSupply() function to get the main regulator supply configuration.
-
Call HAL_PWR_SetMainRegulatorStartupMode() function to set the main regulator fast startup mode.
-
Call HAL_PWR_GetMainRegulatorStartupMode() function to get if the main regulator fast startup mode.
-
Call HAL_PWR_SetAnalogIOSwitchSupply() function to set the analog IO switch supply.
-
Call HAL_PWR_GetAnalogIOSwitchSupply() function to get the analog IO switch supply configuration.
-
Call HAL_PWR_EnableVddUSBIndependentSupply() function to enable the independent USB voltage supply.
-
Call HAL_PWR_DisableVddUSBIndependentSupply() function to disable the independent USB voltage supply.
-
Call HAL_PWR_IsEnabledVddUSBIndependentSupply() function to check if the independent USB voltage supply is enabled.
-
Call HAL_PWR_EnableVddIO2IndependentSupply() function to enable the independent IO2 voltage supply.
-
Call HAL_PWR_DisableVddIO2IndependentSupply() function to disable the independent IO2 voltage supply.
-
Call HAL_PWR_IsEnabledVddIO2IndependentSupply() function to check if the independent IO2 voltage supply is enabled.
-
Call HAL_PWR_EnableVddAIndependentSupply() function to enable the independent analog voltage supply.
-
Call HAL_PWR_DisableVddAIndependentSupply() function to disable the independent analog voltage supply.
-
Call HAL_PWR_IsEnabledVddAIndependentSupply() function to check if the independent analog voltage supply is enabled.
-
Call HAL_PWR_EnableVdd11USBIndependentSupply() function to enable the independent Vdd11 USB voltage supply.
-
Call HAL_PWR_DisableVdd11USBIndependentSupply() function to disable the independent Vdd11 USB voltage supply.
-
Call HAL_PWR_IsEnabledVdd11USBIndependentSupply() function to check if the independent Vdd11 USB voltage supply is enabled.
-
Call HAL_PWR_EnableVddUSBHSTransceiverSupply() function to enable the internal USB HS transceiver supply.
-
Call HAL_PWR_DisableVddUSBHSTransceiverSupply() function to disable the internal USB HS transceiver supply.
-
Call HAL_PWR_IsEnabledVddUSBHSTransceiverSupply() function to check if the internal USB HS transceiver supply is enabled.
Functions
-
hal_status_t
HAL_PWR_SetMainRegulatorVoltageScalingRange
(
hal_pwr_volt_scale_range_t
range
)
¶
-
Set the regulator voltage scaling range.
Warning
There are no constraints when moving to voltage scaling range 1.
Warning
Before moving to voltage scaling range 2, it is mandatory to ensure that the system frequency is below 110 MHz.
Warning
Before moving to voltage scaling range 3, it is mandatory to ensure that the system frequency is below 55 MHz.
Warning
Before moving to voltage scaling range 4,it is mandatory to ensure that the system frequency is below 25 MHz.
- Parameters :
-
range – This parameter is an element of hal_pwr_volt_scale_range_t enumeration.
- Return values :
-
-
HAL_ERROR – VOS setting timeout.
-
HAL_OK – Regulator voltage scaling range has been correctly configured.
-
-
hal_pwr_volt_scale_range_t
HAL_PWR_GetMainRegulatorVoltageScalingRange
(
void
)
¶
-
Get the regulator voltage scaling range.
- Return values :
-
Range – The current applied voltage scaling range.
-
hal_status_t
HAL_PWR_SetMainRegulatorSupply
(
hal_pwr_main_regulator_supply_t
regulator
)
¶
-
Set the system supply regulator configuration.
- Parameters :
-
regulator – This parameter is an element of hal_pwr_main_regulator_supply_t enumeration.
- Return values :
-
-
HAL_ERROR – regulator setting timeout.
-
HAL_OK – System supply regulator has been correctly configured.
-
-
hal_pwr_main_regulator_supply_t
HAL_PWR_GetMainRegulatorSupply
(
void
)
¶
-
Get the system supply regulator configuration.
- Return values :
-
hal_pwr_main_regulator_supply_t – System supply regulator configuration.
-
void
HAL_PWR_SetMainRegulatorStartupMode
(
hal_pwr_main_regulator_fast_startup_mode_t
mode
)
¶
-
Set the main regulator fast startup mode.
- Parameters :
-
mode – This parameter is an element of hal_pwr_main_regulator_fast_startup_mode_t enumeration.
-
hal_pwr_main_regulator_fast_startup_mode_t
HAL_PWR_GetMainRegulatorStartupMode
(
void
)
¶
-
Get the main regulator fast startup mode.
- Return values :
-
hal_pwr_main_regulator_fast_startup_mode_t – The main regulator fast startup mode.
-
void
HAL_PWR_SetAnalogIOSwitchSupply
(
hal_pwr_analog_io_switch_supply_t
analog_switch_supply
)
¶
-
Set the IO analog switch supply.
- Parameters :
-
analog_switch_supply – This parameter is an element of hal_pwr_analog_io_switch_supply_t enumeration.
-
hal_pwr_analog_io_switch_supply_t
HAL_PWR_GetAnalogIOSwitchSupply
(
void
)
¶
-
Get the IO analog switch supply.
- Return values :
-
hal_pwr_analog_io_switch_supply_t – IO Analog switch supply.
-
hal_status_t
HAL_PWR_EnableVddUSBIndependentSupply
(
void
)
¶
-
Enable the Vdd USB independent supply.
- Return values :
-
-
HAL_ERROR – Vdd USB independent supply setting timeout.
-
HAL_OK – Vdd USB independent supply has been correctly configured.
-
-
void
HAL_PWR_DisableVddUSBIndependentSupply
(
void
)
¶
-
Disable the Vdd USB independent supply.
-
hal_pwr_independent_supply_status_t
HAL_PWR_IsEnabledVddUSBIndependentSupply
(
void
)
¶
-
Check if the Vdd USB independent supply is enabled.
- Return values :
-
hal_pwr_independent_supply_status_t – The VddUSB independent supply status.
-
hal_status_t
HAL_PWR_EnableVddIO2IndependentSupply
(
void
)
¶
-
Enable the Vdd IO2 independent supply.
- Return values :
-
-
HAL_ERROR – Vdd IO2 independent supply setting timeout.
-
HAL_OK – Vdd IO2 independent supply has been correctly configured.
-
-
void
HAL_PWR_DisableVddIO2IndependentSupply
(
void
)
¶
-
Disable the Vdd IO2 independent supply.
-
hal_pwr_independent_supply_status_t
HAL_PWR_IsEnabledVddIO2IndependentSupply
(
void
)
¶
-
Check if the Vdd USB independent supply is enabled.
- Return values :
-
hal_pwr_independent_supply_status_t – The VddIO2 independent supply status.
-
hal_status_t
HAL_PWR_EnableVddAIndependentSupply
(
uint32_t
monitor
)
¶
-
Enable the Vdd analog independent supply.
- Parameters :
-
monitor – This parameter can be one or a combination of the following values:
-
HAL_PWR_VDD_ANALOG_MONITOR_1 : Independent VddA voltage monitor 1.
-
HAL_PWR_VDD_ANALOG_MONITOR_2 : Independent VddA voltage monitor 2.
-
- Return values :
-
-
HAL_ERROR – Independent voltage monitor setting timeout.
-
HAL_OK – Independent voltage monitor has been correctly configured.
-
-
void
HAL_PWR_DisableVddAIndependentSupply
(
void
)
¶
-
Disable the Vdd analog independent supply.
-
hal_pwr_independent_supply_status_t
HAL_PWR_IsEnabledVddAIndependentSupply
(
void
)
¶
-
Check if the Vdd analog independent supply is enabled.
- Return values :
-
hal_pwr_independent_supply_status_t – The VddA independent supply status.
-
hal_status_t
HAL_PWR_EnableVdd11USBIndependentSupply
(
void
)
¶
-
Enable the Vdd11 USB independent supply.
- Return values :
-
HAL_OK – The Vdd11 USB has been correctly enabled.
-
void
HAL_PWR_DisableVdd11USBIndependentSupply
(
void
)
¶
-
Disable the Vdd11 USB independent supply.
-
hal_pwr_independent_supply_status_t
HAL_PWR_IsEnabledVdd11USBIndependentSupply
(
void
)
¶
-
Check if the Vdd11 USB independent supply is enabled.
- Return values :
-
hal_pwr_independent_supply_status_t – The Vdd11 USB independent supply status.
-
hal_status_t
HAL_PWR_EnableVddUSBHSTransceiverSupply
(
void
)
¶
-
Enable the internal USB HS transceiver supply.
- Return values :
-
-
HAL_ERROR – USB Boost setting timeout or voltage scaling less than range 2.
-
HAL_OK – USB HS has been correctly enabled.
-
-
void
HAL_PWR_DisableVddUSBHSTransceiverSupply
(
void
)
¶
-
Disable the internal USB HS transceiver supply.
-
hal_pwr_independent_supply_status_t
HAL_PWR_IsEnabledVddUSBHSTransceiverSupply
(
void
)
¶
-
Check if the internal USB HS transceiver supply is enabled.
- Return values :
-
hal_pwr_independent_supply_status_t – The USB HS transceiver supply status.
-
- group PWR_Exported_Functions_Group3
-
This section provides functions allowing to control power supply.
-
Call HAL_PWR_SetMainRegulatorVoltageScalingRange() function to configure voltage scaling range.
-
Call HAL_PWR_GetMainRegulatorVoltageScalingRange() function to get voltage scaling range configuration.
-
Call HAL_PWR_SetMainRegulatorSupply() function to configure the main regulator supply.
-
Call HAL_PWR_GetMainRegulatorSupply() function to get the main regulator supply configuration.
-
Call HAL_PWR_SetMainRegulatorStartupMode() function to set the main regulator fast startup mode.
-
Call HAL_PWR_GetMainRegulatorStartupMode() function to get if the main regulator fast startup mode.
-
Call HAL_PWR_SetAnalogIOSwitchSupply() function to set the analog IO switch supply.
-
Call HAL_PWR_GetAnalogIOSwitchSupply() function to get the analog IO switch supply configuration.
-
Call HAL_PWR_EnableVddUSBIndependentSupply() function to enable the independent USB voltage supply.
-
Call HAL_PWR_DisableVddUSBIndependentSupply() function to disable the independent USB voltage supply.
-
Call HAL_PWR_IsEnabledVddUSBIndependentSupply() function to check if the independent USB voltage supply is enabled.
-
Call HAL_PWR_EnableVddIO2IndependentSupply() function to enable the independent IO2 voltage supply.
-
Call HAL_PWR_DisableVddIO2IndependentSupply() function to disable the independent IO2 voltage supply.
-
Call HAL_PWR_IsEnabledVddIO2IndependentSupply() function to check if the independent IO2 voltage supply is enabled.
-
Call HAL_PWR_EnableVddAIndependentSupply() function to enable the independent analog voltage supply.
-
Call HAL_PWR_DisableVddAIndependentSupply() function to disable the independent analog voltage supply.
-
Call HAL_PWR_IsEnabledVddAIndependentSupply() function to check if the independent analog voltage supply is enabled.
-
Call HAL_PWR_EnableVdd11USBIndependentSupply() function to enable the independent Vdd11 USB voltage supply.
-
Call HAL_PWR_DisableVdd11USBIndependentSupply() function to disable the independent Vdd11 USB voltage supply.
-
Call HAL_PWR_IsEnabledVdd11USBIndependentSupply() function to check if the independent Vdd11 USB voltage supply is enabled.
-
Call HAL_PWR_EnableVddUSBHSTransceiverSupply() function to enable the internal USB HS transceiver supply.
-
Call HAL_PWR_DisableVddUSBHSTransceiverSupply() function to disable the internal USB HS transceiver supply.
-
Call HAL_PWR_IsEnabledVddUSBHSTransceiverSupply() function to check if the internal USB HS transceiver supply is enabled.
Functions
-
hal_status_t
HAL_PWR_SetMainRegulatorVoltageScalingRange
(
hal_pwr_volt_scale_range_t
range
)
-
Set the regulator voltage scaling range.
Warning
There are no constraints when moving to voltage scaling range 1.
Warning
Before moving to voltage scaling range 2, it is mandatory to ensure that the system frequency is below 110 MHz.
Warning
Before moving to voltage scaling range 3, it is mandatory to ensure that the system frequency is below 55 MHz.
Warning
Before moving to voltage scaling range 4,it is mandatory to ensure that the system frequency is below 25 MHz.
- Parameters :
-
range – This parameter is an element of hal_pwr_volt_scale_range_t enumeration.
- Return values :
-
-
HAL_ERROR – VOS setting timeout.
-
HAL_OK – Regulator voltage scaling range has been correctly configured.
-
-
hal_pwr_volt_scale_range_t
HAL_PWR_GetMainRegulatorVoltageScalingRange
(
void
)
-
Get the regulator voltage scaling range.
- Return values :
-
Range – The current applied voltage scaling range.
-
hal_status_t
HAL_PWR_SetMainRegulatorSupply
(
hal_pwr_main_regulator_supply_t
regulator
)
-
Set the system supply regulator configuration.
- Parameters :
-
regulator – This parameter is an element of hal_pwr_main_regulator_supply_t enumeration.
- Return values :
-
-
HAL_ERROR – regulator setting timeout.
-
HAL_OK – System supply regulator has been correctly configured.
-
-
hal_pwr_main_regulator_supply_t
HAL_PWR_GetMainRegulatorSupply
(
void
)
-
Get the system supply regulator configuration.
- Return values :
-
hal_pwr_main_regulator_supply_t – System supply regulator configuration.
-
void
HAL_PWR_SetMainRegulatorStartupMode
(
hal_pwr_main_regulator_fast_startup_mode_t
mode
)
-
Set the main regulator fast startup mode.
- Parameters :
-
mode – This parameter is an element of hal_pwr_main_regulator_fast_startup_mode_t enumeration.
-
hal_pwr_main_regulator_fast_startup_mode_t
HAL_PWR_GetMainRegulatorStartupMode
(
void
)
-
Get the main regulator fast startup mode.
- Return values :
-
hal_pwr_main_regulator_fast_startup_mode_t – The main regulator fast startup mode.
-
void
HAL_PWR_SetAnalogIOSwitchSupply
(
hal_pwr_analog_io_switch_supply_t
analog_switch_supply
)
-
Set the IO analog switch supply.
- Parameters :
-
analog_switch_supply – This parameter is an element of hal_pwr_analog_io_switch_supply_t enumeration.
-
hal_pwr_analog_io_switch_supply_t
HAL_PWR_GetAnalogIOSwitchSupply
(
void
)
-
Get the IO analog switch supply.
- Return values :
-
hal_pwr_analog_io_switch_supply_t – IO Analog switch supply.
-
hal_status_t
HAL_PWR_EnableVddUSBIndependentSupply
(
void
)
-
Enable the Vdd USB independent supply.
- Return values :
-
-
HAL_ERROR – Vdd USB independent supply setting timeout.
-
HAL_OK – Vdd USB independent supply has been correctly configured.
-
-
void
HAL_PWR_DisableVddUSBIndependentSupply
(
void
)
-
Disable the Vdd USB independent supply.
-
hal_pwr_independent_supply_status_t
HAL_PWR_IsEnabledVddUSBIndependentSupply
(
void
)
-
Check if the Vdd USB independent supply is enabled.
- Return values :
-
hal_pwr_independent_supply_status_t – The VddUSB independent supply status.
-
hal_status_t
HAL_PWR_EnableVddIO2IndependentSupply
(
void
)
-
Enable the Vdd IO2 independent supply.
- Return values :
-
-
HAL_ERROR – Vdd IO2 independent supply setting timeout.
-
HAL_OK – Vdd IO2 independent supply has been correctly configured.
-
-
void
HAL_PWR_DisableVddIO2IndependentSupply
(
void
)
-
Disable the Vdd IO2 independent supply.
-
hal_pwr_independent_supply_status_t
HAL_PWR_IsEnabledVddIO2IndependentSupply
(
void
)
-
Check if the Vdd USB independent supply is enabled.
- Return values :
-
hal_pwr_independent_supply_status_t – The VddIO2 independent supply status.
-
hal_status_t
HAL_PWR_EnableVddAIndependentSupply
(
uint32_t
monitor
)
-
Enable the Vdd analog independent supply.
- Parameters :
-
monitor – This parameter can be one or a combination of the following values:
-
HAL_PWR_VDD_ANALOG_MONITOR_1 : Independent VddA voltage monitor 1.
-
HAL_PWR_VDD_ANALOG_MONITOR_2 : Independent VddA voltage monitor 2.
-
- Return values :
-
-
HAL_ERROR – Independent voltage monitor setting timeout.
-
HAL_OK – Independent voltage monitor has been correctly configured.
-
-
void
HAL_PWR_DisableVddAIndependentSupply
(
void
)
-
Disable the Vdd analog independent supply.
-
hal_pwr_independent_supply_status_t
HAL_PWR_IsEnabledVddAIndependentSupply
(
void
)
-
Check if the Vdd analog independent supply is enabled.
- Return values :
-
hal_pwr_independent_supply_status_t – The VddA independent supply status.
-
hal_status_t
HAL_PWR_EnableVdd11USBIndependentSupply
(
void
)
-
Enable the Vdd11 USB independent supply.
- Return values :
-
HAL_OK – The Vdd11 USB has been correctly enabled.
-
void
HAL_PWR_DisableVdd11USBIndependentSupply
(
void
)
-
Disable the Vdd11 USB independent supply.
-
hal_pwr_independent_supply_status_t
HAL_PWR_IsEnabledVdd11USBIndependentSupply
(
void
)
-
Check if the Vdd11 USB independent supply is enabled.
- Return values :
-
hal_pwr_independent_supply_status_t – The Vdd11 USB independent supply status.
-
hal_status_t
HAL_PWR_EnableVddUSBHSTransceiverSupply
(
void
)
-
Enable the internal USB HS transceiver supply.
- Return values :
-
-
HAL_ERROR – USB Boost setting timeout or voltage scaling less than range 2.
-
HAL_OK – USB HS has been correctly enabled.
-
-
void
HAL_PWR_DisableVddUSBHSTransceiverSupply
(
void
)
-
Disable the internal USB HS transceiver supply.
-
hal_pwr_independent_supply_status_t
HAL_PWR_IsEnabledVddUSBHSTransceiverSupply
(
void
)
-
Check if the internal USB HS transceiver supply is enabled.
- Return values :
-
hal_pwr_independent_supply_status_t – The USB HS transceiver supply status.
-
- group PWR_Exported_Functions_Group3
-
This section provides functions allowing to control power supply.
-
Call HAL_PWR_SetMainRegulatorVoltageScalingRange() function to configure voltage scaling range.
-
Call HAL_PWR_GetMainRegulatorVoltageScalingRange() function to get voltage scaling range configuration.
-
Call HAL_PWR_SetMainRegulatorSupply() function to configure the main regulator supply.
-
Call HAL_PWR_GetMainRegulatorSupply() function to get the main regulator supply configuration.
-
Call HAL_PWR_SetMainRegulatorStartupMode() function to set the main regulator fast startup mode.
-
Call HAL_PWR_GetMainRegulatorStartupMode() function to get if the main regulator fast startup mode.
-
Call HAL_PWR_SetAnalogIOSwitchSupply() function to set the analog IO switch supply.
-
Call HAL_PWR_GetAnalogIOSwitchSupply() function to get the analog IO switch supply configuration.
-
Call HAL_PWR_EnableVddUSBIndependentSupply() function to enable the independent USB voltage supply.
-
Call HAL_PWR_DisableVddUSBIndependentSupply() function to disable the independent USB voltage supply.
-
Call HAL_PWR_IsEnabledVddUSBIndependentSupply() function to check if the independent USB voltage supply is enabled.
-
Call HAL_PWR_EnableVddIO2IndependentSupply() function to enable the independent IO2 voltage supply.
-
Call HAL_PWR_DisableVddIO2IndependentSupply() function to disable the independent IO2 voltage supply.
-
Call HAL_PWR_IsEnabledVddIO2IndependentSupply() function to check if the independent IO2 voltage supply is enabled.
-
Call HAL_PWR_EnableVddAIndependentSupply() function to enable the independent analog voltage supply.
-
Call HAL_PWR_DisableVddAIndependentSupply() function to disable the independent analog voltage supply.
-
Call HAL_PWR_IsEnabledVddAIndependentSupply() function to check if the independent analog voltage supply is enabled.
-
Call HAL_PWR_EnableVdd11USBIndependentSupply() function to enable the independent Vdd11 USB voltage supply.
-
Call HAL_PWR_DisableVdd11USBIndependentSupply() function to disable the independent Vdd11 USB voltage supply.
-
Call HAL_PWR_IsEnabledVdd11USBIndependentSupply() function to check if the independent Vdd11 USB voltage supply is enabled.
-
Call HAL_PWR_EnableVddUSBHSTransceiverSupply() function to enable the internal USB HS transceiver supply.
-
Call HAL_PWR_DisableVddUSBHSTransceiverSupply() function to disable the internal USB HS transceiver supply.
-
Call HAL_PWR_IsEnabledVddUSBHSTransceiverSupply() function to check if the internal USB HS transceiver supply is enabled.
Functions
-
hal_status_t
HAL_PWR_SetMainRegulatorVoltageScalingRange
(
hal_pwr_volt_scale_range_t
range
)
-
Set the regulator voltage scaling range.
Warning
There are no constraints when moving to voltage scaling range 1.
Warning
Before moving to voltage scaling range 2, it is mandatory to ensure that the system frequency is below 110 MHz.
Warning
Before moving to voltage scaling range 3, it is mandatory to ensure that the system frequency is below 55 MHz.
Warning
Before moving to voltage scaling range 4,it is mandatory to ensure that the system frequency is below 25 MHz.
- Parameters :
-
range – This parameter is an element of hal_pwr_volt_scale_range_t enumeration.
- Return values :
-
-
HAL_ERROR – VOS setting timeout.
-
HAL_OK – Regulator voltage scaling range has been correctly configured.
-
-
hal_pwr_volt_scale_range_t
HAL_PWR_GetMainRegulatorVoltageScalingRange
(
void
)
-
Get the regulator voltage scaling range.
- Return values :
-
Range – The current applied voltage scaling range.
-
hal_status_t
HAL_PWR_SetMainRegulatorSupply
(
hal_pwr_main_regulator_supply_t
regulator
)
-
Set the system supply regulator configuration.
- Parameters :
-
regulator – This parameter is an element of hal_pwr_main_regulator_supply_t enumeration.
- Return values :
-
-
HAL_ERROR – regulator setting timeout.
-
HAL_OK – System supply regulator has been correctly configured.
-
-
hal_pwr_main_regulator_supply_t
HAL_PWR_GetMainRegulatorSupply
(
void
)
-
Get the system supply regulator configuration.
- Return values :
-
hal_pwr_main_regulator_supply_t – System supply regulator configuration.
-
void
HAL_PWR_SetMainRegulatorStartupMode
(
hal_pwr_main_regulator_fast_startup_mode_t
mode
)
-
Set the main regulator fast startup mode.
- Parameters :
-
mode – This parameter is an element of hal_pwr_main_regulator_fast_startup_mode_t enumeration.
-
hal_pwr_main_regulator_fast_startup_mode_t
HAL_PWR_GetMainRegulatorStartupMode
(
void
)
-
Get the main regulator fast startup mode.
- Return values :
-
hal_pwr_main_regulator_fast_startup_mode_t – The main regulator fast startup mode.
-
void
HAL_PWR_SetAnalogIOSwitchSupply
(
hal_pwr_analog_io_switch_supply_t
analog_switch_supply
)
-
Set the IO analog switch supply.
- Parameters :
-
analog_switch_supply – This parameter is an element of hal_pwr_analog_io_switch_supply_t enumeration.
-
hal_pwr_analog_io_switch_supply_t
HAL_PWR_GetAnalogIOSwitchSupply
(
void
)
-
Get the IO analog switch supply.
- Return values :
-
hal_pwr_analog_io_switch_supply_t – IO Analog switch supply.
-
hal_status_t
HAL_PWR_EnableVddUSBIndependentSupply
(
void
)
-
Enable the Vdd USB independent supply.
- Return values :
-
-
HAL_ERROR – Vdd USB independent supply setting timeout.
-
HAL_OK – Vdd USB independent supply has been correctly configured.
-
-
void
HAL_PWR_DisableVddUSBIndependentSupply
(
void
)
-
Disable the Vdd USB independent supply.
-
hal_pwr_independent_supply_status_t
HAL_PWR_IsEnabledVddUSBIndependentSupply
(
void
)
-
Check if the Vdd USB independent supply is enabled.
- Return values :
-
hal_pwr_independent_supply_status_t – The VddUSB independent supply status.
-
hal_status_t
HAL_PWR_EnableVddIO2IndependentSupply
(
void
)
-
Enable the Vdd IO2 independent supply.
- Return values :
-
-
HAL_ERROR – Vdd IO2 independent supply setting timeout.
-
HAL_OK – Vdd IO2 independent supply has been correctly configured.
-
-
void
HAL_PWR_DisableVddIO2IndependentSupply
(
void
)
-
Disable the Vdd IO2 independent supply.
-
hal_pwr_independent_supply_status_t
HAL_PWR_IsEnabledVddIO2IndependentSupply
(
void
)
-
Check if the Vdd USB independent supply is enabled.
- Return values :
-
hal_pwr_independent_supply_status_t – The VddIO2 independent supply status.
-
hal_status_t
HAL_PWR_EnableVddAIndependentSupply
(
uint32_t
monitor
)
-
Enable the Vdd analog independent supply.
- Parameters :
-
monitor – This parameter can be one or a combination of the following values:
-
HAL_PWR_VDD_ANALOG_MONITOR_1 : Independent VddA voltage monitor 1.
-
HAL_PWR_VDD_ANALOG_MONITOR_2 : Independent VddA voltage monitor 2.
-
- Return values :
-
-
HAL_ERROR – Independent voltage monitor setting timeout.
-
HAL_OK – Independent voltage monitor has been correctly configured.
-
-
void
HAL_PWR_DisableVddAIndependentSupply
(
void
)
-
Disable the Vdd analog independent supply.
-
hal_pwr_independent_supply_status_t
HAL_PWR_IsEnabledVddAIndependentSupply
(
void
)
-
Check if the Vdd analog independent supply is enabled.
- Return values :
-
hal_pwr_independent_supply_status_t – The VddA independent supply status.
-
Low power mode management functions ¶
- group PWR_Exported_Functions_Group4
-
This section provides functions allowing to manage low power modes:
-
Call HAL_PWR_ClearCorePendingEvent() function to clear the internal cortex event before entering low power mode.
-
Call HAL_PWR_EnterSleepMode() function to enter the Core in sleep mode.
-
Call HAL_PWR_EnterStopMode() function to enter the MCU in stop x mode
-
Call HAL_PWR_EnterStandbyMode() function to enter the MCU in standby mode.
-
Call HAL_PWR_EnterShutdownMode() function to enter the MCU in shutdown mode.
-
Call HAL_PWR_SetCoreSleepMode() function to configure the Core in sleep or deep sleep mode.
-
Call HAL_PWR_GetCoreSleepMode() function to get Core sleep mode configuration.
-
Call HAL_PWR_EnableCoreSleepOnExit() function to enable Core to re-entry in sleep mode after an interrupt is over.
-
Call HAL_PWR_DisableCoreSleepOnExit() function to disable Core to re-entry in sleep mode after an interrupt is over.
-
Call HAL_PWR_IsEnabledCoreSleepOnExit() function to check that Core to re-entry in sleep mode is enabled.
-
Call HAL_PWR_EnableCoreSendEventOnPending() function to enable Core to wakeup after any pending event/ interrupt.
-
Call HAL_PWR_DisableCoreSendEventOnPending() function to disable Core to wakeup after any pending event/ interrupt.
-
Call HAL_PWR_IsEnabledCoreSendEventOnPending() function to check that core send event on pending is enabled.
-
Call HAL_PWR_LP_SetSmartRunDomainMode() function to Configure the Smart Run Domain mode.
-
Call HAL_PWR_LP_GetSmartRunDomainMode() function to get the Smart Run Domain mode.
-
Call HAL_PWR_LP_SetBrownoutResetMode() function to configure the brownout reset mode in standby mode.
-
Call HAL_PWR_LP_GetBrownoutResetMode() function to get the brownout reset mode configuration.
-
Call HAL_PWR_Stop3Wakeup_IRQHandler() function to handle the wakeup from Stop 3 interrupt request
-
Call HAL_PWR_Stop3WakeupCallback() function to wakeup from stop 3 interrupt callback.
Functions
-
void
HAL_PWR_ClearCorePendingEvent
(
void
)
¶
-
Clear core pending event.
Note
This API clears the pending event in order to enter a given core to Sleep or Stop mode with WFE entry.
Warning
It must be called just before APIs performing enter Sleep and Stop mode using Wait For Event request
-
void
HAL_PWR_EnterSleepMode
(
hal_pwr_low_pwr_mode_entry_t
sleep_entry
)
¶
-
Enter the core in Sleep mode.
- Parameters :
-
sleep_entry – Parameter to hal_pwr_low_pwr_mode_entry_t enumeration.
-
void
HAL_PWR_EnterStopMode
(
hal_pwr_low_pwr_mode_entry_t
stop_entry
,
hal_pwr_stop_mode_t
stop_mode
)
¶
-
Enter the MCU in Stop mode.
- Parameters :
-
-
stop_entry – This parameter is an element of hal_pwr_low_pwr_mode_entry_t enumeration.
-
stop_mode – This parameter is an element of hal_pwr_stop_mode_t enumeration.
-
-
void
HAL_PWR_EnterStandbyMode
(
void
)
¶
-
Enter the MCU in Standby mode.
-
void
HAL_PWR_EnterShutdownMode
(
void
)
¶
-
Enter the MCU in Shutdown mode.
-
void
HAL_PWR_SetCoreSleepMode
(
hal_pwr_core_sleep_mode_t
sleep_mode
)
¶
-
Set the core sleep mode configuration.
- Parameters :
-
sleep_mode – This parameter is an element of hal_pwr_core_sleep_mode_t enumeration.
-
hal_pwr_core_sleep_mode_t
HAL_PWR_GetCoreSleepMode
(
void
)
¶
-
Get the core sleep mode configuration.
- Return values :
-
hal_pwr_core_sleep_mode_t – The core sleep mode configuration.
-
void
HAL_PWR_EnableCoreSleepOnExit
(
void
)
¶
-
Enable SLEEP-ON-EXIT feature when returning from handler mode to thread mode.
-
void
HAL_PWR_DisableCoreSleepOnExit
(
void
)
¶
-
Disable SLEEP-ON-EXIT feature when returning from handler mode to thread mode.
-
hal_pwr_core_sleep_on_exit_status_t
HAL_PWR_IsEnabledCoreSleepOnExit
(
void
)
¶
-
Check if the Core SLEEP-ON-EXIT is enabled or disabled.
- Return values :
-
hal_pwr_core_sleep_on_exit_status_t – Core sleep on exit status.
-
void
HAL_PWR_EnableCoreSendEventOnPending
(
void
)
¶
-
Enable core Send Event On Pending feature.
-
void
HAL_PWR_DisableCoreSendEventOnPending
(
void
)
¶
-
Disable core Send Event On Pending.
-
hal_pwr_core_sev_on_pending_status_t
HAL_PWR_IsEnabledCoreSendEventOnPending
(
void
)
¶
-
Get core Send Event On Pending.
- Return values :
-
hal_pwr_core_sev_on_pending_status_t – Core send event on pending status.
-
void
HAL_PWR_LP_SetSmartRunDomainMode
(
hal_pwr_system_mode_srd_mode_t
mode
)
¶
-
Set the Smart Run Domain mode when the System in Stop 0/1/2 mode.
- Parameters :
-
mode – This parameter is an element of hal_pwr_system_mode_srd_mode_t enumeration.
-
hal_pwr_system_mode_srd_mode_t
HAL_PWR_LP_GetSmartRunDomainMode
(
void
)
¶
-
Get the Smart Run Domain mode when the System in Stop 0/1/2 mode.
- Return values :
-
hal_pwr_system_mode_srd_mode_t – Smart run domain in Run mod status.
-
void
HAL_PWR_LP_SetBrownoutResetMode
(
hal_pwr_brownout_reset_mode_t
mode
)
¶
-
Set BOR ultra-low power mode.
Note
BOR operating can be in discontinuous (ultra-low power) mode in Stop 1, Stop 2, Stop 3 and Standby modes and when the regulator is in Range 4 (Run, Sleep or Stop 0 mode).
- Parameters :
-
mode – This parameter is an element of hal_pwr_brownout_reset_mode_t enumeration.
-
hal_pwr_brownout_reset_mode_t
HAL_PWR_LP_GetBrownoutResetMode
(
void
)
¶
-
Get BOR ultra-low power mode.
- Return values :
-
hal_pwr_brownout_reset_mode_t – Brownout reset mode status.
-
void
HAL_PWR_Stop3Wakeup_IRQHandler
(
uint32_t
wakeup_pin
)
¶
-
This function handles the PWR wake-up from Stop 3 interrupt request.
- Parameters :
-
wakeup_pin – This parameter can be one or a combination of the following values:
-
HAL_PWR_WAKEUP_PIN_1 : Wakeup pin 1.
-
HAL_PWR_WAKEUP_PIN_2 : Wakeup pin 2.
-
HAL_PWR_WAKEUP_PIN_3 : Wakeup pin 3.
-
HAL_PWR_WAKEUP_PIN_4 : Wakeup pin 4.
-
HAL_PWR_WAKEUP_PIN_5 : Wakeup pin 5.
-
HAL_PWR_WAKEUP_PIN_6 : Wakeup pin 6.
-
HAL_PWR_WAKEUP_PIN_7 : Wakeup pin 7.
-
HAL_PWR_WAKEUP_PIN_8 : Wakeup pin 8
-
HAL_PWR_WAKEUP_PIN_ALL: Wakeup pin all.
-
-
void
HAL_PWR_Stop3WakeupCallback
(
uint32_t
wakeup_pin
)
¶
-
PWR wake-up from Stop 3 interrupt request callback.
- Parameters :
-
wakeup_pin – Specifies the wake-up pin interrupt to be handled. This parameter can be one or a combination of the following values:
-
HAL_PWR_WAKEUP_PIN_1 : Wakeup pin 1.
-
HAL_PWR_WAKEUP_PIN_2 : Wakeup pin 2.
-
HAL_PWR_WAKEUP_PIN_3 : Wakeup pin 3.
-
HAL_PWR_WAKEUP_PIN_4 : Wakeup pin 4.
-
HAL_PWR_WAKEUP_PIN_5 : Wakeup pin 5.
-
HAL_PWR_WAKEUP_PIN_6 : Wakeup pin 6.
-
HAL_PWR_WAKEUP_PIN_7 : Wakeup pin 7.
-
HAL_PWR_WAKEUP_PIN_8 : Wakeup pin 8.
-
HAL_PWR_WAKEUP_PIN_ALL: Wakeup pin all.
-
-
- group PWR_Exported_Functions_Group4
-
This section provides functions allowing to manage low power modes:
-
Call HAL_PWR_ClearCorePendingEvent() function to clear the internal cortex event before entering low power mode.
-
Call HAL_PWR_EnterSleepMode() function to enter the Core in sleep mode.
-
Call HAL_PWR_EnterStopMode() function to enter the MCU in stop x mode
-
Call HAL_PWR_EnterStandbyMode() function to enter the MCU in standby mode.
-
Call HAL_PWR_EnterShutdownMode() function to enter the MCU in shutdown mode.
-
Call HAL_PWR_SetCoreSleepMode() function to configure the Core in sleep or deep sleep mode.
-
Call HAL_PWR_GetCoreSleepMode() function to get Core sleep mode configuration.
-
Call HAL_PWR_EnableCoreSleepOnExit() function to enable Core to re-entry in sleep mode after an interrupt is over.
-
Call HAL_PWR_DisableCoreSleepOnExit() function to disable Core to re-entry in sleep mode after an interrupt is over.
-
Call HAL_PWR_IsEnabledCoreSleepOnExit() function to check that Core to re-entry in sleep mode is enabled.
-
Call HAL_PWR_EnableCoreSendEventOnPending() function to enable Core to wakeup after any pending event/ interrupt.
-
Call HAL_PWR_DisableCoreSendEventOnPending() function to disable Core to wakeup after any pending event/ interrupt.
-
Call HAL_PWR_IsEnabledCoreSendEventOnPending() function to check that core send event on pending is enabled.
-
Call HAL_PWR_LP_SetSmartRunDomainMode() function to Configure the Smart Run Domain mode.
-
Call HAL_PWR_LP_GetSmartRunDomainMode() function to get the Smart Run Domain mode.
-
Call HAL_PWR_LP_SetBrownoutResetMode() function to configure the brownout reset mode in standby mode.
-
Call HAL_PWR_LP_GetBrownoutResetMode() function to get the brownout reset mode configuration.
-
Call HAL_PWR_Stop3Wakeup_IRQHandler() function to handle the wakeup from Stop 3 interrupt request
-
Call HAL_PWR_Stop3WakeupCallback() function to wakeup from stop 3 interrupt callback.
Functions
-
void
HAL_PWR_ClearCorePendingEvent
(
void
)
-
Clear core pending event.
Note
This API clears the pending event in order to enter a given core to Sleep or Stop mode with WFE entry.
Warning
It must be called just before APIs performing enter Sleep and Stop mode using Wait For Event request
-
void
HAL_PWR_EnterSleepMode
(
hal_pwr_low_pwr_mode_entry_t
sleep_entry
)
-
Enter the core in Sleep mode.
- Parameters :
-
sleep_entry – Parameter to hal_pwr_low_pwr_mode_entry_t enumeration.
-
void
HAL_PWR_EnterStopMode
(
hal_pwr_low_pwr_mode_entry_t
stop_entry
,
hal_pwr_stop_mode_t
stop_mode
)
-
Enter the MCU in Stop mode.
- Parameters :
-
-
stop_entry – This parameter is an element of hal_pwr_low_pwr_mode_entry_t enumeration.
-
stop_mode – This parameter is an element of hal_pwr_stop_mode_t enumeration.
-
-
void
HAL_PWR_EnterStandbyMode
(
void
)
-
Enter the MCU in Standby mode.
-
void
HAL_PWR_EnterShutdownMode
(
void
)
-
Enter the MCU in Shutdown mode.
-
void
HAL_PWR_SetCoreSleepMode
(
hal_pwr_core_sleep_mode_t
sleep_mode
)
-
Set the core sleep mode configuration.
- Parameters :
-
sleep_mode – This parameter is an element of hal_pwr_core_sleep_mode_t enumeration.
-
hal_pwr_core_sleep_mode_t
HAL_PWR_GetCoreSleepMode
(
void
)
-
Get the core sleep mode configuration.
- Return values :
-
hal_pwr_core_sleep_mode_t – The core sleep mode configuration.
-
void
HAL_PWR_EnableCoreSleepOnExit
(
void
)
-
Enable SLEEP-ON-EXIT feature when returning from handler mode to thread mode.
-
void
HAL_PWR_DisableCoreSleepOnExit
(
void
)
-
Disable SLEEP-ON-EXIT feature when returning from handler mode to thread mode.
-
hal_pwr_core_sleep_on_exit_status_t
HAL_PWR_IsEnabledCoreSleepOnExit
(
void
)
-
Check if the Core SLEEP-ON-EXIT is enabled or disabled.
- Return values :
-
hal_pwr_core_sleep_on_exit_status_t – Core sleep on exit status.
-
void
HAL_PWR_EnableCoreSendEventOnPending
(
void
)
-
Enable core Send Event On Pending feature.
-
void
HAL_PWR_DisableCoreSendEventOnPending
(
void
)
-
Disable core Send Event On Pending.
-
hal_pwr_core_sev_on_pending_status_t
HAL_PWR_IsEnabledCoreSendEventOnPending
(
void
)
-
Get core Send Event On Pending.
- Return values :
-
hal_pwr_core_sev_on_pending_status_t – Core send event on pending status.
-
void
HAL_PWR_LP_SetSmartRunDomainMode
(
hal_pwr_system_mode_srd_mode_t
mode
)
-
Set the Smart Run Domain mode when the System in Stop 0/1/2 mode.
- Parameters :
-
mode – This parameter is an element of hal_pwr_system_mode_srd_mode_t enumeration.
-
hal_pwr_system_mode_srd_mode_t
HAL_PWR_LP_GetSmartRunDomainMode
(
void
)
-
Get the Smart Run Domain mode when the System in Stop 0/1/2 mode.
- Return values :
-
hal_pwr_system_mode_srd_mode_t – Smart run domain in Run mod status.
-
void
HAL_PWR_LP_SetBrownoutResetMode
(
hal_pwr_brownout_reset_mode_t
mode
)
-
Set BOR ultra-low power mode.
Note
BOR operating can be in discontinuous (ultra-low power) mode in Stop 1, Stop 2, Stop 3 and Standby modes and when the regulator is in Range 4 (Run, Sleep or Stop 0 mode).
- Parameters :
-
mode – This parameter is an element of hal_pwr_brownout_reset_mode_t enumeration.
-
hal_pwr_brownout_reset_mode_t
HAL_PWR_LP_GetBrownoutResetMode
(
void
)
-
Get BOR ultra-low power mode.
- Return values :
-
hal_pwr_brownout_reset_mode_t – Brownout reset mode status.
-
void
HAL_PWR_Stop3Wakeup_IRQHandler
(
uint32_t
wakeup_pin
)
-
This function handles the PWR wake-up from Stop 3 interrupt request.
- Parameters :
-
wakeup_pin – This parameter can be one or a combination of the following values:
-
HAL_PWR_WAKEUP_PIN_1 : Wakeup pin 1.
-
HAL_PWR_WAKEUP_PIN_2 : Wakeup pin 2.
-
HAL_PWR_WAKEUP_PIN_3 : Wakeup pin 3.
-
HAL_PWR_WAKEUP_PIN_4 : Wakeup pin 4.
-
HAL_PWR_WAKEUP_PIN_5 : Wakeup pin 5.
-
HAL_PWR_WAKEUP_PIN_6 : Wakeup pin 6.
-
HAL_PWR_WAKEUP_PIN_7 : Wakeup pin 7.
-
HAL_PWR_WAKEUP_PIN_8 : Wakeup pin 8
-
HAL_PWR_WAKEUP_PIN_ALL: Wakeup pin all.
-
-
void
HAL_PWR_Stop3WakeupCallback
(
uint32_t
wakeup_pin
)
-
PWR wake-up from Stop 3 interrupt request callback.
- Parameters :
-
wakeup_pin – Specifies the wake-up pin interrupt to be handled. This parameter can be one or a combination of the following values:
-
HAL_PWR_WAKEUP_PIN_1 : Wakeup pin 1.
-
HAL_PWR_WAKEUP_PIN_2 : Wakeup pin 2.
-
HAL_PWR_WAKEUP_PIN_3 : Wakeup pin 3.
-
HAL_PWR_WAKEUP_PIN_4 : Wakeup pin 4.
-
HAL_PWR_WAKEUP_PIN_5 : Wakeup pin 5.
-
HAL_PWR_WAKEUP_PIN_6 : Wakeup pin 6.
-
HAL_PWR_WAKEUP_PIN_7 : Wakeup pin 7.
-
HAL_PWR_WAKEUP_PIN_8 : Wakeup pin 8.
-
HAL_PWR_WAKEUP_PIN_ALL: Wakeup pin all.
-
-
- group PWR_Exported_Functions_Group4
-
This section provides functions allowing to manage low power modes:
-
Call HAL_PWR_ClearCorePendingEvent() function to clear the internal cortex event before entering low power mode.
-
Call HAL_PWR_EnterSleepMode() function to enter the Core in sleep mode.
-
Call HAL_PWR_EnterStopMode() function to enter the MCU in stop x mode
-
Call HAL_PWR_EnterStandbyMode() function to enter the MCU in standby mode.
-
Call HAL_PWR_EnterShutdownMode() function to enter the MCU in shutdown mode.
-
Call HAL_PWR_SetCoreSleepMode() function to configure the Core in sleep or deep sleep mode.
-
Call HAL_PWR_GetCoreSleepMode() function to get Core sleep mode configuration.
-
Call HAL_PWR_EnableCoreSleepOnExit() function to enable Core to re-entry in sleep mode after an interrupt is over.
-
Call HAL_PWR_DisableCoreSleepOnExit() function to disable Core to re-entry in sleep mode after an interrupt is over.
-
Call HAL_PWR_IsEnabledCoreSleepOnExit() function to check that Core to re-entry in sleep mode is enabled.
-
Call HAL_PWR_EnableCoreSendEventOnPending() function to enable Core to wakeup after any pending event/ interrupt.
-
Call HAL_PWR_DisableCoreSendEventOnPending() function to disable Core to wakeup after any pending event/ interrupt.
-
Call HAL_PWR_IsEnabledCoreSendEventOnPending() function to check that core send event on pending is enabled.
-
Call HAL_PWR_LP_SetSmartRunDomainMode() function to Configure the Smart Run Domain mode.
-
Call HAL_PWR_LP_GetSmartRunDomainMode() function to get the Smart Run Domain mode.
-
Call HAL_PWR_LP_SetBrownoutResetMode() function to configure the brownout reset mode in standby mode.
-
Call HAL_PWR_LP_GetBrownoutResetMode() function to get the brownout reset mode configuration.
-
Call HAL_PWR_Stop3Wakeup_IRQHandler() function to handle the wakeup from Stop 3 interrupt request
-
Call HAL_PWR_Stop3WakeupCallback() function to wakeup from stop 3 interrupt callback.
Functions
-
void
HAL_PWR_ClearCorePendingEvent
(
void
)
-
Clear core pending event.
Note
This API clears the pending event in order to enter a given core to Sleep or Stop mode with WFE entry.
Warning
It must be called just before APIs performing enter Sleep and Stop mode using Wait For Event request
-
void
HAL_PWR_EnterSleepMode
(
hal_pwr_low_pwr_mode_entry_t
sleep_entry
)
-
Enter the core in Sleep mode.
- Parameters :
-
sleep_entry – Parameter to hal_pwr_low_pwr_mode_entry_t enumeration.
-
void
HAL_PWR_EnterStopMode
(
hal_pwr_low_pwr_mode_entry_t
stop_entry
,
hal_pwr_stop_mode_t
stop_mode
)
-
Enter the MCU in Stop mode.
- Parameters :
-
-
stop_entry – This parameter is an element of hal_pwr_low_pwr_mode_entry_t enumeration.
-
stop_mode – This parameter is an element of hal_pwr_stop_mode_t enumeration.
-
-
void
HAL_PWR_EnterStandbyMode
(
void
)
-
Enter the MCU in Standby mode.
-
void
HAL_PWR_EnterShutdownMode
(
void
)
-
Enter the MCU in Shutdown mode.
-
void
HAL_PWR_SetCoreSleepMode
(
hal_pwr_core_sleep_mode_t
sleep_mode
)
-
Set the core sleep mode configuration.
- Parameters :
-
sleep_mode – This parameter is an element of hal_pwr_core_sleep_mode_t enumeration.
-
hal_pwr_core_sleep_mode_t
HAL_PWR_GetCoreSleepMode
(
void
)
-
Get the core sleep mode configuration.
- Return values :
-
hal_pwr_core_sleep_mode_t – The core sleep mode configuration.
-
void
HAL_PWR_EnableCoreSleepOnExit
(
void
)
-
Enable SLEEP-ON-EXIT feature when returning from handler mode to thread mode.
-
void
HAL_PWR_DisableCoreSleepOnExit
(
void
)
-
Disable SLEEP-ON-EXIT feature when returning from handler mode to thread mode.
-
hal_pwr_core_sleep_on_exit_status_t
HAL_PWR_IsEnabledCoreSleepOnExit
(
void
)
-
Check if the Core SLEEP-ON-EXIT is enabled or disabled.
- Return values :
-
hal_pwr_core_sleep_on_exit_status_t – Core sleep on exit status.
-
void
HAL_PWR_EnableCoreSendEventOnPending
(
void
)
-
Enable core Send Event On Pending feature.
-
void
HAL_PWR_DisableCoreSendEventOnPending
(
void
)
-
Disable core Send Event On Pending.
-
hal_pwr_core_sev_on_pending_status_t
HAL_PWR_IsEnabledCoreSendEventOnPending
(
void
)
-
Get core Send Event On Pending.
- Return values :
-
hal_pwr_core_sev_on_pending_status_t – Core send event on pending status.
-
void
HAL_PWR_LP_SetSmartRunDomainMode
(
hal_pwr_system_mode_srd_mode_t
mode
)
-
Set the Smart Run Domain mode when the System in Stop 0/1/2 mode.
- Parameters :
-
mode – This parameter is an element of hal_pwr_system_mode_srd_mode_t enumeration.
-
hal_pwr_system_mode_srd_mode_t
HAL_PWR_LP_GetSmartRunDomainMode
(
void
)
-
Get the Smart Run Domain mode when the System in Stop 0/1/2 mode.
- Return values :
-
hal_pwr_system_mode_srd_mode_t – Smart run domain in Run mod status.
-
void
HAL_PWR_LP_SetBrownoutResetMode
(
hal_pwr_brownout_reset_mode_t
mode
)
-
Set BOR ultra-low power mode.
Note
BOR operating can be in discontinuous (ultra-low power) mode in Stop 1, Stop 2, Stop 3 and Standby modes and when the regulator is in Range 4 (Run, Sleep or Stop 0 mode).
- Parameters :
-
mode – This parameter is an element of hal_pwr_brownout_reset_mode_t enumeration.
-
hal_pwr_brownout_reset_mode_t
HAL_PWR_LP_GetBrownoutResetMode
(
void
)
-
Get BOR ultra-low power mode.
- Return values :
-
hal_pwr_brownout_reset_mode_t – Brownout reset mode status.
-
void
HAL_PWR_Stop3Wakeup_IRQHandler
(
uint32_t
wakeup_pin
)
-
This function handles the PWR wake-up from Stop 3 interrupt request.
- Parameters :
-
wakeup_pin – This parameter can be one or a combination of the following values:
-
HAL_PWR_WAKEUP_PIN_1 : Wakeup pin 1.
-
HAL_PWR_WAKEUP_PIN_2 : Wakeup pin 2.
-
HAL_PWR_WAKEUP_PIN_3 : Wakeup pin 3.
-
HAL_PWR_WAKEUP_PIN_4 : Wakeup pin 4.
-
HAL_PWR_WAKEUP_PIN_5 : Wakeup pin 5.
-
HAL_PWR_WAKEUP_PIN_6 : Wakeup pin 6.
-
HAL_PWR_WAKEUP_PIN_7 : Wakeup pin 7.
-
HAL_PWR_WAKEUP_PIN_8 : Wakeup pin 8
-
HAL_PWR_WAKEUP_PIN_ALL: Wakeup pin all.
-
-
void
HAL_PWR_Stop3WakeupCallback
(
uint32_t
wakeup_pin
)
-
PWR wake-up from Stop 3 interrupt request callback.
- Parameters :
-
wakeup_pin – Specifies the wake-up pin interrupt to be handled. This parameter can be one or a combination of the following values:
-
HAL_PWR_WAKEUP_PIN_1 : Wakeup pin 1.
-
HAL_PWR_WAKEUP_PIN_2 : Wakeup pin 2.
-
HAL_PWR_WAKEUP_PIN_3 : Wakeup pin 3.
-
HAL_PWR_WAKEUP_PIN_4 : Wakeup pin 4.
-
HAL_PWR_WAKEUP_PIN_5 : Wakeup pin 5.
-
HAL_PWR_WAKEUP_PIN_6 : Wakeup pin 6.
-
HAL_PWR_WAKEUP_PIN_7 : Wakeup pin 7.
-
HAL_PWR_WAKEUP_PIN_8 : Wakeup pin 8.
-
HAL_PWR_WAKEUP_PIN_ALL: Wakeup pin all.
-
-
Voltage monitoring management functions ¶
- group PWR_Exported_Functions_Group5
-
This section provides functions allowing to configure voltage monitoring.
-
Call HAL_PWR_SetProgrammableVoltageDetectorLevel() function to configure the programmable voltage detector.
-
Call HAL_PWR_GetProgrammableVoltageDetectorLevel() function to get the programmable voltage detector configuration.
-
Call HAL_PWR_EnableProgrammableVoltageDetector() function to enable the Programmable Voltage Detector.
-
Call HAL_PWR_DisableProgrammableVoltageDetector() function to disable the Programmable Voltage Detector.
-
Call HAL_PWR_IsEnabledProgrammableVoltageDetector() function to check that Programmable Voltage Detector is enabled.
-
Call HAL_PWR_EnableVddUSBMonitor() function to enable the VddUSB voltage monitor.
-
Call HAL_PWR_DisableVddUSBMonitor() function to disable the VddUSB voltage monitor.
-
Call HAL_PWR_IsEnabledVddUSBMonitor() function to check if the VddUSB voltage monitor is enabled.
-
Call HAL_PWR_EnableVddIO2Monitor() function to enable the VddIO2 voltage monitor.
-
Call HAL_PWR_DisableVddIO2Monitor() function to disable the VddIO2 voltage monitor.
-
Call HAL_PWR_IsEnabledVddIO2Monitor() function to check if the VddIO2 voltage monitor is enabled.
-
Call HAL_PWR_EnableVddAMonitor1() function to enable the Vdd Analog voltage monitor 1.
-
Call HAL_PWR_DisableVddAMonitor1() function to disable the Vdd Analog voltage monitor 1.
-
Call HAL_PWR_IsEnabledVddAMonitor1() function to check if the Vdd Analog voltage monitor 1 is enabled.
-
Call HAL_PWR_EnableVddAMonitor2() function to enable the Vdd Analog voltage monitor 2.
-
Call HAL_PWR_DisableVddAMonitor2() function to disable the Vdd Analog voltage monitor 2.
-
Call HAL_PWR_IsEnabledVddAMonitor2() function to check if the Vdd Analog voltage monitor 2 is enabled.
-
Call HAL_PWR_EnableTemperatureVbatMonitor() function to enable temperature and VBAT monitor.
-
Call HAL_PWR_DisableTemperatureVbatMonitor() function to disable temperature and VBAT monitor.
-
Call HAL_PWR_IsEnabledTemperatureVbatMonitor() function to check if the temperature and VBAT monitor is enabled.
Functions
-
void
HAL_PWR_SetProgrammableVoltageDetectorLevel
(
hal_pwr_pvd_level_t
level
)
¶
-
Set the voltage threshold detection by the Programmable Voltage Detector (PVD).
- Parameters :
-
level – This parameter is an element of hal_pwr_pvd_level_t enumeration.
-
hal_pwr_pvd_level_t
HAL_PWR_GetProgrammableVoltageDetectorLevel
(
void
)
¶
-
Get the voltage threshold detection by the Programmable Voltage Detector (PVD).
- Return values :
-
hal_pwr_pvd_level_t – The current PVD level.
-
void
HAL_PWR_EnableProgrammableVoltageDetector
(
void
)
¶
-
Enable the voltage threshold detection by the Programmable Voltage Detector (PVD).
-
void
HAL_PWR_DisableProgrammableVoltageDetector
(
void
)
¶
-
Disable the voltage threshold detection by the Programmable Voltage Detector (PVD).
-
hal_pwr_pvd_status_t
HAL_PWR_IsEnabledProgrammableVoltageDetector
(
void
)
¶
-
Check if the Programmable Voltage Detector (PVD) is enabled.
- Return values :
-
hal_pwr_pvd_status_t – The Programmable Voltage Detector status.
-
void
HAL_PWR_EnableVddUSBMonitor
(
void
)
¶
-
Enable the Vdd USB voltage monitor.
-
void
HAL_PWR_DisableVddUSBMonitor
(
void
)
¶
-
Disable the Vdd USB voltage monitor.
-
hal_pwr_monitor_status_t
HAL_PWR_IsEnabledVddUSBMonitor
(
void
)
¶
-
Check if the Vdd USB voltage monitor is enabled.
- Return values :
-
hal_pwr_monitor_status_t – The Vdd USB voltage monitor status.
-
void
HAL_PWR_EnableVddIO2Monitor
(
void
)
¶
-
Enable the Vdd IO2 voltage monitor.
-
void
HAL_PWR_DisableVddIO2Monitor
(
void
)
¶
-
Disable the Vdd IO2 voltage monitor.
-
hal_pwr_monitor_status_t
HAL_PWR_IsEnabledVddIO2Monitor
(
void
)
¶
-
Check if the Vdd IO2 voltage monitor is enabled.
- Return values :
-
hal_pwr_monitor_status_t – The Vdd IO2 voltage monitor status.
-
void
HAL_PWR_EnableVddAMonitor1
(
void
)
¶
-
Enable the Vdd Analog voltage monitor 1.
-
void
HAL_PWR_DisableVddAMonitor1
(
void
)
¶
-
Disable the Vdd Analog voltage monitor 1.
-
hal_pwr_monitor_status_t
HAL_PWR_IsEnabledVddAMonitor1
(
void
)
¶
-
Check if the Vdd Analog voltage monitor 1 is enabled.
- Return values :
-
hal_pwr_monitor_status_t – The Vdd analog voltage monitor 1 status.
-
void
HAL_PWR_EnableVddAMonitor2
(
void
)
¶
-
Enable the Vdd Analog voltage monitor 2.
-
void
HAL_PWR_DisableVddAMonitor2
(
void
)
¶
-
Disable the Vdd Analog voltage monitor 2.
-
hal_pwr_monitor_status_t
HAL_PWR_IsEnabledVddAMonitor2
(
void
)
¶
-
Check if the Vdd Analog voltage monitor 2 is enabled.
- Return values :
-
hal_pwr_monitor_status_t – The Vdd analog voltage monitor 2 status.
-
void
HAL_PWR_EnableTemperatureVbatMonitor
(
void
)
¶
-
Enable the temperature and VBAT monitor.
-
void
HAL_PWR_DisableTemperatureVbatMonitor
(
void
)
¶
-
Disable the temperature and VBAT monitor.
-
hal_pwr_monitor_status_t
HAL_PWR_IsEnabledTemperatureVbatMonitor
(
void
)
¶
-
Check if the temperature and VBAT monitor is enabled or disabled.
- Return values :
-
hal_pwr_monitor_status_t – The temperature and VBAT monitor status.
-
- group PWR_Exported_Functions_Group5
-
This section provides functions allowing to configure voltage monitoring.
-
Call HAL_PWR_SetProgrammableVoltageDetectorLevel() function to configure the programmable voltage detector.
-
Call HAL_PWR_GetProgrammableVoltageDetectorLevel() function to get the programmable voltage detector configuration.
-
Call HAL_PWR_EnableProgrammableVoltageDetector() function to enable the Programmable Voltage Detector.
-
Call HAL_PWR_DisableProgrammableVoltageDetector() function to disable the Programmable Voltage Detector.
-
Call HAL_PWR_IsEnabledProgrammableVoltageDetector() function to check that Programmable Voltage Detector is enabled.
-
Call HAL_PWR_EnableVddUSBMonitor() function to enable the VddUSB voltage monitor.
-
Call HAL_PWR_DisableVddUSBMonitor() function to disable the VddUSB voltage monitor.
-
Call HAL_PWR_IsEnabledVddUSBMonitor() function to check if the VddUSB voltage monitor is enabled.
-
Call HAL_PWR_EnableVddIO2Monitor() function to enable the VddIO2 voltage monitor.
-
Call HAL_PWR_DisableVddIO2Monitor() function to disable the VddIO2 voltage monitor.
-
Call HAL_PWR_IsEnabledVddIO2Monitor() function to check if the VddIO2 voltage monitor is enabled.
-
Call HAL_PWR_EnableVddAMonitor1() function to enable the Vdd Analog voltage monitor 1.
-
Call HAL_PWR_DisableVddAMonitor1() function to disable the Vdd Analog voltage monitor 1.
-
Call HAL_PWR_IsEnabledVddAMonitor1() function to check if the Vdd Analog voltage monitor 1 is enabled.
-
Call HAL_PWR_EnableVddAMonitor2() function to enable the Vdd Analog voltage monitor 2.
-
Call HAL_PWR_DisableVddAMonitor2() function to disable the Vdd Analog voltage monitor 2.
-
Call HAL_PWR_IsEnabledVddAMonitor2() function to check if the Vdd Analog voltage monitor 2 is enabled.
-
Call HAL_PWR_EnableTemperatureVbatMonitor() function to enable temperature and VBAT monitor.
-
Call HAL_PWR_DisableTemperatureVbatMonitor() function to disable temperature and VBAT monitor.
-
Call HAL_PWR_IsEnabledTemperatureVbatMonitor() function to check if the temperature and VBAT monitor is enabled.
Functions
-
void
HAL_PWR_SetProgrammableVoltageDetectorLevel
(
hal_pwr_pvd_level_t
level
)
-
Set the voltage threshold detection by the Programmable Voltage Detector (PVD).
- Parameters :
-
level – This parameter is an element of hal_pwr_pvd_level_t enumeration.
-
hal_pwr_pvd_level_t
HAL_PWR_GetProgrammableVoltageDetectorLevel
(
void
)
-
Get the voltage threshold detection by the Programmable Voltage Detector (PVD).
- Return values :
-
hal_pwr_pvd_level_t – The current PVD level.
-
void
HAL_PWR_EnableProgrammableVoltageDetector
(
void
)
-
Enable the voltage threshold detection by the Programmable Voltage Detector (PVD).
-
void
HAL_PWR_DisableProgrammableVoltageDetector
(
void
)
-
Disable the voltage threshold detection by the Programmable Voltage Detector (PVD).
-
hal_pwr_pvd_status_t
HAL_PWR_IsEnabledProgrammableVoltageDetector
(
void
)
-
Check if the Programmable Voltage Detector (PVD) is enabled.
- Return values :
-
hal_pwr_pvd_status_t – The Programmable Voltage Detector status.
-
void
HAL_PWR_EnableVddUSBMonitor
(
void
)
-
Enable the Vdd USB voltage monitor.
-
void
HAL_PWR_DisableVddUSBMonitor
(
void
)
-
Disable the Vdd USB voltage monitor.
-
hal_pwr_monitor_status_t
HAL_PWR_IsEnabledVddUSBMonitor
(
void
)
-
Check if the Vdd USB voltage monitor is enabled.
- Return values :
-
hal_pwr_monitor_status_t – The Vdd USB voltage monitor status.
-
void
HAL_PWR_EnableVddIO2Monitor
(
void
)
-
Enable the Vdd IO2 voltage monitor.
-
void
HAL_PWR_DisableVddIO2Monitor
(
void
)
-
Disable the Vdd IO2 voltage monitor.
-
hal_pwr_monitor_status_t
HAL_PWR_IsEnabledVddIO2Monitor
(
void
)
-
Check if the Vdd IO2 voltage monitor is enabled.
- Return values :
-
hal_pwr_monitor_status_t – The Vdd IO2 voltage monitor status.
-
void
HAL_PWR_EnableVddAMonitor1
(
void
)
-
Enable the Vdd Analog voltage monitor 1.
-
void
HAL_PWR_DisableVddAMonitor1
(
void
)
-
Disable the Vdd Analog voltage monitor 1.
-
hal_pwr_monitor_status_t
HAL_PWR_IsEnabledVddAMonitor1
(
void
)
-
Check if the Vdd Analog voltage monitor 1 is enabled.
- Return values :
-
hal_pwr_monitor_status_t – The Vdd analog voltage monitor 1 status.
-
void
HAL_PWR_EnableVddAMonitor2
(
void
)
-
Enable the Vdd Analog voltage monitor 2.
-
void
HAL_PWR_DisableVddAMonitor2
(
void
)
-
Disable the Vdd Analog voltage monitor 2.
-
hal_pwr_monitor_status_t
HAL_PWR_IsEnabledVddAMonitor2
(
void
)
-
Check if the Vdd Analog voltage monitor 2 is enabled.
- Return values :
-
hal_pwr_monitor_status_t – The Vdd analog voltage monitor 2 status.
-
void
HAL_PWR_EnableTemperatureVbatMonitor
(
void
)
-
Enable the temperature and VBAT monitor.
-
void
HAL_PWR_DisableTemperatureVbatMonitor
(
void
)
-
Disable the temperature and VBAT monitor.
-
hal_pwr_monitor_status_t
HAL_PWR_IsEnabledTemperatureVbatMonitor
(
void
)
-
Check if the temperature and VBAT monitor is enabled or disabled.
- Return values :
-
hal_pwr_monitor_status_t – The temperature and VBAT monitor status.
-
- group PWR_Exported_Functions_Group5
-
This section provides functions allowing to configure voltage monitoring.
-
Call HAL_PWR_SetProgrammableVoltageDetectorLevel() function to configure the programmable voltage detector.
-
Call HAL_PWR_GetProgrammableVoltageDetectorLevel() function to get the programmable voltage detector configuration.
-
Call HAL_PWR_EnableProgrammableVoltageDetector() function to enable the Programmable Voltage Detector.
-
Call HAL_PWR_DisableProgrammableVoltageDetector() function to disable the Programmable Voltage Detector.
-
Call HAL_PWR_IsEnabledProgrammableVoltageDetector() function to check that Programmable Voltage Detector is enabled.
-
Call HAL_PWR_EnableVddUSBMonitor() function to enable the VddUSB voltage monitor.
-
Call HAL_PWR_DisableVddUSBMonitor() function to disable the VddUSB voltage monitor.
-
Call HAL_PWR_IsEnabledVddUSBMonitor() function to check if the VddUSB voltage monitor is enabled.
-
Call HAL_PWR_EnableVddIO2Monitor() function to enable the VddIO2 voltage monitor.
-
Call HAL_PWR_DisableVddIO2Monitor() function to disable the VddIO2 voltage monitor.
-
Call HAL_PWR_IsEnabledVddIO2Monitor() function to check if the VddIO2 voltage monitor is enabled.
-
Call HAL_PWR_EnableVddAMonitor1() function to enable the Vdd Analog voltage monitor 1.
-
Call HAL_PWR_DisableVddAMonitor1() function to disable the Vdd Analog voltage monitor 1.
-
Call HAL_PWR_IsEnabledVddAMonitor1() function to check if the Vdd Analog voltage monitor 1 is enabled.
-
Call HAL_PWR_EnableVddAMonitor2() function to enable the Vdd Analog voltage monitor 2.
-
Call HAL_PWR_DisableVddAMonitor2() function to disable the Vdd Analog voltage monitor 2.
-
Call HAL_PWR_IsEnabledVddAMonitor2() function to check if the Vdd Analog voltage monitor 2 is enabled.
-
Call HAL_PWR_EnableTemperatureVbatMonitor() function to enable temperature and VBAT monitor.
-
Call HAL_PWR_DisableTemperatureVbatMonitor() function to disable temperature and VBAT monitor.
-
Call HAL_PWR_IsEnabledTemperatureVbatMonitor() function to check if the temperature and VBAT monitor is enabled.
Functions
-
void
HAL_PWR_SetProgrammableVoltageDetectorLevel
(
hal_pwr_pvd_level_t
level
)
-
Set the voltage threshold detection by the Programmable Voltage Detector (PVD).
- Parameters :
-
level – This parameter is an element of hal_pwr_pvd_level_t enumeration.
-
hal_pwr_pvd_level_t
HAL_PWR_GetProgrammableVoltageDetectorLevel
(
void
)
-
Get the voltage threshold detection by the Programmable Voltage Detector (PVD).
- Return values :
-
hal_pwr_pvd_level_t – The current PVD level.
-
void
HAL_PWR_EnableProgrammableVoltageDetector
(
void
)
-
Enable the voltage threshold detection by the Programmable Voltage Detector (PVD).
-
void
HAL_PWR_DisableProgrammableVoltageDetector
(
void
)
-
Disable the voltage threshold detection by the Programmable Voltage Detector (PVD).
-
hal_pwr_pvd_status_t
HAL_PWR_IsEnabledProgrammableVoltageDetector
(
void
)
-
Check if the Programmable Voltage Detector (PVD) is enabled.
- Return values :
-
hal_pwr_pvd_status_t – The Programmable Voltage Detector status.
-
void
HAL_PWR_EnableVddUSBMonitor
(
void
)
-
Enable the Vdd USB voltage monitor.
-
void
HAL_PWR_DisableVddUSBMonitor
(
void
)
-
Disable the Vdd USB voltage monitor.
-
hal_pwr_monitor_status_t
HAL_PWR_IsEnabledVddUSBMonitor
(
void
)
-
Check if the Vdd USB voltage monitor is enabled.
- Return values :
-
hal_pwr_monitor_status_t – The Vdd USB voltage monitor status.
-
void
HAL_PWR_EnableVddIO2Monitor
(
void
)
-
Enable the Vdd IO2 voltage monitor.
-
void
HAL_PWR_DisableVddIO2Monitor
(
void
)
-
Disable the Vdd IO2 voltage monitor.
-
hal_pwr_monitor_status_t
HAL_PWR_IsEnabledVddIO2Monitor
(
void
)
-
Check if the Vdd IO2 voltage monitor is enabled.
- Return values :
-
hal_pwr_monitor_status_t – The Vdd IO2 voltage monitor status.
-
void
HAL_PWR_EnableVddAMonitor1
(
void
)
-
Enable the Vdd Analog voltage monitor 1.
-
void
HAL_PWR_DisableVddAMonitor1
(
void
)
-
Disable the Vdd Analog voltage monitor 1.
-
hal_pwr_monitor_status_t
HAL_PWR_IsEnabledVddAMonitor1
(
void
)
-
Check if the Vdd Analog voltage monitor 1 is enabled.
- Return values :
-
hal_pwr_monitor_status_t – The Vdd analog voltage monitor 1 status.
-
void
HAL_PWR_EnableVddAMonitor2
(
void
)
-
Enable the Vdd Analog voltage monitor 2.
-
void
HAL_PWR_DisableVddAMonitor2
(
void
)
-
Disable the Vdd Analog voltage monitor 2.
-
hal_pwr_monitor_status_t
HAL_PWR_IsEnabledVddAMonitor2
(
void
)
-
Check if the Vdd Analog voltage monitor 2 is enabled.
- Return values :
-
hal_pwr_monitor_status_t – The Vdd analog voltage monitor 2 status.
-
void
HAL_PWR_EnableTemperatureVbatMonitor
(
void
)
-
Enable the temperature and VBAT monitor.
-
void
HAL_PWR_DisableTemperatureVbatMonitor
(
void
)
-
Disable the temperature and VBAT monitor.
-
hal_pwr_monitor_status_t
HAL_PWR_IsEnabledTemperatureVbatMonitor
(
void
)
-
Check if the temperature and VBAT monitor is enabled or disabled.
- Return values :
-
hal_pwr_monitor_status_t – The temperature and VBAT monitor status.
-
Memory retention management functions ¶
- group PWR_Exported_Functions_Group6
-
This section provides functions allowing to manage memory content retention.
-
Call HAL_PWR_LP_EnableMemoryRetention() function to enable memory Retention.
-
Call HAL_PWR_LP_DisableMemoryRetention() function to disable memory Retention.
-
Call HAL_PWR_LP_IsEnabledMemoryRetention() function to check if memory Retention is enabled.
-
Call HAL_PWR_LP_EnableMemoryPageRetention() function to enable pages memory Retention.
-
Call HAL_PWR_LP_DisableMemoryPageRetention() function to disable pages memory Retention.
-
Call HAL_PWR_LP_IsEnabledMemoryPageRetention() function to check if memory page Retention is enabled
-
Call HAL_PWR_LP_EnableUCPDRetention() function to enable the UCPD configuration memorization in Stop 3 and Standby mode.
-
Call HAL_PWR_LP_DisableUCPDRetention() function to disable the UCPD configuration memorization in Stop 3 and Standby mode.
-
Call HAL_PWR_LP_IsEnabledUCPDRetention() function to check if the UCPD configuration memorization in Stop 3 and Standby mode is enabled.
-
Call HAL_PWR_LP_EnableOTGHSPHYRetention() function to enable OTG HS PHY power during LP modes (Stop2/3 and Standby)
-
Call HAL_PWR_LP_DisableOTGHSPHYRetention() function to disable OTG HS PHY power during LP modes (Stop2/3 and Standby)
-
Call HAL_PWR_LP_IsEnabledOTGHSPHYRetention() function to check if the UOTG HS PHY power during LP modes is enabled.
Functions
-
hal_status_t
HAL_PWR_LP_EnableMemoryRetention
(
hal_pwr_memory_retention_t
memory
)
¶
-
Enable memory retention.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
- Return values :
-
HAL_OK – The memory retention is successfully enabled.
-
void
HAL_PWR_LP_DisableMemoryRetention
(
hal_pwr_memory_retention_t
memory
)
¶
-
Disable memory retention.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
-
hal_pwr_memory_retention_status_t
HAL_PWR_LP_IsEnabledMemoryRetention
(
hal_pwr_memory_retention_t
memory
)
¶
-
Check if the memory retention is enabled.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
- Return values :
-
hal_pwr_memory_retention_status_t – The memory retention status.
-
void
HAL_PWR_LP_EnableMemoryPageRetention
(
hal_pwr_memory_retention_t
memory
,
uint32_t
page_idx
,
uint32_t
page_nbr
)
¶
-
Enable memory pages retention.
- Parameters :
-
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
-
page_idx – The starting page of memory.
-
page_nbr – The memory pages number.
-
-
void
HAL_PWR_LP_DisableMemoryPageRetention
(
hal_pwr_memory_retention_t
memory
,
uint32_t
page_idx
,
uint32_t
page_nbr
)
¶
-
Disable memory pages retention.
- Parameters :
-
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
-
page_idx – The starting page of memory.
-
page_nbr – The memory pages number.
-
-
hal_pwr_memory_page_retention_status_t
HAL_PWR_LP_IsEnabledMemoryPageRetention
(
hal_pwr_memory_retention_t
memory
,
uint32_t
page_idx
)
¶
-
Check if the memory page retention is enabled.
- Parameters :
-
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
-
page_idx – The index of memory page.
-
- Return values :
-
hal_pwr_memory_page_retention_status_t – The memory page retention status.
-
void
HAL_PWR_LP_EnableUCPDRetention
(
void
)
¶
-
Enable the UCPD configuration memorization in Stop 3 and Standby mode.
Note
This function must be called just before entering Stop 3 or Standby mode.
-
void
HAL_PWR_LP_DisableUCPDRetention
(
void
)
¶
-
Disable UCPD configuration memorization in Stop 3 and Standby mode.
Note
This function must be called on exiting the Stop 3 or Standby mode and before any UCPD configuration update.
-
hal_pwr_ucpd_retention_status_t
HAL_PWR_LP_IsEnabledUCPDRetention
(
void
)
¶
-
Check if the UCPD is enabled.
- Return values :
-
hal_pwr_ucpd_retention_status_t – The UCPD retention status.
-
void
HAL_PWR_LP_EnableOTGHSPHYRetention
(
void
)
¶
-
Enable OTG HS PHY power during low power modes (Stop2, Stop3 and Standby).
-
void
HAL_PWR_LP_DisableOTGHSPHYRetention
(
void
)
¶
-
Disable OTG HS PHY power during low power modes (Stop2, Stop3 and Standby).
-
hal_pwr_otghsphy_retention_status_t
HAL_PWR_LP_IsEnabledOTGHSPHYRetention
(
void
)
¶
-
Check if the OTG HS PHY power during low power modes (Stop2, Stop 3 and Standby) is enabled.
- Return values :
-
hal_pwr_otghsphy_retention_status_t – The OTG HS PHY status.
-
- group PWR_Exported_Functions_Group6
-
This section provides functions allowing to manage memory content retention.
-
Call HAL_PWR_LP_EnableMemoryRetention() function to enable memory Retention.
-
Call HAL_PWR_LP_DisableMemoryRetention() function to disable memory Retention.
-
Call HAL_PWR_LP_IsEnabledMemoryRetention() function to check if memory Retention is enabled.
-
Call HAL_PWR_LP_EnableMemoryPageRetention() function to enable pages memory Retention.
-
Call HAL_PWR_LP_DisableMemoryPageRetention() function to disable pages memory Retention.
-
Call HAL_PWR_LP_IsEnabledMemoryPageRetention() function to check if memory page Retention is enabled
-
Call HAL_PWR_LP_EnableUCPDRetention() function to enable the UCPD configuration memorization in Stop 3 and Standby mode.
-
Call HAL_PWR_LP_DisableUCPDRetention() function to disable the UCPD configuration memorization in Stop 3 and Standby mode.
-
Call HAL_PWR_LP_IsEnabledUCPDRetention() function to check if the UCPD configuration memorization in Stop 3 and Standby mode is enabled.
-
Call HAL_PWR_LP_EnableOTGHSPHYRetention() function to enable OTG HS PHY power during LP modes (Stop2/3 and Standby)
-
Call HAL_PWR_LP_DisableOTGHSPHYRetention() function to disable OTG HS PHY power during LP modes (Stop2/3 and Standby)
-
Call HAL_PWR_LP_IsEnabledOTGHSPHYRetention() function to check if the UOTG HS PHY power during LP modes is enabled.
Functions
-
hal_status_t
HAL_PWR_LP_EnableMemoryRetention
(
hal_pwr_memory_retention_t
memory
)
-
Enable memory retention.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
- Return values :
-
HAL_OK – The memory retention is successfully enabled.
-
void
HAL_PWR_LP_DisableMemoryRetention
(
hal_pwr_memory_retention_t
memory
)
-
Disable memory retention.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
-
hal_pwr_memory_retention_status_t
HAL_PWR_LP_IsEnabledMemoryRetention
(
hal_pwr_memory_retention_t
memory
)
-
Check if the memory retention is enabled.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
- Return values :
-
hal_pwr_memory_retention_status_t – The memory retention status.
-
void
HAL_PWR_LP_EnableMemoryPageRetention
(
hal_pwr_memory_retention_t
memory
,
uint32_t
page_idx
,
uint32_t
page_nbr
)
-
Enable memory pages retention.
- Parameters :
-
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
-
page_idx – The starting page of memory.
-
page_nbr – The memory pages number.
-
-
void
HAL_PWR_LP_DisableMemoryPageRetention
(
hal_pwr_memory_retention_t
memory
,
uint32_t
page_idx
,
uint32_t
page_nbr
)
-
Disable memory pages retention.
- Parameters :
-
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
-
page_idx – The starting page of memory.
-
page_nbr – The memory pages number.
-
-
hal_pwr_memory_page_retention_status_t
HAL_PWR_LP_IsEnabledMemoryPageRetention
(
hal_pwr_memory_retention_t
memory
,
uint32_t
page_idx
)
-
Check if the memory page retention is enabled.
- Parameters :
-
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
-
page_idx – The index of memory page.
-
- Return values :
-
hal_pwr_memory_page_retention_status_t – The memory page retention status.
-
void
HAL_PWR_LP_EnableUCPDRetention
(
void
)
-
Enable the UCPD configuration memorization in Stop 3 and Standby mode.
Note
This function must be called just before entering Stop 3 or Standby mode.
-
void
HAL_PWR_LP_DisableUCPDRetention
(
void
)
-
Disable UCPD configuration memorization in Stop 3 and Standby mode.
Note
This function must be called on exiting the Stop 3 or Standby mode and before any UCPD configuration update.
-
hal_pwr_ucpd_retention_status_t
HAL_PWR_LP_IsEnabledUCPDRetention
(
void
)
-
Check if the UCPD is enabled.
- Return values :
-
hal_pwr_ucpd_retention_status_t – The UCPD retention status.
-
void
HAL_PWR_LP_EnableOTGHSPHYRetention
(
void
)
-
Enable OTG HS PHY power during low power modes (Stop2, Stop3 and Standby).
-
void
HAL_PWR_LP_DisableOTGHSPHYRetention
(
void
)
-
Disable OTG HS PHY power during low power modes (Stop2, Stop3 and Standby).
-
hal_pwr_otghsphy_retention_status_t
HAL_PWR_LP_IsEnabledOTGHSPHYRetention
(
void
)
-
Check if the OTG HS PHY power during low power modes (Stop2, Stop 3 and Standby) is enabled.
- Return values :
-
hal_pwr_otghsphy_retention_status_t – The OTG HS PHY status.
-
- group PWR_Exported_Functions_Group6
-
This section provides functions allowing to manage memory content retention.
-
Call HAL_PWR_LP_EnableMemoryRetention() function to enable memory Retention.
-
Call HAL_PWR_LP_DisableMemoryRetention() function to disable memory Retention.
-
Call HAL_PWR_LP_IsEnabledMemoryRetention() function to check if memory Retention is enabled.
-
Call HAL_PWR_LP_EnableMemoryPageRetention() function to enable pages memory Retention.
-
Call HAL_PWR_LP_DisableMemoryPageRetention() function to disable pages memory Retention.
-
Call HAL_PWR_LP_IsEnabledMemoryPageRetention() function to check if memory page Retention is enabled
-
Call HAL_PWR_LP_EnableUCPDRetention() function to enable the UCPD configuration memorization in Stop 3 and Standby mode.
-
Call HAL_PWR_LP_DisableUCPDRetention() function to disable the UCPD configuration memorization in Stop 3 and Standby mode.
-
Call HAL_PWR_LP_IsEnabledUCPDRetention() function to check if the UCPD configuration memorization in Stop 3 and Standby mode is enabled.
-
Call HAL_PWR_LP_EnableOTGHSPHYRetention() function to enable OTG HS PHY power during LP modes (Stop2/3 and Standby)
-
Call HAL_PWR_LP_DisableOTGHSPHYRetention() function to disable OTG HS PHY power during LP modes (Stop2/3 and Standby)
-
Call HAL_PWR_LP_IsEnabledOTGHSPHYRetention() function to check if the UOTG HS PHY power during LP modes is enabled.
Functions
-
hal_status_t
HAL_PWR_LP_EnableMemoryRetention
(
hal_pwr_memory_retention_t
memory
)
-
Enable memory retention.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
- Return values :
-
HAL_OK – The memory retention is successfully enabled.
-
void
HAL_PWR_LP_DisableMemoryRetention
(
hal_pwr_memory_retention_t
memory
)
-
Disable memory retention.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
-
hal_pwr_memory_retention_status_t
HAL_PWR_LP_IsEnabledMemoryRetention
(
hal_pwr_memory_retention_t
memory
)
-
Check if the memory retention is enabled.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
- Return values :
-
hal_pwr_memory_retention_status_t – The memory retention status.
-
void
HAL_PWR_LP_EnableMemoryPageRetention
(
hal_pwr_memory_retention_t
memory
,
uint32_t
page_idx
,
uint32_t
page_nbr
)
-
Enable memory pages retention.
- Parameters :
-
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
-
page_idx – The starting page of memory.
-
page_nbr – The memory pages number.
-
-
void
HAL_PWR_LP_DisableMemoryPageRetention
(
hal_pwr_memory_retention_t
memory
,
uint32_t
page_idx
,
uint32_t
page_nbr
)
-
Disable memory pages retention.
- Parameters :
-
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
-
page_idx – The starting page of memory.
-
page_nbr – The memory pages number.
-
-
hal_pwr_memory_page_retention_status_t
HAL_PWR_LP_IsEnabledMemoryPageRetention
(
hal_pwr_memory_retention_t
memory
,
uint32_t
page_idx
)
-
Check if the memory page retention is enabled.
- Parameters :
-
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
-
page_idx – The index of memory page.
-
- Return values :
-
hal_pwr_memory_page_retention_status_t – The memory page retention status.
-
Memories fast wake-up management functions ¶
- group PWR_Exported_Functions_Group7
-
This section provides functions allowing to manage memories fast wake-up.
-
Call HAL_PWR_LP_EnableMemoryFastWakeup() function to enable the memories fast wakeup from stop x mode.
-
Call HAL_PWR_LP_DisableMemoryFastWakeup() function to disable the memories fast wakeup from stop x mode.
-
Call HAL_PWR_LP_IsEnabledMemoryFastWakeup() function to check if the memories fast wakeup from stop x mode is enabled.
Functions
-
void
HAL_PWR_LP_EnableMemoryFastWakeup
(
uint32_t
memories
)
¶
-
Enable the memories fast wakeup from stop mode.
- Parameters :
-
memories – Specifies the memories to be selected. This parameter can be one or a combination of the following values:
-
HAL_PWR_FLASH_STOP01_FAST_WAKEUP : Flash fast wake-up.
-
HAL_PWR_SRAM4_STOP012_FAST_WAKEUP : SRAM4 fast wake-up.
-
HAL_PWR_MEMORIES_FAST_WAKEUP_ALL : All memories fast wake-up.
-
-
void
HAL_PWR_LP_DisableMemoryFastWakeup
(
uint32_t
memories
)
¶
-
Disable the memories fast wakeup from stop mode.
- Parameters :
-
memories – Specifies the memories to be selected. This parameter can be one or a combination of the following values:
-
HAL_PWR_FLASH_STOP01_FAST_WAKEUP : Flash fast wake-up.
-
HAL_PWR_SRAM4_STOP012_FAST_WAKEUP : SRAM4 fast wake-up.
-
HAL_PWR_MEMORIES_FAST_WAKEUP_ALL : All memories fast wake-up.
-
-
hal_pwr_memory_fast_wakeup_status_t
HAL_PWR_LP_IsEnabledMemoryFastWakeup
(
uint32_t
memory
)
¶
-
Check the flash and SRAM4 memories fast wakeup from Stop mode is enabled.
- Parameters :
-
memory – This parameter can be one of the following values:
- Return values :
-
hal_pwr_memory_fast_wakeup_status_t – The memory fast wakeup status.
-
- group PWR_Exported_Functions_Group7
-
This section provides functions allowing to manage memories fast wake-up.
-
Call HAL_PWR_LP_EnableMemoryFastWakeup() function to enable the memories fast wakeup from stop x mode.
-
Call HAL_PWR_LP_DisableMemoryFastWakeup() function to disable the memories fast wakeup from stop x mode.
-
Call HAL_PWR_LP_IsEnabledMemoryFastWakeup() function to check if the memories fast wakeup from stop x mode is enabled.
Functions
-
void
HAL_PWR_LP_EnableMemoryFastWakeup
(
uint32_t
memories
)
-
Enable the memories fast wakeup from stop mode.
- Parameters :
-
memories – Specifies the memories to be selected. This parameter can be one or a combination of the following values:
-
HAL_PWR_FLASH_STOP01_FAST_WAKEUP : Flash fast wake-up.
-
HAL_PWR_SRAM4_STOP012_FAST_WAKEUP : SRAM4 fast wake-up.
-
HAL_PWR_MEMORIES_FAST_WAKEUP_ALL : All memories fast wake-up.
-
-
void
HAL_PWR_LP_DisableMemoryFastWakeup
(
uint32_t
memories
)
-
Disable the memories fast wakeup from stop mode.
- Parameters :
-
memories – Specifies the memories to be selected. This parameter can be one or a combination of the following values:
-
HAL_PWR_FLASH_STOP01_FAST_WAKEUP : Flash fast wake-up.
-
HAL_PWR_SRAM4_STOP012_FAST_WAKEUP : SRAM4 fast wake-up.
-
HAL_PWR_MEMORIES_FAST_WAKEUP_ALL : All memories fast wake-up.
-
-
hal_pwr_memory_fast_wakeup_status_t
HAL_PWR_LP_IsEnabledMemoryFastWakeup
(
uint32_t
memory
)
-
Check the flash and SRAM4 memories fast wakeup from Stop mode is enabled.
- Parameters :
-
memory – This parameter can be one of the following values:
- Return values :
-
hal_pwr_memory_fast_wakeup_status_t – The memory fast wakeup status.
-
- group PWR_Exported_Functions_Group7
-
This section provides functions allowing to manage memories fast wake-up.
-
Call HAL_PWR_LP_EnableMemoryFastWakeup() function to enable the memories fast wakeup from stop x mode.
-
Call HAL_PWR_LP_DisableMemoryFastWakeup() function to disable the memories fast wakeup from stop x mode.
-
Call HAL_PWR_LP_IsEnabledMemoryFastWakeup() function to check if the memories fast wakeup from stop x mode is enabled.
Functions
-
void
HAL_PWR_LP_EnableMemoryFastWakeup
(
uint32_t
memories
)
-
Enable the memories fast wakeup from stop mode.
- Parameters :
-
memories – Specifies the memories to be selected. This parameter can be one or a combination of the following values:
-
HAL_PWR_FLASH_STOP01_FAST_WAKEUP : Flash fast wake-up.
-
HAL_PWR_SRAM4_STOP012_FAST_WAKEUP : SRAM4 fast wake-up.
-
HAL_PWR_MEMORIES_FAST_WAKEUP_ALL : All memories fast wake-up.
-
-
void
HAL_PWR_LP_DisableMemoryFastWakeup
(
uint32_t
memories
)
-
Disable the memories fast wakeup from stop mode.
- Parameters :
-
memories – Specifies the memories to be selected. This parameter can be one or a combination of the following values:
-
HAL_PWR_FLASH_STOP01_FAST_WAKEUP : Flash fast wake-up.
-
HAL_PWR_SRAM4_STOP012_FAST_WAKEUP : SRAM4 fast wake-up.
-
HAL_PWR_MEMORIES_FAST_WAKEUP_ALL : All memories fast wake-up.
-
-
hal_pwr_memory_fast_wakeup_status_t
HAL_PWR_LP_IsEnabledMemoryFastWakeup
(
uint32_t
memory
)
-
Check the flash and SRAM4 memories fast wakeup from Stop mode is enabled.
- Parameters :
-
memory – This parameter can be one of the following values:
- Return values :
-
hal_pwr_memory_fast_wakeup_status_t – The memory fast wakeup status.
-
Battery management functions ¶
- group PWR_Exported_Functions_Group8
-
This section provides functions allowing to manage battery charging.
-
Call HAL_PWR_SetConfigBatteryCharging() function to configure the battery charging resistor.
-
Call HAL_PWR_GetConfigBatteryCharging() function to get the battery charging resistor configuration.
-
Call HAL_PWR_EnableBatteryCharging() function to enable the battery charging.
-
Call HAL_PWR_DisableBatteryCharging() function to disable the battery charging.
-
Call HAL_PWR_IsEnabledBatteryCharging() function to check if the battery charging is enabled.
-
Call HAL_PWR_LP_EnableUCPDDeadBattery() function to enable the UCPD dead battery behavior.
-
Call HAL_PWR_LP_DisableUCPDDeadBattery() function to disable the UCPD dead battery behavior.
-
Call HAL_PWR_LP_IsEnabledUCPDDeadBattery() function to check that UCPD dead battery behavior is enabled or disabled.
Functions
-
void
HAL_PWR_SetConfigBatteryCharging
(
hal_pwr_battery_charging_res_value_t
value
)
¶
-
Set the Battery charging resistor.
Note
When Vdd is present, charge the external battery through an internal resistor.
- Parameters :
-
value – Specifies the charging resistor. This parameter can be one of the following values:
-
HAL_PWR_BATTERY_CHARGING_RES_5K : 5 KOhm resistor.
-
HAL_PWR_BATTERY_CHARGING_RES_1_5K : 1.5 KOhm resistor.
-
-
hal_pwr_battery_charging_res_value_t
HAL_PWR_GetConfigBatteryCharging
(
void
)
¶
-
Get the Battery charging resistor.
Note
When Vdd is present, charge the external battery through an internal resistor.
- Return values :
-
hal_pwr_battery_charging_res_value_t – The battery charging resistor value.
-
void
HAL_PWR_EnableBatteryCharging
(
void
)
¶
-
Enable the Battery charging.
-
void
HAL_PWR_DisableBatteryCharging
(
void
)
¶
-
Disable the Battery charging.
-
hal_pwr_battery_charging_status_t
HAL_PWR_IsEnabledBatteryCharging
(
void
)
¶
-
Check that battery charging is enabled.
- Return values :
-
hal_pwr_battery_charging_status_t – The battery charging status.
-
void
HAL_PWR_LP_EnableUCPDDeadBattery
(
void
)
¶
-
Enable dead battery behavior.
Note
After exiting reset, the USB Type-C (dead battery) behavior is enabled, which might have a pull-down effect on CC1 and CC2 pins. It is recommended to disable it in all cases, either to stop this pull-down or to handover control to the UCPD (the UCPD must be initialized before doing the disable).
-
void
HAL_PWR_LP_DisableUCPDDeadBattery
(
void
)
¶
-
Disable dead battery behavior.
Note
After exiting reset, the USB Type-C (dead battery) behavior is enabled, which might have a pull-down effect on CC1 and CC2 pins. It is recommended to disable it in all cases, either to stop this pull-down or to handover control to the UCPD (the UCPD must be initialized before doing the disable).
-
hal_pwr_ucpd_dead_battery_status_t
HAL_PWR_LP_IsEnabledUCPDDeadBattery
(
void
)
¶
-
Check that UCPD dead battery battery is enabled.
- Return values :
-
hal_pwr_ucpd_dead_battery_status_t – The UCPD dead battery status.
-
- group PWR_Exported_Functions_Group8
-
This section provides functions allowing to manage battery charging.
-
Call HAL_PWR_SetConfigBatteryCharging() function to configure the battery charging resistor.
-
Call HAL_PWR_GetConfigBatteryCharging() function to get the battery charging resistor configuration.
-
Call HAL_PWR_EnableBatteryCharging() function to enable the battery charging.
-
Call HAL_PWR_DisableBatteryCharging() function to disable the battery charging.
-
Call HAL_PWR_IsEnabledBatteryCharging() function to check if the battery charging is enabled.
-
Call HAL_PWR_LP_EnableUCPDDeadBattery() function to enable the UCPD dead battery behavior.
-
Call HAL_PWR_LP_DisableUCPDDeadBattery() function to disable the UCPD dead battery behavior.
-
Call HAL_PWR_LP_IsEnabledUCPDDeadBattery() function to check that UCPD dead battery behavior is enabled or disabled.
Functions
-
void
HAL_PWR_SetConfigBatteryCharging
(
hal_pwr_battery_charging_res_value_t
value
)
-
Set the Battery charging resistor.
Note
When Vdd is present, charge the external battery through an internal resistor.
- Parameters :
-
value – Specifies the charging resistor. This parameter can be one of the following values:
-
HAL_PWR_BATTERY_CHARGING_RES_5K : 5 KOhm resistor.
-
HAL_PWR_BATTERY_CHARGING_RES_1_5K : 1.5 KOhm resistor.
-
-
hal_pwr_battery_charging_res_value_t
HAL_PWR_GetConfigBatteryCharging
(
void
)
-
Get the Battery charging resistor.
Note
When Vdd is present, charge the external battery through an internal resistor.
- Return values :
-
hal_pwr_battery_charging_res_value_t – The battery charging resistor value.
-
void
HAL_PWR_EnableBatteryCharging
(
void
)
-
Enable the Battery charging.
-
void
HAL_PWR_DisableBatteryCharging
(
void
)
-
Disable the Battery charging.
-
hal_pwr_battery_charging_status_t
HAL_PWR_IsEnabledBatteryCharging
(
void
)
-
Check that battery charging is enabled.
- Return values :
-
hal_pwr_battery_charging_status_t – The battery charging status.
-
void
HAL_PWR_LP_EnableUCPDDeadBattery
(
void
)
-
Enable dead battery behavior.
Note
After exiting reset, the USB Type-C (dead battery) behavior is enabled, which might have a pull-down effect on CC1 and CC2 pins. It is recommended to disable it in all cases, either to stop this pull-down or to handover control to the UCPD (the UCPD must be initialized before doing the disable).
-
void
HAL_PWR_LP_DisableUCPDDeadBattery
(
void
)
-
Disable dead battery behavior.
Note
After exiting reset, the USB Type-C (dead battery) behavior is enabled, which might have a pull-down effect on CC1 and CC2 pins. It is recommended to disable it in all cases, either to stop this pull-down or to handover control to the UCPD (the UCPD must be initialized before doing the disable).
-
hal_pwr_ucpd_dead_battery_status_t
HAL_PWR_LP_IsEnabledUCPDDeadBattery
(
void
)
-
Check that UCPD dead battery battery is enabled.
- Return values :
-
hal_pwr_ucpd_dead_battery_status_t – The UCPD dead battery status.
-
- group PWR_Exported_Functions_Group8
-
This section provides functions allowing to manage battery charging.
-
Call HAL_PWR_SetConfigBatteryCharging() function to configure the battery charging resistor.
-
Call HAL_PWR_GetConfigBatteryCharging() function to get the battery charging resistor configuration.
-
Call HAL_PWR_EnableBatteryCharging() function to enable the battery charging.
-
Call HAL_PWR_DisableBatteryCharging() function to disable the battery charging.
-
Call HAL_PWR_IsEnabledBatteryCharging() function to check if the battery charging is enabled.
-
Call HAL_PWR_LP_EnableUCPDDeadBattery() function to enable the UCPD dead battery behavior.
-
Call HAL_PWR_LP_DisableUCPDDeadBattery() function to disable the UCPD dead battery behavior.
-
Call HAL_PWR_LP_IsEnabledUCPDDeadBattery() function to check that UCPD dead battery behavior is enabled or disabled.
Functions
-
void
HAL_PWR_SetConfigBatteryCharging
(
hal_pwr_battery_charging_res_value_t
value
)
-
Set the Battery charging resistor.
Note
When Vdd is present, charge the external battery through an internal resistor.
- Parameters :
-
value – Specifies the charging resistor. This parameter can be one of the following values:
-
HAL_PWR_BATTERY_CHARGING_RES_5K : 5 KOhm resistor.
-
HAL_PWR_BATTERY_CHARGING_RES_1_5K : 1.5 KOhm resistor.
-
-
hal_pwr_battery_charging_res_value_t
HAL_PWR_GetConfigBatteryCharging
(
void
)
-
Get the Battery charging resistor.
Note
When Vdd is present, charge the external battery through an internal resistor.
- Return values :
-
hal_pwr_battery_charging_res_value_t – The battery charging resistor value.
-
void
HAL_PWR_EnableBatteryCharging
(
void
)
-
Enable the Battery charging.
-
void
HAL_PWR_DisableBatteryCharging
(
void
)
-
Disable the Battery charging.
-
hal_pwr_battery_charging_status_t
HAL_PWR_IsEnabledBatteryCharging
(
void
)
-
Check that battery charging is enabled.
- Return values :
-
hal_pwr_battery_charging_status_t – The battery charging status.
-
I/O Pull management functions ¶
- group PWR_Exported_Functions_Group9
-
This section provides functions allowing to manage power GPIO pull.
-
Call HAL_PWR_SetConfigGPIOPull() function to configure GPIO Pull.
-
Call HAL_PWR_GetConfigGPIOPull() function to get GPIO Pull configuration.
-
Call HAL_PWR_EnableGPIOPull() function to enable GPIO pull configuration.
-
Call HAL_PWR_DisableGPIOPull() function to disable GPIO pull configuration.
-
Call HAL_PWR_IsEnabledGPIOPull() function to check that GPIO pull configuration is enabled or disabled.
Functions
-
void
HAL_PWR_SetConfigGPIOPull
(
hal_pwr_gpio_port_t
port
,
uint32_t
pin
,
hal_pwr_gpio_pull_t
pull
)
¶
-
Set GPIO pull configuration.
- Parameters :
-
-
port – This parameter is an element of hal_pwr_gpio_port_t enumeration.
-
pin – Specify the I/O pin mask to be configured.
-
pull – This parameter is an element of hal_pwr_gpio_pull_t enumeration.
-
-
hal_pwr_gpio_pull_t
HAL_PWR_GetConfigGPIOPull
(
hal_pwr_gpio_port_t
port
,
uint32_t
pin
)
¶
-
Get GPIO pull configuration.
- Parameters :
-
-
port – This parameter is an element of hal_pwr_gpio_port_t enumeration.
-
pin – Specify the I/O pins numbers.
-
- Return values :
-
hal_pwr_gpio_pull_t – The GPIO pull configuration.
-
void
HAL_PWR_EnableGPIOPull
(
void
)
¶
-
Enable GPIO pull configuration.
Note
Pull-up set by PUy bit of PWR_PUCRx register is not activated if the corresponding PDy bit of PWR_PDCRx register is also set (pull-down configuration priority is higher). HAL_PWR_LP_SetConfigGPIOPull() API ensure there is no conflict when setting PUy or PDy bit.
Warning
When APC bit is set, the I/O pull-up and pull-down configurations defined in PWR_PUCRx and PWR_PDCRx registers are applied.
-
void
HAL_PWR_DisableGPIOPull
(
void
)
¶
-
Disable GPIO pull configuration.
Warning
When APC bit is cleared, the I/O pull-up and pull-down configurations defined in PWR_PUCRx and PWR_PDCRx registers are not applied.
-
hal_pwr_gpio_pull_config_status_t
HAL_PWR_IsEnabledGPIOPull
(
void
)
¶
-
Check that gpio pull is enabled.
Warning
When APC bit is cleared, the I/O pull-up and pull-down configurations defined in PWR_PUCRx and PWR_PDCRx registers are not applied.
- Return values :
-
hal_pwr_gpio_pull_config_status_t – The GPIO pull status.
-
- group PWR_Exported_Functions_Group9
-
This section provides functions allowing to manage power GPIO pull.
-
Call HAL_PWR_SetConfigGPIOPull() function to configure GPIO Pull.
-
Call HAL_PWR_GetConfigGPIOPull() function to get GPIO Pull configuration.
-
Call HAL_PWR_EnableGPIOPull() function to enable GPIO pull configuration.
-
Call HAL_PWR_DisableGPIOPull() function to disable GPIO pull configuration.
-
Call HAL_PWR_IsEnabledGPIOPull() function to check that GPIO pull configuration is enabled or disabled.
Functions
-
void
HAL_PWR_SetConfigGPIOPull
(
hal_pwr_gpio_port_t
port
,
uint32_t
pin
,
hal_pwr_gpio_pull_t
pull
)
-
Set GPIO pull configuration.
- Parameters :
-
-
port – This parameter is an element of hal_pwr_gpio_port_t enumeration.
-
pin – Specify the I/O pin mask to be configured.
-
pull – This parameter is an element of hal_pwr_gpio_pull_t enumeration.
-
-
hal_pwr_gpio_pull_t
HAL_PWR_GetConfigGPIOPull
(
hal_pwr_gpio_port_t
port
,
uint32_t
pin
)
-
Get GPIO pull configuration.
- Parameters :
-
-
port – This parameter is an element of hal_pwr_gpio_port_t enumeration.
-
pin – Specify the I/O pins numbers.
-
- Return values :
-
hal_pwr_gpio_pull_t – The GPIO pull configuration.
-
void
HAL_PWR_EnableGPIOPull
(
void
)
-
Enable GPIO pull configuration.
Note
Pull-up set by PUy bit of PWR_PUCRx register is not activated if the corresponding PDy bit of PWR_PDCRx register is also set (pull-down configuration priority is higher). HAL_PWR_LP_SetConfigGPIOPull() API ensure there is no conflict when setting PUy or PDy bit.
Warning
When APC bit is set, the I/O pull-up and pull-down configurations defined in PWR_PUCRx and PWR_PDCRx registers are applied.
-
void
HAL_PWR_DisableGPIOPull
(
void
)
-
Disable GPIO pull configuration.
Warning
When APC bit is cleared, the I/O pull-up and pull-down configurations defined in PWR_PUCRx and PWR_PDCRx registers are not applied.
-
hal_pwr_gpio_pull_config_status_t
HAL_PWR_IsEnabledGPIOPull
(
void
)
-
Check that gpio pull is enabled.
Warning
When APC bit is cleared, the I/O pull-up and pull-down configurations defined in PWR_PUCRx and PWR_PDCRx registers are not applied.
- Return values :
-
hal_pwr_gpio_pull_config_status_t – The GPIO pull status.
-
- group PWR_Exported_Functions_Group9
-
This section provides functions allowing to manage power GPIO pull.
-
Call HAL_PWR_SetConfigGPIOPull() function to configure GPIO Pull.
-
Call HAL_PWR_GetConfigGPIOPull() function to get GPIO Pull configuration.
-
Call HAL_PWR_EnableGPIOPull() function to enable GPIO pull configuration.
-
Call HAL_PWR_DisableGPIOPull() function to disable GPIO pull configuration.
-
Call HAL_PWR_IsEnabledGPIOPull() function to check that GPIO pull configuration is enabled or disabled.
Functions
-
void
HAL_PWR_SetConfigGPIOPull
(
hal_pwr_gpio_port_t
port
,
uint32_t
pin
,
hal_pwr_gpio_pull_t
pull
)
-
Set GPIO pull configuration.
- Parameters :
-
-
port – This parameter is an element of hal_pwr_gpio_port_t enumeration.
-
pin – Specify the I/O pin mask to be configured.
-
pull – This parameter is an element of hal_pwr_gpio_pull_t enumeration.
-
-
hal_pwr_gpio_pull_t
HAL_PWR_GetConfigGPIOPull
(
hal_pwr_gpio_port_t
port
,
uint32_t
pin
)
-
Get GPIO pull configuration.
- Parameters :
-
-
port – This parameter is an element of hal_pwr_gpio_port_t enumeration.
-
pin – Specify the I/O pins numbers.
-
- Return values :
-
hal_pwr_gpio_pull_t – The GPIO pull configuration.
-
void
HAL_PWR_EnableGPIOPull
(
void
)
-
Enable GPIO pull configuration.
Note
Pull-up set by PUy bit of PWR_PUCRx register is not activated if the corresponding PDy bit of PWR_PDCRx register is also set (pull-down configuration priority is higher). HAL_PWR_LP_SetConfigGPIOPull() API ensure there is no conflict when setting PUy or PDy bit.
Warning
When APC bit is set, the I/O pull-up and pull-down configurations defined in PWR_PUCRx and PWR_PDCRx registers are applied.
-
void
HAL_PWR_DisableGPIOPull
(
void
)
-
Disable GPIO pull configuration.
Warning
When APC bit is cleared, the I/O pull-up and pull-down configurations defined in PWR_PUCRx and PWR_PDCRx registers are not applied.
-
hal_pwr_gpio_pull_config_status_t
HAL_PWR_IsEnabledGPIOPull
(
void
)
-
Check that gpio pull is enabled.
Warning
When APC bit is cleared, the I/O pull-up and pull-down configurations defined in PWR_PUCRx and PWR_PDCRx registers are not applied.
- Return values :
-
hal_pwr_gpio_pull_config_status_t – The GPIO pull status.
-