stm32l5xx_hal_pwr.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. /**
  2. ******************************************************************************
  3. * @file stm32l5xx_hal_pwr.h
  4. * @author MCD Application Team
  5. * @brief Header file of PWR HAL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2019 STMicroelectronics.
  10. * All rights reserved.
  11. *
  12. * This software is licensed under terms that can be found in the LICENSE file in
  13. * the root directory of this software component.
  14. * If no LICENSE file comes with this software, it is provided AS-IS.
  15. ******************************************************************************
  16. */
  17. /* Define to prevent recursive inclusion -------------------------------------*/
  18. #ifndef STM32L5xx_HAL_PWR_H
  19. #define STM32L5xx_HAL_PWR_H
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. /* Includes ------------------------------------------------------------------*/
  24. #include "stm32l5xx_hal_def.h"
  25. /** @addtogroup STM32L5xx_HAL_Driver
  26. * @{
  27. */
  28. /** @addtogroup PWR
  29. * @{
  30. */
  31. /* Exported types ------------------------------------------------------------*/
  32. /** @defgroup PWR_Exported_Types PWR Exported Types
  33. * @{
  34. */
  35. /**
  36. * @brief PWR PVD configuration structure definition
  37. */
  38. typedef struct
  39. {
  40. uint32_t PVDLevel; /*!< PVDLevel: Specifies the PVD detection level.
  41. This parameter can be a value of @ref PWR_PVD_detection_level. */
  42. uint32_t Mode; /*!< Mode: Specifies the operating mode for the selected pins.
  43. This parameter can be a value of @ref PWR_PVD_Mode. */
  44. } PWR_PVDTypeDef;
  45. /**
  46. * @}
  47. */
  48. /* Exported constants --------------------------------------------------------*/
  49. /** @defgroup PWR_Exported_Constants PWR Exported Constants
  50. * @{
  51. */
  52. /** @defgroup PWR_PVD_detection_level Programmable Voltage Detection levels
  53. * @{
  54. */
  55. #define PWR_PVDLEVEL_0 PWR_CR2_PLS_LEV0 /*!< PVD threshold around 2.0 V */
  56. #define PWR_PVDLEVEL_1 PWR_CR2_PLS_LEV1 /*!< PVD threshold around 2.2 V */
  57. #define PWR_PVDLEVEL_2 PWR_CR2_PLS_LEV2 /*!< PVD threshold around 2.4 V */
  58. #define PWR_PVDLEVEL_3 PWR_CR2_PLS_LEV3 /*!< PVD threshold around 2.5 V */
  59. #define PWR_PVDLEVEL_4 PWR_CR2_PLS_LEV4 /*!< PVD threshold around 2.6 V */
  60. #define PWR_PVDLEVEL_5 PWR_CR2_PLS_LEV5 /*!< PVD threshold around 2.8 V */
  61. #define PWR_PVDLEVEL_6 PWR_CR2_PLS_LEV6 /*!< PVD threshold around 2.9 V */
  62. #define PWR_PVDLEVEL_7 PWR_CR2_PLS_LEV7 /*!< External input analog voltage (compared internally to VREFINT) */
  63. /**
  64. * @}
  65. */
  66. /** @defgroup PWR_PVD_Mode PWR PVD interrupt and event mode
  67. * @{
  68. */
  69. #define PWR_PVD_MODE_NORMAL ((uint32_t)0x00000000) /*!< Basic mode is used */
  70. #define PWR_PVD_MODE_IT_RISING ((uint32_t)0x00010001) /*!< External Interrupt Mode with Rising edge trigger detection */
  71. #define PWR_PVD_MODE_IT_FALLING ((uint32_t)0x00010002) /*!< External Interrupt Mode with Falling edge trigger detection */
  72. #define PWR_PVD_MODE_IT_RISING_FALLING ((uint32_t)0x00010003) /*!< External Interrupt Mode with Rising/Falling edge trigger detection */
  73. #define PWR_PVD_MODE_EVENT_RISING ((uint32_t)0x00020001) /*!< Event Mode with Rising edge trigger detection */
  74. #define PWR_PVD_MODE_EVENT_FALLING ((uint32_t)0x00020002) /*!< Event Mode with Falling edge trigger detection */
  75. #define PWR_PVD_MODE_EVENT_RISING_FALLING ((uint32_t)0x00020003) /*!< Event Mode with Rising/Falling edge trigger detection */
  76. /**
  77. * @}
  78. */
  79. /** @defgroup PWR_Regulator_state_in_SLEEP_STOP_mode PWR regulator mode
  80. * @{
  81. */
  82. #define PWR_MAINREGULATOR_ON ((uint32_t)0x00000000) /*!< Regulator in main mode */
  83. #define PWR_LOWPOWERREGULATOR_ON PWR_CR1_LPR /*!< Regulator in low-power mode */
  84. /**
  85. * @}
  86. */
  87. /** @defgroup PWR_SLEEP_mode_entry PWR SLEEP mode entry
  88. * @{
  89. */
  90. #define PWR_SLEEPENTRY_WFI ((uint8_t)0x01) /*!< Wait For Interruption instruction to enter Sleep mode */
  91. #define PWR_SLEEPENTRY_WFE ((uint8_t)0x02) /*!< Wait For Event instruction to enter Sleep mode */
  92. /**
  93. * @}
  94. */
  95. /** @defgroup PWR_STOP_mode_entry PWR STOP mode entry
  96. * @{
  97. */
  98. #define PWR_STOPENTRY_WFI ((uint8_t)0x01) /*!< Wait For Interruption instruction to enter Stop mode */
  99. #define PWR_STOPENTRY_WFE ((uint8_t)0x02) /*!< Wait For Event instruction to enter Stop mode */
  100. /**
  101. * @}
  102. */
  103. /** @defgroup PWR_PVD_EXTI_LINE PWR PVD external interrupt line
  104. * @{
  105. */
  106. #define PWR_EXTI_LINE_PVD ((uint32_t)0x00010000) /*!< External interrupt line 16 Connected to the PVD EXTI Line */
  107. /**
  108. * @}
  109. */
  110. /** @defgroup PWR_PVD_EVENT_LINE PWR PVD event line
  111. * @{
  112. */
  113. #define PWR_EVENT_LINE_PVD ((uint32_t)0x00010000) /*!< Event line 16 Connected to the PVD Event Line */
  114. /**
  115. * @}
  116. */
  117. /** @defgroup PWR_items PWR items
  118. * @brief PWR items to configure attributes on
  119. * @{
  120. */
  121. #define PWR_LPM PWR_SECCFGR_LPMSEC /*!< Low power mode */
  122. #define PWR_WKUP PWR_SECCFGR_WUPSEC /*!< All wake-up pins */
  123. #define PWR_WKUP1 PWR_SECCFGR_WUP1SEC /*!< Wake-up pin 1 */
  124. #define PWR_WKUP2 PWR_SECCFGR_WUP2SEC /*!< Wake-up pin 2 */
  125. #define PWR_WKUP3 PWR_SECCFGR_WUP3SEC /*!< Wake-up pin 3 */
  126. #define PWR_WKUP4 PWR_SECCFGR_WUP4SEC /*!< Wake-up pin 4 */
  127. #define PWR_WKUP5 PWR_SECCFGR_WUP5SEC /*!< Wake-up pin 5 */
  128. #define PWR_VDM PWR_SECCFGR_VDMSEC /*!< Voltage Detection and Monitoring */
  129. #define PWR_VB PWR_SECCFGR_VBSEC /*!< VBAT */
  130. #define PWR_APC PWR_SECCFGR_APCSEC /*!< Pull-Up/Down Control */
  131. #define PWR_ALL (PWR_LPM|PWR_WKUP|PWR_WKUP1|PWR_WKUP2|PWR_WKUP3|PWR_WKUP4|PWR_WKUP5| \
  132. PWR_VDM|PWR_VB|PWR_APC) /*!< All of the above */
  133. /**
  134. * @}
  135. */
  136. /** @defgroup PWR_attributes PWR attributes
  137. * @brief PWR secure/non-secure and privilege/non-privilege attributes
  138. * @note secure and non-secure attributes are only available from secure state when the system
  139. * implement the security (TZEN=1)
  140. * @{
  141. */
  142. #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
  143. #define PWR_SEC (PWR_ATTR_SEC_MASK | 0x00000001U) /*!< Secure attribute */
  144. #define PWR_NSEC (PWR_ATTR_SEC_MASK | 0x00000000U) /*!< Non-secure attribute */
  145. #endif /* __ARM_FEATURE_CMSE */
  146. #define PWR_PRIV (PWR_ATTR_PRIV_MASK | 0x00000002U) /*!< Privilege attribute */
  147. #define PWR_NPRIV (PWR_ATTR_PRIV_MASK | 0x00000000U) /*!< Non-privilege attribute */
  148. /**
  149. * @}
  150. */
  151. /**
  152. * @}
  153. */
  154. /* Exported macros -----------------------------------------------------------*/
  155. /** @defgroup PWR_Exported_Macros PWR Exported Macros
  156. * @{
  157. */
  158. /** @brief Check whether or not a specific PWR flag is set.
  159. * @param __FLAG__ specifies the flag to check.
  160. * This parameter can be one of the following values:
  161. * @arg @ref PWR_FLAG_WUF1 Wake Up Flag 1. Indicates that a wakeup event
  162. * was received from the WKUP pin 1.
  163. * @arg @ref PWR_FLAG_WUF2 Wake Up Flag 2. Indicates that a wakeup event
  164. * was received from the WKUP pin 2.
  165. * @arg @ref PWR_FLAG_WUF3 Wake Up Flag 3. Indicates that a wakeup event
  166. * was received from the WKUP pin 3.
  167. * @arg @ref PWR_FLAG_WUF4 Wake Up Flag 4. Indicates that a wakeup event
  168. * was received from the WKUP pin 4.
  169. * @arg @ref PWR_FLAG_WUF5 Wake Up Flag 5. Indicates that a wakeup event
  170. * was received from the WKUP pin 5.
  171. * @arg @ref PWR_FLAG_SB StandBy Flag. Indicates that the system
  172. * entered StandBy mode.
  173. * @arg @ref PWR_FLAG_SMPS_BYPASS_RDY SMPS bypass ready flag. Indicates
  174. * SMPS bypass mode now operational.
  175. * @arg @ref PWR_FLAG_EXT_SMPS_RDY SMPS external SMPS ready flag. Indicates
  176. * external SMPS switch can be closed.
  177. * @arg @ref PWR_FLAG_REGLPS Low Power Regulator Started. Indicates whether or not the
  178. * low-power regulator is ready.
  179. * @arg @ref PWR_FLAG_REGLPF Low Power Regulator Flag. Indicates whether the
  180. * regulator is ready in main mode or is in low-power mode.
  181. * @arg @ref PWR_FLAG_VOSF Voltage Scaling Flag. Indicates whether the regulator is ready
  182. * in the selected voltage range or is still changing to the required voltage level.
  183. * @arg @ref PWR_FLAG_PVDO Power Voltage Detector Output. Indicates whether VDD voltage is
  184. * below or above the selected PVD threshold.
  185. * @arg @ref PWR_FLAG_PVMO1 Peripheral Voltage Monitoring Output 1. Indicates whether VDDUSB voltage is
  186. * is below or above PVM1 threshold (applicable when USB feature is supported).
  187. * @arg @ref PWR_FLAG_PVMO2 Peripheral Voltage Monitoring Output 2. Indicates whether VDDIO2 voltage is
  188. * is below or above PVM2 threshold (applicable when VDDIO2 is present on device).
  189. * @arg @ref PWR_FLAG_PVMO3 Peripheral Voltage Monitoring Output 3. Indicates whether VDDA voltage is
  190. * is below or above PVM3 threshold.
  191. * @arg @ref PWR_FLAG_PVMO4 Peripheral Voltage Monitoring Output 4. Indicates whether VDDA voltage is
  192. * is below or above PVM4 threshold.
  193. *
  194. * @retval The new state of __FLAG__ (TRUE or FALSE).
  195. */
  196. #define __HAL_PWR_GET_FLAG(__FLAG__) ( ((((uint8_t)(__FLAG__)) >> 5U) == 1) ?\
  197. (PWR->SR1 & (1U << ((__FLAG__) & 31U))) :\
  198. (PWR->SR2 & (1U << ((__FLAG__) & 31U))) )
  199. /** @brief Clear a specific PWR flag.
  200. * @param __FLAG__ specifies the flag to clear.
  201. * This parameter can be one of the following values:
  202. * @arg @ref PWR_FLAG_WUF1 Wake Up Flag 1. Indicates that a wakeup event
  203. * was received from the WKUP pin 1.
  204. * @arg @ref PWR_FLAG_WUF2 Wake Up Flag 2. Indicates that a wakeup event
  205. * was received from the WKUP pin 2.
  206. * @arg @ref PWR_FLAG_WUF3 Wake Up Flag 3. Indicates that a wakeup event
  207. * was received from the WKUP pin 3.
  208. * @arg @ref PWR_FLAG_WUF4 Wake Up Flag 4. Indicates that a wakeup event
  209. * was received from the WKUP pin 4.
  210. * @arg @ref PWR_FLAG_WUF5 Wake Up Flag 5. Indicates that a wakeup event
  211. * was received from the WKUP pin 5.
  212. * @arg @ref PWR_FLAG_WU Encompasses all five Wake Up Flags.
  213. * @arg @ref PWR_FLAG_SB Standby Flag. Indicates that the system
  214. * entered Standby mode.
  215. * @retval None
  216. */
  217. #define __HAL_PWR_CLEAR_FLAG(__FLAG__) ( (((uint8_t)(__FLAG__)) == PWR_FLAG_WU) ?\
  218. (PWR->SCR = (__FLAG__)) :\
  219. (PWR->SCR = (1U << ((__FLAG__) & 31U))) )
  220. /**
  221. * @brief Enable the PVD Extended Interrupt Line.
  222. * @retval None
  223. */
  224. #define __HAL_PWR_PVD_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR1, PWR_EXTI_LINE_PVD)
  225. /**
  226. * @brief Disable the PVD Extended Interrupt Line.
  227. * @retval None
  228. */
  229. #define __HAL_PWR_PVD_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR1, PWR_EXTI_LINE_PVD)
  230. /**
  231. * @brief Enable the PVD Event Line.
  232. * @retval None
  233. */
  234. #define __HAL_PWR_PVD_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR1, PWR_EVENT_LINE_PVD)
  235. /**
  236. * @brief Disable the PVD Event Line.
  237. * @retval None
  238. */
  239. #define __HAL_PWR_PVD_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR1, PWR_EVENT_LINE_PVD)
  240. /**
  241. * @brief Enable the PVD Extended Interrupt Rising Trigger.
  242. * @retval None
  243. */
  244. #define __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR1, PWR_EXTI_LINE_PVD)
  245. /**
  246. * @brief Disable the PVD Extended Interrupt Rising Trigger.
  247. * @retval None
  248. */
  249. #define __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR1, PWR_EXTI_LINE_PVD)
  250. /**
  251. * @brief Enable the PVD Extended Interrupt Falling Trigger.
  252. * @retval None
  253. */
  254. #define __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR1, PWR_EXTI_LINE_PVD)
  255. /**
  256. * @brief Disable the PVD Extended Interrupt Falling Trigger.
  257. * @retval None
  258. */
  259. #define __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR1, PWR_EXTI_LINE_PVD)
  260. /**
  261. * @brief Enable the PVD Extended Interrupt Rising & Falling Trigger.
  262. * @retval None
  263. */
  264. #define __HAL_PWR_PVD_EXTI_ENABLE_RISING_FALLING_EDGE() \
  265. do { \
  266. __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE(); \
  267. __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE(); \
  268. } while(0)
  269. /**
  270. * @brief Disable the PVD Extended Interrupt Rising & Falling Trigger.
  271. * @retval None
  272. */
  273. #define __HAL_PWR_PVD_EXTI_DISABLE_RISING_FALLING_EDGE() \
  274. do { \
  275. __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE(); \
  276. __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE(); \
  277. } while(0)
  278. /**
  279. * @brief Generate a Software interrupt on selected EXTI line.
  280. * @retval None
  281. */
  282. #define __HAL_PWR_PVD_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER1, PWR_EXTI_LINE_PVD)
  283. /**
  284. * @brief Check whether or not the PVD EXTI interrupt flag is set.
  285. * @retval EXTI PVD Line Status.
  286. */
  287. #define __HAL_PWR_PVD_EXTI_GET_FLAG() ((EXTI->RPR1 | EXTI->FPR1) & PWR_EXTI_LINE_PVD)
  288. /**
  289. * @brief Clear the PVD EXTI interrupt flag.
  290. * @retval None
  291. */
  292. #define __HAL_PWR_PVD_EXTI_CLEAR_FLAG() \
  293. do { \
  294. WRITE_REG(EXTI->RPR1, PWR_EXTI_LINE_PVD); \
  295. WRITE_REG(EXTI->FPR1, PWR_EXTI_LINE_PVD); \
  296. } while(0)
  297. /**
  298. * @}
  299. */
  300. /* Private constants -----------------------------------------------------*/
  301. /** @addtogroup PWR_Private_Constants PWR Private Constants
  302. * @{
  303. */
  304. /* Defines for attributes */
  305. #define PWR_ATTR_SEC_MASK 0x100U
  306. #define PWR_ATTR_PRIV_MASK 0x200U
  307. /**
  308. * @}
  309. */
  310. /* Private macros --------------------------------------------------------*/
  311. /** @addtogroup PWR_Private_Macros PWR Private Macros
  312. * @{
  313. */
  314. #define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLEVEL_0) || ((LEVEL) == PWR_PVDLEVEL_1)|| \
  315. ((LEVEL) == PWR_PVDLEVEL_2) || ((LEVEL) == PWR_PVDLEVEL_3)|| \
  316. ((LEVEL) == PWR_PVDLEVEL_4) || ((LEVEL) == PWR_PVDLEVEL_5)|| \
  317. ((LEVEL) == PWR_PVDLEVEL_6) || ((LEVEL) == PWR_PVDLEVEL_7))
  318. #define IS_PWR_PVD_MODE(MODE) (((MODE) == PWR_PVD_MODE_NORMAL) ||\
  319. ((MODE) == PWR_PVD_MODE_IT_RISING) ||\
  320. ((MODE) == PWR_PVD_MODE_IT_FALLING) ||\
  321. ((MODE) == PWR_PVD_MODE_IT_RISING_FALLING) ||\
  322. ((MODE) == PWR_PVD_MODE_EVENT_RISING) ||\
  323. ((MODE) == PWR_PVD_MODE_EVENT_FALLING) ||\
  324. ((MODE) == PWR_PVD_MODE_EVENT_RISING_FALLING))
  325. #define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_MAINREGULATOR_ON) || \
  326. ((REGULATOR) == PWR_LOWPOWERREGULATOR_ON))
  327. #define IS_PWR_SLEEP_ENTRY(ENTRY) (((ENTRY) == PWR_SLEEPENTRY_WFI) || ((ENTRY) == PWR_SLEEPENTRY_WFE))
  328. #define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPENTRY_WFI) || ((ENTRY) == PWR_STOPENTRY_WFE) )
  329. #define IS_PWR_ITEMS_ATTRIBUTES(__ITEM__) ((((__ITEM__) & PWR_LPM) == PWR_LPM) || \
  330. (((__ITEM__) & PWR_WKUP) == PWR_WKUP) || \
  331. (((__ITEM__) & PWR_WKUP1) == PWR_WKUP1) || \
  332. (((__ITEM__) & PWR_WKUP2) == PWR_WKUP2) || \
  333. (((__ITEM__) & PWR_WKUP3) == PWR_WKUP3) || \
  334. (((__ITEM__) & PWR_WKUP4) == PWR_WKUP4) || \
  335. (((__ITEM__) & PWR_WKUP5) == PWR_WKUP5) || \
  336. (((__ITEM__) & PWR_VDM) == PWR_VDM) || \
  337. (((__ITEM__) & PWR_VB) == PWR_VB) || \
  338. (((__ITEM__) & PWR_APC) == PWR_APC) || \
  339. (((__ITEM__) & PWR_ALL) == PWR_ALL) || \
  340. (((__ITEM__) & ~(PWR_ALL)) == 0U))
  341. #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
  342. #define IS_PWR_ATTRIBUTES(__ATTRIBUTES__) (((((__ATTRIBUTES__) & PWR_SEC) == PWR_SEC) || \
  343. (((__ATTRIBUTES__) & PWR_NSEC) == PWR_NSEC) || \
  344. (((__ATTRIBUTES__) & PWR_PRIV) == PWR_PRIV) || \
  345. (((__ATTRIBUTES__) & PWR_NPRIV) == PWR_NPRIV)) && \
  346. (((__ATTRIBUTES__) & ~(PWR_SEC|PWR_NSEC|PWR_PRIV|PWR_NPRIV)) == 0U))
  347. #else
  348. #define IS_PWR_ATTRIBUTES(__ATTRIBUTES__) (((((__ATTRIBUTES__) & PWR_PRIV) == PWR_PRIV) || \
  349. (((__ATTRIBUTES__) & PWR_NPRIV) == PWR_NPRIV)) && \
  350. (((__ATTRIBUTES__) & ~(PWR_PRIV|PWR_NPRIV)) == 0U))
  351. #endif /* __ARM_FEATURE_CMSE */
  352. /**
  353. * @}
  354. */
  355. /* Include PWR HAL Extended module */
  356. #include "stm32l5xx_hal_pwr_ex.h"
  357. /* Exported functions --------------------------------------------------------*/
  358. /** @addtogroup PWR_Exported_Functions PWR Exported Functions
  359. * @{
  360. */
  361. /** @addtogroup PWR_Exported_Functions_Group1 Initialization and de-initialization functions
  362. * @{
  363. */
  364. /* Initialization and de-initialization functions *******************************/
  365. void HAL_PWR_DeInit(void);
  366. void HAL_PWR_EnableBkUpAccess(void);
  367. void HAL_PWR_DisableBkUpAccess(void);
  368. /**
  369. * @}
  370. */
  371. /** @addtogroup PWR_Exported_Functions_Group2 Peripheral Control functions
  372. * @{
  373. */
  374. /* Peripheral Control functions ************************************************/
  375. HAL_StatusTypeDef HAL_PWR_ConfigPVD(PWR_PVDTypeDef *sConfigPVD);
  376. void HAL_PWR_EnablePVD(void);
  377. void HAL_PWR_DisablePVD(void);
  378. /* WakeUp pins configuration functions ****************************************/
  379. void HAL_PWR_EnableWakeUpPin(uint32_t WakeUpPinPolarity);
  380. void HAL_PWR_DisableWakeUpPin(uint32_t WakeUpPinx);
  381. /* Low Power modes configuration functions ************************************/
  382. void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry);
  383. void HAL_PWR_EnterSTOPMode(uint32_t Regulator, uint8_t STOPEntry);
  384. void HAL_PWR_EnterSTANDBYMode(void);
  385. void HAL_PWR_EnableSleepOnExit(void);
  386. void HAL_PWR_DisableSleepOnExit(void);
  387. void HAL_PWR_EnableSEVOnPend(void);
  388. void HAL_PWR_DisableSEVOnPend(void);
  389. void HAL_PWR_PVDCallback(void);
  390. /**
  391. * @}
  392. */
  393. /** @addtogroup RCC_Exported_Functions_Group3 Attributes management functions
  394. * @{
  395. */
  396. /* Attributes management functions ******************************************/
  397. void HAL_PWR_ConfigAttributes(uint32_t Item, uint32_t Attributes);
  398. HAL_StatusTypeDef HAL_PWR_GetConfigAttributes(uint32_t Item, uint32_t *pAttributes);
  399. /**
  400. * @}
  401. */
  402. /**
  403. * @}
  404. */
  405. /**
  406. * @}
  407. */
  408. /**
  409. * @}
  410. */
  411. #ifdef __cplusplus
  412. }
  413. #endif
  414. #endif /* STM32L5xx_HAL_PWR_H */