1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
38
39
40
43
44
47
48
49
51
52
54
55
57
58
60
61
62
63
66
67
68
69
70
71
82
83
84
98
99
102
103
104
105
108
109
112
113
116
117
121
122
125
126
129
130
131
132
133
136
137
140
141
142
145
146
149
150
151
152
155
159
160
161
162
163
164
166
169
170
171
172
173
176
177
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
241
243
244
247
248
249
250
253
254
257
258
259
260
261
262
265
266
267
270
271
274
275
276
277
278
281
282
285
286
289
290
293
294
295
296
297
298
/* ... */
#ifndef STM32F4xx_HAL_WWDG_H
#define STM32F4xx_HAL_WWDG_H
#ifdef __cplusplus
extern "C" {
#endif
#include "stm32f4xx_hal_def.h"
/* ... */
/* ... */
Includes
/* ... */
/* ... */
typedef struct
{
uint32_t Prescaler;
/* ... */
uint32_t Window;
/* ... */
uint32_t Counter;
/* ... */
uint32_t EWIMode ;
/* ... */
...} WWDG_InitTypeDef;
/* ... */
#if (USE_HAL_WWDG_REGISTER_CALLBACKS == 1)
typedef struct __WWDG_HandleTypeDef
#else
typedef struct
#endif
{
WWDG_TypeDef *Instance;
WWDG_InitTypeDef Init;
#if (USE_HAL_WWDG_REGISTER_CALLBACKS == 1)
void (* EwiCallback)(struct __WWDG_HandleTypeDef *hwwdg);
void (* MspInitCallback)(struct __WWDG_HandleTypeDef *hwwdg); /* ... */
#endif
...} WWDG_HandleTypeDef;
#if (USE_HAL_WWDG_REGISTER_CALLBACKS == 1)
/* ... */
typedef enum
{
HAL_WWDG_EWI_CB_ID = 0x00U,
HAL_WWDG_MSPINIT_CB_ID = 0x01U,
...} HAL_WWDG_CallbackIDTypeDef;
/* ... */
typedef void (*pWWDG_CallbackTypeDef)(WWDG_HandleTypeDef *hppp);
/* ... */
#endif
/* ... */
Exported types
/* ... */
/* ... */
#define WWDG_IT_EWI WWDG_CFR_EWI
/* ... */
/* ... */
#define WWDG_FLAG_EWIF WWDG_SR_EWIF
/* ... */
/* ... */
#define WWDG_PRESCALER_1 0x00000000u
#define WWDG_PRESCALER_2 WWDG_CFR_WDGTB_0
#define WWDG_PRESCALER_4 WWDG_CFR_WDGTB_1
#define WWDG_PRESCALER_8 (WWDG_CFR_WDGTB_1 | WWDG_CFR_WDGTB_0)
/* ... */
/* ... */
#define WWDG_EWI_DISABLE 0x00000000u
#define WWDG_EWI_ENABLE WWDG_CFR_EWI
/* ... */
/* ... */
/* ... */
#define IS_WWDG_PRESCALER(__PRESCALER__) (((__PRESCALER__) == WWDG_PRESCALER_1) || \
((__PRESCALER__) == WWDG_PRESCALER_2) || \
((__PRESCALER__) == WWDG_PRESCALER_4) || \
((__PRESCALER__) == WWDG_PRESCALER_8))...
#define IS_WWDG_WINDOW(__WINDOW__) (((__WINDOW__) >= WWDG_CFR_W_6) && ((__WINDOW__) <= WWDG_CFR_W))
#define IS_WWDG_COUNTER(__COUNTER__) (((__COUNTER__) >= WWDG_CR_T_6) && ((__COUNTER__) <= WWDG_CR_T))
#define IS_WWDG_EWI_MODE(__MODE__) (((__MODE__) == WWDG_EWI_ENABLE) || \
((__MODE__) == WWDG_EWI_DISABLE))...
/* ... */
Private macros
/* ... */
/* ... */
#define __HAL_WWDG_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CR, WWDG_CR_WDGA)
/* ... */
#define __HAL_WWDG_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT((__HANDLE__)->Instance->CFR, (__INTERRUPT__))
/* ... */
#define __HAL_WWDG_GET_IT(__HANDLE__, __INTERRUPT__) __HAL_WWDG_GET_FLAG((__HANDLE__),(__INTERRUPT__))
/* ... */
#define __HAL_WWDG_CLEAR_IT(__HANDLE__, __INTERRUPT__) __HAL_WWDG_CLEAR_FLAG((__HANDLE__), (__INTERRUPT__))
/* ... */
#define __HAL_WWDG_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR & (__FLAG__)) == (__FLAG__))
/* ... */
#define __HAL_WWDG_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR = ~(__FLAG__))
/* ... */
#define __HAL_WWDG_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CFR\
& (__INTERRUPT__)) == (__INTERRUPT__))...
19 defines
/* ... */
/* ... */
/* ... */
HAL_StatusTypeDef HAL_WWDG_Init(WWDG_HandleTypeDef *hwwdg);
void HAL_WWDG_MspInit(WWDG_HandleTypeDef *hwwdg);
#if (USE_HAL_WWDG_REGISTER_CALLBACKS == 1)
HAL_StatusTypeDef HAL_WWDG_RegisterCallback(WWDG_HandleTypeDef *hwwdg, HAL_WWDG_CallbackIDTypeDef CallbackID,
pWWDG_CallbackTypeDef pCallback);
HAL_StatusTypeDef HAL_WWDG_UnRegisterCallback(WWDG_HandleTypeDef *hwwdg, HAL_WWDG_CallbackIDTypeDef CallbackID);/* ... */
#endif
/* ... */
/* ... */
HAL_StatusTypeDef HAL_WWDG_Refresh(WWDG_HandleTypeDef *hwwdg);
void HAL_WWDG_IRQHandler(WWDG_HandleTypeDef *hwwdg);
void HAL_WWDG_EarlyWakeupCallback(WWDG_HandleTypeDef *hwwdg);
/* ... */
/* ... */
/* ... */
/* ... */
#ifdef __cplusplus
}extern "C" { ... }
#endif
/* ... */
#endif