You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1008 lines
32 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_ll_pwr.h
  4. * @author MCD Application Team
  5. * @version V1.7.1
  6. * @date 14-April-2017
  7. * @brief Header file of PWR LL module.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
  12. *
  13. * Redistribution and use in source and binary forms, with or without modification,
  14. * are permitted provided that the following conditions are met:
  15. * 1. Redistributions of source code must retain the above copyright notice,
  16. * this list of conditions and the following disclaimer.
  17. * 2. Redistributions in binary form must reproduce the above copyright notice,
  18. * this list of conditions and the following disclaimer in the documentation
  19. * and/or other materials provided with the distribution.
  20. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  21. * may be used to endorse or promote products derived from this software
  22. * without specific prior written permission.
  23. *
  24. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  25. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  26. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  27. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  28. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  29. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  30. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  31. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  32. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  33. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  34. *
  35. ******************************************************************************
  36. */
  37. /* Define to prevent recursive inclusion -------------------------------------*/
  38. #ifndef __STM32F4xx_LL_PWR_H
  39. #define __STM32F4xx_LL_PWR_H
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. /* Includes ------------------------------------------------------------------*/
  44. #include "stm32f4xx.h"
  45. /** @addtogroup STM32F4xx_LL_Driver
  46. * @{
  47. */
  48. #if defined(PWR)
  49. /** @defgroup PWR_LL PWR
  50. * @{
  51. */
  52. /* Private types -------------------------------------------------------------*/
  53. /* Private variables ---------------------------------------------------------*/
  54. /* Private constants ---------------------------------------------------------*/
  55. /* Private macros ------------------------------------------------------------*/
  56. /* Exported types ------------------------------------------------------------*/
  57. /* Exported constants --------------------------------------------------------*/
  58. /** @defgroup PWR_LL_Exported_Constants PWR Exported Constants
  59. * @{
  60. */
  61. /** @defgroup PWR_LL_EC_CLEAR_FLAG Clear Flags Defines
  62. * @brief Flags defines which can be used with LL_PWR_WriteReg function
  63. * @{
  64. */
  65. #define LL_PWR_CR_CSBF PWR_CR_CSBF /*!< Clear standby flag */
  66. #define LL_PWR_CR_CWUF PWR_CR_CWUF /*!< Clear wakeup flag */
  67. /**
  68. * @}
  69. */
  70. /** @defgroup PWR_LL_EC_GET_FLAG Get Flags Defines
  71. * @brief Flags defines which can be used with LL_PWR_ReadReg function
  72. * @{
  73. */
  74. #define LL_PWR_CSR_WUF PWR_CSR_WUF /*!< Wakeup flag */
  75. #define LL_PWR_CSR_SBF PWR_CSR_SBF /*!< Standby flag */
  76. #define LL_PWR_CSR_PVDO PWR_CSR_PVDO /*!< Power voltage detector output flag */
  77. #define LL_PWR_CSR_VOS PWR_CSR_VOSRDY /*!< Voltage scaling select flag */
  78. #if defined(PWR_CSR_EWUP)
  79. #define LL_PWR_CSR_EWUP1 PWR_CSR_EWUP /*!< Enable WKUP pin */
  80. #elif defined(PWR_CSR_EWUP1)
  81. #define LL_PWR_CSR_EWUP1 PWR_CSR_EWUP1 /*!< Enable WKUP pin 1 */
  82. #endif /* PWR_CSR_EWUP */
  83. #if defined(PWR_CSR_EWUP2)
  84. #define LL_PWR_CSR_EWUP2 PWR_CSR_EWUP2 /*!< Enable WKUP pin 2 */
  85. #endif /* PWR_CSR_EWUP2 */
  86. #if defined(PWR_CSR_EWUP3)
  87. #define LL_PWR_CSR_EWUP3 PWR_CSR_EWUP3 /*!< Enable WKUP pin 3 */
  88. #endif /* PWR_CSR_EWUP3 */
  89. /**
  90. * @}
  91. */
  92. /** @defgroup PWR_LL_EC_REGU_VOLTAGE Regulator Voltage
  93. * @{
  94. */
  95. #if defined(PWR_CR_VOS_0)
  96. #define LL_PWR_REGU_VOLTAGE_SCALE3 (PWR_CR_VOS_0)
  97. #define LL_PWR_REGU_VOLTAGE_SCALE2 (PWR_CR_VOS_1)
  98. #define LL_PWR_REGU_VOLTAGE_SCALE1 (PWR_CR_VOS_0 | PWR_CR_VOS_1) /* The SCALE1 is not available for STM32F401xx devices */
  99. #else
  100. #define LL_PWR_REGU_VOLTAGE_SCALE1 (PWR_CR_VOS)
  101. #define LL_PWR_REGU_VOLTAGE_SCALE2 0x00000000U
  102. #endif /* PWR_CR_VOS_0 */
  103. /**
  104. * @}
  105. */
  106. /** @defgroup PWR_LL_EC_MODE_PWR Mode Power
  107. * @{
  108. */
  109. #define LL_PWR_MODE_STOP_MAINREGU 0x00000000U /*!< Enter Stop mode when the CPU enters deepsleep */
  110. #define LL_PWR_MODE_STOP_LPREGU (PWR_CR_LPDS) /*!< Enter Stop mode (with low power Regulator ON) when the CPU enters deepsleep */
  111. #if defined(PWR_CR_MRUDS) && defined(PWR_CR_LPUDS) && defined(PWR_CR_FPDS)
  112. #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 */
  113. #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 */
  114. #endif /* PWR_CR_MRUDS && PWR_CR_LPUDS && PWR_CR_FPDS */
  115. #if defined(PWR_CR_MRLVDS) && defined(PWR_CR_LPLVDS) && defined(PWR_CR_FPDS)
  116. #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 */
  117. #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 */
  118. #endif /* PWR_CR_MRLVDS && PWR_CR_LPLVDS && PWR_CR_FPDS */
  119. #define LL_PWR_MODE_STANDBY (PWR_CR_PDDS) /*!< Enter Standby mode when the CPU enters deepsleep */
  120. /**
  121. * @}
  122. */
  123. /** @defgroup PWR_LL_EC_REGU_MODE_DS_MODE Regulator Mode In Deep Sleep Mode
  124. * @{
  125. */
  126. #define LL_PWR_REGU_DSMODE_MAIN 0x00000000U /*!< Voltage Regulator in main mode during deepsleep mode */
  127. #define LL_PWR_REGU_DSMODE_LOW_POWER (PWR_CR_LPDS) /*!< Voltage Regulator in low-power mode during deepsleep mode */
  128. /**
  129. * @}
  130. */
  131. /** @defgroup PWR_LL_EC_PVDLEVEL Power Voltage Detector Level
  132. * @{
  133. */
  134. #define LL_PWR_PVDLEVEL_0 (PWR_CR_PLS_LEV0) /*!< Voltage threshold detected by PVD 2.2 V */
  135. #define LL_PWR_PVDLEVEL_1 (PWR_CR_PLS_LEV1) /*!< Voltage threshold detected by PVD 2.3 V */
  136. #define LL_PWR_PVDLEVEL_2 (PWR_CR_PLS_LEV2) /*!< Voltage threshold detected by PVD 2.4 V */
  137. #define LL_PWR_PVDLEVEL_3 (PWR_CR_PLS_LEV3) /*!< Voltage threshold detected by PVD 2.5 V */
  138. #define LL_PWR_PVDLEVEL_4 (PWR_CR_PLS_LEV4) /*!< Voltage threshold detected by PVD 2.6 V */
  139. #define LL_PWR_PVDLEVEL_5 (PWR_CR_PLS_LEV5) /*!< Voltage threshold detected by PVD 2.7 V */
  140. #define LL_PWR_PVDLEVEL_6 (PWR_CR_PLS_LEV6) /*!< Voltage threshold detected by PVD 2.8 V */
  141. #define LL_PWR_PVDLEVEL_7 (PWR_CR_PLS_LEV7) /*!< Voltage threshold detected by PVD 2.9 V */
  142. /**
  143. * @}
  144. */
  145. /** @defgroup PWR_LL_EC_WAKEUP_PIN Wakeup Pins
  146. * @{
  147. */
  148. #if defined(PWR_CSR_EWUP)
  149. #define LL_PWR_WAKEUP_PIN1 (PWR_CSR_EWUP) /*!< WKUP pin : PA0 */
  150. #endif /* PWR_CSR_EWUP */
  151. #if defined(PWR_CSR_EWUP1)
  152. #define LL_PWR_WAKEUP_PIN1 (PWR_CSR_EWUP1) /*!< WKUP pin 1 : PA0 */
  153. #endif /* PWR_CSR_EWUP1 */
  154. #if defined(PWR_CSR_EWUP2)
  155. #define LL_PWR_WAKEUP_PIN2 (PWR_CSR_EWUP2) /*!< WKUP pin 2 : PC0 or PC13 according to device */
  156. #endif /* PWR_CSR_EWUP2 */
  157. #if defined(PWR_CSR_EWUP3)
  158. #define LL_PWR_WAKEUP_PIN3 (PWR_CSR_EWUP3) /*!< WKUP pin 3 : PC1 */
  159. #endif /* PWR_CSR_EWUP3 */
  160. /**
  161. * @}
  162. */
  163. /**
  164. * @}
  165. */
  166. /* Exported macro ------------------------------------------------------------*/
  167. /** @defgroup PWR_LL_Exported_Macros PWR Exported Macros
  168. * @{
  169. */
  170. /** @defgroup PWR_LL_EM_WRITE_READ Common write and read registers Macros
  171. * @{
  172. */
  173. /**
  174. * @brief Write a value in PWR register
  175. * @param __REG__ Register to be written
  176. * @param __VALUE__ Value to be written in the register
  177. * @retval None
  178. */
  179. #define LL_PWR_WriteReg(__REG__, __VALUE__) WRITE_REG(PWR->__REG__, (__VALUE__))
  180. /**
  181. * @brief Read a value in PWR register
  182. * @param __REG__ Register to be read
  183. * @retval Register value
  184. */
  185. #define LL_PWR_ReadReg(__REG__) READ_REG(PWR->__REG__)
  186. /**
  187. * @}
  188. */
  189. /**
  190. * @}
  191. */
  192. /* Exported functions --------------------------------------------------------*/
  193. /** @defgroup PWR_LL_Exported_Functions PWR Exported Functions
  194. * @{
  195. */
  196. /** @defgroup PWR_LL_EF_Configuration Configuration
  197. * @{
  198. */
  199. #if defined(PWR_CR_FISSR)
  200. /**
  201. * @brief Enable FLASH interface STOP while system Run is ON
  202. * @rmtoll CR FISSR LL_PWR_EnableFLASHInterfaceSTOP
  203. * @note This mode is enabled only with STOP low power mode.
  204. * @retval None
  205. */
  206. __STATIC_INLINE void LL_PWR_EnableFLASHInterfaceSTOP(void)
  207. {
  208. SET_BIT(PWR->CR, PWR_CR_FISSR);
  209. }
  210. /**
  211. * @brief Disable FLASH Interface STOP while system Run is ON
  212. * @rmtoll CR FISSR LL_PWR_DisableFLASHInterfaceSTOP
  213. * @retval None
  214. */
  215. __STATIC_INLINE void LL_PWR_DisableFLASHInterfaceSTOP(void)
  216. {
  217. CLEAR_BIT(PWR->CR, PWR_CR_FISSR);
  218. }
  219. /**
  220. * @brief Check if FLASH Interface STOP while system Run feature is enabled
  221. * @rmtoll CR FISSR LL_PWR_IsEnabledFLASHInterfaceSTOP
  222. * @retval State of bit (1 or 0).
  223. */
  224. __STATIC_INLINE uint32_t LL_PWR_IsEnabledFLASHInterfaceSTOP(void)
  225. {
  226. return (READ_BIT(PWR->CR, PWR_CR_FISSR) == (PWR_CR_FISSR));
  227. }
  228. #endif /* PWR_CR_FISSR */
  229. #if defined(PWR_CR_FMSSR)
  230. /**
  231. * @brief Enable FLASH Memory STOP while system Run is ON
  232. * @rmtoll CR FMSSR LL_PWR_EnableFLASHMemorySTOP
  233. * @note This mode is enabled only with STOP low power mode.
  234. * @retval None
  235. */
  236. __STATIC_INLINE void LL_PWR_EnableFLASHMemorySTOP(void)
  237. {
  238. SET_BIT(PWR->CR, PWR_CR_FMSSR);
  239. }
  240. /**
  241. * @brief Disable FLASH Memory STOP while system Run is ON
  242. * @rmtoll CR FMSSR LL_PWR_DisableFLASHMemorySTOP
  243. * @retval None
  244. */
  245. __STATIC_INLINE void LL_PWR_DisableFLASHMemorySTOP(void)
  246. {
  247. CLEAR_BIT(PWR->CR, PWR_CR_FMSSR);
  248. }
  249. /**
  250. * @brief Check if FLASH Memory STOP while system Run feature is enabled
  251. * @rmtoll CR FMSSR LL_PWR_IsEnabledFLASHMemorySTOP
  252. * @retval State of bit (1 or 0).
  253. */
  254. __STATIC_INLINE uint32_t LL_PWR_IsEnabledFLASHMemorySTOP(void)
  255. {
  256. return (READ_BIT(PWR->CR, PWR_CR_FMSSR) == (PWR_CR_FMSSR));
  257. }
  258. #endif /* PWR_CR_FMSSR */
  259. #if defined(PWR_CR_UDEN)
  260. /**
  261. * @brief Enable Under Drive Mode
  262. * @rmtoll CR UDEN LL_PWR_EnableUnderDriveMode
  263. * @note This mode is enabled only with STOP low power mode.
  264. * In this mode, the 1.2V domain is preserved in reduced leakage mode. This
  265. * mode is only available when the main Regulator or the low power Regulator
  266. * is in low voltage mode.
  267. * @note If the Under-drive mode was enabled, it is automatically disabled after
  268. * exiting Stop mode.
  269. * When the voltage Regulator operates in Under-drive mode, an additional
  270. * startup delay is induced when waking up from Stop mode.
  271. * @retval None
  272. */
  273. __STATIC_INLINE void LL_PWR_EnableUnderDriveMode(void)
  274. {
  275. SET_BIT(PWR->CR, PWR_CR_UDEN);
  276. }
  277. /**
  278. * @brief Disable Under Drive Mode
  279. * @rmtoll CR UDEN LL_PWR_DisableUnderDriveMode
  280. * @retval None
  281. */
  282. __STATIC_INLINE void LL_PWR_DisableUnderDriveMode(void)
  283. {
  284. CLEAR_BIT(PWR->CR, PWR_CR_UDEN);
  285. }
  286. /**
  287. * @brief Check if Under Drive Mode is enabled
  288. * @rmtoll CR UDEN LL_PWR_IsEnabledUnderDriveMode
  289. * @retval State of bit (1 or 0).
  290. */
  291. __STATIC_INLINE uint32_t LL_PWR_IsEnabledUnderDriveMode(void)
  292. {
  293. return (READ_BIT(PWR->CR, PWR_CR_UDEN) == (PWR_CR_UDEN));
  294. }
  295. #endif /* PWR_CR_UDEN */
  296. #if defined(PWR_CR_ODSWEN)
  297. /**
  298. * @brief Enable Over drive switching
  299. * @rmtoll CR ODSWEN LL_PWR_EnableOverDriveSwitching
  300. * @retval None
  301. */
  302. __STATIC_INLINE void LL_PWR_EnableOverDriveSwitching(void)
  303. {
  304. SET_BIT(PWR->CR, PWR_CR_ODSWEN);
  305. }
  306. /**
  307. * @brief Disable Over drive switching
  308. * @rmtoll CR ODSWEN LL_PWR_DisableOverDriveSwitching
  309. * @retval None
  310. */
  311. __STATIC_INLINE void LL_PWR_DisableOverDriveSwitching(void)
  312. {
  313. CLEAR_BIT(PWR->CR, PWR_CR_ODSWEN);
  314. }
  315. /**
  316. * @brief Check if Over drive switching is enabled
  317. * @rmtoll CR ODSWEN LL_PWR_IsEnabledOverDriveSwitching
  318. * @retval State of bit (1 or 0).
  319. */
  320. __STATIC_INLINE uint32_t LL_PWR_IsEnabledOverDriveSwitching(void)
  321. {
  322. return (READ_BIT(PWR->CR, PWR_CR_ODSWEN) == (PWR_CR_ODSWEN));
  323. }
  324. #endif /* PWR_CR_ODSWEN */
  325. #if defined(PWR_CR_ODEN)
  326. /**
  327. * @brief Enable Over drive Mode
  328. * @rmtoll CR ODEN LL_PWR_EnableOverDriveMode
  329. * @retval None
  330. */
  331. __STATIC_INLINE void LL_PWR_EnableOverDriveMode(void)
  332. {
  333. SET_BIT(PWR->CR, PWR_CR_ODEN);
  334. }
  335. /**
  336. * @brief Disable Over drive Mode
  337. * @rmtoll CR ODEN LL_PWR_DisableOverDriveMode
  338. * @retval None
  339. */
  340. __STATIC_INLINE void LL_PWR_DisableOverDriveMode(void)
  341. {
  342. CLEAR_BIT(PWR->CR, PWR_CR_ODEN);
  343. }
  344. /**
  345. * @brief Check if Over drive switching is enabled
  346. * @rmtoll CR ODEN LL_PWR_IsEnabledOverDriveMode
  347. * @retval State of bit (1 or 0).
  348. */
  349. __STATIC_INLINE uint32_t LL_PWR_IsEnabledOverDriveMode(void)
  350. {
  351. return (READ_BIT(PWR->CR, PWR_CR_ODEN) == (PWR_CR_ODEN));
  352. }
  353. #endif /* PWR_CR_ODEN */
  354. #if defined(PWR_CR_MRUDS)
  355. /**
  356. * @brief Enable Main Regulator in deepsleep under-drive Mode
  357. * @rmtoll CR MRUDS LL_PWR_EnableMainRegulatorDeepSleepUDMode
  358. * @retval None
  359. */
  360. __STATIC_INLINE void LL_PWR_EnableMainRegulatorDeepSleepUDMode(void)
  361. {
  362. SET_BIT(PWR->CR, PWR_CR_MRUDS);
  363. }
  364. /**
  365. * @brief Disable Main Regulator in deepsleep under-drive Mode
  366. * @rmtoll CR MRUDS LL_PWR_DisableMainRegulatorDeepSleepUDMode
  367. * @retval None
  368. */
  369. __STATIC_INLINE void LL_PWR_DisableMainRegulatorDeepSleepUDMode(void)
  370. {
  371. CLEAR_BIT(PWR->CR, PWR_CR_MRUDS);
  372. }
  373. /**
  374. * @brief Check if Main Regulator in deepsleep under-drive Mode is enabled
  375. * @rmtoll CR MRUDS LL_PWR_IsEnabledMainRegulatorDeepSleepUDMode
  376. * @retval State of bit (1 or 0).
  377. */
  378. __STATIC_INLINE uint32_t LL_PWR_IsEnabledMainRegulatorDeepSleepUDMode(void)
  379. {
  380. return (READ_BIT(PWR->CR, PWR_CR_MRUDS) == (PWR_CR_MRUDS));
  381. }
  382. #endif /* PWR_CR_MRUDS */
  383. #if defined(PWR_CR_LPUDS)
  384. /**
  385. * @brief Enable Low Power Regulator in deepsleep under-drive Mode
  386. * @rmtoll CR LPUDS LL_PWR_EnableLowPowerRegulatorDeepSleepUDMode
  387. * @retval None
  388. */
  389. __STATIC_INLINE void LL_PWR_EnableLowPowerRegulatorDeepSleepUDMode(void)
  390. {
  391. SET_BIT(PWR->CR, PWR_CR_LPUDS);
  392. }
  393. /**
  394. * @brief Disable Low Power Regulator in deepsleep under-drive Mode
  395. * @rmtoll CR LPUDS LL_PWR_DisableLowPowerRegulatorDeepSleepUDMode
  396. * @retval None
  397. */
  398. __STATIC_INLINE void LL_PWR_DisableLowPowerRegulatorDeepSleepUDMode(void)
  399. {
  400. CLEAR_BIT(PWR->CR, PWR_CR_LPUDS);
  401. }
  402. /**
  403. * @brief Check if Low Power Regulator in deepsleep under-drive Mode is enabled
  404. * @rmtoll CR LPUDS LL_PWR_IsEnabledLowPowerRegulatorDeepSleepUDMode
  405. * @retval State of bit (1 or 0).
  406. */
  407. __STATIC_INLINE uint32_t LL_PWR_IsEnabledLowPowerRegulatorDeepSleepUDMode(void)
  408. {
  409. return (READ_BIT(PWR->CR, PWR_CR_LPUDS) == (PWR_CR_LPUDS));
  410. }
  411. #endif /* PWR_CR_LPUDS */
  412. #if defined(PWR_CR_MRLVDS)
  413. /**
  414. * @brief Enable Main Regulator low voltage Mode
  415. * @rmtoll CR MRLVDS LL_PWR_EnableMainRegulatorLowVoltageMode
  416. * @retval None
  417. */
  418. __STATIC_INLINE void LL_PWR_EnableMainRegulatorLowVoltageMode(void)
  419. {
  420. SET_BIT(PWR->CR, PWR_CR_MRLVDS);
  421. }
  422. /**
  423. * @brief Disable Main Regulator low voltage Mode
  424. * @rmtoll CR MRLVDS LL_PWR_DisableMainRegulatorLowVoltageMode
  425. * @retval None
  426. */
  427. __STATIC_INLINE void LL_PWR_DisableMainRegulatorLowVoltageMode(void)
  428. {
  429. CLEAR_BIT(PWR->CR, PWR_CR_MRLVDS);
  430. }
  431. /**
  432. * @brief Check if Main Regulator low voltage Mode is enabled
  433. * @rmtoll CR MRLVDS LL_PWR_IsEnabledMainRegulatorLowVoltageMode
  434. * @retval State of bit (1 or 0).
  435. */
  436. __STATIC_INLINE uint32_t LL_PWR_IsEnabledMainRegulatorLowVoltageMode(void)
  437. {
  438. return (READ_BIT(PWR->CR, PWR_CR_MRLVDS) == (PWR_CR_MRLVDS));
  439. }
  440. #endif /* PWR_CR_MRLVDS */
  441. #if defined(PWR_CR_LPLVDS)
  442. /**
  443. * @brief Enable Low Power Regulator low voltage Mode
  444. * @rmtoll CR LPLVDS LL_PWR_EnableLowPowerRegulatorLowVoltageMode
  445. * @retval None
  446. */
  447. __STATIC_INLINE void LL_PWR_EnableLowPowerRegulatorLowVoltageMode(void)
  448. {
  449. SET_BIT(PWR->CR, PWR_CR_LPLVDS);
  450. }
  451. /**
  452. * @brief Disable Low Power Regulator low voltage Mode
  453. * @rmtoll CR LPLVDS LL_PWR_DisableLowPowerRegulatorLowVoltageMode
  454. * @retval None
  455. */
  456. __STATIC_INLINE void LL_PWR_DisableLowPowerRegulatorLowVoltageMode(void)
  457. {
  458. CLEAR_BIT(PWR->CR, PWR_CR_LPLVDS);
  459. }
  460. /**
  461. * @brief Check if Low Power Regulator low voltage Mode is enabled
  462. * @rmtoll CR LPLVDS LL_PWR_IsEnabledLowPowerRegulatorLowVoltageMode
  463. * @retval State of bit (1 or 0).
  464. */
  465. __STATIC_INLINE uint32_t LL_PWR_IsEnabledLowPowerRegulatorLowVoltageMode(void)
  466. {
  467. return (READ_BIT(PWR->CR, PWR_CR_LPLVDS) == (PWR_CR_LPLVDS));
  468. }
  469. #endif /* PWR_CR_LPLVDS */
  470. /**
  471. * @brief Set the main internal Regulator output voltage
  472. * @rmtoll CR VOS LL_PWR_SetRegulVoltageScaling
  473. * @param VoltageScaling This parameter can be one of the following values:
  474. * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE1 (*)
  475. * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE2
  476. * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE3
  477. * (*) LL_PWR_REGU_VOLTAGE_SCALE1 is not available for STM32F401xx devices
  478. * @retval None
  479. */
  480. __STATIC_INLINE void LL_PWR_SetRegulVoltageScaling(uint32_t VoltageScaling)
  481. {
  482. MODIFY_REG(PWR->CR, PWR_CR_VOS, VoltageScaling);
  483. }
  484. /**
  485. * @brief Get the main internal Regulator output voltage
  486. * @rmtoll CR VOS LL_PWR_GetRegulVoltageScaling
  487. * @retval Returned value can be one of the following values:
  488. * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE1 (*)
  489. * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE2
  490. * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE3
  491. * (*) LL_PWR_REGU_VOLTAGE_SCALE1 is not available for STM32F401xx devices
  492. */
  493. __STATIC_INLINE uint32_t LL_PWR_GetRegulVoltageScaling(void)
  494. {
  495. return (uint32_t)(READ_BIT(PWR->CR, PWR_CR_VOS));
  496. }
  497. /**
  498. * @brief Enable the Flash Power Down in Stop Mode
  499. * @rmtoll CR FPDS LL_PWR_EnableFlashPowerDown
  500. * @retval None
  501. */
  502. __STATIC_INLINE void LL_PWR_EnableFlashPowerDown(void)
  503. {
  504. SET_BIT(PWR->CR, PWR_CR_FPDS);
  505. }
  506. /**
  507. * @brief Disable the Flash Power Down in Stop Mode
  508. * @rmtoll CR FPDS LL_PWR_DisableFlashPowerDown
  509. * @retval None
  510. */
  511. __STATIC_INLINE void LL_PWR_DisableFlashPowerDown(void)
  512. {
  513. CLEAR_BIT(PWR->CR, PWR_CR_FPDS);
  514. }
  515. /**
  516. * @brief Check if the Flash Power Down in Stop Mode is enabled
  517. * @rmtoll CR FPDS LL_PWR_IsEnabledFlashPowerDown
  518. * @retval State of bit (1 or 0).
  519. */
  520. __STATIC_INLINE uint32_t LL_PWR_IsEnabledFlashPowerDown(void)
  521. {
  522. return (READ_BIT(PWR->CR, PWR_CR_FPDS) == (PWR_CR_FPDS));
  523. }
  524. /**
  525. * @brief Enable access to the backup domain
  526. * @rmtoll CR DBP LL_PWR_EnableBkUpAccess
  527. * @retval None
  528. */
  529. __STATIC_INLINE void LL_PWR_EnableBkUpAccess(void)
  530. {
  531. SET_BIT(PWR->CR, PWR_CR_DBP);
  532. }
  533. /**
  534. * @brief Disable access to the backup domain
  535. * @rmtoll CR DBP LL_PWR_DisableBkUpAccess
  536. * @retval None
  537. */
  538. __STATIC_INLINE void LL_PWR_DisableBkUpAccess(void)
  539. {
  540. CLEAR_BIT(PWR->CR, PWR_CR_DBP);
  541. }
  542. /**
  543. * @brief Check if the backup domain is enabled
  544. * @rmtoll CR DBP LL_PWR_IsEnabledBkUpAccess
  545. * @retval State of bit (1 or 0).
  546. */
  547. __STATIC_INLINE uint32_t LL_PWR_IsEnabledBkUpAccess(void)
  548. {
  549. return (READ_BIT(PWR->CR, PWR_CR_DBP) == (PWR_CR_DBP));
  550. }
  551. /**
  552. * @brief Enable the backup Regulator
  553. * @rmtoll CSR BRE LL_PWR_EnableBkUpRegulator
  554. * @note The BRE bit of the PWR_CSR register is protected against parasitic write access.
  555. * The LL_PWR_EnableBkUpAccess() must be called before using this API.
  556. * @retval None
  557. */
  558. __STATIC_INLINE void LL_PWR_EnableBkUpRegulator(void)
  559. {
  560. SET_BIT(PWR->CSR, PWR_CSR_BRE);
  561. }
  562. /**
  563. * @brief Disable the backup Regulator
  564. * @rmtoll CSR BRE LL_PWR_DisableBkUpRegulator
  565. * @note The BRE bit of the PWR_CSR register is protected against parasitic write access.
  566. * The LL_PWR_EnableBkUpAccess() must be called before using this API.
  567. * @retval None
  568. */
  569. __STATIC_INLINE void LL_PWR_DisableBkUpRegulator(void)
  570. {
  571. CLEAR_BIT(PWR->CSR, PWR_CSR_BRE);
  572. }
  573. /**
  574. * @brief Check if the backup Regulator is enabled
  575. * @rmtoll CSR BRE LL_PWR_IsEnabledBkUpRegulator
  576. * @retval State of bit (1 or 0).
  577. */
  578. __STATIC_INLINE uint32_t LL_PWR_IsEnabledBkUpRegulator(void)
  579. {
  580. return (READ_BIT(PWR->CSR, PWR_CSR_BRE) == (PWR_CSR_BRE));
  581. }
  582. /**
  583. * @brief Set voltage Regulator mode during deep sleep mode
  584. * @rmtoll CR LPDS LL_PWR_SetRegulModeDS
  585. * @param RegulMode This parameter can be one of the following values:
  586. * @arg @ref LL_PWR_REGU_DSMODE_MAIN
  587. * @arg @ref LL_PWR_REGU_DSMODE_LOW_POWER
  588. * @retval None
  589. */
  590. __STATIC_INLINE void LL_PWR_SetRegulModeDS(uint32_t RegulMode)
  591. {
  592. MODIFY_REG(PWR->CR, PWR_CR_LPDS, RegulMode);
  593. }
  594. /**
  595. * @brief Get voltage Regulator mode during deep sleep mode
  596. * @rmtoll CR LPDS LL_PWR_GetRegulModeDS
  597. * @retval Returned value can be one of the following values:
  598. * @arg @ref LL_PWR_REGU_DSMODE_MAIN
  599. * @arg @ref LL_PWR_REGU_DSMODE_LOW_POWER
  600. */
  601. __STATIC_INLINE uint32_t LL_PWR_GetRegulModeDS(void)
  602. {
  603. return (uint32_t)(READ_BIT(PWR->CR, PWR_CR_LPDS));
  604. }
  605. /**
  606. * @brief Set Power Down mode when CPU enters deepsleep
  607. * @rmtoll CR PDDS LL_PWR_SetPowerMode\n
  608. * @rmtoll CR MRUDS LL_PWR_SetPowerMode\n
  609. * @rmtoll CR LPUDS LL_PWR_SetPowerMode\n
  610. * @rmtoll CR FPDS LL_PWR_SetPowerMode\n
  611. * @rmtoll CR MRLVDS LL_PWR_SetPowerMode\n
  612. * @rmtoll CR LPlVDS LL_PWR_SetPowerMode\n
  613. * @rmtoll CR FPDS LL_PWR_SetPowerMode\n
  614. * @rmtoll CR LPDS LL_PWR_SetPowerMode
  615. * @param PDMode This parameter can be one of the following values:
  616. * @arg @ref LL_PWR_MODE_STOP_MAINREGU
  617. * @arg @ref LL_PWR_MODE_STOP_LPREGU
  618. * @arg @ref LL_PWR_MODE_STOP_MAINREGU_UNDERDRIVE (*)
  619. * @arg @ref LL_PWR_MODE_STOP_LPREGU_UNDERDRIVE (*)
  620. * @arg @ref LL_PWR_MODE_STOP_MAINREGU_DEEPSLEEP (*)
  621. * @arg @ref LL_PWR_MODE_STOP_LPREGU_DEEPSLEEP (*)
  622. *
  623. * (*) not available on all devices
  624. * @arg @ref LL_PWR_MODE_STANDBY
  625. * @retval None
  626. */
  627. __STATIC_INLINE void LL_PWR_SetPowerMode(uint32_t PDMode)
  628. {
  629. #if defined(PWR_CR_MRUDS) && defined(PWR_CR_LPUDS) && defined(PWR_CR_FPDS)
  630. MODIFY_REG(PWR->CR, (PWR_CR_PDDS | PWR_CR_LPDS | PWR_CR_FPDS | PWR_CR_LPUDS | PWR_CR_MRUDS), PDMode);
  631. #elif defined(PWR_CR_MRLVDS) && defined(PWR_CR_LPLVDS) && defined(PWR_CR_FPDS)
  632. MODIFY_REG(PWR->CR, (PWR_CR_PDDS | PWR_CR_LPDS | PWR_CR_FPDS | PWR_CR_LPLVDS | PWR_CR_MRLVDS), PDMode);
  633. #else
  634. MODIFY_REG(PWR->CR, (PWR_CR_PDDS| PWR_CR_LPDS), PDMode);
  635. #endif /* PWR_CR_MRUDS && PWR_CR_LPUDS && PWR_CR_FPDS */
  636. }
  637. /**
  638. * @brief Get Power Down mode when CPU enters deepsleep
  639. * @rmtoll CR PDDS LL_PWR_GetPowerMode\n
  640. * @rmtoll CR MRUDS LL_PWR_GetPowerMode\n
  641. * @rmtoll CR LPUDS LL_PWR_GetPowerMode\n
  642. * @rmtoll CR FPDS LL_PWR_GetPowerMode\n
  643. * @rmtoll CR MRLVDS LL_PWR_GetPowerMode\n
  644. * @rmtoll CR LPLVDS LL_PWR_GetPowerMode\n
  645. * @rmtoll CR FPDS LL_PWR_GetPowerMode\n
  646. * @rmtoll CR LPDS LL_PWR_GetPowerMode
  647. * @retval Returned value can be one of the following values:
  648. * @arg @ref LL_PWR_MODE_STOP_MAINREGU
  649. * @arg @ref LL_PWR_MODE_STOP_LPREGU
  650. * @arg @ref LL_PWR_MODE_STOP_MAINREGU_UNDERDRIVE (*)
  651. * @arg @ref LL_PWR_MODE_STOP_LPREGU_UNDERDRIVE (*)
  652. * @arg @ref LL_PWR_MODE_STOP_MAINREGU_DEEPSLEEP (*)
  653. * @arg @ref LL_PWR_MODE_STOP_LPREGU_DEEPSLEEP (*)
  654. *
  655. * (*) not available on all devices
  656. * @arg @ref LL_PWR_MODE_STANDBY
  657. */
  658. __STATIC_INLINE uint32_t LL_PWR_GetPowerMode(void)
  659. {
  660. #if defined(PWR_CR_MRUDS) && defined(PWR_CR_LPUDS) && defined(PWR_CR_FPDS)
  661. return (uint32_t)(READ_BIT(PWR->CR, (PWR_CR_PDDS | PWR_CR_LPDS | PWR_CR_FPDS | PWR_CR_LPUDS | PWR_CR_MRUDS)));
  662. #elif defined(PWR_CR_MRLVDS) && defined(PWR_CR_LPLVDS) && defined(PWR_CR_FPDS)
  663. return (uint32_t)(READ_BIT(PWR->CR, (PWR_CR_PDDS | PWR_CR_LPDS | PWR_CR_FPDS | PWR_CR_LPLVDS | PWR_CR_MRLVDS)));
  664. #else
  665. return (uint32_t)(READ_BIT(PWR->CR, (PWR_CR_PDDS| PWR_CR_LPDS)));
  666. #endif /* PWR_CR_MRUDS && PWR_CR_LPUDS && PWR_CR_FPDS */
  667. }
  668. /**
  669. * @brief Configure the voltage threshold detected by the Power Voltage Detector
  670. * @rmtoll CR PLS LL_PWR_SetPVDLevel
  671. * @param PVDLevel This parameter can be one of the following values:
  672. * @arg @ref LL_PWR_PVDLEVEL_0
  673. * @arg @ref LL_PWR_PVDLEVEL_1
  674. * @arg @ref LL_PWR_PVDLEVEL_2
  675. * @arg @ref LL_PWR_PVDLEVEL_3
  676. * @arg @ref LL_PWR_PVDLEVEL_4
  677. * @arg @ref LL_PWR_PVDLEVEL_5
  678. * @arg @ref LL_PWR_PVDLEVEL_6
  679. * @arg @ref LL_PWR_PVDLEVEL_7
  680. * @retval None
  681. */
  682. __STATIC_INLINE void LL_PWR_SetPVDLevel(uint32_t PVDLevel)
  683. {
  684. MODIFY_REG(PWR->CR, PWR_CR_PLS, PVDLevel);
  685. }
  686. /**
  687. * @brief Get the voltage threshold detection
  688. * @rmtoll CR PLS LL_PWR_GetPVDLevel
  689. * @retval Returned value can be one of the following values:
  690. * @arg @ref LL_PWR_PVDLEVEL_0
  691. * @arg @ref LL_PWR_PVDLEVEL_1
  692. * @arg @ref LL_PWR_PVDLEVEL_2
  693. * @arg @ref LL_PWR_PVDLEVEL_3
  694. * @arg @ref LL_PWR_PVDLEVEL_4
  695. * @arg @ref LL_PWR_PVDLEVEL_5
  696. * @arg @ref LL_PWR_PVDLEVEL_6
  697. * @arg @ref LL_PWR_PVDLEVEL_7
  698. */
  699. __STATIC_INLINE uint32_t LL_PWR_GetPVDLevel(void)
  700. {
  701. return (uint32_t)(READ_BIT(PWR->CR, PWR_CR_PLS));
  702. }
  703. /**
  704. * @brief Enable Power Voltage Detector
  705. * @rmtoll CR PVDE LL_PWR_EnablePVD
  706. * @retval None
  707. */
  708. __STATIC_INLINE void LL_PWR_EnablePVD(void)
  709. {
  710. SET_BIT(PWR->CR, PWR_CR_PVDE);
  711. }
  712. /**
  713. * @brief Disable Power Voltage Detector
  714. * @rmtoll CR PVDE LL_PWR_DisablePVD
  715. * @retval None
  716. */
  717. __STATIC_INLINE void LL_PWR_DisablePVD(void)
  718. {
  719. CLEAR_BIT(PWR->CR, PWR_CR_PVDE);
  720. }
  721. /**
  722. * @brief Check if Power Voltage Detector is enabled
  723. * @rmtoll CR PVDE LL_PWR_IsEnabledPVD
  724. * @retval State of bit (1 or 0).
  725. */
  726. __STATIC_INLINE uint32_t LL_PWR_IsEnabledPVD(void)
  727. {
  728. return (READ_BIT(PWR->CR, PWR_CR_PVDE) == (PWR_CR_PVDE));
  729. }
  730. /**
  731. * @brief Enable the WakeUp PINx functionality
  732. * @rmtoll CSR EWUP LL_PWR_EnableWakeUpPin\n
  733. * @rmtoll CSR EWUP1 LL_PWR_EnableWakeUpPin\n
  734. * @rmtoll CSR EWUP2 LL_PWR_EnableWakeUpPin\n
  735. * @rmtoll CSR EWUP3 LL_PWR_EnableWakeUpPin
  736. * @param WakeUpPin This parameter can be one of the following values:
  737. * @arg @ref LL_PWR_WAKEUP_PIN1
  738. * @arg @ref LL_PWR_WAKEUP_PIN2 (*)
  739. * @arg @ref LL_PWR_WAKEUP_PIN3 (*)
  740. *
  741. * (*) not available on all devices
  742. * @retval None
  743. */
  744. __STATIC_INLINE void LL_PWR_EnableWakeUpPin(uint32_t WakeUpPin)
  745. {
  746. SET_BIT(PWR->CSR, WakeUpPin);
  747. }
  748. /**
  749. * @brief Disable the WakeUp PINx functionality
  750. * @rmtoll CSR EWUP LL_PWR_DisableWakeUpPin\n
  751. * @rmtoll CSR EWUP1 LL_PWR_DisableWakeUpPin\n
  752. * @rmtoll CSR EWUP2 LL_PWR_DisableWakeUpPin\n
  753. * @rmtoll CSR EWUP3 LL_PWR_DisableWakeUpPin
  754. * @param WakeUpPin This parameter can be one of the following values:
  755. * @arg @ref LL_PWR_WAKEUP_PIN1
  756. * @arg @ref LL_PWR_WAKEUP_PIN2 (*)
  757. * @arg @ref LL_PWR_WAKEUP_PIN3 (*)
  758. *
  759. * (*) not available on all devices
  760. * @retval None
  761. */
  762. __STATIC_INLINE void LL_PWR_DisableWakeUpPin(uint32_t WakeUpPin)
  763. {
  764. CLEAR_BIT(PWR->CSR, WakeUpPin);
  765. }
  766. /**
  767. * @brief Check if the WakeUp PINx functionality is enabled
  768. * @rmtoll CSR EWUP LL_PWR_IsEnabledWakeUpPin\n
  769. * @rmtoll CSR EWUP1 LL_PWR_IsEnabledWakeUpPin\n
  770. * @rmtoll CSR EWUP2 LL_PWR_IsEnabledWakeUpPin\n
  771. * @rmtoll CSR EWUP3 LL_PWR_IsEnabledWakeUpPin
  772. * @param WakeUpPin This parameter can be one of the following values:
  773. * @arg @ref LL_PWR_WAKEUP_PIN1
  774. * @arg @ref LL_PWR_WAKEUP_PIN2 (*)
  775. * @arg @ref LL_PWR_WAKEUP_PIN3 (*)
  776. *
  777. * (*) not available on all devices
  778. * @retval State of bit (1 or 0).
  779. */
  780. __STATIC_INLINE uint32_t LL_PWR_IsEnabledWakeUpPin(uint32_t WakeUpPin)
  781. {
  782. return (READ_BIT(PWR->CSR, WakeUpPin) == (WakeUpPin));
  783. }
  784. /**
  785. * @}
  786. */
  787. /** @defgroup PWR_LL_EF_FLAG_Management FLAG_Management
  788. * @{
  789. */
  790. /**
  791. * @brief Get Wake-up Flag
  792. * @rmtoll CSR WUF LL_PWR_IsActiveFlag_WU
  793. * @retval State of bit (1 or 0).
  794. */
  795. __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU(void)
  796. {
  797. return (READ_BIT(PWR->CSR, PWR_CSR_WUF) == (PWR_CSR_WUF));
  798. }
  799. /**
  800. * @brief Get Standby Flag
  801. * @rmtoll CSR SBF LL_PWR_IsActiveFlag_SB
  802. * @retval State of bit (1 or 0).
  803. */
  804. __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_SB(void)
  805. {
  806. return (READ_BIT(PWR->CSR, PWR_CSR_SBF) == (PWR_CSR_SBF));
  807. }
  808. /**
  809. * @brief Get Backup Regulator ready Flag
  810. * @rmtoll CSR BRR LL_PWR_IsActiveFlag_BRR
  811. * @retval State of bit (1 or 0).
  812. */
  813. __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_BRR(void)
  814. {
  815. return (READ_BIT(PWR->CSR, PWR_CSR_BRR) == (PWR_CSR_BRR));
  816. }
  817. /**
  818. * @brief Indicate whether VDD voltage is below the selected PVD threshold
  819. * @rmtoll CSR PVDO LL_PWR_IsActiveFlag_PVDO
  820. * @retval State of bit (1 or 0).
  821. */
  822. __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_PVDO(void)
  823. {
  824. return (READ_BIT(PWR->CSR, PWR_CSR_PVDO) == (PWR_CSR_PVDO));
  825. }
  826. /**
  827. * @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
  828. * @rmtoll CSR VOS LL_PWR_IsActiveFlag_VOS
  829. * @retval State of bit (1 or 0).
  830. */
  831. __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_VOS(void)
  832. {
  833. return (READ_BIT(PWR->CSR, LL_PWR_CSR_VOS) == (LL_PWR_CSR_VOS));
  834. }
  835. #if defined(PWR_CR_ODEN)
  836. /**
  837. * @brief Indicate whether the Over-Drive mode is ready or not
  838. * @rmtoll CSR ODRDY LL_PWR_IsActiveFlag_OD
  839. * @retval State of bit (1 or 0).
  840. */
  841. __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_OD(void)
  842. {
  843. return (READ_BIT(PWR->CSR, PWR_CSR_ODRDY) == (PWR_CSR_ODRDY));
  844. }
  845. #endif /* PWR_CR_ODEN */
  846. #if defined(PWR_CR_ODSWEN)
  847. /**
  848. * @brief Indicate whether the Over-Drive mode switching is ready or not
  849. * @rmtoll CSR ODSWRDY LL_PWR_IsActiveFlag_ODSW
  850. * @retval State of bit (1 or 0).
  851. */
  852. __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_ODSW(void)
  853. {
  854. return (READ_BIT(PWR->CSR, PWR_CSR_ODSWRDY) == (PWR_CSR_ODSWRDY));
  855. }
  856. #endif /* PWR_CR_ODSWEN */
  857. #if defined(PWR_CR_UDEN)
  858. /**
  859. * @brief Indicate whether the Under-Drive mode is ready or not
  860. * @rmtoll CSR UDRDY LL_PWR_IsActiveFlag_UD
  861. * @retval State of bit (1 or 0).
  862. */
  863. __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_UD(void)
  864. {
  865. return (READ_BIT(PWR->CSR, PWR_CSR_UDRDY) == (PWR_CSR_UDRDY));
  866. }
  867. #endif /* PWR_CR_UDEN */
  868. /**
  869. * @brief Clear Standby Flag
  870. * @rmtoll CR CSBF LL_PWR_ClearFlag_SB
  871. * @retval None
  872. */
  873. __STATIC_INLINE void LL_PWR_ClearFlag_SB(void)
  874. {
  875. SET_BIT(PWR->CR, PWR_CR_CSBF);
  876. }
  877. /**
  878. * @brief Clear Wake-up Flags
  879. * @rmtoll CR CWUF LL_PWR_ClearFlag_WU
  880. * @retval None
  881. */
  882. __STATIC_INLINE void LL_PWR_ClearFlag_WU(void)
  883. {
  884. SET_BIT(PWR->CR, PWR_CR_CWUF);
  885. }
  886. #if defined(PWR_CSR_UDRDY)
  887. /**
  888. * @brief Clear Under-Drive ready Flag
  889. * @rmtoll CSR UDRDY LL_PWR_ClearFlag_UD
  890. * @retval None
  891. */
  892. __STATIC_INLINE void LL_PWR_ClearFlag_UD(void)
  893. {
  894. WRITE_REG(PWR->CSR, PWR_CSR_UDRDY);
  895. }
  896. #endif /* PWR_CSR_UDRDY */
  897. /**
  898. * @}
  899. */
  900. #if defined(USE_FULL_LL_DRIVER)
  901. /** @defgroup PWR_LL_EF_Init De-initialization function
  902. * @{
  903. */
  904. ErrorStatus LL_PWR_DeInit(void);
  905. /**
  906. * @}
  907. */
  908. #endif /* USE_FULL_LL_DRIVER */
  909. /**
  910. * @}
  911. */
  912. /**
  913. * @}
  914. */
  915. #endif /* defined(PWR) */
  916. /**
  917. * @}
  918. */
  919. #ifdef __cplusplus
  920. }
  921. #endif
  922. #endif /* __STM32F4xx_LL_PWR_H */
  923. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/