stm32f4xx_ll_pwr.h 31 KB

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