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.
 
 
 

1037 lines
34 KiB

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