|
STM32F439xx HAL User Manual
|
00001 /** 00002 ****************************************************************************** 00003 * @file stm32f4xx_ll_pwr.h 00004 * @author MCD Application Team 00005 * @brief Header file of PWR LL module. 00006 ****************************************************************************** 00007 * @attention 00008 * 00009 * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2> 00010 * 00011 * Redistribution and use in source and binary forms, with or without modification, 00012 * are permitted provided that the following conditions are met: 00013 * 1. Redistributions of source code must retain the above copyright notice, 00014 * this list of conditions and the following disclaimer. 00015 * 2. Redistributions in binary form must reproduce the above copyright notice, 00016 * this list of conditions and the following disclaimer in the documentation 00017 * and/or other materials provided with the distribution. 00018 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00019 * may be used to endorse or promote products derived from this software 00020 * without specific prior written permission. 00021 * 00022 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00023 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00024 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00025 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00026 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00027 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00028 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00029 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00030 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00031 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00032 * 00033 ****************************************************************************** 00034 */ 00035 00036 /* Define to prevent recursive inclusion -------------------------------------*/ 00037 #ifndef __STM32F4xx_LL_PWR_H 00038 #define __STM32F4xx_LL_PWR_H 00039 00040 #ifdef __cplusplus 00041 extern "C" { 00042 #endif 00043 00044 /* Includes ------------------------------------------------------------------*/ 00045 #include "stm32f4xx.h" 00046 00047 /** @addtogroup STM32F4xx_LL_Driver 00048 * @{ 00049 */ 00050 00051 #if defined(PWR) 00052 00053 /** @defgroup PWR_LL PWR 00054 * @{ 00055 */ 00056 00057 /* Private types -------------------------------------------------------------*/ 00058 /* Private variables ---------------------------------------------------------*/ 00059 /* Private constants ---------------------------------------------------------*/ 00060 /* Private macros ------------------------------------------------------------*/ 00061 /* Exported types ------------------------------------------------------------*/ 00062 /* Exported constants --------------------------------------------------------*/ 00063 /** @defgroup PWR_LL_Exported_Constants PWR Exported Constants 00064 * @{ 00065 */ 00066 00067 /** @defgroup PWR_LL_EC_CLEAR_FLAG Clear Flags Defines 00068 * @brief Flags defines which can be used with LL_PWR_WriteReg function 00069 * @{ 00070 */ 00071 #define LL_PWR_CR_CSBF PWR_CR_CSBF /*!< Clear standby flag */ 00072 #define LL_PWR_CR_CWUF PWR_CR_CWUF /*!< Clear wakeup flag */ 00073 /** 00074 * @} 00075 */ 00076 00077 /** @defgroup PWR_LL_EC_GET_FLAG Get Flags Defines 00078 * @brief Flags defines which can be used with LL_PWR_ReadReg function 00079 * @{ 00080 */ 00081 #define LL_PWR_CSR_WUF PWR_CSR_WUF /*!< Wakeup flag */ 00082 #define LL_PWR_CSR_SBF PWR_CSR_SBF /*!< Standby flag */ 00083 #define LL_PWR_CSR_PVDO PWR_CSR_PVDO /*!< Power voltage detector output flag */ 00084 #define LL_PWR_CSR_VOS PWR_CSR_VOSRDY /*!< Voltage scaling select flag */ 00085 #if defined(PWR_CSR_EWUP) 00086 #define LL_PWR_CSR_EWUP1 PWR_CSR_EWUP /*!< Enable WKUP pin */ 00087 #elif defined(PWR_CSR_EWUP1) 00088 #define LL_PWR_CSR_EWUP1 PWR_CSR_EWUP1 /*!< Enable WKUP pin 1 */ 00089 #endif /* PWR_CSR_EWUP */ 00090 #if defined(PWR_CSR_EWUP2) 00091 #define LL_PWR_CSR_EWUP2 PWR_CSR_EWUP2 /*!< Enable WKUP pin 2 */ 00092 #endif /* PWR_CSR_EWUP2 */ 00093 #if defined(PWR_CSR_EWUP3) 00094 #define LL_PWR_CSR_EWUP3 PWR_CSR_EWUP3 /*!< Enable WKUP pin 3 */ 00095 #endif /* PWR_CSR_EWUP3 */ 00096 /** 00097 * @} 00098 */ 00099 00100 /** @defgroup PWR_LL_EC_REGU_VOLTAGE Regulator Voltage 00101 * @{ 00102 */ 00103 #if defined(PWR_CR_VOS_0) 00104 #define LL_PWR_REGU_VOLTAGE_SCALE3 (PWR_CR_VOS_0) 00105 #define LL_PWR_REGU_VOLTAGE_SCALE2 (PWR_CR_VOS_1) 00106 #define LL_PWR_REGU_VOLTAGE_SCALE1 (PWR_CR_VOS_0 | PWR_CR_VOS_1) /* The SCALE1 is not available for STM32F401xx devices */ 00107 #else 00108 #define LL_PWR_REGU_VOLTAGE_SCALE1 (PWR_CR_VOS) 00109 #define LL_PWR_REGU_VOLTAGE_SCALE2 0x00000000U 00110 #endif /* PWR_CR_VOS_0 */ 00111 /** 00112 * @} 00113 */ 00114 00115 /** @defgroup PWR_LL_EC_MODE_PWR Mode Power 00116 * @{ 00117 */ 00118 #define LL_PWR_MODE_STOP_MAINREGU 0x00000000U /*!< Enter Stop mode when the CPU enters deepsleep */ 00119 #define LL_PWR_MODE_STOP_LPREGU (PWR_CR_LPDS) /*!< Enter Stop mode (with low power Regulator ON) when the CPU enters deepsleep */ 00120 #if defined(PWR_CR_MRUDS) && defined(PWR_CR_LPUDS) && defined(PWR_CR_FPDS) 00121 #define LL_PWR_MODE_STOP_MAINREGU_UNDERDRIVE (PWR_CR_MRUDS | PWR_CR_FPDS) /*!< Enter Stop mode (with main Regulator in under-drive mode) when the CPU enters deepsleep */ 00122 #define LL_PWR_MODE_STOP_LPREGU_UNDERDRIVE (PWR_CR_LPDS | PWR_CR_LPUDS | PWR_CR_FPDS) /*!< Enter Stop mode (with low power Regulator in under-drive mode) when the CPU enters deepsleep */ 00123 #endif /* PWR_CR_MRUDS && PWR_CR_LPUDS && PWR_CR_FPDS */ 00124 #if defined(PWR_CR_MRLVDS) && defined(PWR_CR_LPLVDS) && defined(PWR_CR_FPDS) 00125 #define LL_PWR_MODE_STOP_MAINREGU_DEEPSLEEP (PWR_CR_MRLVDS | PWR_CR_FPDS) /*!< Enter Stop mode (with main Regulator in Deep Sleep mode) when the CPU enters deepsleep */ 00126 #define LL_PWR_MODE_STOP_LPREGU_DEEPSLEEP (PWR_CR_LPDS | PWR_CR_LPLVDS | PWR_CR_FPDS) /*!< Enter Stop mode (with low power Regulator in Deep Sleep mode) when the CPU enters deepsleep */ 00127 #endif /* PWR_CR_MRLVDS && PWR_CR_LPLVDS && PWR_CR_FPDS */ 00128 #define LL_PWR_MODE_STANDBY (PWR_CR_PDDS) /*!< Enter Standby mode when the CPU enters deepsleep */ 00129 /** 00130 * @} 00131 */ 00132 00133 /** @defgroup PWR_LL_EC_REGU_MODE_DS_MODE Regulator Mode In Deep Sleep Mode 00134 * @{ 00135 */ 00136 #define LL_PWR_REGU_DSMODE_MAIN 0x00000000U /*!< Voltage Regulator in main mode during deepsleep mode */ 00137 #define LL_PWR_REGU_DSMODE_LOW_POWER (PWR_CR_LPDS) /*!< Voltage Regulator in low-power mode during deepsleep mode */ 00138 /** 00139 * @} 00140 */ 00141 00142 /** @defgroup PWR_LL_EC_PVDLEVEL Power Voltage Detector Level 00143 * @{ 00144 */ 00145 #define LL_PWR_PVDLEVEL_0 (PWR_CR_PLS_LEV0) /*!< Voltage threshold detected by PVD 2.2 V */ 00146 #define LL_PWR_PVDLEVEL_1 (PWR_CR_PLS_LEV1) /*!< Voltage threshold detected by PVD 2.3 V */ 00147 #define LL_PWR_PVDLEVEL_2 (PWR_CR_PLS_LEV2) /*!< Voltage threshold detected by PVD 2.4 V */ 00148 #define LL_PWR_PVDLEVEL_3 (PWR_CR_PLS_LEV3) /*!< Voltage threshold detected by PVD 2.5 V */ 00149 #define LL_PWR_PVDLEVEL_4 (PWR_CR_PLS_LEV4) /*!< Voltage threshold detected by PVD 2.6 V */ 00150 #define LL_PWR_PVDLEVEL_5 (PWR_CR_PLS_LEV5) /*!< Voltage threshold detected by PVD 2.7 V */ 00151 #define LL_PWR_PVDLEVEL_6 (PWR_CR_PLS_LEV6) /*!< Voltage threshold detected by PVD 2.8 V */ 00152 #define LL_PWR_PVDLEVEL_7 (PWR_CR_PLS_LEV7) /*!< Voltage threshold detected by PVD 2.9 V */ 00153 /** 00154 * @} 00155 */ 00156 /** @defgroup PWR_LL_EC_WAKEUP_PIN Wakeup Pins 00157 * @{ 00158 */ 00159 #if defined(PWR_CSR_EWUP) 00160 #define LL_PWR_WAKEUP_PIN1 (PWR_CSR_EWUP) /*!< WKUP pin : PA0 */ 00161 #endif /* PWR_CSR_EWUP */ 00162 #if defined(PWR_CSR_EWUP1) 00163 #define LL_PWR_WAKEUP_PIN1 (PWR_CSR_EWUP1) /*!< WKUP pin 1 : PA0 */ 00164 #endif /* PWR_CSR_EWUP1 */ 00165 #if defined(PWR_CSR_EWUP2) 00166 #define LL_PWR_WAKEUP_PIN2 (PWR_CSR_EWUP2) /*!< WKUP pin 2 : PC0 or PC13 according to device */ 00167 #endif /* PWR_CSR_EWUP2 */ 00168 #if defined(PWR_CSR_EWUP3) 00169 #define LL_PWR_WAKEUP_PIN3 (PWR_CSR_EWUP3) /*!< WKUP pin 3 : PC1 */ 00170 #endif /* PWR_CSR_EWUP3 */ 00171 /** 00172 * @} 00173 */ 00174 00175 /** 00176 * @} 00177 */ 00178 00179 00180 /* Exported macro ------------------------------------------------------------*/ 00181 /** @defgroup PWR_LL_Exported_Macros PWR Exported Macros 00182 * @{ 00183 */ 00184 00185 /** @defgroup PWR_LL_EM_WRITE_READ Common write and read registers Macros 00186 * @{ 00187 */ 00188 00189 /** 00190 * @brief Write a value in PWR register 00191 * @param __REG__ Register to be written 00192 * @param __VALUE__ Value to be written in the register 00193 * @retval None 00194 */ 00195 #define LL_PWR_WriteReg(__REG__, __VALUE__) WRITE_REG(PWR->__REG__, (__VALUE__)) 00196 00197 /** 00198 * @brief Read a value in PWR register 00199 * @param __REG__ Register to be read 00200 * @retval Register value 00201 */ 00202 #define LL_PWR_ReadReg(__REG__) READ_REG(PWR->__REG__) 00203 /** 00204 * @} 00205 */ 00206 00207 /** 00208 * @} 00209 */ 00210 00211 /* Exported functions --------------------------------------------------------*/ 00212 /** @defgroup PWR_LL_Exported_Functions PWR Exported Functions 00213 * @{ 00214 */ 00215 00216 /** @defgroup PWR_LL_EF_Configuration Configuration 00217 * @{ 00218 */ 00219 #if defined(PWR_CR_FISSR) 00220 /** 00221 * @brief Enable FLASH interface STOP while system Run is ON 00222 * @rmtoll CR FISSR LL_PWR_EnableFLASHInterfaceSTOP 00223 * @note This mode is enabled only with STOP low power mode. 00224 * @retval None 00225 */ 00226 __STATIC_INLINE void LL_PWR_EnableFLASHInterfaceSTOP(void) 00227 { 00228 SET_BIT(PWR->CR, PWR_CR_FISSR); 00229 } 00230 00231 /** 00232 * @brief Disable FLASH Interface STOP while system Run is ON 00233 * @rmtoll CR FISSR LL_PWR_DisableFLASHInterfaceSTOP 00234 * @retval None 00235 */ 00236 __STATIC_INLINE void LL_PWR_DisableFLASHInterfaceSTOP(void) 00237 { 00238 CLEAR_BIT(PWR->CR, PWR_CR_FISSR); 00239 } 00240 00241 /** 00242 * @brief Check if FLASH Interface STOP while system Run feature is enabled 00243 * @rmtoll CR FISSR LL_PWR_IsEnabledFLASHInterfaceSTOP 00244 * @retval State of bit (1 or 0). 00245 */ 00246 __STATIC_INLINE uint32_t LL_PWR_IsEnabledFLASHInterfaceSTOP(void) 00247 { 00248 return (READ_BIT(PWR->CR, PWR_CR_FISSR) == (PWR_CR_FISSR)); 00249 } 00250 #endif /* PWR_CR_FISSR */ 00251 00252 #if defined(PWR_CR_FMSSR) 00253 /** 00254 * @brief Enable FLASH Memory STOP while system Run is ON 00255 * @rmtoll CR FMSSR LL_PWR_EnableFLASHMemorySTOP 00256 * @note This mode is enabled only with STOP low power mode. 00257 * @retval None 00258 */ 00259 __STATIC_INLINE void LL_PWR_EnableFLASHMemorySTOP(void) 00260 { 00261 SET_BIT(PWR->CR, PWR_CR_FMSSR); 00262 } 00263 00264 /** 00265 * @brief Disable FLASH Memory STOP while system Run is ON 00266 * @rmtoll CR FMSSR LL_PWR_DisableFLASHMemorySTOP 00267 * @retval None 00268 */ 00269 __STATIC_INLINE void LL_PWR_DisableFLASHMemorySTOP(void) 00270 { 00271 CLEAR_BIT(PWR->CR, PWR_CR_FMSSR); 00272 } 00273 00274 /** 00275 * @brief Check if FLASH Memory STOP while system Run feature is enabled 00276 * @rmtoll CR FMSSR LL_PWR_IsEnabledFLASHMemorySTOP 00277 * @retval State of bit (1 or 0). 00278 */ 00279 __STATIC_INLINE uint32_t LL_PWR_IsEnabledFLASHMemorySTOP(void) 00280 { 00281 return (READ_BIT(PWR->CR, PWR_CR_FMSSR) == (PWR_CR_FMSSR)); 00282 } 00283 #endif /* PWR_CR_FMSSR */ 00284 #if defined(PWR_CR_UDEN) 00285 /** 00286 * @brief Enable Under Drive Mode 00287 * @rmtoll CR UDEN LL_PWR_EnableUnderDriveMode 00288 * @note This mode is enabled only with STOP low power mode. 00289 * In this mode, the 1.2V domain is preserved in reduced leakage mode. This 00290 * mode is only available when the main Regulator or the low power Regulator 00291 * is in low voltage mode. 00292 * @note If the Under-drive mode was enabled, it is automatically disabled after 00293 * exiting Stop mode. 00294 * When the voltage Regulator operates in Under-drive mode, an additional 00295 * startup delay is induced when waking up from Stop mode. 00296 * @retval None 00297 */ 00298 __STATIC_INLINE void LL_PWR_EnableUnderDriveMode(void) 00299 { 00300 SET_BIT(PWR->CR, PWR_CR_UDEN); 00301 } 00302 00303 /** 00304 * @brief Disable Under Drive Mode 00305 * @rmtoll CR UDEN LL_PWR_DisableUnderDriveMode 00306 * @retval None 00307 */ 00308 __STATIC_INLINE void LL_PWR_DisableUnderDriveMode(void) 00309 { 00310 CLEAR_BIT(PWR->CR, PWR_CR_UDEN); 00311 } 00312 00313 /** 00314 * @brief Check if Under Drive Mode is enabled 00315 * @rmtoll CR UDEN LL_PWR_IsEnabledUnderDriveMode 00316 * @retval State of bit (1 or 0). 00317 */ 00318 __STATIC_INLINE uint32_t LL_PWR_IsEnabledUnderDriveMode(void) 00319 { 00320 return (READ_BIT(PWR->CR, PWR_CR_UDEN) == (PWR_CR_UDEN)); 00321 } 00322 #endif /* PWR_CR_UDEN */ 00323 00324 #if defined(PWR_CR_ODSWEN) 00325 /** 00326 * @brief Enable Over drive switching 00327 * @rmtoll CR ODSWEN LL_PWR_EnableOverDriveSwitching 00328 * @retval None 00329 */ 00330 __STATIC_INLINE void LL_PWR_EnableOverDriveSwitching(void) 00331 { 00332 SET_BIT(PWR->CR, PWR_CR_ODSWEN); 00333 } 00334 00335 /** 00336 * @brief Disable Over drive switching 00337 * @rmtoll CR ODSWEN LL_PWR_DisableOverDriveSwitching 00338 * @retval None 00339 */ 00340 __STATIC_INLINE void LL_PWR_DisableOverDriveSwitching(void) 00341 { 00342 CLEAR_BIT(PWR->CR, PWR_CR_ODSWEN); 00343 } 00344 00345 /** 00346 * @brief Check if Over drive switching is enabled 00347 * @rmtoll CR ODSWEN LL_PWR_IsEnabledOverDriveSwitching 00348 * @retval State of bit (1 or 0). 00349 */ 00350 __STATIC_INLINE uint32_t LL_PWR_IsEnabledOverDriveSwitching(void) 00351 { 00352 return (READ_BIT(PWR->CR, PWR_CR_ODSWEN) == (PWR_CR_ODSWEN)); 00353 } 00354 #endif /* PWR_CR_ODSWEN */ 00355 #if defined(PWR_CR_ODEN) 00356 /** 00357 * @brief Enable Over drive Mode 00358 * @rmtoll CR ODEN LL_PWR_EnableOverDriveMode 00359 * @retval None 00360 */ 00361 __STATIC_INLINE void LL_PWR_EnableOverDriveMode(void) 00362 { 00363 SET_BIT(PWR->CR, PWR_CR_ODEN); 00364 } 00365 00366 /** 00367 * @brief Disable Over drive Mode 00368 * @rmtoll CR ODEN LL_PWR_DisableOverDriveMode 00369 * @retval None 00370 */ 00371 __STATIC_INLINE void LL_PWR_DisableOverDriveMode(void) 00372 { 00373 CLEAR_BIT(PWR->CR, PWR_CR_ODEN); 00374 } 00375 00376 /** 00377 * @brief Check if Over drive switching is enabled 00378 * @rmtoll CR ODEN LL_PWR_IsEnabledOverDriveMode 00379 * @retval State of bit (1 or 0). 00380 */ 00381 __STATIC_INLINE uint32_t LL_PWR_IsEnabledOverDriveMode(void) 00382 { 00383 return (READ_BIT(PWR->CR, PWR_CR_ODEN) == (PWR_CR_ODEN)); 00384 } 00385 #endif /* PWR_CR_ODEN */ 00386 #if defined(PWR_CR_MRUDS) 00387 /** 00388 * @brief Enable Main Regulator in deepsleep under-drive Mode 00389 * @rmtoll CR MRUDS LL_PWR_EnableMainRegulatorDeepSleepUDMode 00390 * @retval None 00391 */ 00392 __STATIC_INLINE void LL_PWR_EnableMainRegulatorDeepSleepUDMode(void) 00393 { 00394 SET_BIT(PWR->CR, PWR_CR_MRUDS); 00395 } 00396 00397 /** 00398 * @brief Disable Main Regulator in deepsleep under-drive Mode 00399 * @rmtoll CR MRUDS LL_PWR_DisableMainRegulatorDeepSleepUDMode 00400 * @retval None 00401 */ 00402 __STATIC_INLINE void LL_PWR_DisableMainRegulatorDeepSleepUDMode(void) 00403 { 00404 CLEAR_BIT(PWR->CR, PWR_CR_MRUDS); 00405 } 00406 00407 /** 00408 * @brief Check if Main Regulator in deepsleep under-drive Mode is enabled 00409 * @rmtoll CR MRUDS LL_PWR_IsEnabledMainRegulatorDeepSleepUDMode 00410 * @retval State of bit (1 or 0). 00411 */ 00412 __STATIC_INLINE uint32_t LL_PWR_IsEnabledMainRegulatorDeepSleepUDMode(void) 00413 { 00414 return (READ_BIT(PWR->CR, PWR_CR_MRUDS) == (PWR_CR_MRUDS)); 00415 } 00416 #endif /* PWR_CR_MRUDS */ 00417 00418 #if defined(PWR_CR_LPUDS) 00419 /** 00420 * @brief Enable Low Power Regulator in deepsleep under-drive Mode 00421 * @rmtoll CR LPUDS LL_PWR_EnableLowPowerRegulatorDeepSleepUDMode 00422 * @retval None 00423 */ 00424 __STATIC_INLINE void LL_PWR_EnableLowPowerRegulatorDeepSleepUDMode(void) 00425 { 00426 SET_BIT(PWR->CR, PWR_CR_LPUDS); 00427 } 00428 00429 /** 00430 * @brief Disable Low Power Regulator in deepsleep under-drive Mode 00431 * @rmtoll CR LPUDS LL_PWR_DisableLowPowerRegulatorDeepSleepUDMode 00432 * @retval None 00433 */ 00434 __STATIC_INLINE void LL_PWR_DisableLowPowerRegulatorDeepSleepUDMode(void) 00435 { 00436 CLEAR_BIT(PWR->CR, PWR_CR_LPUDS); 00437 } 00438 00439 /** 00440 * @brief Check if Low Power Regulator in deepsleep under-drive Mode is enabled 00441 * @rmtoll CR LPUDS LL_PWR_IsEnabledLowPowerRegulatorDeepSleepUDMode 00442 * @retval State of bit (1 or 0). 00443 */ 00444 __STATIC_INLINE uint32_t LL_PWR_IsEnabledLowPowerRegulatorDeepSleepUDMode(void) 00445 { 00446 return (READ_BIT(PWR->CR, PWR_CR_LPUDS) == (PWR_CR_LPUDS)); 00447 } 00448 #endif /* PWR_CR_LPUDS */ 00449 00450 #if defined(PWR_CR_MRLVDS) 00451 /** 00452 * @brief Enable Main Regulator low voltage Mode 00453 * @rmtoll CR MRLVDS LL_PWR_EnableMainRegulatorLowVoltageMode 00454 * @retval None 00455 */ 00456 __STATIC_INLINE void LL_PWR_EnableMainRegulatorLowVoltageMode(void) 00457 { 00458 SET_BIT(PWR->CR, PWR_CR_MRLVDS); 00459 } 00460 00461 /** 00462 * @brief Disable Main Regulator low voltage Mode 00463 * @rmtoll CR MRLVDS LL_PWR_DisableMainRegulatorLowVoltageMode 00464 * @retval None 00465 */ 00466 __STATIC_INLINE void LL_PWR_DisableMainRegulatorLowVoltageMode(void) 00467 { 00468 CLEAR_BIT(PWR->CR, PWR_CR_MRLVDS); 00469 } 00470 00471 /** 00472 * @brief Check if Main Regulator low voltage Mode is enabled 00473 * @rmtoll CR MRLVDS LL_PWR_IsEnabledMainRegulatorLowVoltageMode 00474 * @retval State of bit (1 or 0). 00475 */ 00476 __STATIC_INLINE uint32_t LL_PWR_IsEnabledMainRegulatorLowVoltageMode(void) 00477 { 00478 return (READ_BIT(PWR->CR, PWR_CR_MRLVDS) == (PWR_CR_MRLVDS)); 00479 } 00480 #endif /* PWR_CR_MRLVDS */ 00481 00482 #if defined(PWR_CR_LPLVDS) 00483 /** 00484 * @brief Enable Low Power Regulator low voltage Mode 00485 * @rmtoll CR LPLVDS LL_PWR_EnableLowPowerRegulatorLowVoltageMode 00486 * @retval None 00487 */ 00488 __STATIC_INLINE void LL_PWR_EnableLowPowerRegulatorLowVoltageMode(void) 00489 { 00490 SET_BIT(PWR->CR, PWR_CR_LPLVDS); 00491 } 00492 00493 /** 00494 * @brief Disable Low Power Regulator low voltage Mode 00495 * @rmtoll CR LPLVDS LL_PWR_DisableLowPowerRegulatorLowVoltageMode 00496 * @retval None 00497 */ 00498 __STATIC_INLINE void LL_PWR_DisableLowPowerRegulatorLowVoltageMode(void) 00499 { 00500 CLEAR_BIT(PWR->CR, PWR_CR_LPLVDS); 00501 } 00502 00503 /** 00504 * @brief Check if Low Power Regulator low voltage Mode is enabled 00505 * @rmtoll CR LPLVDS LL_PWR_IsEnabledLowPowerRegulatorLowVoltageMode 00506 * @retval State of bit (1 or 0). 00507 */ 00508 __STATIC_INLINE uint32_t LL_PWR_IsEnabledLowPowerRegulatorLowVoltageMode(void) 00509 { 00510 return (READ_BIT(PWR->CR, PWR_CR_LPLVDS) == (PWR_CR_LPLVDS)); 00511 } 00512 #endif /* PWR_CR_LPLVDS */ 00513 /** 00514 * @brief Set the main internal Regulator output voltage 00515 * @rmtoll CR VOS LL_PWR_SetRegulVoltageScaling 00516 * @param VoltageScaling This parameter can be one of the following values: 00517 * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE1 (*) 00518 * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE2 00519 * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE3 00520 * (*) LL_PWR_REGU_VOLTAGE_SCALE1 is not available for STM32F401xx devices 00521 * @retval None 00522 */ 00523 __STATIC_INLINE void LL_PWR_SetRegulVoltageScaling(uint32_t VoltageScaling) 00524 { 00525 MODIFY_REG(PWR->CR, PWR_CR_VOS, VoltageScaling); 00526 } 00527 00528 /** 00529 * @brief Get the main internal Regulator output voltage 00530 * @rmtoll CR VOS LL_PWR_GetRegulVoltageScaling 00531 * @retval Returned value can be one of the following values: 00532 * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE1 (*) 00533 * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE2 00534 * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE3 00535 * (*) LL_PWR_REGU_VOLTAGE_SCALE1 is not available for STM32F401xx devices 00536 */ 00537 __STATIC_INLINE uint32_t LL_PWR_GetRegulVoltageScaling(void) 00538 { 00539 return (uint32_t)(READ_BIT(PWR->CR, PWR_CR_VOS)); 00540 } 00541 /** 00542 * @brief Enable the Flash Power Down in Stop Mode 00543 * @rmtoll CR FPDS LL_PWR_EnableFlashPowerDown 00544 * @retval None 00545 */ 00546 __STATIC_INLINE void LL_PWR_EnableFlashPowerDown(void) 00547 { 00548 SET_BIT(PWR->CR, PWR_CR_FPDS); 00549 } 00550 00551 /** 00552 * @brief Disable the Flash Power Down in Stop Mode 00553 * @rmtoll CR FPDS LL_PWR_DisableFlashPowerDown 00554 * @retval None 00555 */ 00556 __STATIC_INLINE void LL_PWR_DisableFlashPowerDown(void) 00557 { 00558 CLEAR_BIT(PWR->CR, PWR_CR_FPDS); 00559 } 00560 00561 /** 00562 * @brief Check if the Flash Power Down in Stop Mode is enabled 00563 * @rmtoll CR FPDS LL_PWR_IsEnabledFlashPowerDown 00564 * @retval State of bit (1 or 0). 00565 */ 00566 __STATIC_INLINE uint32_t LL_PWR_IsEnabledFlashPowerDown(void) 00567 { 00568 return (READ_BIT(PWR->CR, PWR_CR_FPDS) == (PWR_CR_FPDS)); 00569 } 00570 00571 /** 00572 * @brief Enable access to the backup domain 00573 * @rmtoll CR DBP LL_PWR_EnableBkUpAccess 00574 * @retval None 00575 */ 00576 __STATIC_INLINE void LL_PWR_EnableBkUpAccess(void) 00577 { 00578 SET_BIT(PWR->CR, PWR_CR_DBP); 00579 } 00580 00581 /** 00582 * @brief Disable access to the backup domain 00583 * @rmtoll CR DBP LL_PWR_DisableBkUpAccess 00584 * @retval None 00585 */ 00586 __STATIC_INLINE void LL_PWR_DisableBkUpAccess(void) 00587 { 00588 CLEAR_BIT(PWR->CR, PWR_CR_DBP); 00589 } 00590 00591 /** 00592 * @brief Check if the backup domain is enabled 00593 * @rmtoll CR DBP LL_PWR_IsEnabledBkUpAccess 00594 * @retval State of bit (1 or 0). 00595 */ 00596 __STATIC_INLINE uint32_t LL_PWR_IsEnabledBkUpAccess(void) 00597 { 00598 return (READ_BIT(PWR->CR, PWR_CR_DBP) == (PWR_CR_DBP)); 00599 } 00600 /** 00601 * @brief Enable the backup Regulator 00602 * @rmtoll CSR BRE LL_PWR_EnableBkUpRegulator 00603 * @note The BRE bit of the PWR_CSR register is protected against parasitic write access. 00604 * The LL_PWR_EnableBkUpAccess() must be called before using this API. 00605 * @retval None 00606 */ 00607 __STATIC_INLINE void LL_PWR_EnableBkUpRegulator(void) 00608 { 00609 SET_BIT(PWR->CSR, PWR_CSR_BRE); 00610 } 00611 00612 /** 00613 * @brief Disable the backup Regulator 00614 * @rmtoll CSR BRE LL_PWR_DisableBkUpRegulator 00615 * @note The BRE bit of the PWR_CSR register is protected against parasitic write access. 00616 * The LL_PWR_EnableBkUpAccess() must be called before using this API. 00617 * @retval None 00618 */ 00619 __STATIC_INLINE void LL_PWR_DisableBkUpRegulator(void) 00620 { 00621 CLEAR_BIT(PWR->CSR, PWR_CSR_BRE); 00622 } 00623 00624 /** 00625 * @brief Check if the backup Regulator is enabled 00626 * @rmtoll CSR BRE LL_PWR_IsEnabledBkUpRegulator 00627 * @retval State of bit (1 or 0). 00628 */ 00629 __STATIC_INLINE uint32_t LL_PWR_IsEnabledBkUpRegulator(void) 00630 { 00631 return (READ_BIT(PWR->CSR, PWR_CSR_BRE) == (PWR_CSR_BRE)); 00632 } 00633 00634 /** 00635 * @brief Set voltage Regulator mode during deep sleep mode 00636 * @rmtoll CR LPDS LL_PWR_SetRegulModeDS 00637 * @param RegulMode This parameter can be one of the following values: 00638 * @arg @ref LL_PWR_REGU_DSMODE_MAIN 00639 * @arg @ref LL_PWR_REGU_DSMODE_LOW_POWER 00640 * @retval None 00641 */ 00642 __STATIC_INLINE void LL_PWR_SetRegulModeDS(uint32_t RegulMode) 00643 { 00644 MODIFY_REG(PWR->CR, PWR_CR_LPDS, RegulMode); 00645 } 00646 00647 /** 00648 * @brief Get voltage Regulator mode during deep sleep mode 00649 * @rmtoll CR LPDS LL_PWR_GetRegulModeDS 00650 * @retval Returned value can be one of the following values: 00651 * @arg @ref LL_PWR_REGU_DSMODE_MAIN 00652 * @arg @ref LL_PWR_REGU_DSMODE_LOW_POWER 00653 */ 00654 __STATIC_INLINE uint32_t LL_PWR_GetRegulModeDS(void) 00655 { 00656 return (uint32_t)(READ_BIT(PWR->CR, PWR_CR_LPDS)); 00657 } 00658 00659 /** 00660 * @brief Set Power Down mode when CPU enters deepsleep 00661 * @rmtoll CR PDDS LL_PWR_SetPowerMode\n 00662 * @rmtoll CR MRUDS LL_PWR_SetPowerMode\n 00663 * @rmtoll CR LPUDS LL_PWR_SetPowerMode\n 00664 * @rmtoll CR FPDS LL_PWR_SetPowerMode\n 00665 * @rmtoll CR MRLVDS LL_PWR_SetPowerMode\n 00666 * @rmtoll CR LPlVDS LL_PWR_SetPowerMode\n 00667 * @rmtoll CR FPDS LL_PWR_SetPowerMode\n 00668 * @rmtoll CR LPDS LL_PWR_SetPowerMode 00669 * @param PDMode This parameter can be one of the following values: 00670 * @arg @ref LL_PWR_MODE_STOP_MAINREGU 00671 * @arg @ref LL_PWR_MODE_STOP_LPREGU 00672 * @arg @ref LL_PWR_MODE_STOP_MAINREGU_UNDERDRIVE (*) 00673 * @arg @ref LL_PWR_MODE_STOP_LPREGU_UNDERDRIVE (*) 00674 * @arg @ref LL_PWR_MODE_STOP_MAINREGU_DEEPSLEEP (*) 00675 * @arg @ref LL_PWR_MODE_STOP_LPREGU_DEEPSLEEP (*) 00676 * 00677 * (*) not available on all devices 00678 * @arg @ref LL_PWR_MODE_STANDBY 00679 * @retval None 00680 */ 00681 __STATIC_INLINE void LL_PWR_SetPowerMode(uint32_t PDMode) 00682 { 00683 #if defined(PWR_CR_MRUDS) && defined(PWR_CR_LPUDS) && defined(PWR_CR_FPDS) 00684 MODIFY_REG(PWR->CR, (PWR_CR_PDDS | PWR_CR_LPDS | PWR_CR_FPDS | PWR_CR_LPUDS | PWR_CR_MRUDS), PDMode); 00685 #elif defined(PWR_CR_MRLVDS) && defined(PWR_CR_LPLVDS) && defined(PWR_CR_FPDS) 00686 MODIFY_REG(PWR->CR, (PWR_CR_PDDS | PWR_CR_LPDS | PWR_CR_FPDS | PWR_CR_LPLVDS | PWR_CR_MRLVDS), PDMode); 00687 #else 00688 MODIFY_REG(PWR->CR, (PWR_CR_PDDS| PWR_CR_LPDS), PDMode); 00689 #endif /* PWR_CR_MRUDS && PWR_CR_LPUDS && PWR_CR_FPDS */ 00690 } 00691 00692 /** 00693 * @brief Get Power Down mode when CPU enters deepsleep 00694 * @rmtoll CR PDDS LL_PWR_GetPowerMode\n 00695 * @rmtoll CR MRUDS LL_PWR_GetPowerMode\n 00696 * @rmtoll CR LPUDS LL_PWR_GetPowerMode\n 00697 * @rmtoll CR FPDS LL_PWR_GetPowerMode\n 00698 * @rmtoll CR MRLVDS LL_PWR_GetPowerMode\n 00699 * @rmtoll CR LPLVDS LL_PWR_GetPowerMode\n 00700 * @rmtoll CR FPDS LL_PWR_GetPowerMode\n 00701 * @rmtoll CR LPDS LL_PWR_GetPowerMode 00702 * @retval Returned value can be one of the following values: 00703 * @arg @ref LL_PWR_MODE_STOP_MAINREGU 00704 * @arg @ref LL_PWR_MODE_STOP_LPREGU 00705 * @arg @ref LL_PWR_MODE_STOP_MAINREGU_UNDERDRIVE (*) 00706 * @arg @ref LL_PWR_MODE_STOP_LPREGU_UNDERDRIVE (*) 00707 * @arg @ref LL_PWR_MODE_STOP_MAINREGU_DEEPSLEEP (*) 00708 * @arg @ref LL_PWR_MODE_STOP_LPREGU_DEEPSLEEP (*) 00709 * 00710 * (*) not available on all devices 00711 * @arg @ref LL_PWR_MODE_STANDBY 00712 */ 00713 __STATIC_INLINE uint32_t LL_PWR_GetPowerMode(void) 00714 { 00715 #if defined(PWR_CR_MRUDS) && defined(PWR_CR_LPUDS) && defined(PWR_CR_FPDS) 00716 return (uint32_t)(READ_BIT(PWR->CR, (PWR_CR_PDDS | PWR_CR_LPDS | PWR_CR_FPDS | PWR_CR_LPUDS | PWR_CR_MRUDS))); 00717 #elif defined(PWR_CR_MRLVDS) && defined(PWR_CR_LPLVDS) && defined(PWR_CR_FPDS) 00718 return (uint32_t)(READ_BIT(PWR->CR, (PWR_CR_PDDS | PWR_CR_LPDS | PWR_CR_FPDS | PWR_CR_LPLVDS | PWR_CR_MRLVDS))); 00719 #else 00720 return (uint32_t)(READ_BIT(PWR->CR, (PWR_CR_PDDS| PWR_CR_LPDS))); 00721 #endif /* PWR_CR_MRUDS && PWR_CR_LPUDS && PWR_CR_FPDS */ 00722 } 00723 00724 /** 00725 * @brief Configure the voltage threshold detected by the Power Voltage Detector 00726 * @rmtoll CR PLS LL_PWR_SetPVDLevel 00727 * @param PVDLevel This parameter can be one of the following values: 00728 * @arg @ref LL_PWR_PVDLEVEL_0 00729 * @arg @ref LL_PWR_PVDLEVEL_1 00730 * @arg @ref LL_PWR_PVDLEVEL_2 00731 * @arg @ref LL_PWR_PVDLEVEL_3 00732 * @arg @ref LL_PWR_PVDLEVEL_4 00733 * @arg @ref LL_PWR_PVDLEVEL_5 00734 * @arg @ref LL_PWR_PVDLEVEL_6 00735 * @arg @ref LL_PWR_PVDLEVEL_7 00736 * @retval None 00737 */ 00738 __STATIC_INLINE void LL_PWR_SetPVDLevel(uint32_t PVDLevel) 00739 { 00740 MODIFY_REG(PWR->CR, PWR_CR_PLS, PVDLevel); 00741 } 00742 00743 /** 00744 * @brief Get the voltage threshold detection 00745 * @rmtoll CR PLS LL_PWR_GetPVDLevel 00746 * @retval Returned value can be one of the following values: 00747 * @arg @ref LL_PWR_PVDLEVEL_0 00748 * @arg @ref LL_PWR_PVDLEVEL_1 00749 * @arg @ref LL_PWR_PVDLEVEL_2 00750 * @arg @ref LL_PWR_PVDLEVEL_3 00751 * @arg @ref LL_PWR_PVDLEVEL_4 00752 * @arg @ref LL_PWR_PVDLEVEL_5 00753 * @arg @ref LL_PWR_PVDLEVEL_6 00754 * @arg @ref LL_PWR_PVDLEVEL_7 00755 */ 00756 __STATIC_INLINE uint32_t LL_PWR_GetPVDLevel(void) 00757 { 00758 return (uint32_t)(READ_BIT(PWR->CR, PWR_CR_PLS)); 00759 } 00760 00761 /** 00762 * @brief Enable Power Voltage Detector 00763 * @rmtoll CR PVDE LL_PWR_EnablePVD 00764 * @retval None 00765 */ 00766 __STATIC_INLINE void LL_PWR_EnablePVD(void) 00767 { 00768 SET_BIT(PWR->CR, PWR_CR_PVDE); 00769 } 00770 00771 /** 00772 * @brief Disable Power Voltage Detector 00773 * @rmtoll CR PVDE LL_PWR_DisablePVD 00774 * @retval None 00775 */ 00776 __STATIC_INLINE void LL_PWR_DisablePVD(void) 00777 { 00778 CLEAR_BIT(PWR->CR, PWR_CR_PVDE); 00779 } 00780 00781 /** 00782 * @brief Check if Power Voltage Detector is enabled 00783 * @rmtoll CR PVDE LL_PWR_IsEnabledPVD 00784 * @retval State of bit (1 or 0). 00785 */ 00786 __STATIC_INLINE uint32_t LL_PWR_IsEnabledPVD(void) 00787 { 00788 return (READ_BIT(PWR->CR, PWR_CR_PVDE) == (PWR_CR_PVDE)); 00789 } 00790 00791 /** 00792 * @brief Enable the WakeUp PINx functionality 00793 * @rmtoll CSR EWUP LL_PWR_EnableWakeUpPin\n 00794 * @rmtoll CSR EWUP1 LL_PWR_EnableWakeUpPin\n 00795 * @rmtoll CSR EWUP2 LL_PWR_EnableWakeUpPin\n 00796 * @rmtoll CSR EWUP3 LL_PWR_EnableWakeUpPin 00797 * @param WakeUpPin This parameter can be one of the following values: 00798 * @arg @ref LL_PWR_WAKEUP_PIN1 00799 * @arg @ref LL_PWR_WAKEUP_PIN2 (*) 00800 * @arg @ref LL_PWR_WAKEUP_PIN3 (*) 00801 * 00802 * (*) not available on all devices 00803 * @retval None 00804 */ 00805 __STATIC_INLINE void LL_PWR_EnableWakeUpPin(uint32_t WakeUpPin) 00806 { 00807 SET_BIT(PWR->CSR, WakeUpPin); 00808 } 00809 00810 /** 00811 * @brief Disable the WakeUp PINx functionality 00812 * @rmtoll CSR EWUP LL_PWR_DisableWakeUpPin\n 00813 * @rmtoll CSR EWUP1 LL_PWR_DisableWakeUpPin\n 00814 * @rmtoll CSR EWUP2 LL_PWR_DisableWakeUpPin\n 00815 * @rmtoll CSR EWUP3 LL_PWR_DisableWakeUpPin 00816 * @param WakeUpPin This parameter can be one of the following values: 00817 * @arg @ref LL_PWR_WAKEUP_PIN1 00818 * @arg @ref LL_PWR_WAKEUP_PIN2 (*) 00819 * @arg @ref LL_PWR_WAKEUP_PIN3 (*) 00820 * 00821 * (*) not available on all devices 00822 * @retval None 00823 */ 00824 __STATIC_INLINE void LL_PWR_DisableWakeUpPin(uint32_t WakeUpPin) 00825 { 00826 CLEAR_BIT(PWR->CSR, WakeUpPin); 00827 } 00828 00829 /** 00830 * @brief Check if the WakeUp PINx functionality is enabled 00831 * @rmtoll CSR EWUP LL_PWR_IsEnabledWakeUpPin\n 00832 * @rmtoll CSR EWUP1 LL_PWR_IsEnabledWakeUpPin\n 00833 * @rmtoll CSR EWUP2 LL_PWR_IsEnabledWakeUpPin\n 00834 * @rmtoll CSR EWUP3 LL_PWR_IsEnabledWakeUpPin 00835 * @param WakeUpPin This parameter can be one of the following values: 00836 * @arg @ref LL_PWR_WAKEUP_PIN1 00837 * @arg @ref LL_PWR_WAKEUP_PIN2 (*) 00838 * @arg @ref LL_PWR_WAKEUP_PIN3 (*) 00839 * 00840 * (*) not available on all devices 00841 * @retval State of bit (1 or 0). 00842 */ 00843 __STATIC_INLINE uint32_t LL_PWR_IsEnabledWakeUpPin(uint32_t WakeUpPin) 00844 { 00845 return (READ_BIT(PWR->CSR, WakeUpPin) == (WakeUpPin)); 00846 } 00847 00848 00849 /** 00850 * @} 00851 */ 00852 00853 /** @defgroup PWR_LL_EF_FLAG_Management FLAG_Management 00854 * @{ 00855 */ 00856 00857 /** 00858 * @brief Get Wake-up Flag 00859 * @rmtoll CSR WUF LL_PWR_IsActiveFlag_WU 00860 * @retval State of bit (1 or 0). 00861 */ 00862 __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU(void) 00863 { 00864 return (READ_BIT(PWR->CSR, PWR_CSR_WUF) == (PWR_CSR_WUF)); 00865 } 00866 00867 /** 00868 * @brief Get Standby Flag 00869 * @rmtoll CSR SBF LL_PWR_IsActiveFlag_SB 00870 * @retval State of bit (1 or 0). 00871 */ 00872 __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_SB(void) 00873 { 00874 return (READ_BIT(PWR->CSR, PWR_CSR_SBF) == (PWR_CSR_SBF)); 00875 } 00876 00877 /** 00878 * @brief Get Backup Regulator ready Flag 00879 * @rmtoll CSR BRR LL_PWR_IsActiveFlag_BRR 00880 * @retval State of bit (1 or 0). 00881 */ 00882 __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_BRR(void) 00883 { 00884 return (READ_BIT(PWR->CSR, PWR_CSR_BRR) == (PWR_CSR_BRR)); 00885 } 00886 /** 00887 * @brief Indicate whether VDD voltage is below the selected PVD threshold 00888 * @rmtoll CSR PVDO LL_PWR_IsActiveFlag_PVDO 00889 * @retval State of bit (1 or 0). 00890 */ 00891 __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_PVDO(void) 00892 { 00893 return (READ_BIT(PWR->CSR, PWR_CSR_PVDO) == (PWR_CSR_PVDO)); 00894 } 00895 00896 /** 00897 * @brief Indicate whether the Regulator is ready in the selected voltage range or if its output voltage is still changing to the required voltage level 00898 * @rmtoll CSR VOS LL_PWR_IsActiveFlag_VOS 00899 * @retval State of bit (1 or 0). 00900 */ 00901 __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_VOS(void) 00902 { 00903 return (READ_BIT(PWR->CSR, LL_PWR_CSR_VOS) == (LL_PWR_CSR_VOS)); 00904 } 00905 #if defined(PWR_CR_ODEN) 00906 /** 00907 * @brief Indicate whether the Over-Drive mode is ready or not 00908 * @rmtoll CSR ODRDY LL_PWR_IsActiveFlag_OD 00909 * @retval State of bit (1 or 0). 00910 */ 00911 __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_OD(void) 00912 { 00913 return (READ_BIT(PWR->CSR, PWR_CSR_ODRDY) == (PWR_CSR_ODRDY)); 00914 } 00915 #endif /* PWR_CR_ODEN */ 00916 00917 #if defined(PWR_CR_ODSWEN) 00918 /** 00919 * @brief Indicate whether the Over-Drive mode switching is ready or not 00920 * @rmtoll CSR ODSWRDY LL_PWR_IsActiveFlag_ODSW 00921 * @retval State of bit (1 or 0). 00922 */ 00923 __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_ODSW(void) 00924 { 00925 return (READ_BIT(PWR->CSR, PWR_CSR_ODSWRDY) == (PWR_CSR_ODSWRDY)); 00926 } 00927 #endif /* PWR_CR_ODSWEN */ 00928 00929 #if defined(PWR_CR_UDEN) 00930 /** 00931 * @brief Indicate whether the Under-Drive mode is ready or not 00932 * @rmtoll CSR UDRDY LL_PWR_IsActiveFlag_UD 00933 * @retval State of bit (1 or 0). 00934 */ 00935 __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_UD(void) 00936 { 00937 return (READ_BIT(PWR->CSR, PWR_CSR_UDRDY) == (PWR_CSR_UDRDY)); 00938 } 00939 #endif /* PWR_CR_UDEN */ 00940 /** 00941 * @brief Clear Standby Flag 00942 * @rmtoll CR CSBF LL_PWR_ClearFlag_SB 00943 * @retval None 00944 */ 00945 __STATIC_INLINE void LL_PWR_ClearFlag_SB(void) 00946 { 00947 SET_BIT(PWR->CR, PWR_CR_CSBF); 00948 } 00949 00950 /** 00951 * @brief Clear Wake-up Flags 00952 * @rmtoll CR CWUF LL_PWR_ClearFlag_WU 00953 * @retval None 00954 */ 00955 __STATIC_INLINE void LL_PWR_ClearFlag_WU(void) 00956 { 00957 SET_BIT(PWR->CR, PWR_CR_CWUF); 00958 } 00959 #if defined(PWR_CSR_UDRDY) 00960 /** 00961 * @brief Clear Under-Drive ready Flag 00962 * @rmtoll CSR UDRDY LL_PWR_ClearFlag_UD 00963 * @retval None 00964 */ 00965 __STATIC_INLINE void LL_PWR_ClearFlag_UD(void) 00966 { 00967 WRITE_REG(PWR->CSR, PWR_CSR_UDRDY); 00968 } 00969 #endif /* PWR_CSR_UDRDY */ 00970 00971 /** 00972 * @} 00973 */ 00974 00975 #if defined(USE_FULL_LL_DRIVER) 00976 /** @defgroup PWR_LL_EF_Init De-initialization function 00977 * @{ 00978 */ 00979 ErrorStatus LL_PWR_DeInit(void); 00980 /** 00981 * @} 00982 */ 00983 #endif /* USE_FULL_LL_DRIVER */ 00984 00985 /** 00986 * @} 00987 */ 00988 00989 /** 00990 * @} 00991 */ 00992 00993 #endif /* defined(PWR) */ 00994 00995 /** 00996 * @} 00997 */ 00998 00999 #ifdef __cplusplus 01000 } 01001 #endif 01002 01003 #endif /* __STM32F4xx_LL_PWR_H */ 01004 01005 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
1.7.6.1