HAL PWR Functions ¶
Wakeup pins management functions ¶
- group PWR_Exported_Functions_Group1
-
This section provides functions to manage the wakeup pins.
Call HAL_PWR_LP_SetConfigWakeupPin() to configure the wakeup pin.
Call HAL_PWR_LP_GetConfigWakeupPin() to get the wakeup pin configuration.
Call HAL_PWR_LP_EnableWakeupPin() to enable the wakeup pin.
Call HAL_PWR_LP_DisableWakeupPin() to disable the wakeup pin.
Call HAL_PWR_LP_IsEnabledWakeupPin() to check whether the wakeup pin is enabled.
Call HAL_PWR_LP_GetWakeupSource() to get the wakeup source(s).
Call HAL_PWR_LP_CleanWakeupSource() to clear wakeup source(s).
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.
Note
(*) : Not available on all devices.
- Parameters :
-
wakeup_pin – This parameter can be a combination of PWR wakeup pin definitions.
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 is configured correctly.
-
void
HAL_PWR_LP_GetConfigWakeupPin
(
uint32_t
wakeup_pin
,
hal_pwr_wakeup_pin_config_t
*
p_config
)
¶
-
Get wakeup pin configuration.
Note
(*) : Not available on all devices.
- Parameters :
-
wakeup_pin – This parameter can be one of PWR wakeup pin definitions.
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
(*) : Not available on all devices.
Note
Wakeup pins are used to wake up the system from Standby mode.
- Parameters :
-
wakeup_pin – This parameter can be one or a combination of PWR wakeup pin definitions.
-
void
HAL_PWR_LP_DisableWakeupPin
(
uint32_t
wakeup_pin
)
¶
-
Disable the wakeup pin configuration.
Note
(*) : Not available on all devices.
Note
Wakeup pins are used to wake up the system from Standby mode.
- Parameters :
-
wakeup_pin – This parameter can be one or a combination of PWR wakeup pin definitions.
-
hal_pwr_wakeup_pin_status_t
HAL_PWR_LP_IsEnabledWakeupPin
(
uint32_t
wakeup_pin
)
¶
-
Check whether the wakeup pin is enabled.
Note
(*) : Not available on all devices.
- Parameters :
-
wakeup_pin – This parameter can be one of PWR wakeup pin definitions.
- Return values :
-
Wakeup – pin status
HAL_PWR_WAKEUP_PIN_DISABLED Wakeup pin disabled
HAL_PWR_WAKEUP_PIN_ENABLED Wakeup pin enabled
-
uint32_t
HAL_PWR_LP_GetWakeupSource
(
void
)
¶
-
Return the wakeup sources.
Note
(*) : Not available on all devices.
Warning
This API returns the wakeup source flags which can be a combination of multiple sources.
- Return values :
-
Can – be one of or a combination of PWR wakeup source definitions.
-
void
HAL_PWR_LP_CleanWakeupSource
(
uint32_t
wakeup_source
)
¶
-
Clean the selected wakeup source(s) flag(s).
Note
(*) : Not available on all devices.
- Parameters :
-
wakeup_source – This parameter can be one or a combination of PWR wakeup source definitions.
- group PWR_Exported_Functions_Group1
-
This section provides functions to manage the wakeup pins.
Call HAL_PWR_LP_SetConfigWakeupPin() to configure the wakeup pin.
Call HAL_PWR_LP_GetConfigWakeupPin() to get the wakeup pin configuration.
Call HAL_PWR_LP_EnableWakeupPin() to enable the wakeup pin.
Call HAL_PWR_LP_DisableWakeupPin() to disable the wakeup pin.
Call HAL_PWR_LP_IsEnabledWakeupPin() to check whether the wakeup pin is enabled.
Call HAL_PWR_LP_GetWakeupSource() to get the wakeup source(s).
Call HAL_PWR_LP_CleanWakeupSource() to clear wakeup source(s).
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.
Note
(*) : Not available on all devices.
- Parameters :
-
wakeup_pin – This parameter can be a combination of PWR wakeup pin definitions.
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 is configured correctly.
-
void
HAL_PWR_LP_GetConfigWakeupPin
(
uint32_t
wakeup_pin
,
hal_pwr_wakeup_pin_config_t
*
p_config
)
-
Get wakeup pin configuration.
Note
(*) : Not available on all devices.
- Parameters :
-
wakeup_pin – This parameter can be one of PWR wakeup pin definitions.
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
(*) : Not available on all devices.
Note
Wakeup pins are used to wake up the system from Standby mode.
- Parameters :
-
wakeup_pin – This parameter can be one or a combination of PWR wakeup pin definitions.
-
void
HAL_PWR_LP_DisableWakeupPin
(
uint32_t
wakeup_pin
)
-
Disable the wakeup pin configuration.
Note
(*) : Not available on all devices.
Note
Wakeup pins are used to wake up the system from Standby mode.
- Parameters :
-
wakeup_pin – This parameter can be one or a combination of PWR wakeup pin definitions.
-
hal_pwr_wakeup_pin_status_t
HAL_PWR_LP_IsEnabledWakeupPin
(
uint32_t
wakeup_pin
)
-
Check whether the wakeup pin is enabled.
Note
(*) : Not available on all devices.
- Parameters :
-
wakeup_pin – This parameter can be one of PWR wakeup pin definitions.
- Return values :
-
Wakeup – pin status
HAL_PWR_WAKEUP_PIN_DISABLED Wakeup pin disabled
HAL_PWR_WAKEUP_PIN_ENABLED Wakeup pin enabled
-
uint32_t
HAL_PWR_LP_GetWakeupSource
(
void
)
-
Return the wakeup sources.
Note
(*) : Not available on all devices.
Warning
This API returns the wakeup source flags which can be a combination of multiple sources.
- Return values :
-
Can – be one of or a combination of PWR wakeup source definitions.
-
void
HAL_PWR_LP_CleanWakeupSource
(
uint32_t
wakeup_source
)
-
Clean the selected wakeup source(s) flag(s).
Note
(*) : Not available on all devices.
- Parameters :
-
wakeup_source – This parameter can be one or a combination of PWR wakeup source definitions.
- group PWR_Exported_Functions_Group1
-
This section provides functions to manage the wakeup pins.
Call HAL_PWR_LP_SetConfigWakeupPin() to configure the wakeup pin.
Call HAL_PWR_LP_GetConfigWakeupPin() to get the wakeup pin configuration.
Call HAL_PWR_LP_EnableWakeupPin() to enable the wakeup pin.
Call HAL_PWR_LP_DisableWakeupPin() to disable the wakeup pin.
Call HAL_PWR_LP_IsEnabledWakeupPin() to check whether the wakeup pin is enabled.
Call HAL_PWR_LP_GetWakeupSource() to get the wakeup source(s).
Call HAL_PWR_LP_CleanWakeupSource() to clear wakeup source(s).
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.
Note
(*) : Not available on all devices.
- Parameters :
-
wakeup_pin – This parameter can be a combination of PWR wakeup pin definitions.
HAL_PWR_WAKEUP_PIN_3 (*)
HAL_PWR_WAKEUP_PIN_6 (*)
HAL_PWR_WAKEUP_PIN_7 (*)
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 is configured correctly.
-
void
HAL_PWR_LP_GetConfigWakeupPin
(
uint32_t
wakeup_pin
,
hal_pwr_wakeup_pin_config_t
*
p_config
)
-
Get wakeup pin configuration.
Note
(*) : Not available on all devices.
- Parameters :
-
wakeup_pin – This parameter can be one of PWR wakeup pin definitions.
HAL_PWR_WAKEUP_PIN_3 (*)
HAL_PWR_WAKEUP_PIN_6 (*)
HAL_PWR_WAKEUP_PIN_7 (*)
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
(*) : Not available on all devices.
Note
Wakeup pins are used to wake up the system from Standby mode.
- Parameters :
-
wakeup_pin – This parameter can be one or a combination of PWR wakeup pin definitions.
HAL_PWR_WAKEUP_PIN_3 (*)
HAL_PWR_WAKEUP_PIN_6 (*)
HAL_PWR_WAKEUP_PIN_7 (*)
-
void
HAL_PWR_LP_DisableWakeupPin
(
uint32_t
wakeup_pin
)
-
Disable the wakeup pin configuration.
Note
(*) : Not available on all devices.
Note
Wakeup pins are used to wake up the system from Standby mode.
- Parameters :
-
wakeup_pin – This parameter can be one or a combination of PWR wakeup pin definitions.
HAL_PWR_WAKEUP_PIN_3 (*)
HAL_PWR_WAKEUP_PIN_6 (*)
HAL_PWR_WAKEUP_PIN_7 (*)
-
hal_pwr_wakeup_pin_status_t
HAL_PWR_LP_IsEnabledWakeupPin
(
uint32_t
wakeup_pin
)
-
Check whether the wakeup pin is enabled.
Note
(*) : Not available on all devices.
- Parameters :
-
wakeup_pin – This parameter can be one of PWR wakeup pin definitions.
HAL_PWR_WAKEUP_PIN_3 (*)
HAL_PWR_WAKEUP_PIN_6 (*)
HAL_PWR_WAKEUP_PIN_7 (*)
- Return values :
-
Wakeup – pin status
HAL_PWR_WAKEUP_PIN_DISABLED Wakeup pin disabled
HAL_PWR_WAKEUP_PIN_ENABLED Wakeup pin enabled
-
uint32_t
HAL_PWR_LP_GetWakeupSource
(
void
)
-
Return the wakeup sources.
Note
(*) : Not available on all devices.
Warning
This API returns the wakeup source flags which can be a combination of multiple sources.
- Return values :
-
Can – be one of or a combination of PWR wakeup source definitions.
HAL_PWR_WAKEUP_SOURCE_3 (*)
HAL_PWR_WAKEUP_SOURCE_6 (*)
HAL_PWR_WAKEUP_SOURCE_7 (*)
-
void
HAL_PWR_LP_CleanWakeupSource
(
uint32_t
wakeup_source
)
-
Clean the selected wakeup source(s) flag(s).
Note
(*) : Not available on all devices.
- Parameters :
-
wakeup_source – This parameter can be one or a combination of PWR wakeup source definitions.
HAL_PWR_WAKEUP_SOURCE_3 (*)
HAL_PWR_WAKEUP_SOURCE_6 (*)
HAL_PWR_WAKEUP_SOURCE_7 (*)
RTC domain write protection management functions ¶
- group PWR_Exported_Functions_Group2
-
This section provides functions to manage RTC domain write protection:
Call HAL_PWR_EnableRTCDomainWriteProtection() to enable RTC domain write protection.
Call HAL_PWR_DisableRTCDomainWriteProtection() to disable RTC domain write protection.
Call HAL_PWR_IsEnabledRTCDomainWriteProtection() to check whether RTC domain write protection is enabled.
Functions
-
void
HAL_PWR_EnableRTCDomainWriteProtection
(
void
)
¶
-
Enable the RTC domain write protection (RCC RTC 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 RTC 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 that RTC domain write protection is enabled.
- Return values :
-
RTC – Domain write protection status
HAL_PWR_RTC_DOMAIN_WRP_DISABLED RTC domain write protection disabled.
HAL_PWR_RTC_DOMAIN_WRP_ENABLED RTC domain write protection enabled.
- group PWR_Exported_Functions_Group2
-
This section provides functions to manage RTC domain write protection:
Call HAL_PWR_EnableRTCDomainWriteProtection() to enable RTC domain write protection.
Call HAL_PWR_DisableRTCDomainWriteProtection() to disable RTC domain write protection.
Call HAL_PWR_IsEnabledRTCDomainWriteProtection() to check whether RTC domain write protection is enabled.
Functions
-
void
HAL_PWR_EnableRTCDomainWriteProtection
(
void
)
-
Enable the RTC domain write protection (RCC RTC 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 RTC 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 that RTC domain write protection is enabled.
- Return values :
-
RTC – Domain write protection status
HAL_PWR_RTC_DOMAIN_WRP_DISABLED RTC domain write protection disabled.
HAL_PWR_RTC_DOMAIN_WRP_ENABLED RTC domain write protection enabled.
- group PWR_Exported_Functions_Group2
-
This section provides functions to manage RTC domain write protection:
Call HAL_PWR_EnableRTCDomainWriteProtection() to enable RTC domain write protection.
Call HAL_PWR_DisableRTCDomainWriteProtection() to disable RTC domain write protection.
Call HAL_PWR_IsEnabledRTCDomainWriteProtection() to check whether RTC domain write protection is enabled.
Functions
-
void
HAL_PWR_EnableRTCDomainWriteProtection
(
void
)
-
Enable the RTC domain write protection (RCC RTC 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 RTC 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 that RTC domain write protection is enabled.
- Return values :
-
RTC – Domain write protection status
HAL_PWR_RTC_DOMAIN_WRP_DISABLED RTC domain write protection disabled.
HAL_PWR_RTC_DOMAIN_WRP_ENABLED RTC domain write protection enabled.
Low power mode management functions ¶
- group PWR_Exported_Functions_Group3
-
This section provides functions to manage low power modes:
Call HAL_PWR_ClearCorePendingEvent() to clear the internal Cortex event before entering low power mode using WFE.
Call HAL_PWR_EnterSleepMode() to enter the core into sleep mode.
Call HAL_PWR_EnterStopMode() to enter the MCU into stop x mode.
Call HAL_PWR_EnterStandbyMode() to enter the MCU into standby mode.
Call HAL_PWR_SetCoreSleepMode() to configure the core sleep or deep sleep mode.
Call HAL_PWR_GetCoreSleepMode() to get the core sleep mode configuration.
Call HAL_PWR_EnableCoreSleepOnExit() to enable the core to re-enter sleep mode after interrupt handling completes.
Call HAL_PWR_DisableCoreSleepOnExit() to disable the core from re-entering sleep mode after interrupt handling completes.
Call HAL_PWR_IsEnabledCoreSleepOnExit() to check whether core sleep-on-exit is enabled.
Call HAL_PWR_EnableCoreSendEventOnPending() to enable the core to wake up after any pending event/interrupt.
Call HAL_PWR_DisableCoreSendEventOnPending() to disable the core from waking up after any pending event/interrupt.
Call HAL_PWR_IsEnabledCoreSendEventOnPending() to check whether core send event on pending is enabled.
Call HAL_PWR_GetPreviousSystemPowerMode() to get previous system power mode.
Call HAL_PWR_CleanPreviousSystemPowerMode() to clean previous system power mode flag.
Functions
-
void
HAL_PWR_ClearCorePendingEvent
(
void
)
¶
-
Clear core pending event.
Note
Clear the pending event to enter a given core into Sleep or stop mode with WFE entry.
Warning
Call this function just before APIs that enter Sleep and stop mode using a Wait For Event request.
-
void
HAL_PWR_EnterSleepMode
(
hal_pwr_low_pwr_mode_entry_t
sleep_entry
)
¶
-
Enter the core into sleep mode.
- Parameters :
-
sleep_entry – Parameter of the 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_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 – Core sleep mode.
HAL_PWR_CORE_DEEP_SLEEP – Core deep sleep mode.
-
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 whether core SLEEP-ON-EXIT is enabled.
- 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 status.
- Return values :
-
HAL_PWR_CORE_SEV_ON_PENDING_DISABLED – Core send event on pending disabled.
HAL_PWR_CORE_SEV_ON_PENDING_ENABLED – Core send event on pending enabled.
-
hal_pwr_system_mode_t
HAL_PWR_GetPreviousSystemPowerMode
(
void
)
¶
-
Get the previous system power mode.
Note
Sleep mode is an ARM core mode and not a system power mode as it does not affect system clock on return from sleep, so it is not reported by this function.
Warning
This function is expected to be called on return from low power mode so to take the necessary actions such as re-enabling clocks automatically disabled during low power mode.
- Return values :
-
hal_pwr_system_mode_t – Previous power mode.
-
void
HAL_PWR_CleanPreviousSystemPowerMode
(
void
)
¶
-
Clean the previous system power mode flags.
Note
This function must be called before entering in low power mode to ensure that HAL_PWR_GetPreviousSystemPowerMode() will return the right information on return from low power mode.
Warning
This function clears both standby and stop flags.
- group PWR_Exported_Functions_Group3
-
This section provides functions to manage low power modes:
Call HAL_PWR_ClearCorePendingEvent() to clear the internal Cortex event before entering low power mode using WFE.
Call HAL_PWR_EnterSleepMode() to enter the core into sleep mode.
Call HAL_PWR_EnterStopMode() to enter the MCU into stop x mode.
Call HAL_PWR_EnterStandbyMode() to enter the MCU into standby mode.
Call HAL_PWR_SetCoreSleepMode() to configure the core sleep or deep sleep mode.
Call HAL_PWR_GetCoreSleepMode() to get the core sleep mode configuration.
Call HAL_PWR_EnableCoreSleepOnExit() to enable the core to re-enter sleep mode after interrupt handling completes.
Call HAL_PWR_DisableCoreSleepOnExit() to disable the core from re-entering sleep mode after interrupt handling completes.
Call HAL_PWR_IsEnabledCoreSleepOnExit() to check whether core sleep-on-exit is enabled.
Call HAL_PWR_EnableCoreSendEventOnPending() to enable the core to wake up after any pending event/interrupt.
Call HAL_PWR_DisableCoreSendEventOnPending() to disable the core from waking up after any pending event/interrupt.
Call HAL_PWR_IsEnabledCoreSendEventOnPending() to check whether core send event on pending is enabled.
Call HAL_PWR_GetPreviousSystemPowerMode() to get previous system power mode.
Call HAL_PWR_CleanPreviousSystemPowerMode() to clean previous system power mode flag.
Functions
-
void
HAL_PWR_ClearCorePendingEvent
(
void
)
-
Clear core pending event.
Note
Clear the pending event to enter a given core into Sleep or stop mode with WFE entry.
Warning
Call this function just before APIs that enter Sleep and stop mode using a Wait For Event request.
-
void
HAL_PWR_EnterSleepMode
(
hal_pwr_low_pwr_mode_entry_t
sleep_entry
)
-
Enter the core into sleep mode.
- Parameters :
-
sleep_entry – Parameter of the 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_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 – Core sleep mode.
HAL_PWR_CORE_DEEP_SLEEP – Core deep sleep mode.
-
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 whether core SLEEP-ON-EXIT is enabled.
- 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 status.
- Return values :
-
HAL_PWR_CORE_SEV_ON_PENDING_DISABLED – Core send event on pending disabled.
HAL_PWR_CORE_SEV_ON_PENDING_ENABLED – Core send event on pending enabled.
-
hal_pwr_system_mode_t
HAL_PWR_GetPreviousSystemPowerMode
(
void
)
-
Get the previous system power mode.
Note
Sleep mode is an ARM core mode and not a system power mode as it does not affect system clock on return from sleep, so it is not reported by this function.
Warning
This function is expected to be called on return from low power mode so to take the necessary actions such as re-enabling clocks automatically disabled during low power mode.
- Return values :
-
hal_pwr_system_mode_t – Previous power mode.
-
void
HAL_PWR_CleanPreviousSystemPowerMode
(
void
)
-
Clean the previous system power mode flags.
Note
This function must be called before entering in low power mode to ensure that HAL_PWR_GetPreviousSystemPowerMode() will return the right information on return from low power mode.
Warning
This function clears both standby and stop flags.
- group PWR_Exported_Functions_Group3
-
This section provides functions to manage low power modes:
Call HAL_PWR_ClearCorePendingEvent() to clear the internal Cortex event before entering low power mode using WFE.
Call HAL_PWR_EnterSleepMode() to enter the core into sleep mode.
Call HAL_PWR_EnterStopMode() to enter the MCU into stop x mode.
Call HAL_PWR_EnterStandbyMode() to enter the MCU into standby mode.
Call HAL_PWR_SetCoreSleepMode() to configure the core sleep or deep sleep mode.
Call HAL_PWR_GetCoreSleepMode() to get the core sleep mode configuration.
Call HAL_PWR_EnableCoreSleepOnExit() to enable the core to re-enter sleep mode after interrupt handling completes.
Call HAL_PWR_DisableCoreSleepOnExit() to disable the core from re-entering sleep mode after interrupt handling completes.
Call HAL_PWR_IsEnabledCoreSleepOnExit() to check whether core sleep-on-exit is enabled.
Call HAL_PWR_EnableCoreSendEventOnPending() to enable the core to wake up after any pending event/interrupt.
Call HAL_PWR_DisableCoreSendEventOnPending() to disable the core from waking up after any pending event/interrupt.
Call HAL_PWR_IsEnabledCoreSendEventOnPending() to check whether core send event on pending is enabled.
Call HAL_PWR_GetPreviousSystemPowerMode() to get previous system power mode.
Call HAL_PWR_CleanPreviousSystemPowerMode() to clean previous system power mode flag.
Functions
-
void
HAL_PWR_ClearCorePendingEvent
(
void
)
-
Clear core pending event.
Note
Clear the pending event to enter a given core into Sleep or stop mode with WFE entry.
Warning
Call this function just before APIs that enter Sleep and stop mode using a Wait For Event request.
-
void
HAL_PWR_EnterSleepMode
(
hal_pwr_low_pwr_mode_entry_t
sleep_entry
)
-
Enter the core into sleep mode.
- Parameters :
-
sleep_entry – Parameter of the 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_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 – Core sleep mode.
HAL_PWR_CORE_DEEP_SLEEP – Core deep sleep mode.
-
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 whether core SLEEP-ON-EXIT is enabled.
- 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 status.
- Return values :
-
HAL_PWR_CORE_SEV_ON_PENDING_DISABLED – Core send event on pending disabled.
HAL_PWR_CORE_SEV_ON_PENDING_ENABLED – Core send event on pending enabled.
-
hal_pwr_system_mode_t
HAL_PWR_GetPreviousSystemPowerMode
(
void
)
-
Get the previous system power mode.
Note
Sleep mode is an ARM core mode and not a system power mode as it does not affect system clock on return from sleep, so it is not reported by this function.
Warning
This function is expected to be called on return from low power mode so to take the necessary actions such as re-enabling clocks automatically disabled during low power mode.
- Return values :
-
hal_pwr_system_mode_t – Previous power mode.
-
void
HAL_PWR_CleanPreviousSystemPowerMode
(
void
)
-
Clean the previous system power mode flags.
Note
This function must be called before entering in low power mode to ensure that HAL_PWR_GetPreviousSystemPowerMode() will return the right information on return from low power mode.
Warning
This function clears both standby and stop flags.
Voltage monitoring management functions ¶
- group PWR_Exported_Functions_Group4
-
This section provides functions to manage voltage monitoring.
Call HAL_PWR_EnableProgrammableVoltageDetector() to enable the programmable voltage detector.
Call HAL_PWR_DisableProgrammableVoltageDetector() to disable the programmable voltage detector.
Call HAL_PWR_IsEnabledProgrammableVoltageDetector() to check whether the programmable voltage detector is enabled.
Call HAL_PWR_GetProgrammableVoltageDetectorOutput() to get the programmable voltage detector output value.
Functions
-
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 whether the programmable voltage detection is enabled.
- Return values :
-
HAL_PWR_PVD_DISABLED – Programmable voltage detection disabled.
HAL_PWR_PVD_ENABLED – Programmable voltage detection enabled.
-
hal_pwr_pvd_out_t
HAL_PWR_GetProgrammableVoltageDetectorOutput
(
void
)
¶
-
Provide the current PVD output.
- Return values :
-
HAL_PWR_PVD_OUT_EQ_HIGH_THR – VDD is equal or higher than programmable voltage detector threshold.
HAL_PWR_PVD_OUT_LOW_THR – VDD is lower than programmable voltage detector threshold.
- group PWR_Exported_Functions_Group4
-
This section provides functions to manage voltage monitoring.
Call HAL_PWR_EnableProgrammableVoltageDetector() to enable the programmable voltage detector.
Call HAL_PWR_DisableProgrammableVoltageDetector() to disable the programmable voltage detector.
Call HAL_PWR_IsEnabledProgrammableVoltageDetector() to check whether the programmable voltage detector is enabled.
Call HAL_PWR_GetProgrammableVoltageDetectorOutput() to get the programmable voltage detector output value.
Functions
-
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 whether the programmable voltage detection is enabled.
- Return values :
-
HAL_PWR_PVD_DISABLED – Programmable voltage detection disabled.
HAL_PWR_PVD_ENABLED – Programmable voltage detection enabled.
-
hal_pwr_pvd_out_t
HAL_PWR_GetProgrammableVoltageDetectorOutput
(
void
)
-
Provide the current PVD output.
- Return values :
-
HAL_PWR_PVD_OUT_EQ_HIGH_THR – VDD is equal or higher than programmable voltage detector threshold.
HAL_PWR_PVD_OUT_LOW_THR – VDD is lower than programmable voltage detector threshold.
- group PWR_Exported_Functions_Group4
-
This section provides functions to manage voltage monitoring.
Call HAL_PWR_EnableProgrammableVoltageDetector() to enable the programmable voltage detector.
Call HAL_PWR_DisableProgrammableVoltageDetector() to disable the programmable voltage detector.
Call HAL_PWR_IsEnabledProgrammableVoltageDetector() to check whether the programmable voltage detector is enabled.
Call HAL_PWR_GetProgrammableVoltageDetectorOutput() to get the programmable voltage detector output value.
Functions
-
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 whether the programmable voltage detection is enabled.
- Return values :
-
HAL_PWR_PVD_DISABLED – Programmable voltage detection disabled.
HAL_PWR_PVD_ENABLED – Programmable voltage detection enabled.
-
hal_pwr_pvd_out_t
HAL_PWR_GetProgrammableVoltageDetectorOutput
(
void
)
-
Provide the current PVD output.
- Return values :
-
HAL_PWR_PVD_OUT_EQ_HIGH_THR – VDD is equal or higher than programmable voltage detector threshold.
HAL_PWR_PVD_OUT_LOW_THR – VDD is lower than programmable voltage detector threshold.
Memory retention management functions ¶
- group PWR_Exported_Functions_Group5
-
This section provides functions to manage memory content retention.
Call HAL_PWR_LP_EnableMemoryRetention() to enable memory retention.
Call HAL_PWR_LP_DisableMemoryRetention() to disable memory retention.
Call HAL_PWR_LP_IsEnabledMemoryRetention() to check whether selected memory retention is enabled.
Call HAL_PWR_LP_EnableMemoryPageRetention() to enable memory retention for selected pages. (*)
Call HAL_PWR_LP_DisableMemoryPageRetention() to disable memory retention for selected pages. (*)
Call HAL_PWR_LP_IsEnabledMemoryPageRetention() to check whether selected memory page retention is enabled. (*)
Note
(*) : Not available on all devices.
Functions
-
hal_status_t
HAL_PWR_LP_EnableMemoryRetention
(
hal_pwr_memory_retention_t
memory
)
¶
-
Enable memory retention in stop mode.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
- Return values :
-
HAL_OK – Memory retention has been correctly enabled.
HAL_INVALID_PARAM – The selected memory does not exist while USE_HAL_CHECK_PARAM is used.
HAL_ERROR – Selected memory is paginated, use HAL_PWR_LP_EnableMemoryPageRetention().
-
hal_status_t
HAL_PWR_LP_DisableMemoryRetention
(
hal_pwr_memory_retention_t
memory
)
¶
-
Disable memory retention in stop mode.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
- Return values :
-
HAL_OK – Memory retention has been correctly disabled.
HAL_INVALID_PARAM – The selected memory does not exist while USE_HAL_CHECK_PARAM is used.
HAL_ERROR – Selected memory is paginated, use HAL_PWR_LP_DisableMemoryPageRetention().
-
hal_pwr_memory_retention_status_t
HAL_PWR_LP_IsEnabledMemoryRetention
(
hal_pwr_memory_retention_t
memory
)
¶
-
Get memory retention status.
Note
If the ASSERT are disabled, HAL_PWR_MEMORY_RETENTION_DISABLED is returned for paginated memories.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
- Return values :
-
HAL_PWR_MEMORY_RETENTION_DISABLED – if the selected memory is not retained in stop mode or if the selected memory does not exist while USE_HAL_CHECK_PARAM is used.
HAL_PWR_MEMORY_RETENTION_ENABLED – if the selected memory is retained in stop mode.
-
hal_status_t
HAL_PWR_LP_EnableMemoryPageRetention
(
hal_pwr_memory_retention_t
memory
,
uint32_t
page_idx
,
uint32_t
page_nbr
)
¶
-
Enable memory page retention in stop mode.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
page_idx – the index of memory page (starting from 1).
page_nbr – The memory pages number.
- Return values :
-
HAL_OK – Memory page retention has been correctly enabled.
HAL_INVALID_PARAM – The selected memory does not exist, the page index is out of range or the selected number of pages does not fit the memory.
HAL_ERROR – Memory page retention could not be enabled, the selected memory is not paginated.
-
hal_status_t
HAL_PWR_LP_DisableMemoryPageRetention
(
hal_pwr_memory_retention_t
memory
,
uint32_t
page_idx
,
uint32_t
page_nbr
)
¶
-
Disable memory page retention in stop mode.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
page_idx – the index of memory page (starting from 1).
page_nbr – The memory pages number.
- Return values :
-
HAL_OK – Memory page retention has been correctly disabled.
HAL_INVALID_PARAM – The selected memory does not exist, the page index is out of range or the selected number of pages does not fit the memory.
HAL_ERROR – Memory page retention could not be disabled, the selected memory is not paginated.
-
hal_pwr_memory_page_retention_status_t
HAL_PWR_LP_IsEnabledMemoryPageRetention
(
hal_pwr_memory_retention_t
memory
,
uint32_t
page_idx
)
¶
-
Check the selected memory page retention in stop mode status.
Note
If the ASSERT are disabled, HAL_PWR_MEMORY_PAGE_RETENTION_DISABLED is returned for out-of-range pages or non-paginated memories.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
page_idx – the index of memory page (starting from 1).
- Return values :
-
HAL_PWR_MEMORY_PAGE_RETENTION_DISABLED – if the selected memory page is not retained in stop mode or if the selected memory does not exist while USE_HAL_CHECK_PARAM is used.
HAL_PWR_MEMORY_PAGE_RETENTION_ENABLED – if the selected memory page is retained in stop mode.
- group PWR_Exported_Functions_Group5
-
This section provides functions to manage memory content retention.
Call HAL_PWR_LP_EnableMemoryRetention() to enable memory retention.
Call HAL_PWR_LP_DisableMemoryRetention() to disable memory retention.
Call HAL_PWR_LP_IsEnabledMemoryRetention() to check whether selected memory retention is enabled.
Call HAL_PWR_LP_EnableMemoryPageRetention() to enable memory retention for selected pages. (*)
Call HAL_PWR_LP_DisableMemoryPageRetention() to disable memory retention for selected pages. (*)
Call HAL_PWR_LP_IsEnabledMemoryPageRetention() to check whether selected memory page retention is enabled. (*)
Note
(*) : Not available on all devices.
Functions
-
hal_status_t
HAL_PWR_LP_EnableMemoryRetention
(
hal_pwr_memory_retention_t
memory
)
-
Enable memory retention in stop mode.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
- Return values :
-
HAL_OK – Memory retention has been correctly enabled.
HAL_INVALID_PARAM – The selected memory does not exist while USE_HAL_CHECK_PARAM is used.
HAL_ERROR – Selected memory is paginated, use HAL_PWR_LP_EnableMemoryPageRetention().
-
hal_status_t
HAL_PWR_LP_DisableMemoryRetention
(
hal_pwr_memory_retention_t
memory
)
-
Disable memory retention in stop mode.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
- Return values :
-
HAL_OK – Memory retention has been correctly disabled.
HAL_INVALID_PARAM – The selected memory does not exist while USE_HAL_CHECK_PARAM is used.
HAL_ERROR – Selected memory is paginated, use HAL_PWR_LP_DisableMemoryPageRetention().
-
hal_pwr_memory_retention_status_t
HAL_PWR_LP_IsEnabledMemoryRetention
(
hal_pwr_memory_retention_t
memory
)
-
Get memory retention status.
Note
If the ASSERT are disabled, HAL_PWR_MEMORY_RETENTION_DISABLED is returned for paginated memories.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
- Return values :
-
HAL_PWR_MEMORY_RETENTION_DISABLED – if the selected memory is not retained in stop mode or if the selected memory does not exist while USE_HAL_CHECK_PARAM is used.
HAL_PWR_MEMORY_RETENTION_ENABLED – if the selected memory is retained in stop mode.
-
hal_status_t
HAL_PWR_LP_EnableMemoryPageRetention
(
hal_pwr_memory_retention_t
memory
,
uint32_t
page_idx
,
uint32_t
page_nbr
)
-
Enable memory page retention in stop mode.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
page_idx – the index of memory page (starting from 1).
page_nbr – The memory pages number.
- Return values :
-
HAL_OK – Memory page retention has been correctly enabled.
HAL_INVALID_PARAM – The selected memory does not exist, the page index is out of range or the selected number of pages does not fit the memory.
HAL_ERROR – Memory page retention could not be enabled, the selected memory is not paginated.
-
hal_status_t
HAL_PWR_LP_DisableMemoryPageRetention
(
hal_pwr_memory_retention_t
memory
,
uint32_t
page_idx
,
uint32_t
page_nbr
)
-
Disable memory page retention in stop mode.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
page_idx – the index of memory page (starting from 1).
page_nbr – The memory pages number.
- Return values :
-
HAL_OK – Memory page retention has been correctly disabled.
HAL_INVALID_PARAM – The selected memory does not exist, the page index is out of range or the selected number of pages does not fit the memory.
HAL_ERROR – Memory page retention could not be disabled, the selected memory is not paginated.
-
hal_pwr_memory_page_retention_status_t
HAL_PWR_LP_IsEnabledMemoryPageRetention
(
hal_pwr_memory_retention_t
memory
,
uint32_t
page_idx
)
-
Check the selected memory page retention in stop mode status.
Note
If the ASSERT are disabled, HAL_PWR_MEMORY_PAGE_RETENTION_DISABLED is returned for out-of-range pages or non-paginated memories.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
page_idx – the index of memory page (starting from 1).
- Return values :
-
HAL_PWR_MEMORY_PAGE_RETENTION_DISABLED – if the selected memory page is not retained in stop mode or if the selected memory does not exist while USE_HAL_CHECK_PARAM is used.
HAL_PWR_MEMORY_PAGE_RETENTION_ENABLED – if the selected memory page is retained in stop mode.
- group PWR_Exported_Functions_Group5
-
This section provides functions to manage memory content retention.
Call HAL_PWR_LP_EnableMemoryRetention() to enable memory retention.
Call HAL_PWR_LP_DisableMemoryRetention() to disable memory retention.
Call HAL_PWR_LP_IsEnabledMemoryRetention() to check whether selected memory retention is enabled.
Call HAL_PWR_LP_EnableMemoryPageRetention() to enable memory retention for selected pages. (*)
Call HAL_PWR_LP_DisableMemoryPageRetention() to disable memory retention for selected pages. (*)
Call HAL_PWR_LP_IsEnabledMemoryPageRetention() to check whether selected memory page retention is enabled. (*)
Note
(*) : Not available on all devices.
Functions
-
hal_status_t
HAL_PWR_LP_EnableMemoryRetention
(
hal_pwr_memory_retention_t
memory
)
-
Enable memory retention in stop mode.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
- Return values :
-
HAL_OK – Memory retention has been correctly enabled.
HAL_INVALID_PARAM – The selected memory does not exist while USE_HAL_CHECK_PARAM is used.
HAL_ERROR – Selected memory is paginated, use HAL_PWR_LP_EnableMemoryPageRetention().
-
hal_status_t
HAL_PWR_LP_DisableMemoryRetention
(
hal_pwr_memory_retention_t
memory
)
-
Disable memory retention in stop mode.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
- Return values :
-
HAL_OK – Memory retention has been correctly disabled.
HAL_INVALID_PARAM – The selected memory does not exist while USE_HAL_CHECK_PARAM is used.
HAL_ERROR – Selected memory is paginated, use HAL_PWR_LP_DisableMemoryPageRetention().
-
hal_pwr_memory_retention_status_t
HAL_PWR_LP_IsEnabledMemoryRetention
(
hal_pwr_memory_retention_t
memory
)
-
Get memory retention status.
Note
If the ASSERT are disabled, HAL_PWR_MEMORY_RETENTION_DISABLED is returned for paginated memories.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
- Return values :
-
HAL_PWR_MEMORY_RETENTION_DISABLED – if the selected memory is not retained in stop mode or if the selected memory does not exist while USE_HAL_CHECK_PARAM is used.
HAL_PWR_MEMORY_RETENTION_ENABLED – if the selected memory is retained in stop mode.
-
hal_status_t
HAL_PWR_LP_EnableMemoryPageRetention
(
hal_pwr_memory_retention_t
memory
,
uint32_t
page_idx
,
uint32_t
page_nbr
)
-
Enable memory page retention in stop mode.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
page_idx – the index of memory page (starting from 1).
page_nbr – The memory pages number.
- Return values :
-
HAL_OK – Memory page retention has been correctly enabled.
HAL_INVALID_PARAM – The selected memory does not exist, the page index is out of range or the selected number of pages does not fit the memory.
HAL_ERROR – Memory page retention could not be enabled, the selected memory is not paginated.
-
hal_status_t
HAL_PWR_LP_DisableMemoryPageRetention
(
hal_pwr_memory_retention_t
memory
,
uint32_t
page_idx
,
uint32_t
page_nbr
)
-
Disable memory page retention in stop mode.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
page_idx – the index of memory page (starting from 1).
page_nbr – The memory pages number.
- Return values :
-
HAL_OK – Memory page retention has been correctly disabled.
HAL_INVALID_PARAM – The selected memory does not exist, the page index is out of range or the selected number of pages does not fit the memory.
HAL_ERROR – Memory page retention could not be disabled, the selected memory is not paginated.
-
hal_pwr_memory_page_retention_status_t
HAL_PWR_LP_IsEnabledMemoryPageRetention
(
hal_pwr_memory_retention_t
memory
,
uint32_t
page_idx
)
-
Check the selected memory page retention in stop mode status.
Note
If the ASSERT are disabled, HAL_PWR_MEMORY_PAGE_RETENTION_DISABLED is returned for out-of-range pages or non-paginated memories.
- Parameters :
-
memory – This parameter is an element of hal_pwr_memory_retention_t enumeration.
page_idx – the index of memory page (starting from 1).
- Return values :
-
HAL_PWR_MEMORY_PAGE_RETENTION_DISABLED – if the selected memory page is not retained in stop mode or if the selected memory does not exist while USE_HAL_CHECK_PARAM is used.
HAL_PWR_MEMORY_PAGE_RETENTION_ENABLED – if the selected memory page is retained in stop mode.
Memory management functions ¶
- group PWR_Exported_Functions_Group6
-
This section provides functions to manage flash memory low power modes.
Call HAL_PWR_LP_EnableFlashLowPWRMode() to enable flash memory power down in stop 0/1 mode.
Call HAL_PWR_LP_DisableFlashLowPWRMode() to disable flash memory power down in stop 0/1 mode.
Call HAL_PWR_LP_IsEnabledFlashLowPWRMode() to check the flash memory power down status in stop 0/1 mode.
Functions
-
void
HAL_PWR_LP_EnableFlashLowPWRMode
(
void
)
¶
-
Enable the flash low power mode.
-
void
HAL_PWR_LP_DisableFlashLowPWRMode
(
void
)
¶
-
Disable the flash low power mode.
-
hal_pwr_flash_low_pwr_mode_status_t
HAL_PWR_LP_IsEnabledFlashLowPWRMode
(
void
)
¶
-
Check whether the flash low power mode is enabled.
- Return values :
-
hal_pwr_Flash_low_pwr_mode_status_t – Flash low power mode status.
- group PWR_Exported_Functions_Group6
-
This section provides functions to manage flash memory low power modes.
Call HAL_PWR_LP_EnableFlashLowPWRMode() to enable flash memory power down in stop 0/1 mode.
Call HAL_PWR_LP_DisableFlashLowPWRMode() to disable flash memory power down in stop 0/1 mode.
Call HAL_PWR_LP_IsEnabledFlashLowPWRMode() to check the flash memory power down status in stop 0/1 mode.
Functions
-
void
HAL_PWR_LP_EnableFlashLowPWRMode
(
void
)
-
Enable the flash low power mode.
-
void
HAL_PWR_LP_DisableFlashLowPWRMode
(
void
)
-
Disable the flash low power mode.
-
hal_pwr_flash_low_pwr_mode_status_t
HAL_PWR_LP_IsEnabledFlashLowPWRMode
(
void
)
-
Check whether the flash low power mode is enabled.
- Return values :
-
hal_pwr_Flash_low_pwr_mode_status_t – Flash low power mode status.
- group PWR_Exported_Functions_Group6
-
This section provides functions to manage flash memory low power modes.
Call HAL_PWR_LP_EnableFlashLowPWRMode() to enable flash memory power down in stop 0/1 mode.
Call HAL_PWR_LP_DisableFlashLowPWRMode() to disable flash memory power down in stop 0/1 mode.
Call HAL_PWR_LP_IsEnabledFlashLowPWRMode() to check the flash memory power down status in stop 0/1 mode.
Functions
-
void
HAL_PWR_LP_EnableFlashLowPWRMode
(
void
)
-
Enable the flash low power mode.
-
void
HAL_PWR_LP_DisableFlashLowPWRMode
(
void
)
-
Disable the flash low power mode.
-
hal_pwr_flash_low_pwr_mode_status_t
HAL_PWR_LP_IsEnabledFlashLowPWRMode
(
void
)
-
Check whether the flash low power mode is enabled.
- Return values :
-
hal_pwr_Flash_low_pwr_mode_status_t – Flash low power mode status.
I/O retention management functions ¶
- group PWR_Exported_Functions_Group7
-
This section provides functions to manage I/O retention in low power mode.
Call HAL_PWR_LP_EnableIORetention() to enable I/O (GPIO and/or JTAGIO) retention in Standby mode.
Call HAL_PWR_LP_DisableIORetention() to disable I/O (GPIO and/or JTAGIO) retention in Standby mode.
Call HAL_PWR_LP_IsEnabledIORetention() to check whether I/O (GPIO or JTAGIO) retention in Standby mode is enabled.
Functions
-
void
HAL_PWR_LP_EnableIORetention
(
hal_pwr_io_retention_t
io
)
¶
-
Enable the IO retention in Standby mode.
Note
The output is sampled and applied to the output I/O during Standby mode.
- Parameters :
-
io – This parameter is an element or combination of elements of hal_pwr_io_retention_t enumeration.
HAL_PWR_IO_RETENTION_JTAGIO IO retention mode is enabled for JTAG I/Os (PA13, PA14, PA15, and PB4).
HAL_PWR_IO_RETENTION_GPIO IO retention mode is enabled for all I/Os except the I/Os supporting the Standby functionality and JTAG I/Os.
HAL_PWR_IO_RETENTION_ALL IO retention mode is enabled for all I/Os.
-
void
HAL_PWR_LP_DisableIORetention
(
hal_pwr_io_retention_t
io
)
¶
-
Disable the IO retention in Standby mode.
- Parameters :
-
io – This parameter is an element of hal_pwr_io_retention_t enumeration.
HAL_PWR_IO_RETENTION_JTAGIO IO retention mode is disabled for JTAG I/Os (PA13, PA14, PA15, and PB4).
HAL_PWR_IO_RETENTION_GPIO IO retention mode is disabled for all I/Os except the I/Os supporting the Standby functionality and JTAG I/Os.
HAL_PWR_IO_RETENTION_ALL IO retention mode is disabled for all I/Os.
-
hal_pwr_io_retention_status_t
HAL_PWR_LP_IsEnabledIORetention
(
hal_pwr_io_retention_t
io
)
¶
-
Check whether I/O retention in Standby mode is enabled.
- Parameters :
-
io – This parameter is an element of hal_pwr_io_retention_t enumeration.
HAL_PWR_IO_RETENTION_JTAGIO IO retention mode is enabled for JTAG I/Os (PA13, PA14, PA15, and PB4).
HAL_PWR_IO_RETENTION_GPIO IO retention mode is enabled for all I/Os except the I/Os supporting the Standby functionality and JTAG I/Os.
- Return values :
-
hal_pwr_io_retention_status_t – The I/O retention status.
- group PWR_Exported_Functions_Group7
-
This section provides functions to manage I/O retention in low power mode.
Call HAL_PWR_LP_EnableIORetention() to enable I/O (GPIO and/or JTAGIO) retention in Standby mode.
Call HAL_PWR_LP_DisableIORetention() to disable I/O (GPIO and/or JTAGIO) retention in Standby mode.
Call HAL_PWR_LP_IsEnabledIORetention() to check whether I/O (GPIO or JTAGIO) retention in Standby mode is enabled.
Functions
-
void
HAL_PWR_LP_EnableIORetention
(
hal_pwr_io_retention_t
io
)
-
Enable the IO retention in Standby mode.
Note
The output is sampled and applied to the output I/O during Standby mode.
- Parameters :
-
io – This parameter is an element or combination of elements of hal_pwr_io_retention_t enumeration.
HAL_PWR_IO_RETENTION_JTAGIO IO retention mode is enabled for JTAG I/Os (PA13, PA14, PA15, and PB4).
HAL_PWR_IO_RETENTION_GPIO IO retention mode is enabled for all I/Os except the I/Os supporting the Standby functionality and JTAG I/Os.
HAL_PWR_IO_RETENTION_ALL IO retention mode is enabled for all I/Os.
-
void
HAL_PWR_LP_DisableIORetention
(
hal_pwr_io_retention_t
io
)
-
Disable the IO retention in Standby mode.
- Parameters :
-
io – This parameter is an element of hal_pwr_io_retention_t enumeration.
HAL_PWR_IO_RETENTION_JTAGIO IO retention mode is disabled for JTAG I/Os (PA13, PA14, PA15, and PB4).
HAL_PWR_IO_RETENTION_GPIO IO retention mode is disabled for all I/Os except the I/Os supporting the Standby functionality and JTAG I/Os.
HAL_PWR_IO_RETENTION_ALL IO retention mode is disabled for all I/Os.
-
hal_pwr_io_retention_status_t
HAL_PWR_LP_IsEnabledIORetention
(
hal_pwr_io_retention_t
io
)
-
Check whether I/O retention in Standby mode is enabled.
- Parameters :
-
io – This parameter is an element of hal_pwr_io_retention_t enumeration.
HAL_PWR_IO_RETENTION_JTAGIO IO retention mode is enabled for JTAG I/Os (PA13, PA14, PA15, and PB4).
HAL_PWR_IO_RETENTION_GPIO IO retention mode is enabled for all I/Os except the I/Os supporting the Standby functionality and JTAG I/Os.
- Return values :
-
hal_pwr_io_retention_status_t – The I/O retention status.
- group PWR_Exported_Functions_Group7
-
This section provides functions to manage I/O retention in low power mode.
Call HAL_PWR_LP_EnableIORetention() to enable I/O (GPIO and/or JTAGIO) retention in Standby mode.
Call HAL_PWR_LP_DisableIORetention() to disable I/O (GPIO and/or JTAGIO) retention in Standby mode.
Call HAL_PWR_LP_IsEnabledIORetention() to check whether I/O (GPIO or JTAGIO) retention in Standby mode is enabled.
Functions
-
void
HAL_PWR_LP_EnableIORetention
(
hal_pwr_io_retention_t
io
)
-
Enable the IO retention in Standby mode.
Note
The output is sampled and applied to the output I/O during Standby mode.
- Parameters :
-
io – This parameter is an element or combination of elements of hal_pwr_io_retention_t enumeration.
HAL_PWR_IO_RETENTION_JTAGIO IO retention mode is enabled for JTAG I/Os (PA13, PA14, PA15, and PB4).
HAL_PWR_IO_RETENTION_GPIO IO retention mode is enabled for all I/Os except the I/Os supporting the Standby functionality and JTAG I/Os.
HAL_PWR_IO_RETENTION_ALL IO retention mode is enabled for all I/Os.
-
void
HAL_PWR_LP_DisableIORetention
(
hal_pwr_io_retention_t
io
)
-
Disable the IO retention in Standby mode.
- Parameters :
-
io – This parameter is an element of hal_pwr_io_retention_t enumeration.
HAL_PWR_IO_RETENTION_JTAGIO IO retention mode is disabled for JTAG I/Os (PA13, PA14, PA15, and PB4).
HAL_PWR_IO_RETENTION_GPIO IO retention mode is disabled for all I/Os except the I/Os supporting the Standby functionality and JTAG I/Os.
HAL_PWR_IO_RETENTION_ALL IO retention mode is disabled for all I/Os.
-
hal_pwr_io_retention_status_t
HAL_PWR_LP_IsEnabledIORetention
(
hal_pwr_io_retention_t
io
)
-
Check whether I/O retention in Standby mode is enabled.
- Parameters :
-
io – This parameter is an element of hal_pwr_io_retention_t enumeration.
HAL_PWR_IO_RETENTION_JTAGIO IO retention mode is enabled for JTAG I/Os (PA13, PA14, PA15, and PB4).
HAL_PWR_IO_RETENTION_GPIO IO retention mode is enabled for all I/Os except the I/Os supporting the Standby functionality and JTAG I/Os.
- Return values :
-
hal_pwr_io_retention_status_t – The I/O retention status.
Privilege management functions ¶
- group PWR_Exported_Functions_Group8
-
This section provides functions to manage privilege attributes.
Call HAL_PWR_SetPrivAttr() to set the privilege attribute.
Call HAL_PWR_GetPrivAttr() to get the privilege attribute.
Functions
-
hal_status_t
HAL_PWR_SetPrivAttr
(
uint32_t
item
,
hal_pwr_priv_attr_t
priv_attr
)
¶
-
Set privilege attribute.
- Parameters :
-
item – The item attribute to be configured.
priv_attr – This parameter is an element of hal_pwr_priv_attr_t enumeration:
HAL_PWR_PRIV Privileged attribute.
HAL_PWR_NPRIV Unprivileged attribute.
- Return values :
-
HAL_ERROR – The function is called in unprivileged mode.
HAL_OK – Privilege attribute has been correctly set.
-
hal_pwr_priv_attr_t
HAL_PWR_GetPrivAttr
(
uint32_t
item
)
¶
-
Get privilege attribute.
- Parameters :
-
item – The item attribute to be queried.
- Return values :
-
hal_pwr_priv_attr_t – This parameter is an element of hal_pwr_priv_attr_t enumeration.
- group PWR_Exported_Functions_Group8
-
This section provides functions to manage privilege attributes.
Call HAL_PWR_SetPrivAttr() to set the privilege attribute.
Call HAL_PWR_GetPrivAttr() to get the privilege attribute.
Functions
-
hal_status_t
HAL_PWR_SetPrivAttr
(
uint32_t
item
,
hal_pwr_priv_attr_t
priv_attr
)
-
Set privilege attribute.
- Parameters :
-
item – The item attribute to be configured.
priv_attr – This parameter is an element of hal_pwr_priv_attr_t enumeration:
HAL_PWR_PRIV Privileged attribute.
HAL_PWR_NPRIV Unprivileged attribute.
- Return values :
-
HAL_ERROR – The function is called in unprivileged mode.
HAL_OK – Privilege attribute has been correctly set.
-
hal_pwr_priv_attr_t
HAL_PWR_GetPrivAttr
(
uint32_t
item
)
-
Get privilege attribute.
- Parameters :
-
item – The item attribute to be queried.
- Return values :
-
hal_pwr_priv_attr_t – This parameter is an element of hal_pwr_priv_attr_t enumeration.
- group PWR_Exported_Functions_Group8
-
This section provides functions to manage privilege attributes.
Call HAL_PWR_SetPrivAttr() to set the privilege attribute.
Call HAL_PWR_GetPrivAttr() to get the privilege attribute.
Functions
-
hal_status_t
HAL_PWR_SetPrivAttr
(
uint32_t
item
,
hal_pwr_priv_attr_t
priv_attr
)
-
Set privilege attribute.
- Parameters :
-
item – The item attribute to be configured.
priv_attr – This parameter is an element of hal_pwr_priv_attr_t enumeration:
HAL_PWR_PRIV Privileged attribute.
HAL_PWR_NPRIV Unprivileged attribute.
- Return values :
-
HAL_ERROR – The function is called in unprivileged mode.
HAL_OK – Privilege attribute has been correctly set.
-
hal_pwr_priv_attr_t
HAL_PWR_GetPrivAttr
(
uint32_t
item
)
-
Get privilege attribute.
- Parameters :
-
item – The item attribute to be queried.
- Return values :
-
hal_pwr_priv_attr_t – This parameter is an element of hal_pwr_priv_attr_t enumeration.