STM CMSIS
stm32f4xx_hal_wwdg.h
Go to the documentation of this file.
1 
38 /* Define to prevent recursive inclusion -------------------------------------*/
39 #ifndef __STM32F4xx_HAL_WWDG_H
40 #define __STM32F4xx_HAL_WWDG_H
41 
42 #ifdef __cplusplus
43  extern "C" {
44 #endif
45 
46 /* Includes ------------------------------------------------------------------*/
47 #include "stm32f4xx_hal_def.h"
48 
57 /* Exported types ------------------------------------------------------------*/
65 typedef struct
66 {
67  uint32_t Prescaler;
70  uint32_t Window;
73  uint32_t Counter;
76  uint32_t EWIMode ;
80 
84 typedef struct
85 {
95 /* Exported constants --------------------------------------------------------*/
96 
104 #define WWDG_IT_EWI WWDG_CFR_EWI
113 #define WWDG_FLAG_EWIF WWDG_SR_EWIF
121 #define WWDG_PRESCALER_1 ((uint32_t)0x00000000U)
122 #define WWDG_PRESCALER_2 WWDG_CFR_WDGTB0
123 #define WWDG_PRESCALER_4 WWDG_CFR_WDGTB1
124 #define WWDG_PRESCALER_8 WWDG_CFR_WDGTB
132 #define WWDG_EWI_DISABLE 0x00000000u
133 #define WWDG_EWI_ENABLE WWDG_CFR_EWI
142 /* Private macros ------------------------------------------------------------*/
143 
147 #define IS_WWDG_PRESCALER(__PRESCALER__) (((__PRESCALER__) == WWDG_PRESCALER_1) || \
148  ((__PRESCALER__) == WWDG_PRESCALER_2) || \
149  ((__PRESCALER__) == WWDG_PRESCALER_4) || \
150  ((__PRESCALER__) == WWDG_PRESCALER_8))
151 
152 #define IS_WWDG_WINDOW(__WINDOW__) (((__WINDOW__) >= WWDG_CFR_W_6) && ((__WINDOW__) <= WWDG_CFR_W))
153 
154 #define IS_WWDG_COUNTER(__COUNTER__) (((__COUNTER__) >= WWDG_CR_T_6) && ((__COUNTER__) <= WWDG_CR_T))
155 
156 #define IS_WWDG_EWI_MODE(__MODE__) (((__MODE__) == WWDG_EWI_ENABLE) || \
157  ((__MODE__) == WWDG_EWI_DISABLE))
158 
163 /* Exported macros ------------------------------------------------------------*/
164 
174 #define __HAL_WWDG_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CR, WWDG_CR_WDGA)
175 
185 #define __HAL_WWDG_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT((__HANDLE__)->Instance->CFR, (__INTERRUPT__))
186 
195 #define __HAL_WWDG_GET_IT(__HANDLE__, __INTERRUPT__) __HAL_WWDG_GET_FLAG((__HANDLE__),(__INTERRUPT__))
196 
204 #define __HAL_WWDG_CLEAR_IT(__HANDLE__, __INTERRUPT__) __HAL_WWDG_CLEAR_FLAG((__HANDLE__), (__INTERRUPT__))
205 
214 #define __HAL_WWDG_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR & (__FLAG__)) == (__FLAG__))
215 
224 #define __HAL_WWDG_CLEAR_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR) = ~(__FLAG__))
225 
233 #define __HAL_WWDG_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CFR & (__INTERRUPT__)) == (__INTERRUPT__))
234 
239 /* Exported functions --------------------------------------------------------*/
247 /* Initialization/de-initialization functions **********************************/
248 HAL_StatusTypeDef HAL_WWDG_Init(WWDG_HandleTypeDef *hwwdg);
249 void HAL_WWDG_MspInit(WWDG_HandleTypeDef *hwwdg);
257 /* I/O operation functions ******************************************************/
258 HAL_StatusTypeDef HAL_WWDG_Refresh(WWDG_HandleTypeDef *hwwdg);
259 void HAL_WWDG_IRQHandler(WWDG_HandleTypeDef *hwwdg);
260 void HAL_WWDG_EarlyWakeupCallback(WWDG_HandleTypeDef* hwwdg);
277 #ifdef __cplusplus
278 }
279 #endif
280 
281 #endif /* __STM32F4xx_HAL_WWDG_H */
282 
283 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
WWDG_InitTypeDef Init
Definition: stm32f4xx_hal_wwdg.h:88
This file contains HAL common defines, enumeration, macros and structures definitions.
uint32_t EWIMode
Definition: stm32f4xx_hal_wwdg.h:76
WWDG Init structure definition.
Definition: stm32f4xx_hal_wwdg.h:65
Window WATCHDOG.
Definition: stm32f401xc.h:533
uint32_t Counter
Definition: stm32f4xx_hal_wwdg.h:73
HAL_StatusTypeDef
HAL Status structures definition.
Definition: stm32f4xx_hal_def.h:57
WWDG_TypeDef * Instance
Definition: stm32f4xx_hal_wwdg.h:86
WWDG handle Structure definition.
Definition: stm32f4xx_hal_wwdg.h:84
uint32_t Window
Definition: stm32f4xx_hal_wwdg.h:70
uint32_t Prescaler
Definition: stm32f4xx_hal_wwdg.h:67