2 ******************************************************************************
3 * @file stm32h7xx_ll_pwr.h
4 * @author MCD Application Team
5 * @brief Header file of PWR LL module.
6 ******************************************************************************
9 * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics.
10 * All rights reserved.</center></h2>
12 * This software component is licensed by ST under BSD 3-Clause license,
13 * the "License"; You may not use this file except in compliance with the
14 * License. You may obtain a copy of the License at:
15 * opensource.org/licenses/BSD-3-Clause
17 ******************************************************************************
20 /* Define to prevent recursive inclusion -------------------------------------*/
21 #ifndef STM32H7xx_LL_PWR_H
22 #define STM32H7xx_LL_PWR_H
28 /* Includes ------------------------------------------------------------------*/
29 #include "stm32h7xx.h"
31 /** @addtogroup STM32H7xx_LL_Driver
37 /** @defgroup PWR_LL PWR
41 /* Private types -------------------------------------------------------------*/
42 /* Private variables ---------------------------------------------------------*/
43 /* Private constants ---------------------------------------------------------*/
44 /** @defgroup PWR_LL_Private_Constants PWR Private Constants
48 /** @defgroup PWR_LL_WAKEUP_PIN_OFFSET Wake-Up Pins register offsets Defines
49 * @brief Flags defines which can be used with LL_PWR_WriteReg function
52 /* Wake-Up Pins PWR register offsets */
53 #define LL_PWR_WAKEUP_PINS_PULL_SHIFT_OFFSET 2UL
54 #define LL_PWR_WAKEUP_PINS_MAX_SHIFT_MASK 0x1FU
61 /* Private macros ------------------------------------------------------------*/
62 /* Exported types ------------------------------------------------------------*/
63 /* Exported constants --------------------------------------------------------*/
64 /** @defgroup PWR_LL_Exported_Constants PWR Exported Constants
68 /** @defgroup PWR_LL_EC_CLEAR_FLAG Clear Flags Defines
69 * @brief Flags defines which can be used with LL_PWR_WriteReg function
72 #define LL_PWR_FLAG_CPU_CSSF PWR_CPUCR_CSSF /*!< Clear flags for CPU */
73 #if defined (DUAL_CORE)
74 #define LL_PWR_FLAG_CPU2_CSSF PWR_CPU2CR_CSSF /*!< Clear flags for CPU2 */
75 #endif /* DUAL_CORE */
76 #define LL_PWR_FLAG_WKUPCR_WKUPC6 PWR_WKUPCR_WKUPC6 /*!< Clear PC1 WKUP flag */
77 #define LL_PWR_FLAG_WKUPCR_WKUPC5 PWR_WKUPCR_WKUPC5 /*!< Clear PI11 WKUP flag */
78 #define LL_PWR_FLAG_WKUPCR_WKUPC4 PWR_WKUPCR_WKUPC4 /*!< Clear PC13 WKUP flag */
79 #define LL_PWR_FLAG_WKUPCR_WKUPC3 PWR_WKUPCR_WKUPC3 /*!< Clear PI8 WKUP flag */
80 #define LL_PWR_FLAG_WKUPCR_WKUPC2 PWR_WKUPCR_WKUPC2 /*!< Clear PA2 WKUP flag */
81 #define LL_PWR_FLAG_WKUPCR_WKUPC1 PWR_WKUPCR_WKUPC1 /*!< Clear PA0 WKUP flag */
86 /** @defgroup PWR_LL_EC_GET_FLAG Get Flags Defines
87 * @brief Flags defines which can be used with LL_PWR_ReadReg function
90 #define LL_PWR_FLAG_AVDO PWR_CSR1_AVDO /*!< Analog voltage detector output on VDDA flag */
91 #define LL_PWR_FLAG_PVDO PWR_CSR1_PVDO /*!< Programmable voltage detect output flag */
92 #define LL_PWR_FLAG_ACTVOS PWR_CSR1_ACTVOS /*!< Current VOS applied for VCORE voltage scaling flag */
93 #define LL_PWR_FLAG_ACTVOSRDY PWR_CSR1_ACTVOSRDY /*!< Ready bit for current actual used VOS for VCORE voltage scaling flag */
94 #if defined (PWR_CSR1_MMCVDO)
95 #define LL_PWR_FLAG_MMCVDO PWR_CSR1_MMCVDO /*!< Voltage detector output on VDDMMC flag */
96 #endif /* PWR_CSR1_MMCVDO */
98 #define LL_PWR_FLAG_TEMPH PWR_CR2_TEMPH /*!< Temperature high threshold flag */
99 #define LL_PWR_FLAG_TEMPL PWR_CR2_TEMPL /*!< Temperature low threshold flag */
100 #define LL_PWR_FLAG_VBATH PWR_CR2_VBATH /*!< VBAT high threshold flag */
101 #define LL_PWR_FLAG_VBATL PWR_CR2_VBATL /*!< VBAT low threshold flag */
102 #define LL_PWR_FLAG_BRRDY PWR_CR2_BRRDY /*!< Backup Regulator ready flag */
104 #define LL_PWR_FLAG_USBRDY PWR_CR3_USB33RDY /*!< USB supply ready flag */
105 #define LL_PWR_FLAG_SMPSEXTRDY PWR_CR3_SMPSEXTRDY /*!< SMPS External supply ready flag */
107 #if defined (PWR_CPUCR_SBF_D2)
108 #define LL_PWR_FLAG_CPU_SBF_D2 PWR_CPUCR_SBF_D2 /*!< D2 domain DSTANDBY Flag */
109 #endif /* PWR_CPUCR_SBF_D2 */
110 #if defined (PWR_CPUCR_SBF_D1)
111 #define LL_PWR_FLAG_CPU_SBF_D1 PWR_CPUCR_SBF_D1 /*!< D1 domain DSTANDBY Flag */
112 #endif /* PWR_CPUCR_SBF_D1 */
113 #define LL_PWR_FLAG_CPU_SBF PWR_CPUCR_SBF /*!< System STANDBY Flag */
114 #define LL_PWR_FLAG_CPU_STOPF PWR_CPUCR_STOPF /*!< STOP Flag */
115 #if defined (DUAL_CORE)
116 #define LL_PWR_FLAG_CPU_HOLD2F PWR_CPUCR_HOLD2F /*!< CPU2 in hold wakeup flag */
117 #endif /* DUAL_CORE */
119 #if defined (DUAL_CORE)
120 #define LL_PWR_FLAG_CPU2_SBF_D2 PWR_CPU2CR_SBF_D2 /*!< D2 domain DSTANDBY Flag */
121 #define LL_PWR_FLAG_CPU2_SBF_D1 PWR_CPU2CR_SBF_D1 /*!< D1 domain DSTANDBY Flag */
122 #define LL_PWR_FLAG_CPU2_SBF PWR_CPU2CR_SBF /*!< System STANDBY Flag */
123 #define LL_PWR_FLAG_CPU2_STOPF PWR_CPU2CR_STOPF /*!< STOP Flag */
124 #define LL_PWR_FLAG_CPU2_HOLD1F PWR_CPU2CR_HOLD1F /*!< CPU1 in hold wakeup flag */
125 #endif /* DUAL_CORE */
127 #if defined (PWR_CPUCR_PDDS_D2)
128 #define LL_PWR_D3CR_VOSRDY PWR_D3CR_VOSRDY /*!< Voltage scaling ready flag */
130 #define LL_PWR_SRDCR_VOSRDY PWR_SRDCR_VOSRDY /*!< Voltage scaling ready flag */
131 #endif /* PWR_CPUCR_PDDS_D2 */
133 #define LL_PWR_WKUPFR_WKUPF6 PWR_WKUPFR_WKUPF6 /*!< Wakeup flag on PC1 */
134 #define LL_PWR_WKUPFR_WKUPF5 PWR_WKUPFR_WKUPF5 /*!< Wakeup flag on PI11 */
135 #define LL_PWR_WKUPFR_WKUPF4 PWR_WKUPFR_WKUPF4 /*!< Wakeup flag on PC13 */
136 #define LL_PWR_WKUPFR_WKUPF3 PWR_WKUPFR_WKUPF3 /*!< Wakeup flag on PI8 */
137 #define LL_PWR_WKUPFR_WKUPF2 PWR_WKUPFR_WKUPF2 /*!< Wakeup flag on PA2 */
138 #define LL_PWR_WKUPFR_WKUPF1 PWR_WKUPFR_WKUPF1 /*!< Wakeup flag on PA0 */
143 /** @defgroup PWR_LL_EC_MODE_PWR Power mode
146 #if defined (PWR_CPUCR_PDDS_D2)
147 #define LL_PWR_CPU_MODE_D1STOP 0x00000000U /*!< Enter D1 domain to Stop mode when the CPU enters deepsleep */
148 #define LL_PWR_CPU_MODE_D1STANDBY PWR_CPUCR_PDDS_D1 /*!< Enter D1 domain to Standby mode when the CPU enters deepsleep */
150 #define LL_PWR_CPU_MODE_CDSTOP 0x00000000U /*!< Enter CD domain to Stop mode when the CPU enters deepsleep */
151 #define LL_PWR_CPU_MODE_CDSTOP2 PWR_CPUCR_RETDS_CD /*!< Enter CD domain to Stop2 mode when the CPU enters deepsleep */
152 #endif /* PWR_CPUCR_PDDS_D2 */
154 #if defined (PWR_CPUCR_PDDS_D2)
155 #define LL_PWR_CPU_MODE_D2STOP 0x00000000U /*!< Enter D2 domain to Stop mode when the CPU enters deepsleep */
156 #define LL_PWR_CPU_MODE_D2STANDBY PWR_CPUCR_PDDS_D2 /*!< Enter D2 domain to Standby mode when the CPU enters deepsleep */
157 #endif /* PWR_CPUCR_PDDS_D2 */
159 #if defined (PWR_CPUCR_PDDS_D2)
160 #define LL_PWR_CPU_MODE_D3RUN PWR_CPUCR_RUN_D3 /*!< Keep system D3 domain in Run mode when the CPU enter deepsleep */
161 #define LL_PWR_CPU_MODE_D3STOP 0x00000000U /*!< Enter D3 domain to Stop mode when the CPU enters deepsleep */
162 #define LL_PWR_CPU_MODE_D3STANDBY PWR_CPUCR_PDDS_D3 /*!< Enter D3 domain to Standby mode when the CPU enters deepsleep */
164 #define LL_PWR_CPU_MODE_SRDRUN PWR_CPUCR_RUN_SRD /*!< Keep system SRD domain in Run mode when the CPU enter deepsleep */
165 #define LL_PWR_CPU_MODE_SRDSTOP 0x00000000U /*!< Enter SRD domain to Stop mode when the CPU enters deepsleep */
166 #define LL_PWR_CPU_MODE_SRDSTANDBY PWR_CPUCR_PDDS_SRD /*!< Enter SRD domain to Standby mode when the CPU enters deepsleep */
167 #endif /* PWR_CPUCR_PDDS_D2 */
169 #if defined (DUAL_CORE)
170 #define LL_PWR_CPU2_MODE_D1STOP 0x00000000U /*!< Enter D1 domain to Stop mode when the CPU2 enters deepsleep */
171 #define LL_PWR_CPU2_MODE_D1STANDBY PWR_CPU2CR_PDDS_D1 /*!< Enter D1 domain to Standby mode when the CPU2 enters deepsleep */
172 #define LL_PWR_CPU2_MODE_D2STOP 0x00000000U /*!< Enter D2 domain to Stop mode when the CPU2 enters deepsleep */
173 #define LL_PWR_CPU2_MODE_D2STANDBY PWR_CPU2CR_PDDS_D2 /*!< Enter D2 domain to Standby mode when the CPU2 enters deepsleep */
174 #define LL_PWR_CPU2_MODE_D3RUN PWR_CPU2CR_RUN_D3 /*!< Keep system D3 domain in RUN mode when the CPU2 enter deepsleep */
175 #define LL_PWR_CPU2_MODE_D3STOP 0x00000000U /*!< Enter D3 domain to Stop mode when the CPU2 enters deepsleep */
176 #define LL_PWR_CPU2_MODE_D3STANDBY PWR_CPU2CR_PDDS_D3 /*!< Enter D3 domain to Standby mode when the CPU2 enter deepsleep */
177 #endif /* DUAL_CORE */
182 /** @defgroup PWR_LL_EC_REGU_VOLTAGE Run mode Regulator Voltage Scaling
185 #if defined (PWR_CPUCR_PDDS_D2)
186 #define LL_PWR_REGU_VOLTAGE_SCALE3 PWR_D3CR_VOS_0 /*!< Select voltage scale 3 */
187 #define LL_PWR_REGU_VOLTAGE_SCALE2 PWR_D3CR_VOS_1 /*!< Select voltage scale 2 */
188 #define LL_PWR_REGU_VOLTAGE_SCALE1 (PWR_D3CR_VOS_0 | PWR_D3CR_VOS_1) /*!< Select voltage scale 1 */
189 #define LL_PWR_REGU_VOLTAGE_SCALE0 (PWR_D3CR_VOS_0 | PWR_D3CR_VOS_1) /*!< Select voltage scale 0 */
191 #define LL_PWR_REGU_VOLTAGE_SCALE3 0x00000000U /*!< Select voltage scale 3 */
192 #define LL_PWR_REGU_VOLTAGE_SCALE2 PWR_D3CR_VOS_0 /*!< Select voltage scale 2 */
193 #define LL_PWR_REGU_VOLTAGE_SCALE1 PWR_D3CR_VOS_1 /*!< Select voltage scale 1 */
194 #define LL_PWR_REGU_VOLTAGE_SCALE0 (PWR_D3CR_VOS_0 | PWR_D3CR_VOS_1) /*!< Select voltage scale 0 */
195 #endif /* PWR_CPUCR_PDDS_D2 */
200 /** @defgroup PWR_LL_EC_STOP_MODE_REGU_VOLTAGE Stop mode Regulator Voltage Scaling
203 #define LL_PWR_REGU_VOLTAGE_SVOS_SCALE5 PWR_CR1_SVOS_0 /*!< Select voltage scale 5 when system enters STOP mode */
204 #define LL_PWR_REGU_VOLTAGE_SVOS_SCALE4 PWR_CR1_SVOS_1 /*!< Select voltage scale 4 when system enters STOP mode */
205 #define LL_PWR_REGU_VOLTAGE_SVOS_SCALE3 (PWR_CR1_SVOS_0 | PWR_CR1_SVOS_1) /*!< Select voltage scale 3 when system enters STOP mode */
210 /** @defgroup PWR_LL_EC_REGU_MODE_DS_MODE Regulator Mode In Deep Sleep Mode
213 #define LL_PWR_REGU_DSMODE_MAIN 0x00000000U /*!< Voltage Regulator in main mode during deepsleep mode */
214 #define LL_PWR_REGU_DSMODE_LOW_POWER PWR_CR1_LPDS /*!< Voltage Regulator in low-power mode during deepsleep mode */
219 /** @defgroup PWR_LL_EC_PVDLEVEL Power Digital Voltage Level Detector
222 #define LL_PWR_PVDLEVEL_0 PWR_CR1_PLS_LEV0 /*!< Voltage threshold detected by PVD 1.95 V */
223 #define LL_PWR_PVDLEVEL_1 PWR_CR1_PLS_LEV1 /*!< Voltage threshold detected by PVD 2.1 V */
224 #define LL_PWR_PVDLEVEL_2 PWR_CR1_PLS_LEV2 /*!< Voltage threshold detected by PVD 2.25 V */
225 #define LL_PWR_PVDLEVEL_3 PWR_CR1_PLS_LEV3 /*!< Voltage threshold detected by PVD 2.4 V */
226 #define LL_PWR_PVDLEVEL_4 PWR_CR1_PLS_LEV4 /*!< Voltage threshold detected by PVD 2.55 V */
227 #define LL_PWR_PVDLEVEL_5 PWR_CR1_PLS_LEV5 /*!< Voltage threshold detected by PVD 2.7 V */
228 #define LL_PWR_PVDLEVEL_6 PWR_CR1_PLS_LEV6 /*!< Voltage threshold detected by PVD 2.85 V */
229 #define LL_PWR_PVDLEVEL_7 PWR_CR1_PLS_LEV7 /*!< External voltage level on PVD_IN pin, compared to internal VREFINT level. */
234 /** @defgroup PWR_LL_EC_AVDLEVEL Power Analog Voltage Level Detector
237 #define LL_PWR_AVDLEVEL_0 PWR_CR1_ALS_LEV0 /*!< Analog Voltage threshold detected by AVD 1.7 V */
238 #define LL_PWR_AVDLEVEL_1 PWR_CR1_ALS_LEV1 /*!< Analog Voltage threshold detected by AVD 2.1 V */
239 #define LL_PWR_AVDLEVEL_2 PWR_CR1_ALS_LEV2 /*!< Analog Voltage threshold detected by AVD 2.5 V */
240 #define LL_PWR_AVDLEVEL_3 PWR_CR1_ALS_LEV3 /*!< Analog Voltage threshold detected by AVD 2.8 V */
246 /** @defgroup PWR_LL_EC_BATT_CHARG_RESISTOR Battery Charge Resistor
249 #define LL_PWR_BATT_CHARG_RESISTOR_5K 0x00000000U /*!< Charge the Battery through a 5 kO resistor */
250 #define LL_PWR_BATT_CHARGRESISTOR_1_5K PWR_CR3_VBRS /*!< Charge the Battery through a 1.5 kO resistor */
255 /** @defgroup PWR_LL_EC_WAKEUP_PIN Wakeup Pins
258 #define LL_PWR_WAKEUP_PIN1 PWR_WKUPEPR_WKUPEN1 /*!< Wake-Up pin 1 : PA0 */
259 #define LL_PWR_WAKEUP_PIN2 PWR_WKUPEPR_WKUPEN2 /*!< Wake-Up pin 2 : PA2 */
260 #define LL_PWR_WAKEUP_PIN3 PWR_WKUPEPR_WKUPEN3 /*!< Wake-Up pin 3 : PI8 */
261 #define LL_PWR_WAKEUP_PIN4 PWR_WKUPEPR_WKUPEN4 /*!< Wake-Up pin 4 : PC13 */
262 #define LL_PWR_WAKEUP_PIN5 PWR_WKUPEPR_WKUPEN5 /*!< Wake-Up pin 5 : PI11 */
263 #define LL_PWR_WAKEUP_PIN6 PWR_WKUPEPR_WKUPEN6 /*!< Wake-Up pin 6 : PC1 */
268 /** @defgroup PWR_LL_EC_WAKEUP_PIN_PULL Wakeup Pins pull configuration
271 #define LL_PWR_WAKEUP_PIN_NOPULL 0x00000000UL /*!< Configure Wake-Up pin in no pull */
272 #define LL_PWR_WAKEUP_PIN_PULLUP 0x00000001UL /*!< Configure Wake-Up pin in pull Up */
273 #define LL_PWR_WAKEUP_PIN_PULLDOWN 0x00000002UL /*!< Configure Wake-Up pin in pull Down */
278 /** @defgroup PWR_LL_EC_SUPPLY_PWR Power supply source configuration
281 #define LL_PWR_LDO_SUPPLY PWR_CR3_LDOEN /*!< Core domains are suppplied from the LDO */
283 #define LL_PWR_DIRECT_SMPS_SUPPLY PWR_CR3_SMPSEN /*!< Core domains are suppplied from the SMPS */
284 #define LL_PWR_SMPS_1V8_SUPPLIES_LDO (PWR_CR3_SMPSLEVEL_0 | PWR_CR3_SMPSEN | PWR_CR3_LDOEN) /*!< The SMPS 1.8V output supplies the LDO which supplies the Core domains */
285 #define LL_PWR_SMPS_2V5_SUPPLIES_LDO (PWR_CR3_SMPSLEVEL_1 | PWR_CR3_SMPSEN | PWR_CR3_LDOEN) /*!< The SMPS 2.5V output supplies the LDO which supplies the Core domains */
286 #define LL_PWR_SMPS_1V8_SUPPLIES_EXT_AND_LDO (PWR_CR3_SMPSLEVEL_0 | PWR_CR3_SMPSEXTHP | PWR_CR3_SMPSEN | PWR_CR3_LDOEN) /*!< The SMPS 1.8V output supplies an external circuits and the LDO. The Core domains are suppplied from the LDO */
287 #define LL_PWR_SMPS_2V5_SUPPLIES_EXT_AND_LDO (PWR_CR3_SMPSLEVEL_1 | PWR_CR3_SMPSEXTHP | PWR_CR3_SMPSEN | PWR_CR3_LDOEN) /*!< The SMPS 2.5V output supplies an external circuits and the LDO. The Core domains are suppplied from the LDO */
288 #define LL_PWR_SMPS_1V8_SUPPLIES_EXT (PWR_CR3_SMPSLEVEL_0 | PWR_CR3_SMPSEXTHP | PWR_CR3_SMPSEN | PWR_CR3_BYPASS) /*!< The SMPS 1.8V output supplies an external source which supplies the Core domains */
289 #define LL_PWR_SMPS_2V5_SUPPLIES_EXT (PWR_CR3_SMPSLEVEL_1 | PWR_CR3_SMPSEXTHP | PWR_CR3_SMPSEN | PWR_CR3_BYPASS) /*!< The SMPS 2.5V output supplies an external source which supplies the Core domains */
291 #define LL_PWR_EXTERNAL_SOURCE_SUPPLY PWR_CR3_BYPASS /*!< The SMPS and the LDO are Bypassed. The Core domains are supplied from an external source */
299 /* Exported macro ------------------------------------------------------------*/
300 /** @defgroup PWR_LL_Exported_Macros PWR Exported Macros
304 /** @defgroup PWR_LL_EM_WRITE_READ Common write and read registers Macros
309 * @brief Write a value in PWR register
310 * @param __REG__ Register to be written
311 * @param __VALUE__ Value to be written in the register
314 #define LL_PWR_WriteReg(__REG__, __VALUE__) WRITE_REG(PWR->__REG__, (__VALUE__))
317 * @brief Read a value in PWR register
318 * @param __REG__ Register to be read
319 * @retval Register value
321 #define LL_PWR_ReadReg(__REG__) READ_REG(PWR->__REG__)
329 /* Exported functions --------------------------------------------------------*/
330 /** @defgroup PWR_LL_Exported_Functions PWR Exported Functions
334 /** @defgroup PWR_LL_EF_Configuration Configuration
339 * @brief Set the voltage Regulator mode during deep sleep mode
340 * @rmtoll CR1 LPDS LL_PWR_SetRegulModeDS
341 * @param RegulMode This parameter can be one of the following values:
342 * @arg @ref LL_PWR_REGU_DSMODE_MAIN
343 * @arg @ref LL_PWR_REGU_DSMODE_LOW_POWER
346 __STATIC_INLINE
void LL_PWR_SetRegulModeDS(uint32_t RegulMode
)
348 MODIFY_REG(PWR
->CR1
, PWR_CR1_LPDS
, RegulMode
);
352 * @brief Get the voltage Regulator mode during deep sleep mode
353 * @rmtoll CR1 LPDS LL_PWR_GetRegulModeDS
354 * @retval Returned value can be one of the following values:
355 * @arg @ref LL_PWR_REGU_DSMODE_MAIN
356 * @arg @ref LL_PWR_REGU_DSMODE_LOW_POWER
358 __STATIC_INLINE
uint32_t LL_PWR_GetRegulModeDS(void)
360 return (uint32_t)(READ_BIT(PWR
->CR1
, PWR_CR1_LPDS
));
364 * @brief Enable Power Voltage Detector
365 * @rmtoll CR1 PVDEN LL_PWR_EnablePVD
368 __STATIC_INLINE
void LL_PWR_EnablePVD(void)
370 SET_BIT(PWR
->CR1
, PWR_CR1_PVDEN
);
374 * @brief Disable Power Voltage Detector
375 * @rmtoll CR1 PVDEN LL_PWR_DisablePVD
378 __STATIC_INLINE
void LL_PWR_DisablePVD(void)
380 CLEAR_BIT(PWR
->CR1
, PWR_CR1_PVDEN
);
384 * @brief Check if Power Voltage Detector is enabled
385 * @rmtoll CR1 PVDEN LL_PWR_IsEnabledPVD
386 * @retval State of bit (1 or 0).
388 __STATIC_INLINE
uint32_t LL_PWR_IsEnabledPVD(void)
390 return ((READ_BIT(PWR
->CR1
, PWR_CR1_PVDEN
) == (PWR_CR1_PVDEN
)) ? 1UL : 0UL);
394 * @brief Configure the voltage threshold detected by the Power Voltage Detector
395 * @rmtoll CR1 PLS LL_PWR_SetPVDLevel
396 * @param PVDLevel This parameter can be one of the following values:
397 * @arg @ref LL_PWR_PVDLEVEL_0
398 * @arg @ref LL_PWR_PVDLEVEL_1
399 * @arg @ref LL_PWR_PVDLEVEL_2
400 * @arg @ref LL_PWR_PVDLEVEL_3
401 * @arg @ref LL_PWR_PVDLEVEL_4
402 * @arg @ref LL_PWR_PVDLEVEL_5
403 * @arg @ref LL_PWR_PVDLEVEL_6
404 * @arg @ref LL_PWR_PVDLEVEL_7
407 __STATIC_INLINE
void LL_PWR_SetPVDLevel(uint32_t PVDLevel
)
409 MODIFY_REG(PWR
->CR1
, PWR_CR1_PLS
, PVDLevel
);
413 * @brief Get the voltage threshold detection
414 * @rmtoll CR1 PLS LL_PWR_GetPVDLevel
415 * @retval Returned value can be one of the following values:
416 * @arg @ref LL_PWR_PVDLEVEL_0
417 * @arg @ref LL_PWR_PVDLEVEL_1
418 * @arg @ref LL_PWR_PVDLEVEL_2
419 * @arg @ref LL_PWR_PVDLEVEL_3
420 * @arg @ref LL_PWR_PVDLEVEL_4
421 * @arg @ref LL_PWR_PVDLEVEL_5
422 * @arg @ref LL_PWR_PVDLEVEL_6
423 * @arg @ref LL_PWR_PVDLEVEL_7
425 __STATIC_INLINE
uint32_t LL_PWR_GetPVDLevel(void)
427 return (uint32_t)(READ_BIT(PWR
->CR1
, PWR_CR1_PLS
));
431 * @brief Enable access to the backup domain
432 * @rmtoll CR1 DBP LL_PWR_EnableBkUpAccess
435 __STATIC_INLINE
void LL_PWR_EnableBkUpAccess(void)
437 SET_BIT(PWR
->CR1
, PWR_CR1_DBP
);
441 * @brief Disable access to the backup domain
442 * @rmtoll CR1 DBP LL_PWR_DisableBkUpAccess
445 __STATIC_INLINE
void LL_PWR_DisableBkUpAccess(void)
447 CLEAR_BIT(PWR
->CR1
, PWR_CR1_DBP
);
451 * @brief Check if the backup domain is enabled
452 * @rmtoll CR1 DBP LL_PWR_IsEnabledBkUpAccess
453 * @retval State of bit (1 or 0).
455 __STATIC_INLINE
uint32_t LL_PWR_IsEnabledBkUpAccess(void)
457 return ((READ_BIT(PWR
->CR1
, PWR_CR1_DBP
) == (PWR_CR1_DBP
)) ? 1UL : 0UL);
461 * @brief Enable the Flash Power Down in Stop Mode
462 * @rmtoll CR1 FLPS LL_PWR_EnableFlashPowerDown
465 __STATIC_INLINE
void LL_PWR_EnableFlashPowerDown(void)
467 SET_BIT(PWR
->CR1
, PWR_CR1_FLPS
);
471 * @brief Disable the Flash Power Down in Stop Mode
472 * @rmtoll CR1 FLPS LL_PWR_DisableFlashPowerDown
475 __STATIC_INLINE
void LL_PWR_DisableFlashPowerDown(void)
477 CLEAR_BIT(PWR
->CR1
, PWR_CR1_FLPS
);
481 * @brief Check if the Flash Power Down in Stop Mode is enabled
482 * @rmtoll CR1 FLPS LL_PWR_IsEnabledFlashPowerDown
483 * @retval State of bit (1 or 0).
485 __STATIC_INLINE
uint32_t LL_PWR_IsEnabledFlashPowerDown(void)
487 return ((READ_BIT(PWR
->CR1
, PWR_CR1_FLPS
) == (PWR_CR1_FLPS
)) ? 1UL : 0UL);
490 #if defined (PWR_CR1_BOOSTE)
492 * @brief Enable the Analog Voltage Booster (VDDA)
493 * @rmtoll CR1 BOOSTE LL_PWR_EnableAnalogBooster
496 __STATIC_INLINE
void LL_PWR_EnableAnalogBooster(void)
498 SET_BIT(PWR
->CR1
, PWR_CR1_BOOSTE
);
502 * @brief Disable the Analog Voltage Booster (VDDA)
503 * @rmtoll CR1 BOOSTE LL_PWR_DisableAnalogBooster
506 __STATIC_INLINE
void LL_PWR_DisableAnalogBooster(void)
508 CLEAR_BIT(PWR
->CR1
, PWR_CR1_BOOSTE
);
512 * @brief Check if the Analog Voltage Booster (VDDA) is enabled
513 * @rmtoll CR1 BOOSTE LL_PWR_IsEnabledAnalogBooster
514 * @retval State of bit (1 or 0).
516 __STATIC_INLINE
uint32_t LL_PWR_IsEnabledAnalogBooster(void)
518 return ((READ_BIT(PWR
->CR1
, PWR_CR1_BOOSTE
) == (PWR_CR1_BOOSTE
)) ? 1UL : 0UL);
520 #endif /* PWR_CR1_BOOSTE */
522 #if defined (PWR_CR1_AVD_READY)
524 * @brief Enable the Analog Voltage Ready to isolate the BOOST IP untill VDDA will be ready
525 * @rmtoll CR1 AVD_READY LL_PWR_EnableAnalogVoltageReady
528 __STATIC_INLINE
void LL_PWR_EnableAnalogVoltageReady(void)
530 SET_BIT(PWR
->CR1
, PWR_CR1_AVD_READY
);
534 * @brief Disable the Analog Voltage Ready (VDDA)
535 * @rmtoll CR1 AVD_READY LL_PWR_DisableAnalogVoltageReady
538 __STATIC_INLINE
void LL_PWR_DisableAnalogVoltageReady(void)
540 CLEAR_BIT(PWR
->CR1
, PWR_CR1_AVD_READY
);
544 * @brief Check if the Analog Voltage Booster (VDDA) is enabled
545 * @rmtoll CR1 AVD_READY LL_PWR_IsEnabledAnalogVoltageReady
546 * @retval State of bit (1 or 0).
548 __STATIC_INLINE
uint32_t LL_PWR_IsEnabledAnalogVoltageReady(void)
550 return ((READ_BIT(PWR
->CR1
, PWR_CR1_AVD_READY
) == (PWR_CR1_AVD_READY
)) ? 1UL : 0UL);
552 #endif /* PWR_CR1_AVD_READY */
555 * @brief Set the internal Regulator output voltage in STOP mode
556 * @rmtoll CR1 SVOS LL_PWR_SetStopModeRegulVoltageScaling
557 * @param VoltageScaling This parameter can be one of the following values:
558 * @arg @ref LL_PWR_REGU_VOLTAGE_SVOS_SCALE3
559 * @arg @ref LL_PWR_REGU_VOLTAGE_SVOS_SCALE4
560 * @arg @ref LL_PWR_REGU_VOLTAGE_SVOS_SCALE5
563 __STATIC_INLINE
void LL_PWR_SetStopModeRegulVoltageScaling(uint32_t VoltageScaling
)
565 MODIFY_REG(PWR
->CR1
, PWR_CR1_SVOS
, VoltageScaling
);
569 * @brief Get the internal Regulator output voltage in STOP mode
570 * @rmtoll CR1 SVOS LL_PWR_GetStopModeRegulVoltageScaling
571 * @retval Returned value can be one of the following values:
572 * @arg @ref LL_PWR_REGU_VOLTAGE_SVOS_SCALE3
573 * @arg @ref LL_PWR_REGU_VOLTAGE_SVOS_SCALE4
574 * @arg @ref LL_PWR_REGU_VOLTAGE_SVOS_SCALE5
576 __STATIC_INLINE
uint32_t LL_PWR_GetStopModeRegulVoltageScaling(void)
578 return (uint32_t)(READ_BIT(PWR
->CR1
, PWR_CR1_SVOS
));
582 * @brief Enable Analog Power Voltage Detector
583 * @rmtoll CR1 AVDEN LL_PWR_EnableAVD
586 __STATIC_INLINE
void LL_PWR_EnableAVD(void)
588 SET_BIT(PWR
->CR1
, PWR_CR1_AVDEN
);
592 * @brief Disable Analog Power Voltage Detector
593 * @rmtoll CR1 AVDEN LL_PWR_DisableAVD
596 __STATIC_INLINE
void LL_PWR_DisableAVD(void)
598 CLEAR_BIT(PWR
->CR1
, PWR_CR1_AVDEN
);
602 * @brief Check if Analog Power Voltage Detector is enabled
603 * @rmtoll CR1 AVDEN LL_PWR_IsEnabledAVD
604 * @retval State of bit (1 or 0).
606 __STATIC_INLINE
uint32_t LL_PWR_IsEnabledAVD(void)
608 return ((READ_BIT(PWR
->CR1
, PWR_CR1_AVDEN
) == (PWR_CR1_AVDEN
)) ? 1UL : 0UL);
612 * @brief Configure the voltage threshold to be detected by the Analog Power Voltage Detector
613 * @rmtoll CR1 ALS LL_PWR_SetAVDLevel
614 * @param AVDLevel This parameter can be one of the following values:
615 * @arg @ref LL_PWR_AVDLEVEL_0
616 * @arg @ref LL_PWR_AVDLEVEL_1
617 * @arg @ref LL_PWR_AVDLEVEL_2
618 * @arg @ref LL_PWR_AVDLEVEL_3
621 __STATIC_INLINE
void LL_PWR_SetAVDLevel(uint32_t AVDLevel
)
623 MODIFY_REG(PWR
->CR1
, PWR_CR1_ALS
, AVDLevel
);
627 * @brief Get the Analog Voltage threshold to be detected by the Analog Power Voltage Detector
628 * @rmtoll CR1 ALS LL_PWR_GetAVDLevel
629 * @retval Returned value can be one of the following values:
630 * @arg @ref LL_PWR_AVDLEVEL_0
631 * @arg @ref LL_PWR_AVDLEVEL_1
632 * @arg @ref LL_PWR_AVDLEVEL_2
633 * @arg @ref LL_PWR_AVDLEVEL_3
635 __STATIC_INLINE
uint32_t LL_PWR_GetAVDLevel(void)
637 return (uint32_t)(READ_BIT(PWR
->CR1
, PWR_CR1_ALS
));
640 #if defined (PWR_CR1_AXIRAM1SO)
642 * @brief Enable the AXI RAM1 shut-off in DStop/DStop2 mode
643 * @rmtoll CR1 AXIRAM1SO LL_PWR_EnableAXIRAM1ShutOff
646 __STATIC_INLINE
void LL_PWR_EnableAXIRAM1ShutOff(void)
648 SET_BIT(PWR
->CR1
, PWR_CR1_AXIRAM1SO
);
652 * @brief Disable the AXI RAM1 shut-off in DStop/DStop2 mode
653 * @rmtoll CR1 AXIRAM1SO LL_PWR_DisableAXIRAM1ShutOff
656 __STATIC_INLINE
void LL_PWR_DisableAXIRAM1ShutOff(void)
658 CLEAR_BIT(PWR
->CR1
, PWR_CR1_AXIRAM1SO
);
662 * @brief Check if the AXI RAM1 shut-off in DStop/DStop2 mode is enabled
663 * @rmtoll CR1 AXIRAM1SO LL_PWR_IsEnabledAXIRAM1ShutOff
664 * @retval State of bit (1 or 0).
666 __STATIC_INLINE
uint32_t LL_PWR_IsEnabledAXIRAM1ShutOff(void)
668 return ((READ_BIT(PWR
->CR1
, PWR_CR1_AXIRAM1SO
) == (PWR_CR1_AXIRAM1SO
)) ? 1UL : 0UL);
670 #endif /* PWR_CR1_AXIRAM1SO */
672 #if defined (PWR_CR1_AXIRAM2SO)
674 * @brief Enable the AXI RAM2 shut-off in DStop/DStop2 mode
675 * @rmtoll CR1 AXIRAM2SO LL_PWR_EnableAXIRAM2ShutOff
678 __STATIC_INLINE
void LL_PWR_EnableAXIRAM2ShutOff(void)
680 SET_BIT(PWR
->CR1
, PWR_CR1_AXIRAM2SO
);
684 * @brief Disable the AXI RAM2 shut-off in DStop/DStop2 mode
685 * @rmtoll CR1 AXIRAM2SO LL_PWR_DisableAXIRAM2ShutOff
688 __STATIC_INLINE
void LL_PWR_DisableAXIRAM2ShutOff(void)
690 CLEAR_BIT(PWR
->CR1
, PWR_CR1_AXIRAM2SO
);
694 * @brief Check if the AXI RAM2 shut-off in DStop/DStop2 mode is enabled
695 * @rmtoll CR1 AXIRAM2SO LL_PWR_IsEnabledAXIRAM2ShutOff
696 * @retval State of bit (1 or 0).
698 __STATIC_INLINE
uint32_t LL_PWR_IsEnabledAXIRAM2ShutOff(void)
700 return ((READ_BIT(PWR
->CR1
, PWR_CR1_AXIRAM2SO
) == (PWR_CR1_AXIRAM2SO
)) ? 1UL : 0UL);
702 #endif /* PWR_CR1_AXIRAM2SO */
704 #if defined (PWR_CR1_AXIRAM3SO)
706 * @brief Enable the AXI RAM3 shut-off in DStop/DStop2 mode
707 * @rmtoll CR1 AXIRAM3SO LL_PWR_EnableAXIRAM3ShutOff
710 __STATIC_INLINE
void LL_PWR_EnableAXIRAM3ShutOff(void)
712 SET_BIT(PWR
->CR1
, PWR_CR1_AXIRAM3SO
);
716 * @brief Disable the AXI RAM3 shut-off in DStop/DStop2 mode
717 * @rmtoll CR1 AXIRAM3SO LL_PWR_DisableAXIRAM3ShutOff
720 __STATIC_INLINE
void LL_PWR_DisableAXIRAM3ShutOff(void)
722 CLEAR_BIT(PWR
->CR1
, PWR_CR1_AXIRAM3SO
);
726 * @brief Check if the AXI RAM3 shut-off in DStop/DStop2 mode is enabled
727 * @rmtoll CR1 AXIRAM3SO LL_PWR_IsEnabledAXIRAM3ShutOff
728 * @retval State of bit (1 or 0).
730 __STATIC_INLINE
uint32_t LL_PWR_IsEnabledAXIRAM3ShutOff(void)
732 return ((READ_BIT(PWR
->CR1
, PWR_CR1_AXIRAM3SO
) == (PWR_CR1_AXIRAM3SO
)) ? 1UL : 0UL);
734 #endif /* PWR_CR1_AXIRAM3SO */
736 #if defined (PWR_CR1_AHBRAM1SO)
738 * @brief Enable the AHB RAM1 shut-off in DStop/DStop2 mode
739 * @rmtoll CR1 AHBRAM1SO LL_PWR_EnableAHBRAM1ShutOff
742 __STATIC_INLINE
void LL_PWR_EnableAHBRAM1ShutOff(void)
744 SET_BIT(PWR
->CR1
, PWR_CR1_AHBRAM1SO
);
748 * @brief Disable the AHB RAM1 shut-off in DStop/DStop2 mode
749 * @rmtoll CR1 AHBRAM1SO LL_PWR_DisableAHBRAM1ShutOff
752 __STATIC_INLINE
void LL_PWR_DisableAHBRAM1ShutOff(void)
754 CLEAR_BIT(PWR
->CR1
, PWR_CR1_AHBRAM1SO
);
758 * @brief Check if the AHB RAM1 shut-off in DStop/DStop2 mode is enabled
759 * @rmtoll CR1 AHBRAM1SO LL_PWR_IsEnabledAHBRAM1ShutOff
760 * @retval State of bit (1 or 0).
762 __STATIC_INLINE
uint32_t LL_PWR_IsEnabledAHBRAM1ShutOff(void)
764 return ((READ_BIT(PWR
->CR1
, PWR_CR1_AHBRAM1SO
) == (PWR_CR1_AHBRAM1SO
)) ? 1UL : 0UL);
766 #endif /* PWR_CR1_AHBRAM1SO */
768 #if defined (PWR_CR1_AHBRAM2SO)
770 * @brief Enable the AHB RAM2 shut-off in DStop/DStop2 mode
771 * @rmtoll CR1 AHBRAM2SO LL_PWR_EnableAHBRAM2ShutOff
774 __STATIC_INLINE
void LL_PWR_EnableAHBRAM2ShutOff(void)
776 SET_BIT(PWR
->CR1
, PWR_CR1_AHBRAM2SO
);
780 * @brief Disable the AHB RAM2 shut-off in DStop/DStop2 mode
781 * @rmtoll CR1 AHBRAM2SO LL_PWR_DisableAHBRAM2ShutOff
784 __STATIC_INLINE
void LL_PWR_DisableAHBRAM2ShutOff(void)
786 CLEAR_BIT(PWR
->CR1
, PWR_CR1_AHBRAM2SO
);
790 * @brief Check if the AHB RAM2 shut-off in DStop/DStop2 mode is enabled
791 * @rmtoll CR1 AHBRAM2SO LL_PWR_IsEnabledAHBRAM2ShutOff
792 * @retval State of bit (1 or 0).
794 __STATIC_INLINE
uint32_t LL_PWR_IsEnabledAHBRAM2ShutOff(void)
796 return ((READ_BIT(PWR
->CR1
, PWR_CR1_AHBRAM2SO
) == (PWR_CR1_AHBRAM2SO
)) ? 1UL : 0UL);
798 #endif /* PWR_CR1_AHBRAM2SO */
800 #if defined (PWR_CR1_ITCMSO)
802 * @brief Enable the ITCM shut-off in DStop/DStop2 mode
803 * @rmtoll CR1 ITCMSO LL_PWR_EnableITCMSOShutOff
806 __STATIC_INLINE
void LL_PWR_EnableITCMSOShutOff(void)
808 SET_BIT(PWR
->CR1
, PWR_CR1_ITCMSO
);
812 * @brief Disable the ITCM shut-off in DStop/DStop2 mode
813 * @rmtoll CR1 ITCMSO LL_PWR_DisableITCMSOShutOff
816 __STATIC_INLINE
void LL_PWR_DisableITCMSOShutOff(void)
818 CLEAR_BIT(PWR
->CR1
, PWR_CR1_ITCMSO
);
822 * @brief Check if the ITCM shut-off in DStop/DStop2 mode is enabled
823 * @rmtoll CR1 ITCMSO LL_PWR_IsEnabledITCMShutOff
824 * @retval State of bit (1 or 0).
826 __STATIC_INLINE
uint32_t LL_PWR_IsEnabledITCMShutOff(void)
828 return ((READ_BIT(PWR
->CR1
, PWR_CR1_ITCMSO
) == (PWR_CR1_ITCMSO
)) ? 1UL : 0UL);
830 #endif /* PWR_CR1_ITCMSO */
832 #if defined (PWR_CR1_HSITFSO)
834 * @brief Enable the USB and FDCAN shut-off in DStop/DStop2 mode
835 * @rmtoll CR1 HSITFSO LL_PWR_EnableHSITFShutOff
838 __STATIC_INLINE
void LL_PWR_EnableHSITFShutOff(void)
840 SET_BIT(PWR
->CR1
, PWR_CR1_HSITFSO
);
844 * @brief Disable the USB and FDCAN shut-off in DStop/DStop2 mode
845 * @rmtoll CR1 HSITFSO LL_PWR_DisableHSITFShutOff
848 __STATIC_INLINE
void LL_PWR_DisableHSITFShutOff(void)
850 CLEAR_BIT(PWR
->CR1
, PWR_CR1_HSITFSO
);
854 * @brief Check if the USB and FDCAN shut-off in DStop/DStop2 mode is enabled
855 * @rmtoll CR1 HSITFSO LL_PWR_IsEnabledHSITFShutOff
856 * @retval State of bit (1 or 0).
858 __STATIC_INLINE
uint32_t LL_PWR_IsEnabledHSITFShutOff(void)
860 return ((READ_BIT(PWR
->CR1
, PWR_CR1_HSITFSO
) == (PWR_CR1_HSITFSO
)) ? 1UL : 0UL);
862 #endif /* PWR_CR1_HSITFSO */
864 #if defined (PWR_CR1_SRDRAMSO)
866 * @brief Enable the SRD AHB RAM shut-off in DStop/DStop2 mode
867 * @rmtoll CR1 SRDRAMSO LL_PWR_EnableSRDRAMShutOff
870 __STATIC_INLINE
void LL_PWR_EnableSRDRAMShutOff(void)
872 SET_BIT(PWR
->CR1
, PWR_CR1_SRDRAMSO
);
876 * @brief Disable the SRD AHB RAM shut-off in DStop/DStop2 mode
877 * @rmtoll CR1 SRDRAMSO LL_PWR_DisableSRDRAMShutOff
880 __STATIC_INLINE
void LL_PWR_DisableSRDRAMShutOff(void)
882 CLEAR_BIT(PWR
->CR1
, PWR_CR1_SRDRAMSO
);
886 * @brief Check if the SRD AHB RAM shut-off in DStop/DStop2 mode is enabled
887 * @rmtoll CR1 SRDRAMSO LL_PWR_IsEnabledSRDRAMShutOff
888 * @retval State of bit (1 or 0).
890 __STATIC_INLINE
uint32_t LL_PWR_IsEnabledSRDRAMShutOff(void)
892 return ((READ_BIT(PWR
->CR1
, PWR_CR1_SRDRAMSO
) == (PWR_CR1_SRDRAMSO
)) ? 1UL : 0UL);
894 #endif /* PWR_CR1_SRDRAMSO */
897 * @brief Enable Backup Regulator
898 * @rmtoll CR2 BREN LL_PWR_EnableBkUpRegulator
899 * @note When set, the Backup Regulator (used to maintain backup SRAM content in Standby and
900 * VBAT modes) is enabled. If BRE is reset, the backup Regulator is switched off. The backup
901 * SRAM can still be used but its content will be lost in the Standby and VBAT modes. Once set,
902 * the application must wait that the Backup Regulator Ready flag (BRR) is set to indicate that
903 * the data written into the RAM will be maintained in the Standby and VBAT modes.
906 __STATIC_INLINE
void LL_PWR_EnableBkUpRegulator(void)
908 SET_BIT(PWR
->CR2
, PWR_CR2_BREN
);
912 * @brief Disable Backup Regulator
913 * @rmtoll CR2 BREN LL_PWR_DisableBkUpRegulator
916 __STATIC_INLINE
void LL_PWR_DisableBkUpRegulator(void)
918 CLEAR_BIT(PWR
->CR2
, PWR_CR2_BREN
);
922 * @brief Check if the backup Regulator is enabled
923 * @rmtoll CR2 BREN LL_PWR_IsEnabledBkUpRegulator
924 * @retval State of bit (1 or 0).
926 __STATIC_INLINE
uint32_t LL_PWR_IsEnabledBkUpRegulator(void)
928 return ((READ_BIT(PWR
->CR2
, PWR_CR2_BREN
) == (PWR_CR2_BREN
)) ? 1UL : 0UL);
932 * @brief Enable VBAT and Temperature monitoring
933 * @rmtoll CR2 MONEN LL_PWR_EnableMonitoring
936 __STATIC_INLINE
void LL_PWR_EnableMonitoring(void)
938 SET_BIT(PWR
->CR2
, PWR_CR2_MONEN
);
942 * @brief Disable VBAT and Temperature monitoring
943 * @rmtoll CR2 MONEN LL_PWR_DisableMonitoring
946 __STATIC_INLINE
void LL_PWR_DisableMonitoring(void)
948 CLEAR_BIT(PWR
->CR2
, PWR_CR2_MONEN
);
952 * @brief Check if the VBAT and Temperature monitoring is enabled
953 * @rmtoll CR2 MONEN LL_PWR_IsEnabledMonitoring
954 * @retval State of bit (1 or 0).
956 __STATIC_INLINE
uint32_t LL_PWR_IsEnabledMonitoring(void)
958 return ((READ_BIT(PWR
->CR2
, PWR_CR2_MONEN
) == (PWR_CR2_MONEN
)) ? 1UL : 0UL);
963 * @brief Configure the PWR supply
964 * @rmtoll CR3 BYPASS LL_PWR_ConfigSupply
965 * @rmtoll CR3 LDOEN LL_PWR_ConfigSupply
966 * @rmtoll CR3 SMPSEN LL_PWR_ConfigSupply
967 * @rmtoll CR3 SMPSEXTHP LL_PWR_ConfigSupply
968 * @rmtoll CR3 SMPSLEVEL LL_PWR_ConfigSupply
969 * @param SupplySource This parameter can be one of the following values:
970 * @arg @ref LL_PWR_LDO_SUPPLY
971 * @arg @ref LL_PWR_DIRECT_SMPS_SUPPLY
972 * @arg @ref LL_PWR_SMPS_1V8_SUPPLIES_LDO
973 * @arg @ref LL_PWR_SMPS_2V5_SUPPLIES_LDO
974 * @arg @ref LL_PWR_SMPS_1V8_SUPPLIES_EXT_AND_LDO
975 * @arg @ref LL_PWR_SMPS_2V5_SUPPLIES_EXT_AND_LDO
976 * @arg @ref LL_PWR_SMPS_1V8_SUPPLIES_EXT
977 * @arg @ref LL_PWR_SMPS_2V5_SUPPLIES_EXT
978 * @arg @ref LL_PWR_EXTERNAL_SOURCE_SUPPLY
981 __STATIC_INLINE
void LL_PWR_ConfigSupply(uint32_t SupplySource
)
983 /* Set the power supply configuration */
984 MODIFY_REG(PWR
->CR3
, (PWR_CR3_SMPSLEVEL
| PWR_CR3_SMPSEXTHP
| PWR_CR3_SMPSEN
| PWR_CR3_LDOEN
| PWR_CR3_BYPASS
), SupplySource
);
988 * @brief Configure the PWR supply
989 * @rmtoll CR3 BYPASS LL_PWR_ConfigSupply
990 * @rmtoll CR3 LDOEN LL_PWR_ConfigSupply
991 * @rmtoll CR3 SCUEN LL_PWR_ConfigSupply
992 * @param SupplySource This parameter can be one of the following values:
993 * @arg @ref LL_PWR_LDO_SUPPLY
994 * @arg @ref LL_PWR_EXTERNAL_SOURCE_SUPPLY
997 __STATIC_INLINE
void LL_PWR_ConfigSupply(uint32_t SupplySource
)
999 /* Set the power supply configuration */
1000 MODIFY_REG(PWR
->CR3
, (PWR_CR3_SCUEN
| PWR_CR3_LDOEN
| PWR_CR3_BYPASS
), SupplySource
);
1002 #endif /* defined (SMPS) */
1006 * @brief Get the PWR supply
1007 * @rmtoll CR3 BYPASS LL_PWR_GetSupply
1008 * @rmtoll CR3 LDOEN LL_PWR_GetSupply
1009 * @rmtoll CR3 SMPSEN LL_PWR_GetSupply
1010 * @rmtoll CR3 SMPSEXTHP LL_PWR_GetSupply
1011 * @rmtoll CR3 SMPSLEVEL LL_PWR_GetSupply
1012 * @retval Returned value can be one of the following values:
1013 * @arg @ref LL_PWR_LDO_SUPPLY
1014 * @arg @ref LL_PWR_DIRECT_SMPS_SUPPLY
1015 * @arg @ref LL_PWR_SMPS_1V8_SUPPLIES_LDO
1016 * @arg @ref LL_PWR_SMPS_2V5_SUPPLIES_LDO
1017 * @arg @ref LL_PWR_SMPS_1V8_SUPPLIES_EXT_AND_LDO
1018 * @arg @ref LL_PWR_SMPS_2V5_SUPPLIES_EXT_AND_LDO
1019 * @arg @ref LL_PWR_SMPS_1V8_SUPPLIES_EXT
1020 * @arg @ref LL_PWR_SMPS_2V5_SUPPLIES_EXT
1021 * @arg @ref LL_PWR_EXTERNAL_SOURCE_SUPPLY
1023 __STATIC_INLINE
uint32_t LL_PWR_GetSupply(void)
1025 /* Get the power supply configuration */
1026 return(uint32_t)(READ_BIT(PWR
->CR3
, (PWR_CR3_SMPSLEVEL
| PWR_CR3_SMPSEXTHP
| PWR_CR3_SMPSEN
| PWR_CR3_LDOEN
| PWR_CR3_BYPASS
)));
1030 * @brief Get the PWR supply
1031 * @rmtoll CR3 BYPASS LL_PWR_GetSupply
1032 * @rmtoll CR3 LDOEN LL_PWR_GetSupply
1033 * @rmtoll CR3 SCUEN LL_PWR_GetSupply
1034 * @retval Returned value can be one of the following values:
1035 * @arg @ref LL_PWR_LDO_SUPPLY
1036 * @arg @ref LL_PWR_EXTERNAL_SOURCE_SUPPLY
1038 __STATIC_INLINE
uint32_t LL_PWR_GetSupply(void)
1040 /* Get the power supply configuration */
1041 return(uint32_t)(READ_BIT(PWR
->CR3
, (PWR_CR3_SCUEN
| PWR_CR3_LDOEN
| PWR_CR3_BYPASS
)));
1043 #endif /* defined (SMPS) */
1046 * @brief Enable battery charging
1047 * @rmtoll CR3 VBE LL_PWR_EnableBatteryCharging
1050 __STATIC_INLINE
void LL_PWR_EnableBatteryCharging(void)
1052 SET_BIT(PWR
->CR3
, PWR_CR3_VBE
);
1056 * @brief Disable battery charging
1057 * @rmtoll CR3 VBE LL_PWR_DisableBatteryCharging
1060 __STATIC_INLINE
void LL_PWR_DisableBatteryCharging(void)
1062 CLEAR_BIT(PWR
->CR3
, PWR_CR3_VBE
);
1066 * @brief Check if battery charging is enabled
1067 * @rmtoll CR3 VBE LL_PWR_IsEnabledBatteryCharging
1068 * @retval State of bit (1 or 0).
1070 __STATIC_INLINE
uint32_t LL_PWR_IsEnabledBatteryCharging(void)
1072 return ((READ_BIT(PWR
->CR3
, PWR_CR3_VBE
) == (PWR_CR3_VBE
)) ? 1UL : 0UL);
1076 * @brief Set the Battery charge resistor impedance
1077 * @rmtoll CR3 VBRS LL_PWR_SetBattChargResistor
1078 * @param Resistor This parameter can be one of the following values:
1079 * @arg @ref LL_PWR_BATT_CHARG_RESISTOR_5K
1080 * @arg @ref LL_PWR_BATT_CHARGRESISTOR_1_5K
1083 __STATIC_INLINE
void LL_PWR_SetBattChargResistor(uint32_t Resistor
)
1085 MODIFY_REG(PWR
->CR3
, PWR_CR3_VBRS
, Resistor
);
1089 * @brief Get the Battery charge resistor impedance
1090 * @rmtoll CR3 VBRS LL_PWR_GetBattChargResistor
1091 * @retval Returned value can be one of the following values:
1092 * @arg @ref LL_PWR_BATT_CHARG_RESISTOR_5K
1093 * @arg @ref LL_PWR_BATT_CHARGRESISTOR_1_5K
1095 __STATIC_INLINE
uint32_t LL_PWR_GetBattChargResistor(void)
1097 return (uint32_t)(READ_BIT(PWR
->CR3
, PWR_CR3_VBRS
));
1101 * @brief Enable the USB regulator
1102 * @rmtoll CR3 USBREGEN LL_PWR_EnableUSBReg
1105 __STATIC_INLINE
void LL_PWR_EnableUSBReg(void)
1107 SET_BIT(PWR
->CR3
, PWR_CR3_USBREGEN
);
1111 * @brief Disable the USB regulator
1112 * @rmtoll CR3 USBREGEN LL_PWR_DisableUSBReg
1115 __STATIC_INLINE
void LL_PWR_DisableUSBReg(void)
1117 CLEAR_BIT(PWR
->CR3
, PWR_CR3_USBREGEN
);
1121 * @brief Check if the USB regulator is enabled
1122 * @rmtoll CR3 USBREGEN LL_PWR_IsEnabledUSBReg
1123 * @retval State of bit (1 or 0).
1125 __STATIC_INLINE
uint32_t LL_PWR_IsEnabledUSBReg(void)
1127 return ((READ_BIT(PWR
->CR3
, PWR_CR3_USBREGEN
) == (PWR_CR3_USBREGEN
)) ? 1UL : 0UL);
1131 * @brief Enable the USB voltage detector
1132 * @rmtoll CR3 USB33DEN LL_PWR_EnableUSBVoltageDetector
1135 __STATIC_INLINE
void LL_PWR_EnableUSBVoltageDetector(void)
1137 SET_BIT(PWR
->CR3
, PWR_CR3_USB33DEN
);
1141 * @brief Disable the USB voltage detector
1142 * @rmtoll CR3 USB33DEN LL_PWR_DisableUSBVoltageDetector
1145 __STATIC_INLINE
void LL_PWR_DisableUSBVoltageDetector(void)
1147 CLEAR_BIT(PWR
->CR3
, PWR_CR3_USB33DEN
);
1151 * @brief Check if the USB voltage detector is enabled
1152 * @rmtoll CR3 USB33DEN LL_PWR_IsEnabledUSBVoltageDetector
1153 * @retval State of bit (1 or 0).
1155 __STATIC_INLINE
uint32_t LL_PWR_IsEnabledUSBVoltageDetector(void)
1157 return ((READ_BIT(PWR
->CR3
, PWR_CR3_USB33DEN
) == (PWR_CR3_USB33DEN
)) ? 1UL : 0UL);
1160 #if defined (PWR_CPUCR_PDDS_D2)
1162 * @brief Set the D1 domain Power Down mode when the CPU enters deepsleep
1163 * @rmtoll CPUCR PDDS_D1 LL_PWR_CPU_SetD1PowerMode
1164 * @param PDMode This parameter can be one of the following values:
1165 * @arg @ref LL_PWR_CPU_MODE_D1STOP
1166 * @arg @ref LL_PWR_CPU_MODE_D1STANDBY
1169 __STATIC_INLINE
void LL_PWR_CPU_SetD1PowerMode(uint32_t PDMode
)
1171 MODIFY_REG(PWR
->CPUCR
, PWR_CPUCR_PDDS_D1
, PDMode
);
1175 * @brief Set the CPU domain Power Down mode when the CPU enters deepsleep
1176 * @rmtoll CPUCR RETDS_CD LL_PWR_CPU_SetCDPowerMode
1177 * @param PDMode This parameter can be one of the following values:
1178 * @arg @ref LL_PWR_CPU_MODE_CDSTOP
1179 * @arg @ref LL_PWR_CPU_MODE_CDSTOP2
1182 __STATIC_INLINE
void LL_PWR_CPU_SetCDPowerMode(uint32_t PDMode
)
1184 MODIFY_REG(PWR
->CPUCR
, PWR_CPUCR_RETDS_CD
, PDMode
);
1186 #endif /* PWR_CPUCR_PDDS_D2 */
1188 #if defined (DUAL_CORE)
1190 * @brief Set the D1 domain Power Down mode when the CPU2 enters deepsleep
1191 * @rmtoll CPU2CR PDDS_D1 LL_PWR_CPU2_SetD1PowerMode
1192 * @param PDMode This parameter can be one of the following values:
1193 * @arg @ref LL_PWR_CPU2_MODE_D1STOP
1194 * @arg @ref LL_PWR_CPU2_MODE_D1STANDBY
1197 __STATIC_INLINE
void LL_PWR_CPU2_SetD1PowerMode(uint32_t PDMode
)
1199 MODIFY_REG(PWR
->CPU2CR
, PWR_CPU2CR_PDDS_D1
, PDMode
);
1201 #endif /* DUAL_CORE */
1203 #if defined (PWR_CPUCR_PDDS_D2)
1205 * @brief Get the D1 Domain Power Down mode when the CPU enters deepsleep
1206 * @rmtoll CPUCR PDDS_D1 LL_PWR_CPU_GetD1PowerMode
1207 * @retval Returned value can be one of the following values:
1208 * @arg @ref LL_PWR_CPU_MODE_D1STOP
1209 * @arg @ref LL_PWR_CPU_MODE_D1STANDBY
1211 __STATIC_INLINE
uint32_t LL_PWR_CPU_GetD1PowerMode(void)
1213 return (uint32_t)(READ_BIT(PWR
->CPUCR
, PWR_CPUCR_PDDS_D1
));
1217 * @brief Get the CD Domain Power Down mode when the CPU enters deepsleep
1218 * @rmtoll CPUCR RETDS_CD LL_PWR_CPU_GetCDPowerMode
1219 * @retval Returned value can be one of the following values:
1220 * @arg @ref LL_PWR_CPU_MODE_CDSTOP
1221 * @arg @ref LL_PWR_CPU_MODE_CDSTOP2
1223 __STATIC_INLINE
uint32_t LL_PWR_CPU_GetCDPowerMode(void)
1225 return (uint32_t)(READ_BIT(PWR
->CPUCR
, PWR_CPUCR_RETDS_CD
));
1227 #endif /* PWR_CPUCR_PDDS_D2 */
1229 #if defined (DUAL_CORE)
1231 * @brief Get the D1 Domain Power Down mode when the CPU2 enters deepsleep
1232 * @rmtoll CPU2CR PDDS_D1 LL_PWR_CPU2_GetD1PowerMode
1233 * @retval Returned value can be one of the following values:
1234 * @arg @ref LL_PWR_CPU2_MODE_D1STOP
1235 * @arg @ref LL_PWR_CPU2_MODE_D1STANDBY
1237 __STATIC_INLINE
uint32_t LL_PWR_CPU2_GetD1PowerMode(void)
1239 return (uint32_t)(READ_BIT(PWR
->CPU2CR
, PWR_CPU2CR_PDDS_D1
));
1241 #endif /* DUAL_CORE */
1243 #if defined (PWR_CPUCR_PDDS_D2)
1245 * @brief Set the D2 domain Power Down mode when the CPU enters deepsleep
1246 * @rmtoll CPUCR PDDS_D2 LL_PWR_CPU_SetD2PowerMode
1247 * @param PDMode This parameter can be one of the following values:
1248 * @arg @ref LL_PWR_CPU_MODE_D2STOP
1249 * @arg @ref LL_PWR_CPU_MODE_D2STANDBY
1252 __STATIC_INLINE
void LL_PWR_CPU_SetD2PowerMode(uint32_t PDMode
)
1254 MODIFY_REG(PWR
->CPUCR
, PWR_CPUCR_PDDS_D2
, PDMode
);
1256 #endif /* PWR_CPUCR_PDDS_D2 */
1258 #if defined (DUAL_CORE)
1260 * @brief Set the D2 domain Power Down mode when the CPU2 enters deepsleep
1261 * @rmtoll CPU2CR PDDS_D2 LL_PWR_CPU2_SetD2PowerMode
1262 * @param PDMode This parameter can be one of the following values:
1263 * @arg @ref LL_PWR_CPU2_MODE_D2STOP
1264 * @arg @ref LL_PWR_CPU2_MODE_D2STANDBY
1267 __STATIC_INLINE
void LL_PWR_CPU2_SetD2PowerMode(uint32_t PDMode
)
1269 MODIFY_REG(PWR
->CPU2CR
, PWR_CPU2CR_PDDS_D2
, PDMode
);
1271 #endif /* DUAL_CORE */
1273 #if defined (PWR_CPUCR_PDDS_D2)
1275 * @brief Get the D2 Domain Power Down mode when the CPU enters deepsleep
1276 * @rmtoll CPUCR PDDS_D2 LL_PWR_CPU_GetD2PowerMode
1277 * @retval Returned value can be one of the following values:
1278 * @arg @ref LL_PWR_CPU_MODE_D2STOP
1279 * @arg @ref LL_PWR_CPU_MODE_D2STANDBY
1281 __STATIC_INLINE
uint32_t LL_PWR_CPU_GetD2PowerMode(void)
1283 return (uint32_t)(READ_BIT(PWR
->CPUCR
, PWR_CPUCR_PDDS_D2
));
1285 #endif /* PWR_CPUCR_PDDS_D2 */
1287 #if defined (DUAL_CORE)
1289 * @brief Get the D2 Domain Power Down mode when the CPU2 enters deepsleep
1290 * @rmtoll CPU2CR PDDS_D2 LL_PWR_CPU2_GetD2PowerMode
1291 * @retval Returned value can be one of the following values:
1292 * @arg @ref LL_PWR_CPU2_MODE_D2STOP
1293 * @arg @ref LL_PWR_CPU2_MODE_D2STANDBY
1295 __STATIC_INLINE
uint32_t LL_PWR_CPU2_GetD2PowerMode(void)
1297 return (uint32_t)(READ_BIT(PWR
->CPU2CR
, PWR_CPU2CR_PDDS_D2
));
1299 #endif /* DUAL_CORE */
1301 #if defined (PWR_CPUCR_PDDS_D2)
1303 * @brief Set the D3 domain Power Down mode when the CPU enters deepsleep
1304 * @rmtoll CPUCR PDDS_D3 LL_PWR_CPU_SetD3PowerMode
1305 * @param PDMode This parameter can be one of the following values:
1306 * @arg @ref LL_PWR_CPU_MODE_D3STOP
1307 * @arg @ref LL_PWR_CPU_MODE_D3STANDBY
1310 __STATIC_INLINE
void LL_PWR_CPU_SetD3PowerMode(uint32_t PDMode
)
1312 MODIFY_REG(PWR
->CPUCR
, PWR_CPUCR_PDDS_D3
, PDMode
);
1316 * @brief Set the SRD domain Power Down mode when the CPU enters deepsleep
1317 * @rmtoll CPUCR PDDS_SRD LL_PWR_CPU_SetSRDPowerMode
1318 * @param PDMode This parameter can be one of the following values:
1319 * @arg @ref LL_PWR_CPU_MODE_SRDSTOP
1320 * @arg @ref LL_PWR_CPU_MODE_SRDSTANDBY
1323 __STATIC_INLINE
void LL_PWR_CPU_SetSRDPowerMode(uint32_t PDMode
)
1325 MODIFY_REG(PWR
->CPUCR
, PWR_CPUCR_PDDS_SRD
, PDMode
);
1327 #endif /* PWR_CPUCR_PDDS_D2 */
1329 #if defined (DUAL_CORE)
1331 * @brief Set the D3 domain Power Down mode when the CPU2 enters deepsleep
1332 * @rmtoll CPU2CR PDDS_D3 LL_PWR_CPU2_SetD3PowerMode
1333 * @param PDMode This parameter can be one of the following values:
1334 * @arg @ref LL_PWR_CPU2_MODE_D3STOP
1335 * @arg @ref LL_PWR_CPU2_MODE_D3STANDBY
1338 __STATIC_INLINE
void LL_PWR_CPU2_SetD3PowerMode(uint32_t PDMode
)
1340 MODIFY_REG(PWR
->CPU2CR
, PWR_CPU2CR_PDDS_D3
, PDMode
);
1342 #endif /* DUAL_CORE */
1344 #if defined (PWR_CPUCR_PDDS_D3)
1346 * @brief Get the D3 Domain Power Down mode when the CPU enters deepsleep
1347 * @rmtoll CPUCR PDDS_D3 LL_PWR_CPU_GetD3PowerMode
1348 * @retval Returned value can be one of the following values:
1349 * @arg @ref LL_PWR_CPU_MODE_D3STOP
1350 * @arg @ref LL_PWR_CPU_MODE_D3STANDBY
1352 __STATIC_INLINE
uint32_t LL_PWR_CPU_GetD3PowerMode(void)
1354 return (uint32_t)(READ_BIT(PWR
->CPUCR
, PWR_CPUCR_PDDS_D3
));
1358 * @brief Get the SRD Domain Power Down mode when the CPU enters deepsleep
1359 * @rmtoll CPUCR PDDS_SRD LL_PWR_CPU_GetSRDPowerMode
1360 * @retval Returned value can be one of the following values:
1361 * @arg @ref LL_PWR_CPU_MODE_SRDSTOP
1362 * @arg @ref LL_PWR_CPU_MODE_SRDSTANDBY
1364 __STATIC_INLINE
uint32_t LL_PWR_CPU_GetSRDPowerMode(void)
1366 return (uint32_t)(READ_BIT(PWR
->CPUCR
, PWR_CPUCR_PDDS_SRD
));
1368 #endif /* PWR_CPUCR_PDDS_D3 */
1370 #if defined (DUAL_CORE)
1372 * @brief Get the D3 Domain Power Down mode when the CPU2 enters deepsleep
1373 * @rmtoll CPU2CR PDDS_D3 LL_PWR_CPU2_GetD3PowerMode
1374 * @retval Returned value can be one of the following values:
1375 * @arg @ref LL_PWR_CPU2_MODE_D3STOP
1376 * @arg @ref LL_PWR_CPU2_MODE_D3STANDBY
1378 __STATIC_INLINE
uint32_t LL_PWR_CPU2_GetD3PowerMode(void)
1380 return (uint32_t)(READ_BIT(PWR
->CPU2CR
, PWR_CPU2CR_PDDS_D3
));
1382 #endif /* DUAL_CORE */
1384 #if defined (DUAL_CORE)
1386 * @brief Hold the CPU1 and allocated peripherals when exiting from STOP mode
1387 * @rmtoll CPU2CR HOLD1 LL_PWR_HoldCPU1
1390 __STATIC_INLINE
void LL_PWR_HoldCPU1(void)
1392 SET_BIT(PWR
->CPU2CR
, PWR_CPU2CR_HOLD1
);
1396 * @brief Release the CPU1 and allocated peripherals
1397 * @rmtoll CPU2CR HOLD1 LL_PWR_ReleaseCPU1
1400 __STATIC_INLINE
void LL_PWR_ReleaseCPU1(void)
1402 CLEAR_BIT(PWR
->CPU2CR
, PWR_CPU2CR_HOLD1
);
1406 * @brief Ckeck if the CPU1 and allocated peripherals are held
1407 * @rmtoll CPU2CR HOLD1 LL_PWR_IsCPU1Held
1408 * @retval State of bit (1 or 0).
1410 __STATIC_INLINE
uint32_t LL_PWR_IsCPU1Held(void)
1412 return ((READ_BIT(PWR
->CPU2CR
, PWR_CPU2CR_HOLD1
) == (PWR_CPU2CR_HOLD1
)) ? 1UL : 0UL);
1416 * @brief Hold the CPU2 and allocated peripherals when exiting from STOP mode
1417 * @rmtoll CPUCR HOLD2 LL_PWR_HoldCPU2
1420 __STATIC_INLINE
void LL_PWR_HoldCPU2(void)
1422 SET_BIT(PWR
->CPUCR
, PWR_CPUCR_HOLD2
);
1426 * @brief Release the CPU2 and allocated peripherals
1427 * @rmtoll CPUCR HOLD2 LL_PWR_ReleaseCPU2
1430 __STATIC_INLINE
void LL_PWR_ReleaseCPU2(void)
1432 CLEAR_BIT(PWR
->CPUCR
, PWR_CPUCR_HOLD2
);
1436 * @brief Ckeck if the CPU2 and allocated peripherals are held
1437 * @rmtoll CPUCR HOLD2 LL_PWR_IsCPU2Held
1438 * @retval State of bit (1 or 0).
1440 __STATIC_INLINE
uint32_t LL_PWR_IsCPU2Held(void)
1442 return ((READ_BIT(PWR
->CPUCR
, PWR_CPUCR_HOLD2
) == (PWR_CPUCR_HOLD2
)) ? 1UL : 0UL);
1444 #endif /* DUAL_CORE */
1446 #if defined (PWR_CPUCR_PDDS_D2)
1448 * @brief D3 domain remains in Run mode regardless of CPU subsystem modes
1449 * @rmtoll CPUCR RUN_D3 LL_PWR_CPU_EnableD3RunInLowPowerMode
1452 __STATIC_INLINE
void LL_PWR_CPU_EnableD3RunInLowPowerMode(void)
1454 SET_BIT(PWR
->CPUCR
, PWR_CPUCR_RUN_D3
);
1458 * @brief SRD domain remains in Run mode regardless of CPU subsystem modes
1459 * @rmtoll CPUCR RUN_SRD LL_PWR_CPU_EnableSRDRunInLowPowerMode
1462 __STATIC_INLINE
void LL_PWR_CPU_EnableSRDRunInLowPowerMode(void)
1464 SET_BIT(PWR
->CPUCR
, PWR_CPUCR_RUN_SRD
);
1466 #endif /* PWR_CPUCR_PDDS_D2 */
1468 #if defined (DUAL_CORE)
1470 * @brief D3 domain remains in Run mode regardless of CPU2 subsystem modes
1471 * @rmtoll CPU2CR RUN_D3 LL_PWR_CPU2_EnableD3RunInLowPowerMode
1474 __STATIC_INLINE
void LL_PWR_CPU2_EnableD3RunInLowPowerMode(void)
1476 SET_BIT(PWR
->CPU2CR
, PWR_CPU2CR_RUN_D3
);
1478 #endif /* DUAL_CORE */
1480 #if defined (PWR_CPUCR_PDDS_D2)
1482 * @brief D3 domain follows CPU subsystem modes
1483 * @rmtoll CPUCR RUN_D3 LL_PWR_CPU_DisableD3RunInLowPowerMode
1486 __STATIC_INLINE
void LL_PWR_CPU_DisableD3RunInLowPowerMode(void)
1488 CLEAR_BIT(PWR
->CPUCR
, PWR_CPUCR_RUN_D3
);
1492 * @brief SRD domain follows CPU subsystem modes
1493 * @rmtoll CPUCR RUN_SRD LL_PWR_CPU_DisableSRDRunInLowPowerMode
1496 __STATIC_INLINE
void LL_PWR_CPU_DisableSRDRunInLowPowerMode(void)
1498 CLEAR_BIT(PWR
->CPUCR
, PWR_CPUCR_RUN_SRD
);
1500 #endif /* PWR_CPUCR_PDDS_D2 */
1502 #if defined (DUAL_CORE)
1504 * @brief D3 domain follows CPU2 subsystem modes
1505 * @rmtoll CPU2CR RUN_D3 LL_PWR_CPU2_DisableD3RunInLowPowerMode
1508 __STATIC_INLINE
void LL_PWR_CPU2_DisableD3RunInLowPowerMode(void)
1510 CLEAR_BIT(PWR
->CPU2CR
, PWR_CPU2CR_RUN_D3
);
1512 #endif /* DUAL_CORE */
1514 #if defined (PWR_CPUCR_PDDS_D2)
1516 * @brief Check if D3 is kept in Run mode when CPU enters low power mode
1517 * @rmtoll CPUCR RUN_D3 LL_PWR_CPU_IsEnabledD3RunInLowPowerMode
1518 * @retval State of bit (1 or 0).
1520 __STATIC_INLINE
uint32_t LL_PWR_CPU_IsEnabledD3RunInLowPowerMode(void)
1522 return ((READ_BIT(PWR
->CPUCR
, PWR_CPUCR_RUN_D3
) == (PWR_CPUCR_RUN_D3
)) ? 1UL : 0UL);
1526 * @brief Check if SRD is kept in Run mode when CPU enters low power mode
1527 * @rmtoll CPUCR RUN_SRD LL_PWR_CPU_IsEnabledSRDRunInLowPowerMode
1528 * @retval State of bit (1 or 0).
1530 __STATIC_INLINE
uint32_t LL_PWR_CPU_IsEnabledSRDRunInLowPowerMode(void)
1532 return ((READ_BIT(PWR
->CPUCR
, PWR_CPUCR_RUN_SRD
) == (PWR_CPUCR_RUN_SRD
)) ? 1UL : 0UL);
1534 #endif /* PWR_CPUCR_PDDS_D2 */
1536 #if defined (DUAL_CORE)
1538 * @brief Check if D3 is kept in Run mode when CPU2 enters low power mode
1539 * @rmtoll CPU2CR RUN_D3 LL_PWR_CPU2_IsEnabledD3RunInLowPowerMode
1540 * @retval State of bit (1 or 0).
1542 __STATIC_INLINE
uint32_t LL_PWR_CPU2_IsEnabledD3RunInLowPowerMode(void)
1544 return ((READ_BIT(PWR
->CPU2CR
, PWR_CPU2CR_RUN_D3
) == (PWR_CPU2CR_RUN_D3
)) ? 1UL : 0UL);
1546 #endif /* DUAL_CORE */
1549 * @brief Set the main internal Regulator output voltage
1550 * @rmtoll D3CR VOS LL_PWR_SetRegulVoltageScaling
1551 * @param VoltageScaling This parameter can be one of the following values:
1552 * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE0
1553 * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE1
1554 * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE2
1555 * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE3
1556 * @note For all H7 lines except STM32H7Axxx and STM32H7Bxxx lines, VOS0
1557 * is applied when PWR_D3CR_VOS[1:0] = 0b11 and SYSCFG_PWRCR_ODEN = 0b1.
1560 __STATIC_INLINE
void LL_PWR_SetRegulVoltageScaling(uint32_t VoltageScaling
)
1562 #if defined (PWR_CPUCR_PDDS_D2)
1563 MODIFY_REG(PWR
->D3CR
, PWR_D3CR_VOS
, VoltageScaling
);
1565 MODIFY_REG(PWR
->SRDCR
, PWR_SRDCR_VOS
, VoltageScaling
);
1566 #endif /* PWR_CPUCR_PDDS_D2 */
1570 * @brief Get the main internal Regulator output voltage
1571 * @rmtoll D3CR VOS LL_PWR_GetRegulVoltageScaling
1572 * @note For all H7 lines except STM32H7Axxx and STM32H7Bxxx lines, checking
1573 * VOS0 need the check of PWR_D3CR_VOS[1:0] field and SYSCFG_PWRCR_ODEN bit.
1574 * @retval Returned value can be one of the following values:
1575 * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE0
1576 * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE1
1577 * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE2
1578 * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE3
1580 __STATIC_INLINE
uint32_t LL_PWR_GetRegulVoltageScaling(void)
1582 #if defined (PWR_CPUCR_PDDS_D2)
1583 return (uint32_t)(READ_BIT(PWR
->D3CR
, PWR_D3CR_VOS
));
1585 return (uint32_t)(READ_BIT(PWR
->SRDCR
, PWR_SRDCR_VOS
));
1586 #endif /* PWR_CPUCR_PDDS_D2 */
1590 * @brief Enable the WakeUp PINx functionality
1591 * @rmtoll WKUPEPR WKUPEN1 LL_PWR_EnableWakeUpPin\n
1592 * WKUPEPR WKUPEN2 LL_PWR_EnableWakeUpPin\n
1593 * WKUPEPR WKUPEN3 LL_PWR_EnableWakeUpPin\n
1594 * WKUPEPR WKUPEN4 LL_PWR_EnableWakeUpPin\n
1595 * WKUPEPR WKUPEN5 LL_PWR_EnableWakeUpPin\n
1596 * WKUPEPR WKUPEN6 LL_PWR_EnableWakeUpPin
1597 * @param WakeUpPin This parameter can be one of the following values:
1598 * @arg @ref LL_PWR_WAKEUP_PIN1
1599 * @arg @ref LL_PWR_WAKEUP_PIN2
1600 * @arg @ref LL_PWR_WAKEUP_PIN3
1601 * @arg @ref LL_PWR_WAKEUP_PIN4
1602 * @arg @ref LL_PWR_WAKEUP_PIN5
1603 * @arg @ref LL_PWR_WAKEUP_PIN6
1606 __STATIC_INLINE
void LL_PWR_EnableWakeUpPin(uint32_t WakeUpPin
)
1608 SET_BIT(PWR
->WKUPEPR
, WakeUpPin
);
1612 * @brief Disable the WakeUp PINx functionality
1613 * @rmtoll WKUPEPR WKUPEN1 LL_PWR_DisableWakeUpPin\n
1614 * WKUPEPR WKUPEN2 LL_PWR_DisableWakeUpPin\n
1615 * WKUPEPR WKUPEN3 LL_PWR_DisableWakeUpPin\n
1616 * WKUPEPR WKUPEN4 LL_PWR_DisableWakeUpPin\n
1617 * WKUPEPR WKUPEN5 LL_PWR_DisableWakeUpPin\n
1618 * WKUPEPR WKUPEN6 LL_PWR_DisableWakeUpPin
1619 * @param WakeUpPin This parameter can be one of the following values:
1620 * @arg @ref LL_PWR_WAKEUP_PIN1
1621 * @arg @ref LL_PWR_WAKEUP_PIN2
1622 * @arg @ref LL_PWR_WAKEUP_PIN3
1623 * @arg @ref LL_PWR_WAKEUP_PIN4
1624 * @arg @ref LL_PWR_WAKEUP_PIN5
1625 * @arg @ref LL_PWR_WAKEUP_PIN6
1628 __STATIC_INLINE
void LL_PWR_DisableWakeUpPin(uint32_t WakeUpPin
)
1630 CLEAR_BIT(PWR
->WKUPEPR
, WakeUpPin
);
1634 * @brief Check if the WakeUp PINx functionality is enabled
1635 * @rmtoll WKUPEPR WKUPEN1 LL_PWR_IsEnabledWakeUpPin\n
1636 * WKUPEPR WKUPEN2 LL_PWR_IsEnabledWakeUpPin\n
1637 * WKUPEPR WKUPEN3 LL_PWR_IsEnabledWakeUpPin\n
1638 * WKUPEPR WKUPEN4 LL_PWR_IsEnabledWakeUpPin\n
1639 * WKUPEPR WKUPEN5 LL_PWR_IsEnabledWakeUpPin\n
1640 * WKUPEPR WKUPEN6 LL_PWR_IsEnabledWakeUpPin
1641 * @param WakeUpPin This parameter can be one of the following values:
1642 * @arg @ref LL_PWR_WAKEUP_PIN1
1643 * @arg @ref LL_PWR_WAKEUP_PIN2
1644 * @arg @ref LL_PWR_WAKEUP_PIN3
1645 * @arg @ref LL_PWR_WAKEUP_PIN4
1646 * @arg @ref LL_PWR_WAKEUP_PIN5
1647 * @arg @ref LL_PWR_WAKEUP_PIN6
1648 * @retval State of bit (1 or 0).
1650 __STATIC_INLINE
uint32_t LL_PWR_IsEnabledWakeUpPin(uint32_t WakeUpPin
)
1652 return ((READ_BIT(PWR
->WKUPEPR
, WakeUpPin
) == (WakeUpPin
)) ? 1UL : 0UL);
1656 * @brief Set the Wake-Up pin polarity low for the event detection
1657 * @rmtoll WKUPEPR WKUPP1 LL_PWR_SetWakeUpPinPolarityLow\n
1658 * WKUPEPR WKUPP2 LL_PWR_SetWakeUpPinPolarityLow\n
1659 * WKUPEPR WKUPP3 LL_PWR_SetWakeUpPinPolarityLow\n
1660 * WKUPEPR WKUPP4 LL_PWR_SetWakeUpPinPolarityLow\n
1661 * WKUPEPR WKUPP5 LL_PWR_SetWakeUpPinPolarityLow\n
1662 * WKUPEPR WKUPP6 LL_PWR_SetWakeUpPinPolarityLow
1663 * @param WakeUpPin This parameter can be one of the following values:
1664 * @arg @ref LL_PWR_WAKEUP_PIN1
1665 * @arg @ref LL_PWR_WAKEUP_PIN2
1666 * @arg @ref LL_PWR_WAKEUP_PIN3
1667 * @arg @ref LL_PWR_WAKEUP_PIN4
1668 * @arg @ref LL_PWR_WAKEUP_PIN5
1669 * @arg @ref LL_PWR_WAKEUP_PIN6
1672 __STATIC_INLINE
void LL_PWR_SetWakeUpPinPolarityLow(uint32_t WakeUpPin
)
1674 SET_BIT(PWR
->WKUPEPR
, (WakeUpPin
<< PWR_WKUPEPR_WKUPP1_Pos
));
1678 * @brief Set the Wake-Up pin polarity high for the event detection
1679 * @rmtoll WKUPEPR WKUPP1 LL_PWR_SetWakeUpPinPolarityHigh\n
1680 * WKUPEPR WKUPP2 LL_PWR_SetWakeUpPinPolarityHigh\n
1681 * WKUPEPR WKUPP3 LL_PWR_SetWakeUpPinPolarityHigh\n
1682 * WKUPEPR WKUPP4 LL_PWR_SetWakeUpPinPolarityHigh\n
1683 * WKUPEPR WKUPP5 LL_PWR_SetWakeUpPinPolarityHigh\n
1684 * WKUPEPR WKUPP6 LL_PWR_SetWakeUpPinPolarityHigh
1685 * @param WakeUpPin This parameter can be one of the following values:
1686 * @arg @ref LL_PWR_WAKEUP_PIN1
1687 * @arg @ref LL_PWR_WAKEUP_PIN2
1688 * @arg @ref LL_PWR_WAKEUP_PIN3
1689 * @arg @ref LL_PWR_WAKEUP_PIN4
1690 * @arg @ref LL_PWR_WAKEUP_PIN5
1691 * @arg @ref LL_PWR_WAKEUP_PIN6
1694 __STATIC_INLINE
void LL_PWR_SetWakeUpPinPolarityHigh(uint32_t WakeUpPin
)
1696 CLEAR_BIT(PWR
->WKUPEPR
, (WakeUpPin
<< PWR_WKUPEPR_WKUPP1_Pos
));
1700 * @brief Get the Wake-Up pin polarity for the event detection
1701 * @rmtoll WKUPEPR WKUPP1 LL_PWR_IsWakeUpPinPolarityLow\n
1702 * WKUPEPR WKUPP2 LL_PWR_IsWakeUpPinPolarityLow\n
1703 * WKUPEPR WKUPP3 LL_PWR_IsWakeUpPinPolarityLow\n
1704 * WKUPEPR WKUPP4 LL_PWR_IsWakeUpPinPolarityLow\n
1705 * WKUPEPR WKUPP5 LL_PWR_IsWakeUpPinPolarityLow\n
1706 * WKUPEPR WKUPP6 LL_PWR_IsWakeUpPinPolarityLow
1707 * @param WakeUpPin This parameter can be one of the following values:
1708 * @arg @ref LL_PWR_WAKEUP_PIN1
1709 * @arg @ref LL_PWR_WAKEUP_PIN2
1710 * @arg @ref LL_PWR_WAKEUP_PIN3
1711 * @arg @ref LL_PWR_WAKEUP_PIN4
1712 * @arg @ref LL_PWR_WAKEUP_PIN5
1713 * @arg @ref LL_PWR_WAKEUP_PIN6
1714 * @retval State of bit (1 or 0).
1716 __STATIC_INLINE
uint32_t LL_PWR_IsWakeUpPinPolarityLow(uint32_t WakeUpPin
)
1718 return ((READ_BIT(PWR
->WKUPEPR
, (WakeUpPin
<< PWR_WKUPEPR_WKUPP1_Pos
)) == (WakeUpPin
<< PWR_WKUPEPR_WKUPP1_Pos
)) ? 1UL : 0UL);
1722 * @brief Set the Wake-Up pin Pull None
1723 * @rmtoll WKUPEPR WKUPPUPD1 LL_PWR_SetWakeUpPinPullNone\n
1724 * WKUPEPR WKUPPUPD2 LL_PWR_SetWakeUpPinPullNone\n
1725 * WKUPEPR WKUPPUPD3 LL_PWR_SetWakeUpPinPullNone\n
1726 * WKUPEPR WKUPPUPD4 LL_PWR_SetWakeUpPinPullNone\n
1727 * WKUPEPR WKUPPUPD5 LL_PWR_SetWakeUpPinPullNone\n
1728 * WKUPEPR WKUPPUPD6 LL_PWR_SetWakeUpPinPullNone
1729 * @param WakeUpPin This parameter can be one of the following values:
1730 * @arg @ref LL_PWR_WAKEUP_PIN1
1731 * @arg @ref LL_PWR_WAKEUP_PIN2
1732 * @arg @ref LL_PWR_WAKEUP_PIN3
1733 * @arg @ref LL_PWR_WAKEUP_PIN4
1734 * @arg @ref LL_PWR_WAKEUP_PIN5
1735 * @arg @ref LL_PWR_WAKEUP_PIN6
1738 __STATIC_INLINE
void LL_PWR_SetWakeUpPinPullNone(uint32_t WakeUpPin
)
1740 MODIFY_REG(PWR
->WKUPEPR
, \
1741 (PWR_WKUPEPR_WKUPPUPD1
<< ((LL_PWR_WAKEUP_PINS_PULL_SHIFT_OFFSET
* POSITION_VAL(WakeUpPin
)) & LL_PWR_WAKEUP_PINS_MAX_SHIFT_MASK
)), \
1742 (LL_PWR_WAKEUP_PIN_NOPULL
<< ((PWR_WKUPEPR_WKUPPUPD1_Pos
+ (LL_PWR_WAKEUP_PINS_PULL_SHIFT_OFFSET
* POSITION_VAL(WakeUpPin
))) & LL_PWR_WAKEUP_PINS_MAX_SHIFT_MASK
)));
1746 * @brief Set the Wake-Up pin Pull Up
1747 * @rmtoll WKUPEPR WKUPPUPD1 LL_PWR_SetWakeUpPinPullUp\n
1748 * WKUPEPR WKUPPUPD2 LL_PWR_SetWakeUpPinPullUp\n
1749 * WKUPEPR WKUPPUPD3 LL_PWR_SetWakeUpPinPullUp\n
1750 * WKUPEPR WKUPPUPD4 LL_PWR_SetWakeUpPinPullUp\n
1751 * WKUPEPR WKUPPUPD5 LL_PWR_SetWakeUpPinPullUp\n
1752 * WKUPEPR WKUPPUPD6 LL_PWR_SetWakeUpPinPullUp
1753 * @param WakeUpPin This parameter can be one of the following values:
1754 * @arg @ref LL_PWR_WAKEUP_PIN1
1755 * @arg @ref LL_PWR_WAKEUP_PIN2
1756 * @arg @ref LL_PWR_WAKEUP_PIN3
1757 * @arg @ref LL_PWR_WAKEUP_PIN4
1758 * @arg @ref LL_PWR_WAKEUP_PIN5
1759 * @arg @ref LL_PWR_WAKEUP_PIN6
1762 __STATIC_INLINE
void LL_PWR_SetWakeUpPinPullUp(uint32_t WakeUpPin
)
1764 MODIFY_REG(PWR
->WKUPEPR
, \
1765 (PWR_WKUPEPR_WKUPPUPD1
<< ((LL_PWR_WAKEUP_PINS_PULL_SHIFT_OFFSET
* POSITION_VAL(WakeUpPin
)) & LL_PWR_WAKEUP_PINS_MAX_SHIFT_MASK
)), \
1766 (LL_PWR_WAKEUP_PIN_PULLUP
<< ((PWR_WKUPEPR_WKUPPUPD1_Pos
+ (LL_PWR_WAKEUP_PINS_PULL_SHIFT_OFFSET
* POSITION_VAL(WakeUpPin
))) & LL_PWR_WAKEUP_PINS_MAX_SHIFT_MASK
)));
1770 * @brief Set the Wake-Up pin Pull Down
1771 * @rmtoll WKUPEPR WKUPPUPD1 LL_PWR_SetWakeUpPinPullDown\n
1772 * WKUPEPR WKUPPUPD2 LL_PWR_SetWakeUpPinPullDown\n
1773 * WKUPEPR WKUPPUPD3 LL_PWR_SetWakeUpPinPullDown\n
1774 * WKUPEPR WKUPPUPD4 LL_PWR_SetWakeUpPinPullDown\n
1775 * WKUPEPR WKUPPUPD5 LL_PWR_SetWakeUpPinPullDown\n
1776 * WKUPEPR WKUPPUPD6 LL_PWR_SetWakeUpPinPullDown
1777 * @param WakeUpPin This parameter can be one of the following values:
1778 * @arg @ref LL_PWR_WAKEUP_PIN1
1779 * @arg @ref LL_PWR_WAKEUP_PIN2
1780 * @arg @ref LL_PWR_WAKEUP_PIN3
1781 * @arg @ref LL_PWR_WAKEUP_PIN4
1782 * @arg @ref LL_PWR_WAKEUP_PIN5
1783 * @arg @ref LL_PWR_WAKEUP_PIN6
1786 __STATIC_INLINE
void LL_PWR_SetWakeUpPinPullDown(uint32_t WakeUpPin
)
1788 MODIFY_REG(PWR
->WKUPEPR
, \
1789 (PWR_WKUPEPR_WKUPPUPD1
<< ((LL_PWR_WAKEUP_PINS_PULL_SHIFT_OFFSET
* POSITION_VAL(WakeUpPin
)) & LL_PWR_WAKEUP_PINS_MAX_SHIFT_MASK
)), \
1790 (LL_PWR_WAKEUP_PIN_PULLDOWN
<< ((PWR_WKUPEPR_WKUPPUPD1_Pos
+ (LL_PWR_WAKEUP_PINS_PULL_SHIFT_OFFSET
* POSITION_VAL(WakeUpPin
))) & LL_PWR_WAKEUP_PINS_MAX_SHIFT_MASK
)));
1794 * @brief Get the Wake-Up pin pull
1795 * @rmtoll WKUPEPR WKUPPUPD1 LL_PWR_GetWakeUpPinPull\n
1796 * WKUPEPR WKUPPUPD2 LL_PWR_GetWakeUpPinPull\n
1797 * WKUPEPR WKUPPUPD3 LL_PWR_GetWakeUpPinPull\n
1798 * WKUPEPR WKUPPUPD4 LL_PWR_GetWakeUpPinPull\n
1799 * WKUPEPR WKUPPUPD5 LL_PWR_GetWakeUpPinPull\n
1800 * WKUPEPR WKUPPUPD6 LL_PWR_GetWakeUpPinPull
1801 * @param WakeUpPin This parameter can be one of the following values:
1802 * @arg @ref LL_PWR_WAKEUP_PIN1
1803 * @arg @ref LL_PWR_WAKEUP_PIN2
1804 * @arg @ref LL_PWR_WAKEUP_PIN3
1805 * @arg @ref LL_PWR_WAKEUP_PIN4
1806 * @arg @ref LL_PWR_WAKEUP_PIN5
1807 * @arg @ref LL_PWR_WAKEUP_PIN6
1808 * @retval Returned value can be one of the following values:
1809 * @arg @ref LL_PWR_WAKEUP_PIN_NOPULL
1810 * @arg @ref LL_PWR_WAKEUP_PIN_PULLUP
1811 * @arg @ref LL_PWR_WAKEUP_PIN_PULLDOWN
1813 __STATIC_INLINE
uint32_t LL_PWR_GetWakeUpPinPull(uint32_t WakeUpPin
)
1815 register uint32_t regValue
= READ_BIT(PWR
->WKUPEPR
, (PWR_WKUPEPR_WKUPPUPD1
<< ((LL_PWR_WAKEUP_PINS_PULL_SHIFT_OFFSET
* POSITION_VAL(WakeUpPin
)) & LL_PWR_WAKEUP_PINS_MAX_SHIFT_MASK
)));
1817 return (uint32_t)(regValue
>> ((PWR_WKUPEPR_WKUPPUPD1_Pos
+ (LL_PWR_WAKEUP_PINS_PULL_SHIFT_OFFSET
* POSITION_VAL(WakeUpPin
))) & LL_PWR_WAKEUP_PINS_MAX_SHIFT_MASK
));
1824 /** @defgroup PWR_LL_EF_FLAG_Management FLAG_Management
1829 * @brief Indicate whether VDD voltage is below the selected PVD threshold
1830 * @rmtoll CSR1 PVDO LL_PWR_IsActiveFlag_PVDO
1831 * @retval State of bit (1 or 0).
1833 __STATIC_INLINE
uint32_t LL_PWR_IsActiveFlag_PVDO(void)
1835 return ((READ_BIT(PWR
->CSR1
, PWR_CSR1_PVDO
) == (PWR_CSR1_PVDO
)) ? 1UL : 0UL);
1839 * @brief Indicate whether the voltage level is ready for current actual used VOS
1840 * @rmtoll CSR1 ACTVOSRDY LL_PWR_IsActiveFlag_ACTVOS
1841 * @retval State of bit (1 or 0).
1843 __STATIC_INLINE
uint32_t LL_PWR_IsActiveFlag_ACTVOS(void)
1845 return ((READ_BIT(PWR
->CSR1
, PWR_CSR1_ACTVOSRDY
) == (PWR_CSR1_ACTVOSRDY
)) ? 1UL : 0UL);
1849 * @brief Indicate whether VDDA voltage is below the selected AVD threshold
1850 * @rmtoll CSR1 AVDO LL_PWR_IsActiveFlag_AVDO
1851 * @retval State of bit (1 or 0).
1853 __STATIC_INLINE
uint32_t LL_PWR_IsActiveFlag_AVDO(void)
1855 return ((READ_BIT(PWR
->CSR1
, PWR_CSR1_AVDO
) == (PWR_CSR1_AVDO
)) ? 1UL : 0UL);
1858 #if defined (PWR_CSR1_MMCVDO)
1860 * @brief Indicate whether VDDMMC voltage is below 1V2
1861 * @rmtoll CSR1 MMCVDO LL_PWR_IsActiveFlag_MMCVDO
1862 * @retval State of bit (1 or 0).
1864 __STATIC_INLINE
uint32_t LL_PWR_IsActiveFlag_MMCVDO(void)
1866 return ((READ_BIT(PWR
->CSR1
, PWR_CSR1_MMCVDO
) == (PWR_CSR1_MMCVDO
)) ? 1UL : 0UL);
1868 #endif /* PWR_CSR1_MMCVDO */
1871 * @brief Get Backup Regulator ready Flag
1872 * @rmtoll CR2 BRRDY LL_PWR_IsActiveFlag_BRR
1873 * @retval State of bit (1 or 0).
1875 __STATIC_INLINE
uint32_t LL_PWR_IsActiveFlag_BRR(void)
1877 return ((READ_BIT(PWR
->CR2
, PWR_CR2_BRRDY
) == (PWR_CR2_BRRDY
)) ? 1UL : 0UL);
1881 * @brief Indicate whether the VBAT level is above or below low threshold
1882 * @rmtoll CR2 VBATL LL_PWR_IsActiveFlag_VBATL
1883 * @retval State of bit (1 or 0).
1885 __STATIC_INLINE
uint32_t LL_PWR_IsActiveFlag_VBATL(void)
1887 return ((READ_BIT(PWR
->CR2
, PWR_CR2_VBATL
) == (PWR_CR2_VBATL
)) ? 1UL : 0UL);
1891 * @brief Indicate whether the VBAT level is above or below high threshold
1892 * @rmtoll CR2 VBATH LL_PWR_IsActiveFlag_VBATH
1893 * @retval State of bit (1 or 0).
1895 __STATIC_INLINE
uint32_t LL_PWR_IsActiveFlag_VBATH(void)
1897 return ((READ_BIT(PWR
->CR2
, PWR_CR2_VBATH
) == (PWR_CR2_VBATH
)) ? 1UL : 0UL);
1901 * @brief Indicate whether the CPU temperature level is above or below low threshold
1902 * @rmtoll CR2 TEMPL LL_PWR_IsActiveFlag_TEMPL
1903 * @retval State of bit (1 or 0).
1905 __STATIC_INLINE
uint32_t LL_PWR_IsActiveFlag_TEMPL(void)
1907 return ((READ_BIT(PWR
->CR2
, PWR_CR2_TEMPL
) == (PWR_CR2_TEMPL
)) ? 1UL : 0UL);
1911 * @brief Indicate whether the CPU temperature level is above or below high threshold
1912 * @rmtoll CR2 TEMPH LL_PWR_IsActiveFlag_TEMPH
1913 * @retval State of bit (1 or 0).
1915 __STATIC_INLINE
uint32_t LL_PWR_IsActiveFlag_TEMPH(void)
1917 return ((READ_BIT(PWR
->CR2
, PWR_CR2_TEMPH
) == (PWR_CR2_TEMPH
)) ? 1UL : 0UL);
1922 * @brief Indicate whether the SMPS external supply is ready or not
1923 * @rmtoll CR3 SMPSEXTRDY LL_PWR_IsActiveFlag_SMPSEXT
1924 * @retval State of bit (1 or 0).
1926 __STATIC_INLINE
uint32_t LL_PWR_IsActiveFlag_SMPSEXT(void)
1928 return ((READ_BIT(PWR
->CR3
, PWR_CR3_SMPSEXTRDY
) == (PWR_CR3_SMPSEXTRDY
)) ? 1UL : 0UL);
1933 * @brief Indicate whether the USB supply is ready or not
1934 * @rmtoll CR3 USBRDY LL_PWR_IsActiveFlag_USB
1935 * @retval State of bit (1 or 0).
1937 __STATIC_INLINE
uint32_t LL_PWR_IsActiveFlag_USB(void)
1939 return ((READ_BIT(PWR
->CR3
, PWR_CR3_USB33RDY
) == (PWR_CR3_USB33RDY
)) ? 1UL : 0UL);
1942 #if defined (DUAL_CORE)
1944 * @brief Get HOLD2 Flag
1945 * @rmtoll CPUCR HOLD2F LL_PWR_IsActiveFlag_HOLD2
1946 * @retval State of bit (1 or 0).
1948 __STATIC_INLINE
uint32_t LL_PWR_IsActiveFlag_HOLD2(void)
1950 return ((READ_BIT(PWR
->CPUCR
, PWR_CPUCR_HOLD2F
) == (PWR_CPUCR_HOLD2F
)) ? 1UL : 0UL);
1954 * @brief Get HOLD1 Flag
1955 * @rmtoll CPU2CR HOLD1F LL_PWR_IsActiveFlag_HOLD1
1956 * @retval State of bit (1 or 0).
1958 __STATIC_INLINE
uint32_t LL_PWR_IsActiveFlag_HOLD1(void)
1960 return ((READ_BIT(PWR
->CPU2CR
, PWR_CPU2CR_HOLD1F
) == (PWR_CPU2CR_HOLD1F
)) ? 1UL : 0UL);
1962 #endif /* DUAL_CORE */
1965 * @brief Get CPU System Stop Flag
1966 * @rmtoll CPUCR STOPF LL_PWR_CPU_IsActiveFlag_STOP
1967 * @retval State of bit (1 or 0).
1969 __STATIC_INLINE
uint32_t LL_PWR_CPU_IsActiveFlag_STOP(void)
1971 return ((READ_BIT(PWR
->CPUCR
, PWR_CPUCR_STOPF
) == (PWR_CPUCR_STOPF
)) ? 1UL : 0UL);
1974 #if defined (DUAL_CORE)
1976 * @brief Get CPU2 System Stop Flag
1977 * @rmtoll CPU2CR STOPF LL_PWR_CPU2_IsActiveFlag_STOP
1978 * @retval State of bit (1 or 0).
1980 __STATIC_INLINE
uint32_t LL_PWR_CPU2_IsActiveFlag_STOP(void)
1982 return ((READ_BIT(PWR
->CPU2CR
, PWR_CPU2CR_STOPF
) == (PWR_CPU2CR_STOPF
)) ? 1UL : 0UL);
1984 #endif /* DUAL_CORE */
1987 * @brief Get CPU System Standby Flag
1988 * @rmtoll CPUCR SBF LL_PWR_CPU_IsActiveFlag_SB
1989 * @retval State of bit (1 or 0).
1991 __STATIC_INLINE
uint32_t LL_PWR_CPU_IsActiveFlag_SB(void)
1993 return ((READ_BIT(PWR
->CPUCR
, PWR_CPUCR_SBF
) == (PWR_CPUCR_SBF
)) ? 1UL : 0UL);
1996 #if defined (DUAL_CORE)
1998 * @brief Get CPU2 System Standby Flag
1999 * @rmtoll CPU2CR SBF LL_PWR_CPU2_IsActiveFlag_SB
2000 * @retval State of bit (1 or 0).
2002 __STATIC_INLINE
uint32_t LL_PWR_CPU2_IsActiveFlag_SB(void)
2004 return ((READ_BIT(PWR
->CPU2CR
, PWR_CPU2CR_SBF
) == (PWR_CPU2CR_SBF
)) ? 1UL : 0UL);
2006 #endif /* DUAL_CORE */
2008 #if defined (PWR_CPUCR_SBF_D1)
2010 * @brief Get CPU D1 Domain Standby Flag
2011 * @rmtoll CPUCR SBF_D1 LL_PWR_CPU_IsActiveFlag_SB_D1
2012 * @retval State of bit (1 or 0).
2014 __STATIC_INLINE
uint32_t LL_PWR_CPU_IsActiveFlag_SB_D1(void)
2016 return ((READ_BIT(PWR
->CPUCR
, PWR_CPUCR_SBF_D1
) == (PWR_CPUCR_SBF_D1
)) ? 1UL : 0UL);
2018 #endif /* PWR_CPUCR_SBF_D1 */
2020 #if defined (DUAL_CORE)
2022 * @brief Get CPU2 D1 Domain Standby Flag
2023 * @rmtoll CPU2CR SBF_D1 LL_PWR_CPU2_IsActiveFlag_SB_D1
2024 * @retval State of bit (1 or 0).
2026 __STATIC_INLINE
uint32_t LL_PWR_CPU2_IsActiveFlag_SB_D1(void)
2028 return ((READ_BIT(PWR
->CPU2CR
, PWR_CPU2CR_SBF_D1
) == (PWR_CPU2CR_SBF_D1
)) ? 1UL : 0UL);
2030 #endif /* DUAL_CORE */
2032 #if defined (PWR_CPUCR_SBF_D2)
2034 * @brief Get CPU D2 Domain Standby Flag
2035 * @rmtoll CPUCR SBF_D2 LL_PWR_CPU_IsActiveFlag_SB_D2
2036 * @retval State of bit (1 or 0).
2038 __STATIC_INLINE
uint32_t LL_PWR_CPU_IsActiveFlag_SB_D2(void)
2040 return ((READ_BIT(PWR
->CPUCR
, PWR_CPUCR_SBF_D2
) == (PWR_CPUCR_SBF_D2
)) ? 1UL : 0UL);
2042 #endif /* PWR_CPUCR_SBF_D2 */
2044 #if defined (DUAL_CORE)
2046 * @brief Get CPU2 D2 Domain Standby Flag
2047 * @rmtoll CPU2CR SBF_D2 LL_PWR_CPU2_IsActiveFlag_SB_D2
2048 * @retval State of bit (1 or 0).
2050 __STATIC_INLINE
uint32_t LL_PWR_CPU2_IsActiveFlag_SB_D2(void)
2052 return ((READ_BIT(PWR
->CPU2CR
, PWR_CPU2CR_SBF_D2
) == (PWR_CPU2CR_SBF_D2
)) ? 1UL : 0UL);
2054 #endif /* DUAL_CORE */
2058 * @brief Indicate whether the Regulator is ready in the selected voltage range
2059 * or if its output voltage is still changing to the required voltage level
2060 * @rmtoll D3CR VOSRDY LL_PWR_IsActiveFlag_VOS
2061 * @retval State of bit (1 or 0).
2063 __STATIC_INLINE
uint32_t LL_PWR_IsActiveFlag_VOS(void)
2065 #if defined (PWR_CPUCR_PDDS_D2)
2066 return ((READ_BIT(PWR
->D3CR
, PWR_D3CR_VOSRDY
) == (PWR_D3CR_VOSRDY
)) ? 1UL : 0UL);
2068 return ((READ_BIT(PWR
->SRDCR
, PWR_SRDCR_VOSRDY
) == (PWR_SRDCR_VOSRDY
)) ? 1UL : 0UL);
2069 #endif /* PWR_CPUCR_PDDS_D2 */
2073 * @brief Get Wake-up Flag 6
2074 * @rmtoll WKUPFR WKUPF6 LL_PWR_IsActiveFlag_WU6
2075 * @retval State of bit (1 or 0).
2077 __STATIC_INLINE
uint32_t LL_PWR_IsActiveFlag_WU6(void)
2079 return ((READ_BIT(PWR
->WKUPFR
, PWR_WKUPFR_WKUPF6
) == (PWR_WKUPFR_WKUPF6
)) ? 1UL : 0UL);
2083 * @brief Get Wake-up Flag 5
2084 * @rmtoll WKUPFR WKUPF5 LL_PWR_IsActiveFlag_WU5
2085 * @retval State of bit (1 or 0).
2087 __STATIC_INLINE
uint32_t LL_PWR_IsActiveFlag_WU5(void)
2089 return ((READ_BIT(PWR
->WKUPFR
, PWR_WKUPFR_WKUPF5
) == (PWR_WKUPFR_WKUPF5
)) ? 1UL : 0UL);
2093 * @brief Get Wake-up Flag 4
2094 * @rmtoll WKUPFR WKUPF4 LL_PWR_IsActiveFlag_WU4
2095 * @retval State of bit (1 or 0).
2097 __STATIC_INLINE
uint32_t LL_PWR_IsActiveFlag_WU4(void)
2099 return ((READ_BIT(PWR
->WKUPFR
, PWR_WKUPFR_WKUPF4
) == (PWR_WKUPFR_WKUPF4
)) ? 1UL : 0UL);
2103 * @brief Get Wake-up Flag 3
2104 * @rmtoll WKUPFR WKUPF3 LL_PWR_IsActiveFlag_WU3
2105 * @retval State of bit (1 or 0).
2107 __STATIC_INLINE
uint32_t LL_PWR_IsActiveFlag_WU3(void)
2109 return ((READ_BIT(PWR
->WKUPFR
, PWR_WKUPFR_WKUPF3
) == (PWR_WKUPFR_WKUPF3
)) ? 1UL : 0UL);
2113 * @brief Get Wake-up Flag 2
2114 * @rmtoll WKUPFR WKUPF2 LL_PWR_IsActiveFlag_WU2
2115 * @retval State of bit (1 or 0).
2117 __STATIC_INLINE
uint32_t LL_PWR_IsActiveFlag_WU2(void)
2119 return ((READ_BIT(PWR
->WKUPFR
, PWR_WKUPFR_WKUPF2
) == (PWR_WKUPFR_WKUPF2
)) ? 1UL : 0UL);
2123 * @brief Get Wake-up Flag 1
2124 * @rmtoll WKUPFR WKUPF1 LL_PWR_IsActiveFlag_WU1
2125 * @retval State of bit (1 or 0).
2127 __STATIC_INLINE
uint32_t LL_PWR_IsActiveFlag_WU1(void)
2129 return ((READ_BIT(PWR
->WKUPFR
, PWR_WKUPFR_WKUPF1
) == (PWR_WKUPFR_WKUPF1
)) ? 1UL : 0UL);
2133 * @brief Clear CPU STANDBY, STOP and HOLD flags
2134 * @rmtoll CPUCR CSSF LL_PWR_ClearFlag_CPU
2137 __STATIC_INLINE
void LL_PWR_ClearFlag_CPU(void)
2139 SET_BIT(PWR
->CPUCR
, PWR_CPUCR_CSSF
);
2142 #if defined (DUAL_CORE)
2144 * @brief Clear CPU2 STANDBY, STOP and HOLD flags
2145 * @rmtoll CPU2CR CSSF LL_PWR_ClearFlag_CPU2
2148 __STATIC_INLINE
void LL_PWR_ClearFlag_CPU2(void)
2150 SET_BIT(PWR
->CPU2CR
, PWR_CPU2CR_CSSF
);
2152 #endif /* DUAL_CORE */
2155 * @brief Clear Wake-up Flag 6
2156 * @rmtoll WKUPCR WKUPC6 LL_PWR_ClearFlag_WU6
2159 __STATIC_INLINE
void LL_PWR_ClearFlag_WU6(void)
2161 WRITE_REG(PWR
->WKUPCR
, PWR_WKUPCR_WKUPC6
);
2165 * @brief Clear Wake-up Flag 5
2166 * @rmtoll WKUPCR WKUPC5 LL_PWR_ClearFlag_WU5
2169 __STATIC_INLINE
void LL_PWR_ClearFlag_WU5(void)
2171 WRITE_REG(PWR
->WKUPCR
, PWR_WKUPCR_WKUPC5
);
2175 * @brief Clear Wake-up Flag 4
2176 * @rmtoll WKUPCR WKUPC4 LL_PWR_ClearFlag_WU4
2179 __STATIC_INLINE
void LL_PWR_ClearFlag_WU4(void)
2181 WRITE_REG(PWR
->WKUPCR
, PWR_WKUPCR_WKUPC4
);
2185 * @brief Clear Wake-up Flag 3
2186 * @rmtoll WKUPCR WKUPC3 LL_PWR_ClearFlag_WU3
2189 __STATIC_INLINE
void LL_PWR_ClearFlag_WU3(void)
2191 WRITE_REG(PWR
->WKUPCR
, PWR_WKUPCR_WKUPC3
);
2195 * @brief Clear Wake-up Flag 2
2196 * @rmtoll WKUPCR WKUPC2 LL_PWR_ClearFlag_WU2
2199 __STATIC_INLINE
void LL_PWR_ClearFlag_WU2(void)
2201 WRITE_REG(PWR
->WKUPCR
, PWR_WKUPCR_WKUPC2
);
2205 * @brief Clear Wake-up Flag 1
2206 * @rmtoll WKUPCR WKUPC1 LL_PWR_ClearFlag_WU1
2209 __STATIC_INLINE
void LL_PWR_ClearFlag_WU1(void)
2211 WRITE_REG(PWR
->WKUPCR
, PWR_WKUPCR_WKUPC1
);
2214 #if defined (USE_FULL_LL_DRIVER)
2215 /** @defgroup PWR_LL_EF_Init De-initialization function
2218 ErrorStatus
LL_PWR_DeInit(void);
2222 #endif /* defined (USE_FULL_LL_DRIVER) */
2237 #endif /* defined (PWR) */
2247 #endif /* STM32H7xx_LL_PWR_H */
2249 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/