stm32f7xx_hal_pwr.h
Go to the documentation of this file.
1 
20 /* Define to prevent recursive inclusion -------------------------------------*/
21 #ifndef __STM32F7xx_HAL_PWR_H
22 #define __STM32F7xx_HAL_PWR_H
23 
24 #ifdef __cplusplus
25  extern "C" {
26 #endif
27 
28 /* Includes ------------------------------------------------------------------*/
29 #include "stm32f7xx_hal_def.h"
30 
39 /* Exported types ------------------------------------------------------------*/
40 
48 typedef struct
49 {
50  uint32_t PVDLevel;
53  uint32_t Mode;
56 
61 /* Exported constants --------------------------------------------------------*/
69 #define PWR_PVDLEVEL_0 PWR_CR1_PLS_LEV0
70 #define PWR_PVDLEVEL_1 PWR_CR1_PLS_LEV1
71 #define PWR_PVDLEVEL_2 PWR_CR1_PLS_LEV2
72 #define PWR_PVDLEVEL_3 PWR_CR1_PLS_LEV3
73 #define PWR_PVDLEVEL_4 PWR_CR1_PLS_LEV4
74 #define PWR_PVDLEVEL_5 PWR_CR1_PLS_LEV5
75 #define PWR_PVDLEVEL_6 PWR_CR1_PLS_LEV6
76 #define PWR_PVDLEVEL_7 PWR_CR1_PLS_LEV7/* External input analog voltage
77  (Compare internally to VREFINT) */
78 
86 #define PWR_PVD_MODE_NORMAL ((uint32_t)0x00000000U)
87 #define PWR_PVD_MODE_IT_RISING ((uint32_t)0x00010001U)
88 #define PWR_PVD_MODE_IT_FALLING ((uint32_t)0x00010002U)
89 #define PWR_PVD_MODE_IT_RISING_FALLING ((uint32_t)0x00010003U)
90 #define PWR_PVD_MODE_EVENT_RISING ((uint32_t)0x00020001U)
91 #define PWR_PVD_MODE_EVENT_FALLING ((uint32_t)0x00020002U)
92 #define PWR_PVD_MODE_EVENT_RISING_FALLING ((uint32_t)0x00020003U)
100 #define PWR_MAINREGULATOR_ON ((uint32_t)0x00000000U)
101 #define PWR_LOWPOWERREGULATOR_ON PWR_CR1_LPDS
102 
109 #define PWR_SLEEPENTRY_WFI ((uint8_t)0x01U)
110 #define PWR_SLEEPENTRY_WFE ((uint8_t)0x02U)
111 
118 #define PWR_STOPENTRY_WFI ((uint8_t)0x01U)
119 #define PWR_STOPENTRY_WFE ((uint8_t)0x02U)
120 
127 #define PWR_REGULATOR_VOLTAGE_SCALE1 PWR_CR1_VOS
128 #define PWR_REGULATOR_VOLTAGE_SCALE2 PWR_CR1_VOS_1
129 #define PWR_REGULATOR_VOLTAGE_SCALE3 PWR_CR1_VOS_0
130 
137 #define PWR_FLAG_WU PWR_CSR1_WUIF
138 #define PWR_FLAG_SB PWR_CSR1_SBF
139 #define PWR_FLAG_PVDO PWR_CSR1_PVDO
140 #define PWR_FLAG_BRR PWR_CSR1_BRR
141 #define PWR_FLAG_VOSRDY PWR_CSR1_VOSRDY
142 
150 /* Exported macro ------------------------------------------------------------*/
165 #define __HAL_PWR_VOLTAGESCALING_CONFIG(__REGULATOR__) do { \
166  __IO uint32_t tmpreg; \
167  MODIFY_REG(PWR->CR1, PWR_CR1_VOS, (__REGULATOR__)); \
168  /* Delay after an RCC peripheral clock enabling */ \
169  tmpreg = READ_BIT(PWR->CR1, PWR_CR1_VOS); \
170  UNUSED(tmpreg); \
171  } while(0)
172 
192 #define __HAL_PWR_GET_FLAG(__FLAG__) ((PWR->CSR1 & (__FLAG__)) == (__FLAG__))
193 
199 #define __HAL_PWR_CLEAR_FLAG(__FLAG__) (PWR->CR1 |= (__FLAG__) << 2)
200 
205 #define __HAL_PWR_PVD_EXTI_ENABLE_IT() (EXTI->IMR |= (PWR_EXTI_LINE_PVD))
206 
211 #define __HAL_PWR_PVD_EXTI_DISABLE_IT() (EXTI->IMR &= ~(PWR_EXTI_LINE_PVD))
212 
217 #define __HAL_PWR_PVD_EXTI_ENABLE_EVENT() (EXTI->EMR |= (PWR_EXTI_LINE_PVD))
218 
223 #define __HAL_PWR_PVD_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(PWR_EXTI_LINE_PVD))
224 
229 #define __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR, PWR_EXTI_LINE_PVD)
230 
235 #define __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR, PWR_EXTI_LINE_PVD)
236 
241 #define __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR, PWR_EXTI_LINE_PVD)
242 
243 
248 #define __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR, PWR_EXTI_LINE_PVD)
249 
250 
255 #define __HAL_PWR_PVD_EXTI_ENABLE_RISING_FALLING_EDGE() __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE();__HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE();
256 
261 #define __HAL_PWR_PVD_EXTI_DISABLE_RISING_FALLING_EDGE() __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE();__HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE();
262 
267 #define __HAL_PWR_PVD_EXTI_GET_FLAG() (EXTI->PR & (PWR_EXTI_LINE_PVD))
268 
273 #define __HAL_PWR_PVD_EXTI_CLEAR_FLAG() (EXTI->PR = (PWR_EXTI_LINE_PVD))
274 
279 #define __HAL_PWR_PVD_EXTI_GENERATE_SWIT() (EXTI->SWIER |= (PWR_EXTI_LINE_PVD))
280 
285 /* Include PWR HAL Extension module */
286 #include "stm32f7xx_hal_pwr_ex.h"
287 
288 /* Exported functions --------------------------------------------------------*/
296 /* Initialization and de-initialization functions *****************************/
297 void HAL_PWR_DeInit(void);
298 void HAL_PWR_EnableBkUpAccess(void);
299 void HAL_PWR_DisableBkUpAccess(void);
307 /* Peripheral Control functions **********************************************/
308 /* PVD configuration */
309 void HAL_PWR_ConfigPVD(PWR_PVDTypeDef *sConfigPVD);
310 void HAL_PWR_EnablePVD(void);
311 void HAL_PWR_DisablePVD(void);
312 
313 /* WakeUp pins configuration */
314 void HAL_PWR_EnableWakeUpPin(uint32_t WakeUpPinPolarity);
315 void HAL_PWR_DisableWakeUpPin(uint32_t WakeUpPinx);
316 
317 /* Low Power modes entry */
318 void HAL_PWR_EnterSTOPMode(uint32_t Regulator, uint8_t STOPEntry);
319 void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry);
320 void HAL_PWR_EnterSTANDBYMode(void);
321 
322 /* Power PVD IRQ Handler */
323 void HAL_PWR_PVD_IRQHandler(void);
324 void HAL_PWR_PVDCallback(void);
325 
326 /* Cortex System Control functions *******************************************/
327 void HAL_PWR_EnableSleepOnExit(void);
328 void HAL_PWR_DisableSleepOnExit(void);
329 void HAL_PWR_EnableSEVOnPend(void);
330 void HAL_PWR_DisableSEVOnPend(void);
339 /* Private types -------------------------------------------------------------*/
340 /* Private variables ---------------------------------------------------------*/
341 /* Private constants ---------------------------------------------------------*/
349 #define PWR_EXTI_LINE_PVD ((uint32_t)EXTI_IMR_IM16)
357 /* Private macros ------------------------------------------------------------*/
358 
365 #define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLEVEL_0) || ((LEVEL) == PWR_PVDLEVEL_1)|| \
366  ((LEVEL) == PWR_PVDLEVEL_2) || ((LEVEL) == PWR_PVDLEVEL_3)|| \
367  ((LEVEL) == PWR_PVDLEVEL_4) || ((LEVEL) == PWR_PVDLEVEL_5)|| \
368  ((LEVEL) == PWR_PVDLEVEL_6) || ((LEVEL) == PWR_PVDLEVEL_7))
369 #define IS_PWR_PVD_MODE(MODE) (((MODE) == PWR_PVD_MODE_IT_RISING)|| ((MODE) == PWR_PVD_MODE_IT_FALLING) || \
370  ((MODE) == PWR_PVD_MODE_IT_RISING_FALLING) || ((MODE) == PWR_PVD_MODE_EVENT_RISING) || \
371  ((MODE) == PWR_PVD_MODE_EVENT_FALLING) || ((MODE) == PWR_PVD_MODE_EVENT_RISING_FALLING) || \
372  ((MODE) == PWR_PVD_MODE_NORMAL))
373 #define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_MAINREGULATOR_ON) || \
374  ((REGULATOR) == PWR_LOWPOWERREGULATOR_ON))
375 #define IS_PWR_SLEEP_ENTRY(ENTRY) (((ENTRY) == PWR_SLEEPENTRY_WFI) || ((ENTRY) == PWR_SLEEPENTRY_WFE))
376 #define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPENTRY_WFI) || ((ENTRY) == PWR_STOPENTRY_WFE))
377 #define IS_PWR_REGULATOR_VOLTAGE(VOLTAGE) (((VOLTAGE) == PWR_REGULATOR_VOLTAGE_SCALE1) || \
378  ((VOLTAGE) == PWR_REGULATOR_VOLTAGE_SCALE2) || \
379  ((VOLTAGE) == PWR_REGULATOR_VOLTAGE_SCALE3))
380 
397 #ifdef __cplusplus
398 }
399 #endif
400 
401 
402 #endif /* __STM32F7xx_HAL_PWR_H */
403 
404 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
HAL_PWR_EnterSTOPMode
void HAL_PWR_EnterSTOPMode(uint32_t Regulator, uint8_t STOPEntry)
HAL_PWR_EnablePVD
void HAL_PWR_EnablePVD(void)
HAL_PWR_EnterSTANDBYMode
void HAL_PWR_EnterSTANDBYMode(void)
PWR_PVDTypeDef
PWR PVD configuration structure definition.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h:48
HAL_PWR_DisableBkUpAccess
void HAL_PWR_DisableBkUpAccess(void)
HAL_PWR_DisableSEVOnPend
void HAL_PWR_DisableSEVOnPend(void)
HAL_PWR_PVDCallback
void HAL_PWR_PVDCallback(void)
HAL_PWR_EnableBkUpAccess
void HAL_PWR_EnableBkUpAccess(void)
HAL_PWR_EnableSleepOnExit
void HAL_PWR_EnableSleepOnExit(void)
HAL_PWR_DisablePVD
void HAL_PWR_DisablePVD(void)
HAL_PWR_PVD_IRQHandler
void HAL_PWR_PVD_IRQHandler(void)
HAL_PWR_ConfigPVD
void HAL_PWR_ConfigPVD(PWR_PVDTypeDef *sConfigPVD)
HAL_PWR_DeInit
void HAL_PWR_DeInit(void)
HAL_PWR_DisableWakeUpPin
void HAL_PWR_DisableWakeUpPin(uint32_t WakeUpPinx)
stm32f7xx_hal_def.h
This file contains HAL common defines, enumeration, macros and structures definitions.
HAL_PWR_EnableSEVOnPend
void HAL_PWR_EnableSEVOnPend(void)
HAL_PWR_EnterSLEEPMode
void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry)
HAL_PWR_DisableSleepOnExit
void HAL_PWR_DisableSleepOnExit(void)
Mode
Definition: porcupine/demo/c/dr_libs/tests/external/miniaudio/extras/stb_vorbis.c:745
HAL_PWR_EnableWakeUpPin
void HAL_PWR_EnableWakeUpPin(uint32_t WakeUpPinx)
stm32f7xx_hal_pwr_ex.h
Header file of PWR HAL Extension module.


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:53