stm32f7xx_ll_pwr.h 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016
  1. /**
  2. ******************************************************************************
  3. * @file stm32f7xx_ll_pwr.h
  4. * @author MCD Application Team
  5. * @brief Header file of PWR LL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2017 STMicroelectronics.
  10. * All rights reserved.
  11. *
  12. * This software is licensed under terms that can be found in the LICENSE file
  13. * in the root directory of this software component.
  14. * If no LICENSE file comes with this software, it is provided AS-IS.
  15. *
  16. ******************************************************************************
  17. */
  18. /* Define to prevent recursive inclusion -------------------------------------*/
  19. #ifndef __STM32F7xx_LL_PWR_H
  20. #define __STM32F7xx_LL_PWR_H
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /* Includes ------------------------------------------------------------------*/
  25. #include "stm32f7xx.h"
  26. /** @addtogroup STM32F7xx_LL_Driver
  27. * @{
  28. */
  29. #if defined(PWR)
  30. /** @defgroup PWR_LL PWR
  31. * @{
  32. */
  33. /* Private types -------------------------------------------------------------*/
  34. /* Private variables ---------------------------------------------------------*/
  35. /* Private constants ---------------------------------------------------------*/
  36. /* Private macros ------------------------------------------------------------*/
  37. /* Exported types ------------------------------------------------------------*/
  38. /* Exported constants --------------------------------------------------------*/
  39. /** @defgroup PWR_LL_Exported_Constants PWR Exported Constants
  40. * @{
  41. */
  42. /** @defgroup PWR_LL_EC_CLEAR_FLAG Clear Flags Defines
  43. * @brief Flags defines which can be used with LL_PWR_WriteReg function
  44. * @{
  45. */
  46. #define LL_PWR_CR1_CSBF PWR_CR1_CSBF /*!< Clear standby flag */
  47. #define LL_PWR_CR2_CWUF6 PWR_CR2_CWUF6 /*!< Clear WKUP pin 6 */
  48. #define LL_PWR_CR2_CWUF5 PWR_CR2_CWUF5 /*!< Clear WKUP pin 5 */
  49. #define LL_PWR_CR2_CWUF4 PWR_CR2_CWUF4 /*!< Clear WKUP pin 4 */
  50. #define LL_PWR_CR2_CWUF3 PWR_CR2_CWUF3 /*!< Clear WKUP pin 3 */
  51. #define LL_PWR_CR2_CWUF2 PWR_CR2_CWUF2 /*!< Clear WKUP pin 2 */
  52. #define LL_PWR_CR2_CWUF1 PWR_CR2_CWUF1 /*!< Clear WKUP pin 1 */
  53. /**
  54. * @}
  55. */
  56. /** @defgroup PWR_LL_EC_GET_FLAG Get Flags Defines
  57. * @brief Flags defines which can be used with LL_PWR_ReadReg function
  58. * @{
  59. */
  60. #define LL_PWR_CSR1_WUIF PWR_CSR1_WUIF /*!< Wakeup flag */
  61. #define LL_PWR_CSR1_SBF PWR_CSR1_SBF /*!< Standby flag */
  62. #define LL_PWR_CSR1_PVDO PWR_CSR1_PVDO /*!< Power voltage detector output flag */
  63. #define LL_PWR_CSR1_BRR PWR_CSR1_BRR /*!< Backup Regulator ready flag */
  64. #define LL_PWR_CSR1_VOSRDY PWR_CSR1_VOSRDY /*!< Voltage scaling select flag */
  65. #define LL_PWR_CSR1_ODRDY PWR_CSR1_ODRDY /*!< Over-drive mode ready */
  66. #define LL_PWR_CSR1_ODSWRDY PWR_CSR1_ODSWRDY /*!< Over-drive mode switching ready */
  67. #define LL_PWR_CSR1_UDRDY PWR_CSR1_UDRDY /*!< Under-drive ready flag */
  68. #define LL_PWR_CSR2_EWUP1 PWR_CSR2_EWUP1 /*!< Enable WKUP pin 1 */
  69. #define LL_PWR_CSR2_EWUP2 PWR_CSR2_EWUP2 /*!< Enable WKUP pin 2 */
  70. #define LL_PWR_CSR2_EWUP3 PWR_CSR2_EWUP3 /*!< Enable WKUP pin 3 */
  71. #define LL_PWR_CSR2_EWUP4 PWR_CSR2_EWUP4 /*!< Enable WKUP pin 4 */
  72. #define LL_PWR_CSR2_EWUP5 PWR_CSR2_EWUP5 /*!< Enable WKUP pin 5 */
  73. #define LL_PWR_CSR2_EWUP6 PWR_CSR2_EWUP6 /*!< Enable WKUP pin 6 */
  74. /**
  75. * @}
  76. */
  77. /** @defgroup PWR_LL_EC_MODE_PWR Mode Power
  78. * @{
  79. */
  80. #define LL_PWR_MODE_STOP_MAINREGU 0x00000000U /*!< Enter Stop mode (with main Regulator ON) when the CPU enters deepsleep */
  81. #define LL_PWR_MODE_STOP_MAINREGU_UNDERDRIVE (PWR_CR1_MRUDS | PWR_CR1_FPDS) /*!< Enter Stop mode (with main Regulator in under-drive mode) when the CPU enters deepsleep */
  82. #define LL_PWR_MODE_STOP_LPREGU PWR_CR1_LPDS /*!< Enter Stop mode (with low power Regulator ON) when the CPU enters deepsleep */
  83. #define LL_PWR_MODE_STOP_LPREGU_UNDERDRIVE (PWR_CR1_LPDS | PWR_CR1_LPUDS | PWR_CR1_FPDS) /*!< Enter Stop mode (with low power Regulator in under-drive mode) when the CPU enters deepsleep */
  84. #define LL_PWR_MODE_STANDBY PWR_CR1_PDDS /*!< Enter Standby mode when the CPU enters deepsleep */
  85. /**
  86. * @}
  87. */
  88. /** @defgroup PWR_LL_EC_REGU_VOLTAGE Regulator Voltage
  89. * @{
  90. */
  91. #define LL_PWR_REGU_VOLTAGE_SCALE3 PWR_CR1_VOS_0
  92. #define LL_PWR_REGU_VOLTAGE_SCALE2 PWR_CR1_VOS_1
  93. #define LL_PWR_REGU_VOLTAGE_SCALE1 (PWR_CR1_VOS_0 | PWR_CR1_VOS_1)
  94. /**
  95. * @}
  96. */
  97. /** @defgroup PWR_LL_EC_REGU_MODE_DS_MODE Regulator Mode In Deep Sleep Mode
  98. * @{
  99. */
  100. #define LL_PWR_REGU_DSMODE_MAIN 0x00000000U /*!< Voltage Regulator in main mode during deepsleep mode */
  101. #define LL_PWR_REGU_DSMODE_LOW_POWER PWR_CR1_LPDS /*!< Voltage Regulator in low-power mode during deepsleep mode */
  102. /**
  103. * @}
  104. */
  105. /** @defgroup PWR_LL_EC_PVDLEVEL Power Voltage Detector Level
  106. * @{
  107. */
  108. #define LL_PWR_PVDLEVEL_0 PWR_CR1_PLS_LEV0 /*!< Voltage threshold detected by PVD 2.0 V */
  109. #define LL_PWR_PVDLEVEL_1 PWR_CR1_PLS_LEV1 /*!< Voltage threshold detected by PVD 2.1 V */
  110. #define LL_PWR_PVDLEVEL_2 PWR_CR1_PLS_LEV2 /*!< Voltage threshold detected by PVD 2.3 V */
  111. #define LL_PWR_PVDLEVEL_3 PWR_CR1_PLS_LEV3 /*!< Voltage threshold detected by PVD 2.5 V */
  112. #define LL_PWR_PVDLEVEL_4 PWR_CR1_PLS_LEV4 /*!< Voltage threshold detected by PVD 2.6 V */
  113. #define LL_PWR_PVDLEVEL_5 PWR_CR1_PLS_LEV5 /*!< Voltage threshold detected by PVD 2.7 V */
  114. #define LL_PWR_PVDLEVEL_6 PWR_CR1_PLS_LEV6 /*!< Voltage threshold detected by PVD 2.8 V */
  115. #define LL_PWR_PVDLEVEL_7 PWR_CR1_PLS_LEV7 /*!< Voltage threshold detected by PVD 2.9 V */
  116. /**
  117. * @}
  118. */
  119. /** @defgroup PWR_LL_EC_WAKEUP_PIN Wakeup Pins
  120. * @{
  121. */
  122. #define LL_PWR_WAKEUP_PIN1 PWR_CSR2_EWUP1 /*!< WKUP pin 1 : PA0 */
  123. #define LL_PWR_WAKEUP_PIN2 PWR_CSR2_EWUP2 /*!< WKUP pin 2 : PA2 */
  124. #define LL_PWR_WAKEUP_PIN3 PWR_CSR2_EWUP3 /*!< WKUP pin 3 : PC1 */
  125. #define LL_PWR_WAKEUP_PIN4 PWR_CSR2_EWUP4 /*!< WKUP pin 4 : PC13 */
  126. #define LL_PWR_WAKEUP_PIN5 PWR_CSR2_EWUP5 /*!< WKUP pin 5 : PI8 */
  127. #define LL_PWR_WAKEUP_PIN6 PWR_CSR2_EWUP6 /*!< WKUP pin 6 : PI11 */
  128. /**
  129. * @}
  130. */
  131. /**
  132. * @}
  133. */
  134. /* Exported macro ------------------------------------------------------------*/
  135. /** @defgroup PWR_LL_Exported_Macros PWR Exported Macros
  136. * @{
  137. */
  138. /** @defgroup PWR_LL_EM_WRITE_READ Common write and read registers Macros
  139. * @{
  140. */
  141. /**
  142. * @brief Write a value in PWR register
  143. * @param __REG__ Register to be written
  144. * @param __VALUE__ Value to be written in the register
  145. * @retval None
  146. */
  147. #define LL_PWR_WriteReg(__REG__, __VALUE__) WRITE_REG(PWR->__REG__, (__VALUE__))
  148. /**
  149. * @brief Read a value in PWR register
  150. * @param __REG__ Register to be read
  151. * @retval Register value
  152. */
  153. #define LL_PWR_ReadReg(__REG__) READ_REG(PWR->__REG__)
  154. /**
  155. * @}
  156. */
  157. /**
  158. * @}
  159. */
  160. /* Exported functions --------------------------------------------------------*/
  161. /** @defgroup PWR_LL_Exported_Functions PWR Exported Functions
  162. * @{
  163. */
  164. /** @defgroup PWR_LL_EF_Configuration Configuration
  165. * @{
  166. */
  167. /**
  168. * @brief Enable Under Drive Mode
  169. * @rmtoll CR1 UDEN LL_PWR_EnableUnderDriveMode
  170. * @note This mode is enabled only with STOP low power mode.
  171. * In this mode, the 1.2V domain is preserved in reduced leakage mode. This
  172. * mode is only available when the main Regulator or the low power Regulator
  173. * is in low voltage mode.
  174. * @note If the Under-drive mode was enabled, it is automatically disabled after
  175. * exiting Stop mode.
  176. * When the voltage Regulator operates in Under-drive mode, an additional
  177. * startup delay is induced when waking up from Stop mode.
  178. * @retval None
  179. */
  180. __STATIC_INLINE void LL_PWR_EnableUnderDriveMode(void)
  181. {
  182. SET_BIT(PWR->CR1, PWR_CR1_UDEN);
  183. }
  184. /**
  185. * @brief Disable Under Drive Mode
  186. * @rmtoll CR1 UDEN LL_PWR_DisableUnderDriveMode
  187. * @retval None
  188. */
  189. __STATIC_INLINE void LL_PWR_DisableUnderDriveMode(void)
  190. {
  191. CLEAR_BIT(PWR->CR1, PWR_CR1_UDEN);
  192. }
  193. /**
  194. * @brief Check if Under Drive Mode is enabled
  195. * @rmtoll CR1 UDEN LL_PWR_IsEnabledUnderDriveMode
  196. * @retval State of bit (1 or 0).
  197. */
  198. __STATIC_INLINE uint32_t LL_PWR_IsEnabledUnderDriveMode(void)
  199. {
  200. return (READ_BIT(PWR->CR1, PWR_CR1_UDEN) == (PWR_CR1_UDEN));
  201. }
  202. /**
  203. * @brief Enable Over drive switching
  204. * @rmtoll CR1 ODSWEN LL_PWR_EnableOverDriveSwitching
  205. * @retval None
  206. */
  207. __STATIC_INLINE void LL_PWR_EnableOverDriveSwitching(void)
  208. {
  209. SET_BIT(PWR->CR1, PWR_CR1_ODSWEN);
  210. }
  211. /**
  212. * @brief Disable Over drive switching
  213. * @rmtoll CR1 ODSWEN LL_PWR_DisableOverDriveSwitching
  214. * @retval None
  215. */
  216. __STATIC_INLINE void LL_PWR_DisableOverDriveSwitching(void)
  217. {
  218. CLEAR_BIT(PWR->CR1, PWR_CR1_ODSWEN);
  219. }
  220. /**
  221. * @brief Check if Over drive switching is enabled
  222. * @rmtoll CR1 ODSWEN LL_PWR_IsEnabledOverDriveSwitching
  223. * @retval State of bit (1 or 0).
  224. */
  225. __STATIC_INLINE uint32_t LL_PWR_IsEnabledOverDriveSwitching(void)
  226. {
  227. return (READ_BIT(PWR->CR1, PWR_CR1_ODSWEN) == (PWR_CR1_ODSWEN));
  228. }
  229. /**
  230. * @brief Enable Over drive Mode
  231. * @rmtoll CR1 ODEN LL_PWR_EnableOverDriveMode
  232. * @retval None
  233. */
  234. __STATIC_INLINE void LL_PWR_EnableOverDriveMode(void)
  235. {
  236. SET_BIT(PWR->CR1, PWR_CR1_ODEN);
  237. }
  238. /**
  239. * @brief Disable Over drive Mode
  240. * @rmtoll CR1 ODEN LL_PWR_DisableOverDriveMode
  241. * @retval None
  242. */
  243. __STATIC_INLINE void LL_PWR_DisableOverDriveMode(void)
  244. {
  245. CLEAR_BIT(PWR->CR1, PWR_CR1_ODEN);
  246. }
  247. /**
  248. * @brief Check if Over drive switching is enabled
  249. * @rmtoll CR1 ODEN LL_PWR_IsEnabledOverDriveMode
  250. * @retval State of bit (1 or 0).
  251. */
  252. __STATIC_INLINE uint32_t LL_PWR_IsEnabledOverDriveMode(void)
  253. {
  254. return (READ_BIT(PWR->CR1, PWR_CR1_ODEN) == (PWR_CR1_ODEN));
  255. }
  256. /**
  257. * @brief Set the main internal Regulator output voltage
  258. * @rmtoll CR1 VOS LL_PWR_SetRegulVoltageScaling
  259. * @param VoltageScaling This parameter can be one of the following values:
  260. * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE1
  261. * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE2
  262. * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE3
  263. * @retval None
  264. */
  265. __STATIC_INLINE void LL_PWR_SetRegulVoltageScaling(uint32_t VoltageScaling)
  266. {
  267. MODIFY_REG(PWR->CR1, PWR_CR1_VOS, VoltageScaling);
  268. }
  269. /**
  270. * @brief Get the main internal Regulator output voltage
  271. * @rmtoll CR1 VOS LL_PWR_GetRegulVoltageScaling
  272. * @retval Returned value can be one of the following values:
  273. * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE1
  274. * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE2
  275. * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE3
  276. */
  277. __STATIC_INLINE uint32_t LL_PWR_GetRegulVoltageScaling(void)
  278. {
  279. return (uint32_t)(READ_BIT(PWR->CR1, PWR_CR1_VOS));
  280. }
  281. /**
  282. * @brief Enable Main Regulator in deepsleep under-drive Mode
  283. * @rmtoll CR1 MRUDS LL_PWR_EnableMainRegulatorDeepSleepUDMode
  284. * @retval None
  285. */
  286. __STATIC_INLINE void LL_PWR_EnableMainRegulatorDeepSleepUDMode(void)
  287. {
  288. SET_BIT(PWR->CR1, PWR_CR1_MRUDS);
  289. }
  290. /**
  291. * @brief Disable Main Regulator in deepsleep under-drive Mode
  292. * @rmtoll CR1 MRUDS LL_PWR_DisableMainRegulatorDeepSleepUDMode
  293. * @retval None
  294. */
  295. __STATIC_INLINE void LL_PWR_DisableMainRegulatorDeepSleepUDMode(void)
  296. {
  297. CLEAR_BIT(PWR->CR1, PWR_CR1_MRUDS);
  298. }
  299. /**
  300. * @brief Check if Main Regulator in deepsleep under-drive Mode is enabled
  301. * @rmtoll CR1 MRUDS LL_PWR_IsEnabledMainRegulatorDeepSleepUDMode
  302. * @retval State of bit (1 or 0).
  303. */
  304. __STATIC_INLINE uint32_t LL_PWR_IsEnabledMainRegulatorDeepSleepUDMode(void)
  305. {
  306. return (READ_BIT(PWR->CR1, PWR_CR1_MRUDS) == (PWR_CR1_MRUDS));
  307. }
  308. /**
  309. * @brief Enable Low Power Regulator in deepsleep under-drive Mode
  310. * @rmtoll CR1 LPUDS LL_PWR_EnableLowPowerRegulatorDeepSleepUDMode
  311. * @retval None
  312. */
  313. __STATIC_INLINE void LL_PWR_EnableLowPowerRegulatorDeepSleepUDMode(void)
  314. {
  315. SET_BIT(PWR->CR1, PWR_CR1_LPUDS);
  316. }
  317. /**
  318. * @brief Disable Low Power Regulator in deepsleep under-drive Mode
  319. * @rmtoll CR1 LPUDS LL_PWR_DisableLowPowerRegulatorDeepSleepUDMode
  320. * @retval None
  321. */
  322. __STATIC_INLINE void LL_PWR_DisableLowPowerRegulatorDeepSleepUDMode(void)
  323. {
  324. CLEAR_BIT(PWR->CR1, PWR_CR1_LPUDS);
  325. }
  326. /**
  327. * @brief Check if Low Power Regulator in deepsleep under-drive Mode is enabled
  328. * @rmtoll CR1 LPUDS LL_PWR_IsEnabledLowPowerRegulatorDeepSleepUDMode
  329. * @retval State of bit (1 or 0).
  330. */
  331. __STATIC_INLINE uint32_t LL_PWR_IsEnabledLowPowerRegulatorDeepSleepUDMode(void)
  332. {
  333. return (READ_BIT(PWR->CR1, PWR_CR1_LPUDS) == (PWR_CR1_LPUDS));
  334. }
  335. /**
  336. * @brief Enable the Flash Power Down in Stop Mode
  337. * @rmtoll CR1 FPDS LL_PWR_EnableFlashPowerDown
  338. * @retval None
  339. */
  340. __STATIC_INLINE void LL_PWR_EnableFlashPowerDown(void)
  341. {
  342. SET_BIT(PWR->CR1, PWR_CR1_FPDS);
  343. }
  344. /**
  345. * @brief Disable the Flash Power Down in Stop Mode
  346. * @rmtoll CR1 FPDS LL_PWR_DisableFlashPowerDown
  347. * @retval None
  348. */
  349. __STATIC_INLINE void LL_PWR_DisableFlashPowerDown(void)
  350. {
  351. CLEAR_BIT(PWR->CR1, PWR_CR1_FPDS);
  352. }
  353. /**
  354. * @brief Check if the Flash Power Down in Stop Mode is enabled
  355. * @rmtoll CR1 FPDS LL_PWR_IsEnabledFlashPowerDown
  356. * @retval State of bit (1 or 0).
  357. */
  358. __STATIC_INLINE uint32_t LL_PWR_IsEnabledFlashPowerDown(void)
  359. {
  360. return (READ_BIT(PWR->CR1, PWR_CR1_FPDS) == (PWR_CR1_FPDS));
  361. }
  362. /**
  363. * @brief Enable access to the backup domain
  364. * @rmtoll CR1 DBP LL_PWR_EnableBkUpAccess
  365. * @retval None
  366. */
  367. __STATIC_INLINE void LL_PWR_EnableBkUpAccess(void)
  368. {
  369. SET_BIT(PWR->CR1, PWR_CR1_DBP);
  370. }
  371. /**
  372. * @brief Disable access to the backup domain
  373. * @rmtoll CR1 DBP LL_PWR_DisableBkUpAccess
  374. * @retval None
  375. */
  376. __STATIC_INLINE void LL_PWR_DisableBkUpAccess(void)
  377. {
  378. CLEAR_BIT(PWR->CR1, PWR_CR1_DBP);
  379. }
  380. /**
  381. * @brief Check if the backup domain is enabled
  382. * @rmtoll CR1 DBP LL_PWR_IsEnabledBkUpAccess
  383. * @retval State of bit (1 or 0).
  384. */
  385. __STATIC_INLINE uint32_t LL_PWR_IsEnabledBkUpAccess(void)
  386. {
  387. return (READ_BIT(PWR->CR1, PWR_CR1_DBP) == (PWR_CR1_DBP));
  388. }
  389. /**
  390. * @brief Enable Backup Regulator
  391. * @rmtoll CSR1 BRE LL_PWR_EnableBkUpRegulator
  392. * @note When set, the Backup Regulator (used to maintain backup SRAM content in Standby and
  393. * VBAT modes) is enabled. If BRE is reset, the backup Regulator is switched off. The backup
  394. * SRAM can still be used but its content will be lost in the Standby and VBAT modes. Once set,
  395. * the application must wait that the Backup Regulator Ready flag (BRR) is set to indicate that
  396. * the data written into the RAM will be maintained in the Standby and VBAT modes.
  397. * @retval None
  398. */
  399. __STATIC_INLINE void LL_PWR_EnableBkUpRegulator(void)
  400. {
  401. SET_BIT(PWR->CSR1, PWR_CSR1_BRE);
  402. }
  403. /**
  404. * @brief Disable Backup Regulator
  405. * @rmtoll CSR1 BRE LL_PWR_DisableBkUpRegulator
  406. * @retval None
  407. */
  408. __STATIC_INLINE void LL_PWR_DisableBkUpRegulator(void)
  409. {
  410. CLEAR_BIT(PWR->CSR1, PWR_CSR1_BRE);
  411. }
  412. /**
  413. * @brief Check if the backup Regulator is enabled
  414. * @rmtoll CSR1 BRE LL_PWR_IsEnabledBkUpRegulator
  415. * @retval State of bit (1 or 0).
  416. */
  417. __STATIC_INLINE uint32_t LL_PWR_IsEnabledBkUpRegulator(void)
  418. {
  419. return (READ_BIT(PWR->CSR1, PWR_CSR1_BRE) == (PWR_CSR1_BRE));
  420. }
  421. /**
  422. * @brief Set voltage Regulator mode during deep sleep mode
  423. * @rmtoll CR1 LPDS LL_PWR_SetRegulModeDS
  424. * @param RegulMode This parameter can be one of the following values:
  425. * @arg @ref LL_PWR_REGU_DSMODE_MAIN
  426. * @arg @ref LL_PWR_REGU_DSMODE_LOW_POWER
  427. * @retval None
  428. */
  429. __STATIC_INLINE void LL_PWR_SetRegulModeDS(uint32_t RegulMode)
  430. {
  431. MODIFY_REG(PWR->CR1, PWR_CR1_LPDS, RegulMode);
  432. }
  433. /**
  434. * @brief Get voltage Regulator mode during deep sleep mode
  435. * @rmtoll CR1 LPDS LL_PWR_GetRegulModeDS
  436. * @retval Returned value can be one of the following values:
  437. * @arg @ref LL_PWR_REGU_DSMODE_MAIN
  438. * @arg @ref LL_PWR_REGU_DSMODE_LOW_POWER
  439. */
  440. __STATIC_INLINE uint32_t LL_PWR_GetRegulModeDS(void)
  441. {
  442. return (uint32_t)(READ_BIT(PWR->CR1, PWR_CR1_LPDS));
  443. }
  444. /**
  445. * @brief Set Power Down mode when CPU enters deepsleep
  446. * @rmtoll CR1 PDDS LL_PWR_SetPowerMode\n
  447. * CR1 LPDS LL_PWR_SetPowerMode\n
  448. * CR1 FPDS LL_PWR_SetPowerMode\n
  449. * CR1 LPUDS LL_PWR_SetPowerMode\n
  450. * CR1 MRUDS LL_PWR_SetPowerMode
  451. * @param PDMode This parameter can be one of the following values:
  452. * @arg @ref LL_PWR_MODE_STOP_MAINREGU
  453. * @arg @ref LL_PWR_MODE_STOP_MAINREGU_UNDERDRIVE
  454. * @arg @ref LL_PWR_MODE_STOP_LPREGU
  455. * @arg @ref LL_PWR_MODE_STOP_LPREGU_UNDERDRIVE
  456. * @arg @ref LL_PWR_MODE_STANDBY
  457. * @retval None
  458. */
  459. __STATIC_INLINE void LL_PWR_SetPowerMode(uint32_t PDMode)
  460. {
  461. MODIFY_REG(PWR->CR1, (PWR_CR1_PDDS | PWR_CR1_LPDS | PWR_CR1_FPDS | PWR_CR1_LPUDS | PWR_CR1_MRUDS), PDMode);
  462. }
  463. /**
  464. * @brief Get Power Down mode when CPU enters deepsleep
  465. * @rmtoll CR1 PDDS LL_PWR_GetPowerMode\n
  466. * CR1 LPDS LL_PWR_GetPowerMode\n
  467. * CR1 FPDS LL_PWR_GetPowerMode\n
  468. * CR1 LPUDS LL_PWR_GetPowerMode\n
  469. * CR1 MRUDS LL_PWR_GetPowerMode
  470. * @retval Returned value can be one of the following values:
  471. * @arg @ref LL_PWR_MODE_STOP_MAINREGU
  472. * @arg @ref LL_PWR_MODE_STOP_MAINREGU_UNDERDRIVE
  473. * @arg @ref LL_PWR_MODE_STOP_LPREGU
  474. * @arg @ref LL_PWR_MODE_STOP_LPREGU_UNDERDRIVE
  475. * @arg @ref LL_PWR_MODE_STANDBY
  476. */
  477. __STATIC_INLINE uint32_t LL_PWR_GetPowerMode(void)
  478. {
  479. return (uint32_t)(READ_BIT(PWR->CR1, (PWR_CR1_PDDS | PWR_CR1_LPDS | PWR_CR1_FPDS | PWR_CR1_LPUDS | PWR_CR1_MRUDS)));
  480. }
  481. /**
  482. * @brief Configure the voltage threshold detected by the Power Voltage Detector
  483. * @rmtoll CR1 PLS LL_PWR_SetPVDLevel
  484. * @param PVDLevel This parameter can be one of the following values:
  485. * @arg @ref LL_PWR_PVDLEVEL_0
  486. * @arg @ref LL_PWR_PVDLEVEL_1
  487. * @arg @ref LL_PWR_PVDLEVEL_2
  488. * @arg @ref LL_PWR_PVDLEVEL_3
  489. * @arg @ref LL_PWR_PVDLEVEL_4
  490. * @arg @ref LL_PWR_PVDLEVEL_5
  491. * @arg @ref LL_PWR_PVDLEVEL_6
  492. * @arg @ref LL_PWR_PVDLEVEL_7
  493. * @retval None
  494. */
  495. __STATIC_INLINE void LL_PWR_SetPVDLevel(uint32_t PVDLevel)
  496. {
  497. MODIFY_REG(PWR->CR1, PWR_CR1_PLS, PVDLevel);
  498. }
  499. /**
  500. * @brief Get the voltage threshold detection
  501. * @rmtoll CR1 PLS LL_PWR_GetPVDLevel
  502. * @retval Returned value can be one of the following values:
  503. * @arg @ref LL_PWR_PVDLEVEL_0
  504. * @arg @ref LL_PWR_PVDLEVEL_1
  505. * @arg @ref LL_PWR_PVDLEVEL_2
  506. * @arg @ref LL_PWR_PVDLEVEL_3
  507. * @arg @ref LL_PWR_PVDLEVEL_4
  508. * @arg @ref LL_PWR_PVDLEVEL_5
  509. * @arg @ref LL_PWR_PVDLEVEL_6
  510. * @arg @ref LL_PWR_PVDLEVEL_7
  511. */
  512. __STATIC_INLINE uint32_t LL_PWR_GetPVDLevel(void)
  513. {
  514. return (uint32_t)(READ_BIT(PWR->CR1, PWR_CR1_PLS));
  515. }
  516. /**
  517. * @brief Enable Power Voltage Detector
  518. * @rmtoll CR1 PVDE LL_PWR_EnablePVD
  519. * @retval None
  520. */
  521. __STATIC_INLINE void LL_PWR_EnablePVD(void)
  522. {
  523. SET_BIT(PWR->CR1, PWR_CR1_PVDE);
  524. }
  525. /**
  526. * @brief Disable Power Voltage Detector
  527. * @rmtoll CR1 PVDE LL_PWR_DisablePVD
  528. * @retval None
  529. */
  530. __STATIC_INLINE void LL_PWR_DisablePVD(void)
  531. {
  532. CLEAR_BIT(PWR->CR1, PWR_CR1_PVDE);
  533. }
  534. /**
  535. * @brief Check if Power Voltage Detector is enabled
  536. * @rmtoll CR1 PVDE LL_PWR_IsEnabledPVD
  537. * @retval State of bit (1 or 0).
  538. */
  539. __STATIC_INLINE uint32_t LL_PWR_IsEnabledPVD(void)
  540. {
  541. return (READ_BIT(PWR->CR1, PWR_CR1_PVDE) == (PWR_CR1_PVDE));
  542. }
  543. /**
  544. * @brief Enable the WakeUp PINx functionality
  545. * @rmtoll CSR2 EWUP1 LL_PWR_EnableWakeUpPin\n
  546. * CSR2 EWUP2 LL_PWR_EnableWakeUpPin\n
  547. * CSR2 EWUP3 LL_PWR_EnableWakeUpPin\n
  548. * CSR2 EWUP4 LL_PWR_EnableWakeUpPin\n
  549. * CSR2 EWUP5 LL_PWR_EnableWakeUpPin\n
  550. * CSR2 EWUP6 LL_PWR_EnableWakeUpPin
  551. * @param WakeUpPin This parameter can be one of the following values:
  552. * @arg @ref LL_PWR_WAKEUP_PIN1
  553. * @arg @ref LL_PWR_WAKEUP_PIN2
  554. * @arg @ref LL_PWR_WAKEUP_PIN3
  555. * @arg @ref LL_PWR_WAKEUP_PIN4
  556. * @arg @ref LL_PWR_WAKEUP_PIN5
  557. * @arg @ref LL_PWR_WAKEUP_PIN6
  558. * @retval None
  559. */
  560. __STATIC_INLINE void LL_PWR_EnableWakeUpPin(uint32_t WakeUpPin)
  561. {
  562. SET_BIT(PWR->CSR2, WakeUpPin);
  563. }
  564. /**
  565. * @brief Disable the WakeUp PINx functionality
  566. * @rmtoll CSR2 EWUP1 LL_PWR_DisableWakeUpPin\n
  567. * CSR2 EWUP2 LL_PWR_DisableWakeUpPin\n
  568. * CSR2 EWUP3 LL_PWR_DisableWakeUpPin\n
  569. * CSR2 EWUP4 LL_PWR_DisableWakeUpPin\n
  570. * CSR2 EWUP5 LL_PWR_DisableWakeUpPin\n
  571. * CSR2 EWUP6 LL_PWR_DisableWakeUpPin
  572. * @param WakeUpPin This parameter can be one of the following values:
  573. * @arg @ref LL_PWR_WAKEUP_PIN1
  574. * @arg @ref LL_PWR_WAKEUP_PIN2
  575. * @arg @ref LL_PWR_WAKEUP_PIN3
  576. * @arg @ref LL_PWR_WAKEUP_PIN4
  577. * @arg @ref LL_PWR_WAKEUP_PIN5
  578. * @arg @ref LL_PWR_WAKEUP_PIN6
  579. * @retval None
  580. */
  581. __STATIC_INLINE void LL_PWR_DisableWakeUpPin(uint32_t WakeUpPin)
  582. {
  583. CLEAR_BIT(PWR->CSR2, WakeUpPin);
  584. }
  585. /**
  586. * @brief Check if the WakeUp PINx functionality is enabled
  587. * @rmtoll CSR2 EWUP1 LL_PWR_IsEnabledWakeUpPin\n
  588. * CSR2 EWUP2 LL_PWR_IsEnabledWakeUpPin\n
  589. * CSR2 EWUP3 LL_PWR_IsEnabledWakeUpPin\n
  590. * CSR2 EWUP4 LL_PWR_IsEnabledWakeUpPin\n
  591. * CSR2 EWUP5 LL_PWR_IsEnabledWakeUpPin\n
  592. * CSR2 EWUP6 LL_PWR_IsEnabledWakeUpPin
  593. * @param WakeUpPin This parameter can be one of the following values:
  594. * @arg @ref LL_PWR_WAKEUP_PIN1
  595. * @arg @ref LL_PWR_WAKEUP_PIN2
  596. * @arg @ref LL_PWR_WAKEUP_PIN3
  597. * @arg @ref LL_PWR_WAKEUP_PIN4
  598. * @arg @ref LL_PWR_WAKEUP_PIN5
  599. * @arg @ref LL_PWR_WAKEUP_PIN6
  600. * @retval State of bit (1 or 0).
  601. */
  602. __STATIC_INLINE uint32_t LL_PWR_IsEnabledWakeUpPin(uint32_t WakeUpPin)
  603. {
  604. return (READ_BIT(PWR->CSR2, WakeUpPin) == (WakeUpPin));
  605. }
  606. /**
  607. * @brief Set the Wake-Up pin polarity low for the event detection
  608. * @rmtoll CR2 WUPP1 LL_PWR_SetWakeUpPinPolarityLow\n
  609. * CR2 WUPP2 LL_PWR_SetWakeUpPinPolarityLow\n
  610. * CR2 WUPP3 LL_PWR_SetWakeUpPinPolarityLow\n
  611. * CR2 WUPP4 LL_PWR_SetWakeUpPinPolarityLow\n
  612. * CR2 WUPP5 LL_PWR_SetWakeUpPinPolarityLow\n
  613. * CR2 WUPP6 LL_PWR_SetWakeUpPinPolarityLow
  614. * @param WakeUpPin This parameter can be one of the following values:
  615. * @arg @ref LL_PWR_WAKEUP_PIN1
  616. * @arg @ref LL_PWR_WAKEUP_PIN2
  617. * @arg @ref LL_PWR_WAKEUP_PIN3
  618. * @arg @ref LL_PWR_WAKEUP_PIN4
  619. * @arg @ref LL_PWR_WAKEUP_PIN5
  620. * @arg @ref LL_PWR_WAKEUP_PIN6
  621. * @retval None
  622. */
  623. __STATIC_INLINE void LL_PWR_SetWakeUpPinPolarityLow(uint32_t WakeUpPin)
  624. {
  625. SET_BIT(PWR->CR2, WakeUpPin);
  626. }
  627. /**
  628. * @brief Set the Wake-Up pin polarity high for the event detection
  629. * @rmtoll CR2 WUPP1 LL_PWR_SetWakeUpPinPolarityHigh\n
  630. * CR2 WUPP2 LL_PWR_SetWakeUpPinPolarityHigh\n
  631. * CR2 WUPP3 LL_PWR_SetWakeUpPinPolarityHigh\n
  632. * CR2 WUPP4 LL_PWR_SetWakeUpPinPolarityHigh\n
  633. * CR2 WUPP5 LL_PWR_SetWakeUpPinPolarityHigh\n
  634. * CR2 WUPP6 LL_PWR_SetWakeUpPinPolarityHigh
  635. * @param WakeUpPin This parameter can be one of the following values:
  636. * @arg @ref LL_PWR_WAKEUP_PIN1
  637. * @arg @ref LL_PWR_WAKEUP_PIN2
  638. * @arg @ref LL_PWR_WAKEUP_PIN3
  639. * @arg @ref LL_PWR_WAKEUP_PIN4
  640. * @arg @ref LL_PWR_WAKEUP_PIN5
  641. * @arg @ref LL_PWR_WAKEUP_PIN6
  642. * @retval None
  643. */
  644. __STATIC_INLINE void LL_PWR_SetWakeUpPinPolarityHigh(uint32_t WakeUpPin)
  645. {
  646. CLEAR_BIT(PWR->CR2, WakeUpPin);
  647. }
  648. /**
  649. * @brief Get the Wake-Up pin polarity for the event detection
  650. * @rmtoll CR2 WUPP1 LL_PWR_IsWakeUpPinPolarityLow\n
  651. * CR2 WUPP2 LL_PWR_IsWakeUpPinPolarityLow\n
  652. * CR2 WUPP3 LL_PWR_IsWakeUpPinPolarityLow\n
  653. * CR2 WUPP4 LL_PWR_IsWakeUpPinPolarityLow\n
  654. * CR2 WUPP5 LL_PWR_IsWakeUpPinPolarityLow\n
  655. * CR2 WUPP6 LL_PWR_IsWakeUpPinPolarityLow
  656. * @param WakeUpPin This parameter can be one of the following values:
  657. * @arg @ref LL_PWR_WAKEUP_PIN1
  658. * @arg @ref LL_PWR_WAKEUP_PIN2
  659. * @arg @ref LL_PWR_WAKEUP_PIN3
  660. * @arg @ref LL_PWR_WAKEUP_PIN4
  661. * @arg @ref LL_PWR_WAKEUP_PIN5
  662. * @arg @ref LL_PWR_WAKEUP_PIN6
  663. * @retval State of bit (1 or 0).
  664. */
  665. __STATIC_INLINE uint32_t LL_PWR_IsWakeUpPinPolarityLow(uint32_t WakeUpPin)
  666. {
  667. return (READ_BIT(PWR->CR2, WakeUpPin) == (WakeUpPin));
  668. }
  669. /**
  670. * @brief Enable Internal WakeUp
  671. * @rmtoll CSR1 EIWUP LL_PWR_EnableInternalWakeUp
  672. * @note This API must be used when RTC events (Alarm A or Alarm B, RTC Tamper, RTC TimeStamp
  673. * or RTC Wakeup time) are used to wake up the system from Standby mode.
  674. * @retval None
  675. */
  676. __STATIC_INLINE void LL_PWR_EnableInternalWakeUp(void)
  677. {
  678. SET_BIT(PWR->CSR1, PWR_CSR1_EIWUP);
  679. }
  680. /**
  681. * @brief Disable Internal WakeUp
  682. * @rmtoll CSR1 EIWUP LL_PWR_DisableInternalWakeUp
  683. * @retval None
  684. */
  685. __STATIC_INLINE void LL_PWR_DisableInternalWakeUp(void)
  686. {
  687. CLEAR_BIT(PWR->CSR1, PWR_CSR1_EIWUP);
  688. }
  689. /**
  690. * @brief Check if the Internal WakeUp functionality is enabled
  691. * @rmtoll CSR1 EIWUP LL_PWR_IsEnabledInternalWakeUp
  692. * @retval State of bit (1 or 0).
  693. */
  694. __STATIC_INLINE uint32_t LL_PWR_IsEnabledInternalWakeUp(void)
  695. {
  696. return (READ_BIT(PWR->CSR1, PWR_CSR1_EIWUP) == (PWR_CSR1_EIWUP));
  697. }
  698. /**
  699. * @}
  700. */
  701. /** @defgroup PWR_LL_EF_FLAG_Management FLAG_Management
  702. * @{
  703. */
  704. /**
  705. * @brief Get Wake-up Flag 6
  706. * @rmtoll CSR2 WUPF6 LL_PWR_IsActiveFlag_WU6
  707. * @retval State of bit (1 or 0).
  708. */
  709. __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU6(void)
  710. {
  711. return (READ_BIT(PWR->CSR2, PWR_CSR2_WUPF6) == (PWR_CSR2_WUPF6));
  712. }
  713. /**
  714. * @brief Get Wake-up Flag 5
  715. * @rmtoll CSR2 WUPF5 LL_PWR_IsActiveFlag_WU5
  716. * @retval State of bit (1 or 0).
  717. */
  718. __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU5(void)
  719. {
  720. return (READ_BIT(PWR->CSR2, PWR_CSR2_WUPF5) == (PWR_CSR2_WUPF5));
  721. }
  722. /**
  723. * @brief Get Wake-up Flag 4
  724. * @rmtoll CSR2 WUPF4 LL_PWR_IsActiveFlag_WU4
  725. * @retval State of bit (1 or 0).
  726. */
  727. __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU4(void)
  728. {
  729. return (READ_BIT(PWR->CSR2, PWR_CSR2_WUPF4) == (PWR_CSR2_WUPF4));
  730. }
  731. /**
  732. * @brief Get Wake-up Flag 3
  733. * @rmtoll CSR2 WUPF3 LL_PWR_IsActiveFlag_WU3
  734. * @retval State of bit (1 or 0).
  735. */
  736. __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU3(void)
  737. {
  738. return (READ_BIT(PWR->CSR2, PWR_CSR2_WUPF3) == (PWR_CSR2_WUPF3));
  739. }
  740. /**
  741. * @brief Get Wake-up Flag 2
  742. * @rmtoll CSR2 WUPF2 LL_PWR_IsActiveFlag_WU2
  743. * @retval State of bit (1 or 0).
  744. */
  745. __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU2(void)
  746. {
  747. return (READ_BIT(PWR->CSR2, PWR_CSR2_WUPF2) == (PWR_CSR2_WUPF2));
  748. }
  749. /**
  750. * @brief Get Wake-up Flag 1
  751. * @rmtoll CSR2 WUPF1 LL_PWR_IsActiveFlag_WU1
  752. * @retval State of bit (1 or 0).
  753. */
  754. __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU1(void)
  755. {
  756. return (READ_BIT(PWR->CSR2, PWR_CSR2_WUPF1) == (PWR_CSR2_WUPF1));
  757. }
  758. /**
  759. * @brief Get Standby Flag
  760. * @rmtoll CSR1 SBF LL_PWR_IsActiveFlag_SB
  761. * @retval State of bit (1 or 0).
  762. */
  763. __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_SB(void)
  764. {
  765. return (READ_BIT(PWR->CSR1, PWR_CSR1_SBF) == (PWR_CSR1_SBF));
  766. }
  767. /**
  768. * @brief Indicate whether VDD voltage is below the selected PVD threshold
  769. * @rmtoll CSR1 PVDO LL_PWR_IsActiveFlag_PVDO
  770. * @retval State of bit (1 or 0).
  771. */
  772. __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_PVDO(void)
  773. {
  774. return (READ_BIT(PWR->CSR1, PWR_CSR1_PVDO) == (PWR_CSR1_PVDO));
  775. }
  776. /**
  777. * @brief Get Backup Regulator ready Flag
  778. * @rmtoll CSR1 BRR LL_PWR_IsActiveFlag_BRR
  779. * @retval State of bit (1 or 0).
  780. */
  781. __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_BRR(void)
  782. {
  783. return (READ_BIT(PWR->CSR1, PWR_CSR1_BRR) == (PWR_CSR1_BRR));
  784. }
  785. /**
  786. * @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
  787. * @rmtoll CSR1 VOSRDY LL_PWR_IsActiveFlag_VOS
  788. * @retval State of bit (1 or 0).
  789. */
  790. __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_VOS(void)
  791. {
  792. return (READ_BIT(PWR->CSR1, PWR_CSR1_VOSRDY) == (PWR_CSR1_VOSRDY));
  793. }
  794. /**
  795. * @brief Indicate whether the Over-Drive mode is ready or not
  796. * @rmtoll CSR1 ODRDY LL_PWR_IsActiveFlag_OD
  797. * @retval State of bit (1 or 0).
  798. */
  799. __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_OD(void)
  800. {
  801. return (READ_BIT(PWR->CSR1, PWR_CSR1_ODRDY) == (PWR_CSR1_ODRDY));
  802. }
  803. /**
  804. * @brief Indicate whether the Over-Drive mode switching is ready or not
  805. * @rmtoll CSR1 ODSWRDY LL_PWR_IsActiveFlag_ODSW
  806. * @retval State of bit (1 or 0).
  807. */
  808. __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_ODSW(void)
  809. {
  810. return (READ_BIT(PWR->CSR1, PWR_CSR1_ODSWRDY) == (PWR_CSR1_ODSWRDY));
  811. }
  812. /**
  813. * @brief Indicate whether the Under-Drive mode is ready or not
  814. * @rmtoll CSR1 UDRDY LL_PWR_IsActiveFlag_UD
  815. * @retval State of bit (1 or 0).
  816. */
  817. __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_UD(void)
  818. {
  819. return (READ_BIT(PWR->CSR1, PWR_CSR1_UDRDY) == (PWR_CSR1_UDRDY));
  820. }
  821. /**
  822. * @brief Clear Standby Flag
  823. * @rmtoll CR1 CSBF LL_PWR_ClearFlag_SB
  824. * @retval None
  825. */
  826. __STATIC_INLINE void LL_PWR_ClearFlag_SB(void)
  827. {
  828. SET_BIT(PWR->CR1, PWR_CR1_CSBF);
  829. }
  830. /**
  831. * @brief Clear Wake-up Flag 6
  832. * @rmtoll CR2 CWUF6 LL_PWR_ClearFlag_WU6
  833. * @retval None
  834. */
  835. __STATIC_INLINE void LL_PWR_ClearFlag_WU6(void)
  836. {
  837. WRITE_REG(PWR->CR2, PWR_CR2_CWUPF6);
  838. }
  839. /**
  840. * @brief Clear Wake-up Flag 5
  841. * @rmtoll CR2 CWUF5 LL_PWR_ClearFlag_WU5
  842. * @retval None
  843. */
  844. __STATIC_INLINE void LL_PWR_ClearFlag_WU5(void)
  845. {
  846. WRITE_REG(PWR->CR2, PWR_CR2_CWUPF5);
  847. }
  848. /**
  849. * @brief Clear Wake-up Flag 4
  850. * @rmtoll CR2 CWUF4 LL_PWR_ClearFlag_WU4
  851. * @retval None
  852. */
  853. __STATIC_INLINE void LL_PWR_ClearFlag_WU4(void)
  854. {
  855. WRITE_REG(PWR->CR2, PWR_CR2_CWUPF4);
  856. }
  857. /**
  858. * @brief Clear Wake-up Flag 3
  859. * @rmtoll CR2 CWUF3 LL_PWR_ClearFlag_WU3
  860. * @retval None
  861. */
  862. __STATIC_INLINE void LL_PWR_ClearFlag_WU3(void)
  863. {
  864. WRITE_REG(PWR->CR2, PWR_CR2_CWUPF3);
  865. }
  866. /**
  867. * @brief Clear Wake-up Flag 2
  868. * @rmtoll CR2 CWUF2 LL_PWR_ClearFlag_WU2
  869. * @retval None
  870. */
  871. __STATIC_INLINE void LL_PWR_ClearFlag_WU2(void)
  872. {
  873. WRITE_REG(PWR->CR2, PWR_CR2_CWUPF2);
  874. }
  875. /**
  876. * @brief Clear Wake-up Flag 1
  877. * @rmtoll CR2 CWUF1 LL_PWR_ClearFlag_WU1
  878. * @retval None
  879. */
  880. __STATIC_INLINE void LL_PWR_ClearFlag_WU1(void)
  881. {
  882. WRITE_REG(PWR->CR2, PWR_CR2_CWUPF1);
  883. }
  884. /**
  885. * @brief Clear Under-Drive ready Flag
  886. * @rmtoll CSR1 UDRDY LL_PWR_ClearFlag_UD
  887. * @retval None
  888. */
  889. __STATIC_INLINE void LL_PWR_ClearFlag_UD(void)
  890. {
  891. WRITE_REG(PWR->CSR1, PWR_CSR1_UDRDY);
  892. }
  893. #if defined(USE_FULL_LL_DRIVER)
  894. /** @defgroup PWR_LL_EF_Init De-initialization function
  895. * @{
  896. */
  897. ErrorStatus LL_PWR_DeInit(void);
  898. /**
  899. * @}
  900. */
  901. #endif /* USE_FULL_LL_DRIVER */
  902. /**
  903. * @}
  904. */
  905. /**
  906. * @}
  907. */
  908. /**
  909. * @}
  910. */
  911. #endif /* defined(PWR) */
  912. /**
  913. * @}
  914. */
  915. #ifdef __cplusplus
  916. }
  917. #endif
  918. #endif /* __STM32F7xx_LL_PWR_H */