stm32g0xx_hal_pwr.c 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  1. /**
  2. ******************************************************************************
  3. * @file stm32g0xx_hal_pwr.c
  4. * @author MCD Application Team
  5. * @brief PWR HAL module driver.
  6. * This file provides firmware functions to manage the following
  7. * functionalities of the Power Controller (PWR) peripheral:
  8. * + Initialization/de-initialization functions
  9. * + Peripheral Control functions
  10. *
  11. ******************************************************************************
  12. * @attention
  13. *
  14. * Copyright (c) 2018 STMicroelectronics.
  15. * All rights reserved.
  16. *
  17. * This software is licensed under terms that can be found in the LICENSE file
  18. * in the root directory of this software component.
  19. * If no LICENSE file comes with this software, it is provided AS-IS.
  20. *
  21. ******************************************************************************
  22. */
  23. /* Includes ------------------------------------------------------------------*/
  24. #include "stm32g0xx_hal.h"
  25. /** @addtogroup STM32G0xx_HAL_Driver
  26. * @{
  27. */
  28. /** @addtogroup PWR
  29. * @{
  30. */
  31. #ifdef HAL_PWR_MODULE_ENABLED
  32. /* Private typedef -----------------------------------------------------------*/
  33. /* Private define ------------------------------------------------------------*/
  34. /** @defgroup PWR_Private_Defines PWR Private Defines
  35. * @{
  36. */
  37. /**
  38. * @}
  39. */
  40. /* Private macro -------------------------------------------------------------*/
  41. /* Private variables ---------------------------------------------------------*/
  42. /* Private function prototypes -----------------------------------------------*/
  43. /* Exported functions --------------------------------------------------------*/
  44. /** @addtogroup PWR_Exported_Functions PWR Exported Functions
  45. * @{
  46. */
  47. /** @addtogroup PWR_Exported_Functions_Group1 Initialization and de-initialization functions
  48. * @brief Initialization and de-initialization functions
  49. *
  50. @verbatim
  51. ===============================================================================
  52. ##### Initialization and de-initialization functions #####
  53. ===============================================================================
  54. [..]
  55. @endverbatim
  56. * @{
  57. */
  58. /**
  59. * @brief Deinitialize the HAL PWR peripheral registers to their default reset
  60. values.
  61. * @retval None
  62. */
  63. void HAL_PWR_DeInit(void)
  64. {
  65. __HAL_RCC_PWR_FORCE_RESET();
  66. __HAL_RCC_PWR_RELEASE_RESET();
  67. }
  68. /**
  69. * @}
  70. */
  71. /** @addtogroup PWR_Exported_Functions_Group2 Peripheral Control functions
  72. * @brief Low Power modes configuration functions
  73. *
  74. @verbatim
  75. ===============================================================================
  76. ##### Peripheral Control functions #####
  77. ===============================================================================
  78. [..]
  79. *** WakeUp pin configuration ***
  80. ================================
  81. [..]
  82. (+) WakeUp pins are used to wakeup the system from Standby mode or
  83. Shutdown mode. WakeUp pins polarity can be set to configure event
  84. detection on high level (rising edge) or low level (falling edge).
  85. *** Low Power mode configuration ***
  86. =====================================
  87. [..]
  88. The devices feature 7 low-power modes:
  89. (+) Low-power run mode: core and peripherals are running at low frequency.
  90. Regulator is in low power mode.
  91. (+) Sleep mode: Cortex-M0+ core stopped, peripherals kept running,
  92. regulator is main mode.
  93. (+) Low-power Sleep mode: Cortex-M0+ core stopped, peripherals kept running
  94. and regulator in low power mode.
  95. (+) Stop 0 mode: all clocks are stopped except LSI and LSE, regulator is
  96. main mode.
  97. (+) Stop 1 mode: all clocks are stopped except LSI and LSE, main regulator
  98. off, low power regulator on.
  99. (+) Standby mode: all clocks are stopped except LSI and LSE, regulator is
  100. disable.
  101. (+) Shutdown mode: all clocks are stopped except LSE, regulator is
  102. disable.
  103. *** Low-power run mode ***
  104. ==========================
  105. [..]
  106. (+) Entry: (from main run mode)
  107. (++) set LPR bit with HAL_PWREx_EnableLowPowerRunMode() API after
  108. having decreased the system clock below 2 MHz.
  109. (+) Exit:
  110. (++) clear LPR bit then wait for REGLPF bit to be reset with
  111. HAL_PWREx_DisableLowPowerRunMode() API. Only then can the
  112. system clock frequency be increased above 2 MHz.
  113. *** Sleep mode / Low-power sleep mode ***
  114. =========================================
  115. [..]
  116. (+) Entry:
  117. The Sleep & Low-power Sleep modes are entered through
  118. HAL_PWR_EnterSLEEPMode() API specifying whether or not the regulator
  119. is forced to low-power mode and if exit is interrupt or event
  120. triggered.
  121. (++) PWR_MAINREGULATOR_ON: Sleep mode (regulator in main mode).
  122. (++) PWR_LOWPOWERREGULATOR_ON: Low-power Sleep mode (regulator in low
  123. power mode). In this case, the system clock frequency must have
  124. been decreased below 2 MHz beforehand.
  125. (++) PWR_SLEEPENTRY_WFI: Core enters sleep mode with WFI instruction
  126. (++) PWR_SLEEPENTRY_WFE: Core enters sleep mode with WFE instruction
  127. (+) WFI Exit:
  128. (++) Any interrupt enabled in nested vectored interrupt controller (NVIC)
  129. (+) WFE Exit:
  130. (++) Any wakeup event if cortex is configured with SEVONPEND = 0
  131. (++) Interrupt even when disabled in NVIC if cortex is configured with
  132. SEVONPEND = 1
  133. [..] When exiting the Low-power Sleep mode by issuing an interrupt or a wakeup event,
  134. the MCU is in Low-power Run mode.
  135. *** Stop 0 & Stop 1 modes ***
  136. =============================
  137. [..]
  138. (+) Entry:
  139. The Stop modes are entered through the following APIs:
  140. (++) HAL_PWR_EnterSTOPMode() with following settings:
  141. (+++) PWR_MAINREGULATOR_ON to enter STOP0 mode.
  142. (+++) PWR_LOWPOWERREGULATOR_ON to enter STOP1 mode.
  143. (+) Exit (interrupt or event-triggered, specified when entering STOP mode):
  144. (++) PWR_STOPENTRY_WFI: enter Stop mode with WFI instruction
  145. (++) PWR_STOPENTRY_WFE: enter Stop mode with WFE instruction
  146. (+) WFI Exit:
  147. (++) Any EXTI line (internal or external) configured in interrupt mode
  148. with corresponding interrupt enable in NVIC
  149. (+) WFE Exit:
  150. (++) Any EXTI line (internal or external) configured in event mode if
  151. cortex is configured with SEVONPEND = 0
  152. (++) Any EXTI line configured in interrupt mode (even if the
  153. corresponding EXTI Interrupt vector is disabled in the NVIC) if
  154. cortex is configured with SEVONPEND = 0. The interrupt source can
  155. be external interrupts or peripherals with wakeup capability.
  156. [..] When exiting Stop, the MCU is either in Run mode or in Low-power Run mode
  157. depending on the LPR bit setting.
  158. *** Standby mode ***
  159. ====================
  160. [..] In Standby mode, it is possible to keep backup SRAM content (defined as
  161. full SRAM) keeping low power regulator on. This is achievable by setting
  162. Ram retention bit calling HAL_PWREx_EnableSRAMRetention API. This increases
  163. power consumption.
  164. Its also possible to define I/O states using APIs:
  165. HAL_PWREx_EnableGPIOPullUp, HAL_PWREx_EnableGPIOPullDown &
  166. HAL_PWREx_EnablePullUpPullDownConfig
  167. (+) Entry:
  168. (++) The Standby mode is entered through HAL_PWR_EnterSTANDBYMode() API, by
  169. setting SLEEPDEEP in Cortex control register.
  170. (+) Exit:
  171. (++) WKUP pin edge detection, RTC event (wakeup, alarm, timestamp),
  172. tamper event (internal & external), LSE CSS detection, reset on
  173. NRST pin, IWDG reset & BOR reset.
  174. [..] Exiting Standby generates a power reset: Cortex is reset and execute
  175. Reset handler vector, all registers in the Vcore domain are set to
  176. their reset value. Registers outside the VCORE domain (RTC, WKUP, IWDG,
  177. and Standby/Shutdown modes control) are not impacted.
  178. *** Shutdown mode ***
  179. ======================
  180. [..]
  181. In Shutdown mode,
  182. voltage regulator is disabled, all clocks are off except LSE, RRS bit is
  183. cleared. SRAM and registers contents are lost except for backup domain
  184. registers.
  185. (+) Entry:
  186. (++) The Shutdown mode is entered through HAL_PWREx_EnterSHUTDOWNMode() API,
  187. by setting SLEEPDEEP in Cortex control register.
  188. (+) Exit:
  189. (++) WKUP pin edge detection, RTC event (wakeup, alarm, timestamp),
  190. tamper event (internal & external), LSE CSS detection, reset on
  191. NRST pin.
  192. [..] Exiting Shutdown generates a brown out reset: Cortex is reset and execute
  193. Reset handler vector, all registers are set to their reset value but ones
  194. in backup domain.
  195. @endverbatim
  196. * @{
  197. */
  198. /**
  199. * @brief Enable access to the backup domain
  200. * (RTC & TAMP registers, backup registers, RCC BDCR register).
  201. * @note After reset, the backup domain is protected against
  202. * possible unwanted write accesses. All RTC & TAMP registers (backup
  203. * registers included) and RCC BDCR register are concerned.
  204. * @retval None
  205. */
  206. void HAL_PWR_EnableBkUpAccess(void)
  207. {
  208. SET_BIT(PWR->CR1, PWR_CR1_DBP);
  209. }
  210. /**
  211. * @brief Disable access to the backup domain
  212. * @retval None
  213. */
  214. void HAL_PWR_DisableBkUpAccess(void)
  215. {
  216. CLEAR_BIT(PWR->CR1, PWR_CR1_DBP);
  217. }
  218. /**
  219. * @brief Enable the WakeUp PINx functionality.
  220. * @param WakeUpPinPolarity Specifies which Wake-Up pin to enable.
  221. * This parameter can be one of the following legacy values which set
  222. * the default polarity i.e. detection on high level (rising edge):
  223. * @arg @ref PWR_WAKEUP_PIN1, PWR_WAKEUP_PIN2, PWR_WAKEUP_PIN3(*),
  224. * PWR_WAKEUP_PIN4, PWR_WAKEUP_PIN5(*),PWR_WAKEUP_PIN6
  225. * or one of the following value where the user can explicitly specify
  226. * the enabled pin and the chosen polarity:
  227. * @arg @ref PWR_WAKEUP_PIN1_HIGH or PWR_WAKEUP_PIN1_LOW
  228. * @arg @ref PWR_WAKEUP_PIN2_HIGH or PWR_WAKEUP_PIN2_LOW
  229. * @arg @ref PWR_WAKEUP_PIN3_HIGH or PWR_WAKEUP_PIN3_LOW (*)
  230. * @arg @ref PWR_WAKEUP_PIN4_HIGH or PWR_WAKEUP_PIN4_LOW
  231. * @arg @ref PWR_WAKEUP_PIN5_HIGH or PWR_WAKEUP_PIN5_LOW (*)
  232. * @arg @ref PWR_WAKEUP_PIN6_HIGH or PWR_WAKEUP_PIN6_LOW
  233. * @note PWR_WAKEUP_PINx and PWR_WAKEUP_PINx_HIGH are equivalent.
  234. * @note (*) availability depends on devices
  235. * @retval None
  236. */
  237. void HAL_PWR_EnableWakeUpPin(uint32_t WakeUpPinPolarity)
  238. {
  239. assert_param(IS_PWR_WAKEUP_PIN(WakeUpPinPolarity));
  240. /* Specifies the Wake-Up pin polarity for the event detection
  241. (rising or falling edge) */
  242. MODIFY_REG(PWR->CR4, (PWR_CR4_WP & WakeUpPinPolarity), (WakeUpPinPolarity >> PWR_WUP_POLARITY_SHIFT));
  243. /* Enable wake-up pin */
  244. SET_BIT(PWR->CR3, (PWR_CR3_EWUP & WakeUpPinPolarity));
  245. }
  246. /**
  247. * @brief Disable the WakeUp PINx functionality.
  248. * @param WakeUpPinx Specifies the Power Wake-Up pin to disable.
  249. * This parameter can be one of the following values:
  250. * @arg @ref PWR_WAKEUP_PIN1, PWR_WAKEUP_PIN2,PWR_WAKEUP_PIN3(*),
  251. * PWR_WAKEUP_PIN4,PWR_WAKEUP_PIN5(*),PWR_WAKEUP_PIN6
  252. * @note (*) availability depends on devices
  253. * @retval None
  254. */
  255. void HAL_PWR_DisableWakeUpPin(uint32_t WakeUpPinx)
  256. {
  257. assert_param(IS_PWR_WAKEUP_PIN(WakeUpPinx));
  258. CLEAR_BIT(PWR->CR3, (PWR_CR3_EWUP & WakeUpPinx));
  259. }
  260. /**
  261. * @brief Enter Sleep or Low-power Sleep mode.
  262. * @note In Sleep/Low-power Sleep mode, all I/O pins keep the same state as
  263. * in Run mode.
  264. * @param Regulator Specifies the regulator state in Sleep/Low-power Sleep
  265. * mode. This parameter can be one of the following values:
  266. * @arg @ref PWR_MAINREGULATOR_ON Sleep mode (regulator in main mode)
  267. * @arg @ref PWR_LOWPOWERREGULATOR_ON Low-power Sleep mode (regulator
  268. * in low-power mode)
  269. * @note Low-power Sleep mode is entered from Low-power Run mode only. In
  270. * case Regulator parameter is set to Low Power but MCU is in Run mode,
  271. * we will first enter in Low-power Run mode. Therefore, user should
  272. * take care that HCLK frequency is less than 2 MHz.
  273. * @note When exiting Low-power Sleep mode, the MCU is in Low-power Run mode.
  274. * To switch back to Run mode, user must call
  275. * HAL_PWREx_DisableLowPowerRunMode() API.
  276. * @param SLEEPEntry Specifies if Sleep mode is entered with WFI or WFE
  277. * instruction. This parameter can be one of the following values:
  278. * @arg @ref PWR_SLEEPENTRY_WFI enter Sleep or Low-power Sleep
  279. * mode with WFI instruction
  280. * @arg @ref PWR_SLEEPENTRY_WFE enter Sleep or Low-power Sleep
  281. * mode with WFE instruction
  282. * @note When WFI entry is used, tick interrupt have to be disabled if not
  283. * desired as the interrupt wake up source.
  284. * @retval None
  285. */
  286. void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry)
  287. {
  288. /* Check the parameters */
  289. assert_param(IS_PWR_REGULATOR(Regulator));
  290. assert_param(IS_PWR_SLEEP_ENTRY(SLEEPEntry));
  291. /* Set Regulator parameter */
  292. if (Regulator != PWR_MAINREGULATOR_ON)
  293. {
  294. /* If in run mode, first move to low-power run mode.
  295. The system clock frequency must be below 2 MHz at this point. */
  296. if ((PWR->SR2 & PWR_SR2_REGLPF) == 0x00u)
  297. {
  298. HAL_PWREx_EnableLowPowerRunMode();
  299. }
  300. }
  301. else
  302. {
  303. /* If in low-power run mode at this point, exit it */
  304. if ((PWR->SR2 & PWR_SR2_REGLPF) != 0x00u)
  305. {
  306. if (HAL_PWREx_DisableLowPowerRunMode() != HAL_OK)
  307. {
  308. return ;
  309. }
  310. }
  311. }
  312. /* Clear SLEEPDEEP bit of Cortex System Control Register */
  313. CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk));
  314. /* Select SLEEP mode entry -------------------------------------------------*/
  315. if (SLEEPEntry == PWR_SLEEPENTRY_WFI)
  316. {
  317. /* Request Wait For Interrupt */
  318. __WFI();
  319. }
  320. else
  321. {
  322. /* Request Wait For Event */
  323. __SEV();
  324. __WFE();
  325. __WFE();
  326. }
  327. }
  328. /**
  329. * @brief Enter Stop mode
  330. * @note This API is named HAL_PWR_EnterSTOPMode to ensure compatibility with
  331. * legacy code running on devices where only "Stop mode" is mentioned
  332. * with main or low power regulator ON.
  333. * @note In Stop mode, all I/O pins keep the same state as in Run mode.
  334. * @note All clocks in the VCORE domain are stopped; the PLL, the HSI and the
  335. * HSE oscillators are disabled. Some peripherals with the wakeup
  336. * capability can switch on the HSI to receive a frame, and switch off
  337. * the HSI after receiving the frame if it is not a wakeup frame.
  338. * SRAM and register contents are preserved.
  339. * The BOR is available.
  340. * The voltage regulator can be configured either in normal (Stop 0) or
  341. * low-power mode (Stop 1).
  342. * @note When exiting Stop 0 or Stop 1 mode by issuing an interrupt or a
  343. * wakeup event, the HSI RC oscillator is selected as system clock
  344. * @note When the voltage regulator operates in low power mode (Stop 1),
  345. * an additional startup delay is incurred when waking up. By keeping
  346. * the internal regulator ON during Stop mode (Stop 0), the consumption
  347. * is higher although the startup time is reduced.
  348. * @param Regulator Specifies the regulator state in Stop mode
  349. * This parameter can be one of the following values:
  350. * @arg @ref PWR_MAINREGULATOR_ON Stop 0 mode (main regulator ON)
  351. * @arg @ref PWR_LOWPOWERREGULATOR_ON Stop 1 mode (low power
  352. * regulator ON)
  353. * @param STOPEntry Specifies Stop 0 or Stop 1 mode is entered with WFI or
  354. * WFE instruction. This parameter can be one of the following values:
  355. * @arg @ref PWR_STOPENTRY_WFI Enter Stop 0 or Stop 1 mode with WFI
  356. * instruction.
  357. * @arg @ref PWR_STOPENTRY_WFE Enter Stop 0 or Stop 1 mode with WFE
  358. * instruction.
  359. * @retval None
  360. */
  361. void HAL_PWR_EnterSTOPMode(uint32_t Regulator, uint8_t STOPEntry)
  362. {
  363. /* Check the parameters */
  364. assert_param(IS_PWR_REGULATOR(Regulator));
  365. assert_param(IS_PWR_STOP_ENTRY(STOPEntry));
  366. if (Regulator != PWR_MAINREGULATOR_ON)
  367. {
  368. /* Stop mode with Low-Power Regulator */
  369. MODIFY_REG(PWR->CR1, PWR_CR1_LPMS, PWR_LOWPOWERMODE_STOP1);
  370. }
  371. else
  372. {
  373. /* Stop mode with Main Regulator */
  374. MODIFY_REG(PWR->CR1, PWR_CR1_LPMS, PWR_LOWPOWERMODE_STOP0);
  375. }
  376. /* Set SLEEPDEEP bit of Cortex System Control Register */
  377. SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk));
  378. /* Select Stop mode entry --------------------------------------------------*/
  379. if (STOPEntry == PWR_STOPENTRY_WFI)
  380. {
  381. /* Request Wait For Interrupt */
  382. __WFI();
  383. }
  384. else
  385. {
  386. /* Request Wait For Event */
  387. __SEV();
  388. __WFE();
  389. __WFE();
  390. }
  391. /* Reset SLEEPDEEP bit of Cortex System Control Register */
  392. CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk));
  393. }
  394. /**
  395. * @brief Enter Standby mode.
  396. * @note In Standby mode, the PLL, the HSI and the HSE oscillators are
  397. * switched off. The voltage regulator is disabled. SRAM and register
  398. * contents are lost except for registers in the Backup domain and
  399. * Standby circuitry. BOR is available.
  400. * @note The I/Os can be configured either with a pull-up or pull-down or can
  401. * be kept in analog state.
  402. * HAL_PWREx_EnableGPIOPullUp() and HAL_PWREx_EnableGPIOPullDown()
  403. * respectively enable Pull Up and PullDown state.
  404. * HAL_PWREx_DisableGPIOPullUp() & HAL_PWREx_DisableGPIOPullDown()
  405. * disable the same. These states are effective in Standby mode only if
  406. * APC bit is set through HAL_PWREx_EnablePullUpPullDownConfig() API.
  407. * @note Sram content can be kept setting RRS through HAL_PWREx_EnableSRAMRetention()
  408. * @retval None
  409. */
  410. void HAL_PWR_EnterSTANDBYMode(void)
  411. {
  412. /* Set Stand-by mode */
  413. MODIFY_REG(PWR->CR1, PWR_CR1_LPMS, PWR_LOWPOWERMODE_STANDBY);
  414. /* Set SLEEPDEEP bit of Cortex System Control Register */
  415. SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk));
  416. /* This option is used to ensure that store operations are completed */
  417. #if defined ( __CC_ARM)
  418. __force_stores();
  419. #endif /* __CC_ARM */
  420. /* Request Wait For Interrupt */
  421. __WFI();
  422. }
  423. /**
  424. * @brief Enable Sleep-On-Exit Cortex feature
  425. * @note Set SLEEPONEXIT bit of SCR register. When this bit is set, the
  426. * processor enters SLEEP or DEEPSLEEP mode when an interruption
  427. * handling is over returning to thread mode. Setting this bit is
  428. * useful when the processor is expected to run only on interruptions
  429. * handling.
  430. * @retval None
  431. */
  432. void HAL_PWR_EnableSleepOnExit(void)
  433. {
  434. /* Set SLEEPONEXIT bit of Cortex System Control Register */
  435. SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPONEXIT_Msk));
  436. }
  437. /**
  438. * @brief Disable Sleep-On-Exit Cortex feature
  439. * @note Clear SLEEPONEXIT bit of SCR register. When this bit is set, the
  440. * processor enters SLEEP or DEEPSLEEP mode when an interruption
  441. * handling is over.
  442. * @retval None
  443. */
  444. void HAL_PWR_DisableSleepOnExit(void)
  445. {
  446. /* Clear SLEEPONEXIT bit of Cortex System Control Register */
  447. CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPONEXIT_Msk));
  448. }
  449. /**
  450. * @brief Enable Cortex Sev On Pending feature.
  451. * @note Set SEVONPEND bit of SCR register. When this bit is set, enabled
  452. * events and all interrupts, including disabled ones can wakeup
  453. * processor from WFE.
  454. * @retval None
  455. */
  456. void HAL_PWR_EnableSEVOnPend(void)
  457. {
  458. /* Set SEVONPEND bit of Cortex System Control Register */
  459. SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SEVONPEND_Msk));
  460. }
  461. /**
  462. * @brief Disable Cortex Sev On Pending feature.
  463. * @note Clear SEVONPEND bit of SCR register. When this bit is clear, only
  464. * enable interrupts or events can wakeup processor from WFE
  465. * @retval None
  466. */
  467. void HAL_PWR_DisableSEVOnPend(void)
  468. {
  469. /* Clear SEVONPEND bit of Cortex System Control Register */
  470. CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SEVONPEND_Msk));
  471. }
  472. /**
  473. * @}
  474. */
  475. /**
  476. * @}
  477. */
  478. #endif /* HAL_PWR_MODULE_ENABLED */
  479. /**
  480. * @}
  481. */
  482. /**
  483. * @}
  484. */