stm32h5xx_hal_pwr.h 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695
  1. /**
  2. ******************************************************************************
  3. * @file stm32h5xx_hal_pwr.h
  4. * @author MCD Application Team
  5. * @brief Header file of PWR HAL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2023 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 STM32H5xx_HAL_PWR_H
  20. #define STM32H5xx_HAL_PWR_H
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif /* __cplusplus */
  24. /* Includes ------------------------------------------------------------------*/
  25. #include "stm32h5xx_hal_def.h"
  26. /** @addtogroup STM32H5xx_HAL_Driver
  27. * @{
  28. */
  29. /** @addtogroup PWR
  30. * @{
  31. */
  32. /* Exported types ------------------------------------------------------------*/
  33. /** @defgroup PWR_Exported_Types PWR Exported Types
  34. * @{
  35. */
  36. /**
  37. * @brief PWR PVD configuration structure definition
  38. */
  39. typedef struct
  40. {
  41. uint32_t PVDLevel; /*!< Specifies the PVD detection level.
  42. This parameter can be a value of
  43. @ref PWR_PVD_Detection_Level. */
  44. uint32_t Mode; /*!< Specifies the operating mode for the selected pins.
  45. This parameter can be a value of @ref PWR_PVD_Mode. */
  46. } PWR_PVDTypeDef;
  47. /**
  48. * @}
  49. */
  50. /* Exported constants --------------------------------------------------------*/
  51. /** @defgroup PWR_Exported_Constants PWR Exported Constants
  52. * @{
  53. */
  54. /** @defgroup PWR_PVD_Detection_Level Programmable Voltage Detection Level
  55. * @{
  56. */
  57. #define PWR_PVDLEVEL_0 0x00000000UL /*!< PVD threshold around 1.95 V */
  58. #define PWR_PVDLEVEL_1 (PWR_VMCR_PLS_0) /*!< PVD threshold around 2.1 V */
  59. #define PWR_PVDLEVEL_2 (PWR_VMCR_PLS_1) /*!< PVD threshold around 2.25 V */
  60. #define PWR_PVDLEVEL_3 (PWR_VMCR_PLS_0 | PWR_VMCR_PLS_1) /*!< PVD threshold around 2.4 V */
  61. #define PWR_PVDLEVEL_4 (PWR_VMCR_PLS_2) /*!< PVD threshold around 2.55 V */
  62. #define PWR_PVDLEVEL_5 (PWR_VMCR_PLS_0 | PWR_VMCR_PLS_2) /*!< PVD threshold around 2.7 V */
  63. #define PWR_PVDLEVEL_6 (PWR_VMCR_PLS_1 | PWR_VMCR_PLS_2) /*!< PVD threshold around 2.85 V */
  64. #define PWR_PVDLEVEL_7 (PWR_VMCR_PLS) /*!< External input analog voltage
  65. (compared internally to VREFINT) */
  66. /**
  67. * @}
  68. */
  69. /** @defgroup PWR_PVD_Mode PWR PVD Mode
  70. * @{
  71. */
  72. #define PWR_PVD_MODE_NORMAL (0x00U) /*!< Basic Mode is used */
  73. #define PWR_PVD_MODE_IT_RISING (0x05U) /*!< External Interrupt Mode with Rising edge trigger detection */
  74. #define PWR_PVD_MODE_IT_FALLING (0x06U) /*!< External Interrupt Mode with Falling
  75. edge trigger detection */
  76. #define PWR_PVD_MODE_IT_RISING_FALLING (0x07U) /*!< External Interrupt Mode with Rising/Falling
  77. edge trigger detection */
  78. #define PWR_PVD_MODE_EVENT_RISING (0x09U) /*!< Event Mode with Rising edge trigger detection */
  79. #define PWR_PVD_MODE_EVENT_FALLING (0x0AU) /*!< Event Mode with Falling edge trigger detection */
  80. #define PWR_PVD_MODE_EVENT_RISING_FALLING (0x0BU) /*!< Event Mode with Rising/Falling edge trigger detection */
  81. /**
  82. * @}
  83. */
  84. /** @defgroup PWR_Regulator_In_LowPower_Mode PWR Regulator State in SLEEP/STOP Mode
  85. * @{
  86. */
  87. #define PWR_MAINREGULATOR_ON (0x00U) /*!< Main Regulator ON in Run Mode */
  88. #define PWR_LOWPOWERREGULATOR_ON (0x00U) /*!< Main Regulator ON in Low Power Mode */
  89. /**
  90. * @}
  91. */
  92. /** @defgroup PWR_SLEEP_Mode_Entry PWR SLEEP Mode Entry
  93. * @{
  94. */
  95. #define PWR_SLEEPENTRY_WFI (0x01U) /*!< Wait For Interruption instruction to enter Sleep mode */
  96. #define PWR_SLEEPENTRY_WFE (0x02U) /*!< Wait For Event instruction to enter Sleep mode */
  97. /**
  98. * @}
  99. */
  100. /** @defgroup PWR_STOP_Mode_Entry PWR STOP Mode Entry
  101. * @{
  102. */
  103. #define PWR_STOPENTRY_WFI (0x01U) /*!< Wait For Interruption instruction to enter Stop mode */
  104. #define PWR_STOPENTRY_WFE (0x02U) /*!< Wait For Event instruction to enter Stop mode */
  105. /**
  106. * @}
  107. */
  108. /** @defgroup PWR_Flags PWR Flags
  109. * @{
  110. */
  111. #define PWR_FLAG_STOPF (0x01U) /*!< STOP flag */
  112. #define PWR_FLAG_SBF (0x02U) /*!< STANDBY flag */
  113. #define PWR_FLAG_VOSRDY (0x03U) /*!< Voltage scaling ready flag */
  114. #define PWR_FLAG_ACTVOSRDY (0x04U) /*!< Currently applied VOS ready flag */
  115. #define PWR_FLAG_BRR (0x05U) /*!< Backup regulator ready flag */
  116. #define PWR_FLAG_VBATL (0x06U) /*!< Backup domain voltage level flag (versus low threshold) */
  117. #define PWR_FLAG_VBATH (0x07U) /*!< Backup domain voltage level flag (versus high threshold) */
  118. #define PWR_FLAG_TEMPL (0x08U) /*!< Temperature level flag (versus low threshold) */
  119. #define PWR_FLAG_TEMPH (0x09U) /*!< Temperature level flag (versus high threshold) */
  120. #define PWR_FLAG_AVDO (0x0AU) /*!< VDDA voltage detector output flag */
  121. #define PWR_FLAG_VDDIO2RDY (0x0BU) /*!< VDDIO2 voltage detector output flag */
  122. #define PWR_FLAG_PVDO (0x0CU) /*!< VDD voltage detector output flag */
  123. #define PWR_FLAG_USB33RDY (0x0DU) /*!< VDDUSB33 ready flag */
  124. #define PWR_WAKEUP_FLAG1 (0x10U) /*!< Wake up line 1 flag */
  125. #define PWR_WAKEUP_FLAG2 (0x20U) /*!< Wake up line 2 flag */
  126. #define PWR_WAKEUP_FLAG3 (0x30U) /*!< Wake up line 3 flag */
  127. #define PWR_WAKEUP_FLAG4 (0x40U) /*!< Wake up line 4 flag */
  128. #define PWR_WAKEUP_FLAG5 (0x50U) /*!< Wake up line 5 flag */
  129. #define PWR_WAKEUP_FLAG6 (0x60U) /*!< Wake up line 6 flag */
  130. #define PWR_WAKEUP_FLAG7 (0x70U) /*!< Wake up line 7 flag */
  131. #define PWR_WAKEUP_FLAG8 (0x80U) /*!< Wake up line 8 flag */
  132. #define PWR_WAKEUP_ALL_FLAG (0x90U) /*!< Wakeup flag all */
  133. /**
  134. * @}
  135. */
  136. /** @defgroup PWREx_WakeUp_Pins PWREx Wake-Up Pins
  137. * @{
  138. */
  139. /* High level and No pull (default configuration) */
  140. #define PWR_WAKEUP_PIN1 PWR_WUCR_WUPEN1
  141. #define PWR_WAKEUP_PIN2 PWR_WUCR_WUPEN2
  142. #define PWR_WAKEUP_PIN3 PWR_WUCR_WUPEN3
  143. #define PWR_WAKEUP_PIN4 PWR_WUCR_WUPEN4
  144. #define PWR_WAKEUP_PIN5 PWR_WUCR_WUPEN5
  145. #if defined (PWR_WUCR_WUPEN6)
  146. #define PWR_WAKEUP_PIN6 PWR_WUCR_WUPEN6
  147. #define PWR_WAKEUP_PIN7 PWR_WUCR_WUPEN7
  148. #define PWR_WAKEUP_PIN8 PWR_WUCR_WUPEN8
  149. #endif /* PWR_WUCR_WUPEN6 */
  150. /* High level and No pull */
  151. #define PWR_WAKEUP_PIN1_HIGH PWR_WUCR_WUPEN1
  152. #define PWR_WAKEUP_PIN2_HIGH PWR_WUCR_WUPEN2
  153. #define PWR_WAKEUP_PIN3_HIGH PWR_WUCR_WUPEN3
  154. #define PWR_WAKEUP_PIN4_HIGH PWR_WUCR_WUPEN4
  155. #define PWR_WAKEUP_PIN5_HIGH PWR_WUCR_WUPEN5
  156. #if defined (PWR_WUCR_WUPEN6)
  157. #define PWR_WAKEUP_PIN6_HIGH PWR_WUCR_WUPEN6
  158. #define PWR_WAKEUP_PIN7_HIGH PWR_WUCR_WUPEN7
  159. #define PWR_WAKEUP_PIN8_HIGH PWR_WUCR_WUPEN8
  160. #endif /* PWR_WUCR_WUPEN6 */
  161. /* Low level and No pull */
  162. #define PWR_WAKEUP_PIN1_LOW (PWR_WUCR_WUPP1 | PWR_WUCR_WUPEN1)
  163. #define PWR_WAKEUP_PIN2_LOW (PWR_WUCR_WUPP2 | PWR_WUCR_WUPEN2)
  164. #define PWR_WAKEUP_PIN3_LOW (PWR_WUCR_WUPP3 | PWR_WUCR_WUPEN3)
  165. #define PWR_WAKEUP_PIN4_LOW (PWR_WUCR_WUPP4 | PWR_WUCR_WUPEN4)
  166. #define PWR_WAKEUP_PIN5_LOW (PWR_WUCR_WUPP5 | PWR_WUCR_WUPEN5)
  167. #if defined (PWR_WUCR_WUPEN6)
  168. #define PWR_WAKEUP_PIN6_LOW (PWR_WUCR_WUPP6 | PWR_WUCR_WUPEN6)
  169. #define PWR_WAKEUP_PIN7_LOW (PWR_WUCR_WUPP7 | PWR_WUCR_WUPEN7)
  170. #define PWR_WAKEUP_PIN8_LOW (PWR_WUCR_WUPP8 | PWR_WUCR_WUPEN8)
  171. #endif /* PWR_WUCR_WUPEN6 */
  172. /**
  173. * @}
  174. */
  175. /** @defgroup PWR_Items PWR Items
  176. * @{
  177. */
  178. #if defined(PWR_SECCFGR_WUP1SEC)
  179. #define PWR_WKUP1 (PWR_SECCFGR_WUP1SEC) /*!< WUP1 secure protection */
  180. #define PWR_WKUP2 (PWR_SECCFGR_WUP2SEC) /*!< WUP2 secure protection */
  181. #define PWR_WKUP3 (PWR_SECCFGR_WUP3SEC) /*!< WUP3 secure protection */
  182. #define PWR_WKUP4 (PWR_SECCFGR_WUP4SEC) /*!< WUP4 secure protection */
  183. #define PWR_WKUP5 (PWR_SECCFGR_WUP5SEC) /*!< WUP5 secure protection */
  184. #define PWR_WKUP6 (PWR_SECCFGR_WUP6SEC) /*!< WUP6 secure protection */
  185. #define PWR_WKUP7 (PWR_SECCFGR_WUP7SEC) /*!< WUP7 secure protection */
  186. #define PWR_WKUP8 (PWR_SECCFGR_WUP8SEC) /*!< WUP8 secure protection */
  187. #define PWR_RET (PWR_SECCFGR_RETSEC) /*!< IO Retention secure protection */
  188. #define PWR_LPM (PWR_SECCFGR_LPMSEC) /*!< Low power modes secure protection */
  189. #define PWR_SCM (PWR_SECCFGR_SCMSEC) /*!< Voltage detection and monitoring secure protection */
  190. #define PWR_VB (PWR_SECCFGR_VBSEC) /*!< Backup domain secure protection */
  191. #define PWR_VUSB (PWR_SECCFGR_VUSBSEC) /*!< Voltage USB secure protection */
  192. #define PWR_ALL (PWR_WKUP1 | PWR_WKUP2 | PWR_WKUP3 | PWR_WKUP4 | \
  193. PWR_WKUP5 | PWR_WKUP6 | PWR_WKUP7 | PWR_WKUP8 | \
  194. PWR_LPM | PWR_SCM | PWR_VB | PWR_VUSB | \
  195. PWR_RET)
  196. #else
  197. #define PWR_ALL 0xFF /*!< Dummy Value */
  198. #endif /* PWR_SECCFGR_WUP1SEC */
  199. /**
  200. * @}
  201. */
  202. /** @defgroup PWR_Attributes PWR Attributes
  203. * @brief PWR Privilege/NPrivilege and Secure/NSecure Attributes
  204. * @{
  205. */
  206. #if defined(PWR_PRIVCFGR_NSPRIV)
  207. #define PWR_NSEC_PRIV (PWR_ITEM_ATTR_NSEC_PRIV_MASK | 0x01U) /*!< NSecure and Privileged attribute */
  208. #define PWR_NSEC_NPRIV (PWR_ITEM_ATTR_NSEC_PRIV_MASK) /*!< NSecure and NPrivileged attribute */
  209. #else
  210. #define PWR_PRIV (PWR_ITEM_ATTR_NSEC_PRIV_MASK | 0x01U) /*!< Privileged attribute */
  211. #define PWR_NPRIV (PWR_ITEM_ATTR_NSEC_PRIV_MASK) /*!< NPrivileged attribute */
  212. #endif /* PWR_PRIVCFGR_NSPRIV */
  213. #define PWR_SEC_PRIV (PWR_ITEM_ATTR_SEC_PRIV_MASK | 0x02U) /*!< Secure and Privileged attribute */
  214. #define PWR_SEC_NPRIV (PWR_ITEM_ATTR_SEC_PRIV_MASK) /*!< Secure and NPrivileged attribute */
  215. /**
  216. * @}
  217. */
  218. /**
  219. * @}
  220. */
  221. /* Exported macros -----------------------------------------------------------*/
  222. /** @defgroup PWR_Exported_Macros PWR Exported Macros
  223. * @{
  224. */
  225. /** @brief Check PWR flags are set or not.
  226. * @param __FLAG__ : Specifies the flag to check.
  227. * This parameter can be one of the following values :
  228. * @arg @ref PWR_FLAG_STOPF : Stop flag.
  229. * Indicates that the device was resumed from Stop mode.
  230. * @arg @ref PWR_FLAG_SBF : Standby flag.
  231. * Indicates that the device was resumed from Standby mode.
  232. * @arg @ref PWR_FLAG_VOSRDY : Voltage scaling ready flag.
  233. * Indicates that the Vcore level at or above VOS selected level.
  234. * @arg @ref PWR_FLAG_ACTVOSRDY : Currently applied VOS ready flag.
  235. * Indicates that Vcore is equal to the current
  236. * voltage scaling provided by ACTVOS.
  237. * @arg @ref PWR_FLAG_BRR : Backup regulator ready flag. This bit is not
  238. * reset when the device wakes up from STANDBY
  239. * mode or by a system reset or power-on reset.
  240. * @arg @ref PWR_FLAG_VBATL : Backup domain voltage level flag (versus low threshold).
  241. * Indicates the backup domain voltage
  242. * level is equal or above low threshold.
  243. * @arg @ref PWR_FLAG_VBATH : Backup domain voltage level flag (versus high threshold).
  244. * Indicates the backup domain voltage
  245. * level is equal or above high threshold.
  246. * @arg @ref PWR_FLAG_TEMPL : Temperature level flag (versus low threshold).
  247. * Indicates the temperature is equal or above low threshold.
  248. * @arg @ref PWR_FLAG_TEMPH : Temperature level flag (versus high threshold).
  249. * Indicates the temperature is equal or above high threshold.
  250. * @arg @ref PWR_FLAG_AVDO : Regulator selection flag.
  251. * Indicates the regulator selected.
  252. * @arg @ref PWR_FLAG_VDDIO2RDY : VDDIO2 ready flag (versus 0.9 V threshold).
  253. * Indicates that VDDIO2 is equal or above the threshold
  254. * of the VDDIO2 voltage monitor (around 0.9 V).
  255. * @arg @ref PWR_FLAG_PVDO : Voltage detector output flag.
  256. * Indicates that Vdd is equal or above
  257. * the PVD threshold selected by PVDLS.
  258. * @arg @ref PWR_FLAG_USB33RDY : VDDUSB ready flag (versus 1.2 V threshold).
  259. * Indicates that VDDUSB is equal or above the threshold
  260. * of the VDDUSB voltage monitor (around 1.2 V).
  261. * @arg @ref PWR_WAKEUP_FLAG1 : Wakeup flag 1.
  262. * Indicates that a wakeup event was received from the WKUP line 1.
  263. * @arg @ref PWR_WAKEUP_FLAG2 : Wakeup flag 2.
  264. * Indicates that a wakeup event was received from the WKUP line 2.
  265. * @arg @ref PWR_WAKEUP_FLAG3 : Wakeup flag 3.
  266. * Indicates that a wakeup event was received from the WKUP line 3.
  267. * @arg @ref PWR_WAKEUP_FLAG4 : Wakeup flag 4.
  268. * Indicates that a wakeup event was received from the WKUP line 4.
  269. * @arg @ref PWR_WAKEUP_FLAG5 : Wakeup flag 5.
  270. * Indicates that a wakeup event was received from the WKUP line 5.
  271. * @arg @ref PWR_WAKEUP_FLAG6 : Wakeup flag 6.
  272. * Indicates that a wakeup event was received from the WKUP line 6.
  273. * @arg @ref PWR_WAKEUP_FLAG7 : Wakeup flag 7.
  274. * Indicates that a wakeup event was received from the WKUP line 7.
  275. * @arg @ref PWR_WAKEUP_FLAG8 : Wakeup flag 8.
  276. * Indicates that a wakeup event was received from the WKUP line 8.
  277. * @note The PWR_WAKEUP_FLAG6, PWR_WAKEUP_FLAG7 AND PWR_WAKEUP_FLAG8 are not available for STM32H503xx devices.
  278. * @retval The state of __FLAG__ (TRUE or FALSE).
  279. */
  280. #if defined (PWR_WUSR_WUF6)
  281. #define __HAL_PWR_GET_FLAG(__FLAG__) \
  282. (((__FLAG__) == PWR_FLAG_STOPF) ? (READ_BIT(PWR->PMSR, PWR_PMSR_STOPF) == PWR_PMSR_STOPF) : \
  283. ((__FLAG__) == PWR_FLAG_SBF) ? (READ_BIT(PWR->PMSR, PWR_PMSR_SBF) == PWR_PMSR_SBF) : \
  284. ((__FLAG__) == PWR_FLAG_VOSRDY) ? (READ_BIT(PWR->VOSSR, PWR_VOSSR_VOSRDY) == PWR_VOSSR_VOSRDY) : \
  285. ((__FLAG__) == PWR_FLAG_ACTVOSRDY) ? (READ_BIT(PWR->VOSSR, PWR_VOSSR_ACTVOSRDY) == PWR_VOSSR_ACTVOSRDY) : \
  286. ((__FLAG__) == PWR_FLAG_BRR) ? (READ_BIT(PWR->BDSR, PWR_BDSR_BRRDY) == PWR_BDSR_BRRDY) : \
  287. ((__FLAG__) == PWR_FLAG_VBATL) ? (READ_BIT(PWR->BDSR, PWR_BDSR_VBATL) == PWR_BDSR_VBATL) : \
  288. ((__FLAG__) == PWR_FLAG_VBATH) ? (READ_BIT(PWR->BDSR, PWR_BDSR_VBATH) == PWR_BDSR_VBATH) : \
  289. ((__FLAG__) == PWR_FLAG_TEMPL) ? (READ_BIT(PWR->BDSR, PWR_BDSR_TEMPL) == PWR_BDSR_TEMPL) : \
  290. ((__FLAG__) == PWR_FLAG_TEMPH) ? (READ_BIT(PWR->BDSR, PWR_BDSR_TEMPH) == PWR_BDSR_TEMPH) : \
  291. ((__FLAG__) == PWR_FLAG_AVDO) ? (READ_BIT(PWR->VMSR, PWR_VMSR_AVDO) == PWR_VMSR_AVDO) : \
  292. ((__FLAG__) == PWR_FLAG_VDDIO2RDY) ? (READ_BIT(PWR->VMSR, PWR_VMSR_VDDIO2RDY) == PWR_VMSR_VDDIO2RDY) : \
  293. ((__FLAG__) == PWR_FLAG_PVDO) ? (READ_BIT(PWR->VMSR, PWR_VMSR_PVDO) == PWR_VMSR_PVDO) : \
  294. ((__FLAG__) == PWR_FLAG_USB33RDY) ? (READ_BIT(PWR->VMSR, PWR_VMSR_USB33RDY) == PWR_VMSR_USB33RDY) : \
  295. ((__FLAG__) == PWR_WAKEUP_FLAG1) ? (READ_BIT(PWR->WUSR, PWR_WUSR_WUF1) == PWR_WUSR_WUF1) : \
  296. ((__FLAG__) == PWR_WAKEUP_FLAG2) ? (READ_BIT(PWR->WUSR, PWR_WUSR_WUF2) == PWR_WUSR_WUF2) : \
  297. ((__FLAG__) == PWR_WAKEUP_FLAG3) ? (READ_BIT(PWR->WUSR, PWR_WUSR_WUF3) == PWR_WUSR_WUF3) : \
  298. ((__FLAG__) == PWR_WAKEUP_FLAG4) ? (READ_BIT(PWR->WUSR, PWR_WUSR_WUF4) == PWR_WUSR_WUF4) : \
  299. ((__FLAG__) == PWR_WAKEUP_FLAG5) ? (READ_BIT(PWR->WUSR, PWR_WUSR_WUF5) == PWR_WUSR_WUF5) : \
  300. ((__FLAG__) == PWR_WAKEUP_FLAG6) ? (READ_BIT(PWR->WUSR, PWR_WUSR_WUF6) == PWR_WUSR_WUF6) : \
  301. ((__FLAG__) == PWR_WAKEUP_FLAG7) ? (READ_BIT(PWR->WUSR, PWR_WUSR_WUF7) == PWR_WUSR_WUF7) : \
  302. (READ_BIT(PWR->WUSR, PWR_WUSR_WUF8) == PWR_WUSR_WUF8))
  303. #else
  304. #define __HAL_PWR_GET_FLAG(__FLAG__) \
  305. (((__FLAG__) == PWR_FLAG_STOPF) ? (READ_BIT(PWR->PMSR, PWR_PMSR_STOPF) == PWR_PMSR_STOPF) : \
  306. ((__FLAG__) == PWR_FLAG_SBF) ? (READ_BIT(PWR->PMSR, PWR_PMSR_SBF) == PWR_PMSR_SBF) : \
  307. ((__FLAG__) == PWR_FLAG_VOSRDY) ? (READ_BIT(PWR->VOSSR, PWR_VOSSR_VOSRDY) == PWR_VOSSR_VOSRDY) : \
  308. ((__FLAG__) == PWR_FLAG_ACTVOSRDY) ? (READ_BIT(PWR->VOSSR, PWR_VOSSR_ACTVOSRDY) == PWR_VOSSR_ACTVOSRDY) : \
  309. ((__FLAG__) == PWR_FLAG_BRR) ? (READ_BIT(PWR->BDSR, PWR_BDSR_BRRDY) == PWR_BDSR_BRRDY) : \
  310. ((__FLAG__) == PWR_FLAG_VBATL) ? (READ_BIT(PWR->BDSR, PWR_BDSR_VBATL) == PWR_BDSR_VBATL) : \
  311. ((__FLAG__) == PWR_FLAG_VBATH) ? (READ_BIT(PWR->BDSR, PWR_BDSR_VBATH) == PWR_BDSR_VBATH) : \
  312. ((__FLAG__) == PWR_FLAG_TEMPL) ? (READ_BIT(PWR->BDSR, PWR_BDSR_TEMPL) == PWR_BDSR_TEMPL) : \
  313. ((__FLAG__) == PWR_FLAG_TEMPH) ? (READ_BIT(PWR->BDSR, PWR_BDSR_TEMPH) == PWR_BDSR_TEMPH) : \
  314. ((__FLAG__) == PWR_FLAG_AVDO) ? (READ_BIT(PWR->VMSR, PWR_VMSR_AVDO) == PWR_VMSR_AVDO) : \
  315. ((__FLAG__) == PWR_FLAG_VDDIO2RDY) ? (READ_BIT(PWR->VMSR, PWR_VMSR_VDDIO2RDY) == PWR_VMSR_VDDIO2RDY) : \
  316. ((__FLAG__) == PWR_FLAG_PVDO) ? (READ_BIT(PWR->VMSR, PWR_VMSR_PVDO) == PWR_VMSR_PVDO) : \
  317. ((__FLAG__) == PWR_WAKEUP_FLAG1) ? (READ_BIT(PWR->WUSR, PWR_WUSR_WUF1) == PWR_WUSR_WUF1) : \
  318. ((__FLAG__) == PWR_WAKEUP_FLAG2) ? (READ_BIT(PWR->WUSR, PWR_WUSR_WUF2) == PWR_WUSR_WUF2) : \
  319. ((__FLAG__) == PWR_WAKEUP_FLAG3) ? (READ_BIT(PWR->WUSR, PWR_WUSR_WUF3) == PWR_WUSR_WUF3) : \
  320. ((__FLAG__) == PWR_WAKEUP_FLAG4) ? (READ_BIT(PWR->WUSR, PWR_WUSR_WUF4) == PWR_WUSR_WUF4) : \
  321. (READ_BIT(PWR->WUSR, PWR_WUSR_WUF5) == PWR_WUSR_WUF5))
  322. #endif /* PWR_WUSR_WUF6 */
  323. /** @brief Clear PWR flags.
  324. * @param __FLAG__ : Specifies the flag to clear.
  325. * This parameter can be one of the following values :
  326. * @arg @ref PWR_FLAG_STOPF : STOP flag.
  327. * Indicates that the device was resumed from STOP mode.
  328. * @arg @ref PWR_FLAG_SBF : STANDBY flag.
  329. * Indicates that the device was resumed from STANDBY mode.
  330. * @arg @ref PWR_WAKEUP_FLAG1 : Wakeup flag 1.
  331. * Indicates that a wakeup event was received from the WKUP line 1.
  332. * @arg @ref PWR_WAKEUP_FLAG2 : Wakeup flag 2.
  333. * Indicates that a wakeup event was received from the WKUP line 2.
  334. * @arg @ref PWR_WAKEUP_FLAG3 : Wakeup flag 3.
  335. * Indicates that a wakeup event was received from the WKUP line 3.
  336. * @arg @ref PWR_WAKEUP_FLAG4 : Wakeup flag 4.
  337. * Indicates that a wakeup event was received from the WKUP line 4.
  338. * @arg @ref PWR_WAKEUP_FLAG5 : Wakeup flag 5.
  339. * Indicates that a wakeup event was received from the WKUP line 5.
  340. * @arg @ref PWR_WAKEUP_FLAG6 : Wakeup flag 6.
  341. * Indicates that a wakeup event was received from the WKUP line 6.
  342. * @arg @ref PWR_WAKEUP_FLAG7 : Wakeup flag 7.
  343. * Indicates that a wakeup event was received from the WKUP line 7.
  344. * @arg @ref PWR_WAKEUP_FLAG8 : Wakeup flag 8.
  345. * Indicates that a wakeup event was received from the WKUP line 8.
  346. * @note The PWR_WAKEUP_FLAG6, PWR_WAKEUP_FLAG7 AND PWR_WAKEUP_FLAG8 are not available for STM32H503xx devices.
  347. * @retval None.
  348. */
  349. #if defined (PWR_WUSCR_CWUF6)
  350. #define __HAL_PWR_CLEAR_FLAG(__FLAG__) \
  351. (((__FLAG__) == PWR_FLAG_STOPF) ? (SET_BIT(PWR->PMCR, PWR_PMCR_CSSF)) : \
  352. ((__FLAG__) == PWR_FLAG_SBF) ? (SET_BIT(PWR->PMCR, PWR_PMCR_CSSF)) : \
  353. ((__FLAG__) == PWR_WAKEUP_FLAG1) ? (SET_BIT(PWR->WUSCR, PWR_WUSCR_CWUF1)) : \
  354. ((__FLAG__) == PWR_WAKEUP_FLAG2) ? (SET_BIT(PWR->WUSCR, PWR_WUSCR_CWUF2)) : \
  355. ((__FLAG__) == PWR_WAKEUP_FLAG3) ? (SET_BIT(PWR->WUSCR, PWR_WUSCR_CWUF3)) : \
  356. ((__FLAG__) == PWR_WAKEUP_FLAG4) ? (SET_BIT(PWR->WUSCR, PWR_WUSCR_CWUF4)) : \
  357. ((__FLAG__) == PWR_WAKEUP_FLAG5) ? (SET_BIT(PWR->WUSCR, PWR_WUSCR_CWUF5)) : \
  358. ((__FLAG__) == PWR_WAKEUP_FLAG6) ? (SET_BIT(PWR->WUSCR, PWR_WUSCR_CWUF6)) : \
  359. ((__FLAG__) == PWR_WAKEUP_FLAG7) ? (SET_BIT(PWR->WUSCR, PWR_WUSCR_CWUF7)) : \
  360. ((__FLAG__) == PWR_WAKEUP_FLAG8) ? (SET_BIT(PWR->WUSCR, PWR_WUSCR_CWUF8)) : \
  361. (SET_BIT(PWR->WUSCR, PWR_WUSCR_CWUF)))
  362. #else
  363. #define __HAL_PWR_CLEAR_FLAG(__FLAG__) \
  364. (((__FLAG__) == PWR_FLAG_STOPF) ? (SET_BIT(PWR->PMCR, PWR_PMCR_CSSF)) : \
  365. ((__FLAG__) == PWR_FLAG_SBF) ? (SET_BIT(PWR->PMCR, PWR_PMCR_CSSF)) : \
  366. ((__FLAG__) == PWR_WAKEUP_FLAG1) ? (SET_BIT(PWR->WUSCR, PWR_WUSCR_CWUF1)) : \
  367. ((__FLAG__) == PWR_WAKEUP_FLAG2) ? (SET_BIT(PWR->WUSCR, PWR_WUSCR_CWUF2)) : \
  368. ((__FLAG__) == PWR_WAKEUP_FLAG3) ? (SET_BIT(PWR->WUSCR, PWR_WUSCR_CWUF3)) : \
  369. ((__FLAG__) == PWR_WAKEUP_FLAG4) ? (SET_BIT(PWR->WUSCR, PWR_WUSCR_CWUF4)) : \
  370. ((__FLAG__) == PWR_WAKEUP_FLAG5) ? (SET_BIT(PWR->WUSCR, PWR_WUSCR_CWUF5)) : \
  371. (SET_BIT(PWR->WUSCR, PWR_WUSCR_CWUF)))
  372. #endif /* PWR_WUSCR_CWUF6 */
  373. /**
  374. * @brief Enable the PVD Extended Interrupt Line.
  375. * @retval None.
  376. */
  377. #define __HAL_PWR_PVD_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR1, PWR_EXTI_LINE_PVD)
  378. /**
  379. * @brief Disable the PVD Extended Interrupt Line.
  380. * @retval None.
  381. */
  382. #define __HAL_PWR_PVD_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR1, PWR_EXTI_LINE_PVD)
  383. /**
  384. * @brief Enable the PVD Event Line.
  385. * @retval None.
  386. */
  387. #define __HAL_PWR_PVD_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR1, PWR_EXTI_LINE_PVD)
  388. /**
  389. * @brief Disable the PVD Event Line.
  390. * @retval None.
  391. */
  392. #define __HAL_PWR_PVD_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR1, PWR_EXTI_LINE_PVD)
  393. /**
  394. * @brief Enable the PVD Extended Interrupt Rising Trigger.
  395. * @retval None.
  396. */
  397. #define __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR1, PWR_EXTI_LINE_PVD)
  398. /**
  399. * @brief Disable the PVD Extended Interrupt Rising Trigger.
  400. * @retval None.
  401. */
  402. #define __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR1, PWR_EXTI_LINE_PVD)
  403. /**
  404. * @brief Enable the PVD Extended Interrupt Falling Trigger.
  405. * @retval None.
  406. */
  407. #define __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR1, PWR_EXTI_LINE_PVD)
  408. /**
  409. * @brief Disable the PVD Extended Interrupt Falling Trigger.
  410. * @retval None.
  411. */
  412. #define __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR1, PWR_EXTI_LINE_PVD)
  413. /**
  414. * @brief Enable the PVD Extended Interrupt Rising & Falling Trigger.
  415. * @retval None.
  416. */
  417. #define __HAL_PWR_PVD_EXTI_ENABLE_RISING_FALLING_EDGE() \
  418. do \
  419. { \
  420. __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE(); \
  421. __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE(); \
  422. } while(0)
  423. /**
  424. * @brief Disable the PVD Extended Interrupt Rising & Falling Trigger.
  425. * @retval None.
  426. */
  427. #define __HAL_PWR_PVD_EXTI_DISABLE_RISING_FALLING_EDGE() \
  428. do \
  429. { \
  430. __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE(); \
  431. __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE(); \
  432. } while(0)
  433. /**
  434. * @brief Generate a Software Interrupt on selected EXTI line.
  435. * @retval None
  436. */
  437. #define __HAL_PWR_PVD_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER1, PWR_EXTI_LINE_PVD)
  438. /**
  439. * @brief Check whether the specified PVD EXTI Rising interrupt flag is set or not.
  440. * @retval EXTI PVD Line Status.
  441. */
  442. #define __HAL_PWR_PVD_EXTI_GET_RISING_FLAG() \
  443. ((READ_BIT(EXTI->RPR1, PWR_EXTI_LINE_PVD) == PWR_EXTI_LINE_PVD) ? 1UL : 0UL)
  444. /**
  445. * @brief Check whether the specified PVD EXTI Falling interrupt flag is set or not.
  446. * @retval EXTI PVD Line Status.
  447. */
  448. #define __HAL_PWR_PVD_EXTI_GET_FALLING_FLAG()\
  449. ((READ_BIT(EXTI->FPR1, PWR_EXTI_LINE_PVD) == PWR_EXTI_LINE_PVD) ? 1UL : 0UL)
  450. /**
  451. * @brief Clear the PVD EXTI Interrupt Rising flag.
  452. * @retval None.
  453. */
  454. #define __HAL_PWR_PVD_EXTI_CLEAR_RISING_FLAG() WRITE_REG(EXTI->RPR1, PWR_EXTI_LINE_PVD);
  455. /**
  456. * @brief Clear the PVD EXTI Interrupt Falling flag.
  457. * @retval None.
  458. */
  459. #define __HAL_PWR_PVD_EXTI_CLEAR_FALLING_FLAG() WRITE_REG(EXTI->FPR1, PWR_EXTI_LINE_PVD);
  460. /**
  461. * @brief Clear the PVD EXTI Interrupt flag.
  462. * @retval None.
  463. */
  464. #define __HAL_PWR_PVD_EXTI_CLEAR_FLAG() \
  465. do \
  466. { \
  467. WRITE_REG(EXTI->RPR1, PWR_EXTI_LINE_PVD); \
  468. WRITE_REG(EXTI->FPR1, PWR_EXTI_LINE_PVD); \
  469. } while(0)
  470. /**
  471. * @}
  472. */
  473. /* Private constants ---------------------------------------------------------*/
  474. /** @defgroup PWR_Private_Constants PWR Private Constants
  475. * @{
  476. */
  477. /* Define PVD extended interrupts and event line */
  478. #define PWR_EXTI_LINE_PVD EXTI_IMR1_IM16 /*!< PVD EXTI Line */
  479. /* Defines wake up lines shift */
  480. #define PWR_EWUP_MASK (0x0FFF3F3FU)
  481. /* Defines attribute */
  482. #define PWR_ITEM_ATTR_NSEC_PRIV_MASK (0x10U) /*!< NSecure Privilege / NPrivilege attribute item mask */
  483. #define PWR_ITEM_ATTR_SEC_PRIV_MASK (0x20U) /*!< Secure Privilege / NPrivilege attribute item mask */
  484. /**
  485. * @}
  486. */
  487. /* Private macros ------------------------------------------------------------*/
  488. /** @defgroup PWR_Private_Macros PWR Private Macros
  489. * @{
  490. */
  491. #if defined(PWR_WUCR_WUPEN6)
  492. /* Check wake up pin parameter */
  493. #define IS_PWR_WAKEUP_PIN(PIN) \
  494. (((PIN) == PWR_WAKEUP_PIN1) || ((PIN) == PWR_WAKEUP_PIN2) ||\
  495. ((PIN) == PWR_WAKEUP_PIN3) || ((PIN) == PWR_WAKEUP_PIN4) ||\
  496. ((PIN) == PWR_WAKEUP_PIN5) || ((PIN) == PWR_WAKEUP_PIN6) ||\
  497. ((PIN) == PWR_WAKEUP_PIN7) || ((PIN) == PWR_WAKEUP_PIN8) ||\
  498. ((PIN) == PWR_WAKEUP_PIN1_HIGH) || ((PIN) == PWR_WAKEUP_PIN2_HIGH) ||\
  499. ((PIN) == PWR_WAKEUP_PIN3_HIGH) || ((PIN) == PWR_WAKEUP_PIN4_HIGH) ||\
  500. ((PIN) == PWR_WAKEUP_PIN5_HIGH) || ((PIN) == PWR_WAKEUP_PIN6_HIGH) ||\
  501. ((PIN) == PWR_WAKEUP_PIN7_HIGH) || ((PIN) == PWR_WAKEUP_PIN8_HIGH) ||\
  502. ((PIN) == PWR_WAKEUP_PIN1_LOW) || ((PIN) == PWR_WAKEUP_PIN2_LOW) ||\
  503. ((PIN) == PWR_WAKEUP_PIN3_LOW) || ((PIN) == PWR_WAKEUP_PIN4_LOW) ||\
  504. ((PIN) == PWR_WAKEUP_PIN5_LOW) || ((PIN) == PWR_WAKEUP_PIN6_LOW) ||\
  505. ((PIN) == PWR_WAKEUP_PIN7_LOW) || ((PIN) == PWR_WAKEUP_PIN8_LOW))
  506. #else
  507. /* Check wake up pin parameter */
  508. #define IS_PWR_WAKEUP_PIN(PIN) \
  509. (((PIN) == PWR_WAKEUP_PIN1) || ((PIN) == PWR_WAKEUP_PIN2) ||\
  510. ((PIN) == PWR_WAKEUP_PIN3) || ((PIN) == PWR_WAKEUP_PIN4) ||\
  511. ((PIN) == PWR_WAKEUP_PIN5) || ((PIN) == PWR_WAKEUP_PIN1_HIGH) ||\
  512. ((PIN) == PWR_WAKEUP_PIN2_HIGH) || ((PIN) == PWR_WAKEUP_PIN3_HIGH) ||\
  513. ((PIN) == PWR_WAKEUP_PIN4_HIGH) || ((PIN) == PWR_WAKEUP_PIN5_HIGH) ||\
  514. ((PIN) == PWR_WAKEUP_PIN1_LOW) || ((PIN) == PWR_WAKEUP_PIN2_LOW) ||\
  515. ((PIN) == PWR_WAKEUP_PIN3_LOW) || ((PIN) == PWR_WAKEUP_PIN4_LOW) ||\
  516. ((PIN) == PWR_WAKEUP_PIN5_LOW))
  517. #endif /* PWR_WUCR_WUPEN6 */
  518. /* PVD level check macro */
  519. #define IS_PWR_PVD_LEVEL(LEVEL) \
  520. (((LEVEL) == PWR_PVDLEVEL_0) || ((LEVEL) == PWR_PVDLEVEL_1) ||\
  521. ((LEVEL) == PWR_PVDLEVEL_2) || ((LEVEL) == PWR_PVDLEVEL_3) ||\
  522. ((LEVEL) == PWR_PVDLEVEL_4) || ((LEVEL) == PWR_PVDLEVEL_5) ||\
  523. ((LEVEL) == PWR_PVDLEVEL_6) || ((LEVEL) == PWR_PVDLEVEL_7))
  524. /* PVD mode check macro */
  525. #define IS_PWR_PVD_MODE(MODE) \
  526. (((MODE) == PWR_PVD_MODE_NORMAL) ||\
  527. ((MODE) == PWR_PVD_MODE_IT_RISING) ||\
  528. ((MODE) == PWR_PVD_MODE_IT_FALLING) ||\
  529. ((MODE) == PWR_PVD_MODE_IT_RISING_FALLING) ||\
  530. ((MODE) == PWR_PVD_MODE_EVENT_RISING) ||\
  531. ((MODE) == PWR_PVD_MODE_EVENT_FALLING) ||\
  532. ((MODE) == PWR_PVD_MODE_EVENT_RISING_FALLING))
  533. /* SLEEP mode entry check macro */
  534. #define IS_PWR_SLEEP_ENTRY(ENTRY) (((ENTRY) == PWR_SLEEPENTRY_WFI) || ((ENTRY) == PWR_SLEEPENTRY_WFE))
  535. /* STOP mode entry check macro */
  536. #define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPENTRY_WFI) || ((ENTRY) == PWR_STOPENTRY_WFE))
  537. #if defined (PWR_SECCFGR_WUP1SEC)
  538. /* PWR items check macro */
  539. #define IS_PWR_ITEMS_ATTRIBUTES(ITEM) ((((ITEM) & (~PWR_ALL)) == 0U) && ((ITEM) != 0U))
  540. #endif /* PWR_SECCFGR_WUP1SEC */
  541. #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
  542. /* PWR attribute check macro (Secure) */
  543. #define IS_PWR_ATTRIBUTES(ATTRIBUTES) \
  544. ((((~(((ATTRIBUTES) & 0xF0U) >> 4U)) &((ATTRIBUTES) & 0x0FU)) == 0U) && (((ATTRIBUTES) & 0xFFFFFFCCU) == 0U))
  545. #elif defined(PWR_PRIVCFGR_NSPRIV)
  546. /* PWR attribute check macro (NSecure) */
  547. #define IS_PWR_ATTRIBUTES(ATTRIBUTES) (((ATTRIBUTES) == PWR_NSEC_NPRIV) || ((ATTRIBUTES) == PWR_NSEC_PRIV))
  548. #else
  549. /* PWR attribute check macro (NSecure) */
  550. #define IS_PWR_ATTRIBUTES(ATTRIBUTES) (((ATTRIBUTES) == PWR_NPRIV) || ((ATTRIBUTES) == PWR_PRIV))
  551. #endif /* __ARM_FEATURE_CMSE */
  552. /**
  553. * @}
  554. */
  555. /* Include PWR HAL Extended module */
  556. #include "stm32h5xx_hal_pwr_ex.h"
  557. /* Exported functions --------------------------------------------------------*/
  558. /** @addtogroup PWR_Exported_Functions
  559. * @{
  560. */
  561. /** @addtogroup PWR_Exported_Functions_Group1
  562. * @{
  563. */
  564. /* Initialization and de-initialization functions *****************************/
  565. void HAL_PWR_DeInit(void);
  566. void HAL_PWR_EnableBkUpAccess(void);
  567. void HAL_PWR_DisableBkUpAccess(void);
  568. /**
  569. * @}
  570. */
  571. /** @addtogroup PWR_Exported_Functions_Group2
  572. * @{
  573. */
  574. /* Programmable voltage detector functions ************************************/
  575. HAL_StatusTypeDef HAL_PWR_ConfigPVD(const PWR_PVDTypeDef *sConfigPVD);
  576. void HAL_PWR_EnablePVD(void);
  577. void HAL_PWR_DisablePVD(void);
  578. /* Wake up pins configuration functions ***************************************/
  579. void HAL_PWR_EnableWakeUpPin(uint32_t WakeUpPinPolarity);
  580. void HAL_PWR_DisableWakeUpPin(uint32_t WakeUpPinx);
  581. /* Low power modes configuration functions ************************************/
  582. void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry);
  583. void HAL_PWR_EnterSTOPMode(uint32_t Regulator, uint8_t STOPEntry);
  584. void HAL_PWR_EnterSTANDBYMode(void);
  585. /* Sleep on exit and sev on pending configuration functions *******************/
  586. void HAL_PWR_EnableSleepOnExit(void);
  587. void HAL_PWR_DisableSleepOnExit(void);
  588. void HAL_PWR_EnableSEVOnPend(void);
  589. void HAL_PWR_DisableSEVOnPend(void);
  590. /* Interrupt handler functions ************************************************/
  591. void HAL_PWR_PVD_IRQHandler(void);
  592. void HAL_PWR_PVDCallback(void);
  593. /**
  594. * @}
  595. */
  596. /** @addtogroup PWR_Exported_Functions_Group3
  597. * @{
  598. */
  599. /* Privileges and security configuration functions ****************************/
  600. void HAL_PWR_ConfigAttributes(uint32_t Item, uint32_t Attributes);
  601. HAL_StatusTypeDef HAL_PWR_GetConfigAttributes(uint32_t Item, uint32_t *pAttributes);
  602. /**
  603. * @}
  604. */
  605. /**
  606. * @}
  607. */
  608. /**
  609. * @}
  610. */
  611. /**
  612. * @}
  613. */
  614. /**
  615. * @}
  616. */
  617. #ifdef __cplusplus
  618. }
  619. #endif /* __cplusplus */
  620. #endif /* STM32H5xx_HAL_PWR_H */