RTEMS 6.1-rc4
Loading...
Searching...
No Matches
stm32h7xx_hal_wwdg.h
Go to the documentation of this file.
1
19/* Define to prevent recursive inclusion -------------------------------------*/
20#ifndef STM32H7xx_HAL_WWDG_H
21#define STM32H7xx_HAL_WWDG_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/* Includes ------------------------------------------------------------------*/
28#include "stm32h7xx_hal_def.h"
29
38/* Exported types ------------------------------------------------------------*/
39
48typedef struct
49{
50 uint32_t Prescaler;
53 uint32_t Window;
56 uint32_t Counter;
59 uint32_t EWIMode ;
63
67#if (USE_HAL_WWDG_REGISTER_CALLBACKS == 1)
68typedef struct __WWDG_HandleTypeDef
69#else
70typedef struct
71#endif /* USE_HAL_WWDG_REGISTER_CALLBACKS */
72{
77#if (USE_HAL_WWDG_REGISTER_CALLBACKS == 1)
78 void (* EwiCallback)(struct __WWDG_HandleTypeDef *hwwdg);
80 void (* MspInitCallback)(struct __WWDG_HandleTypeDef *hwwdg);
81#endif /* USE_HAL_WWDG_REGISTER_CALLBACKS */
83
84#if (USE_HAL_WWDG_REGISTER_CALLBACKS == 1)
88typedef enum
89{
90 HAL_WWDG_EWI_CB_ID = 0x00U,
91 HAL_WWDG_MSPINIT_CB_ID = 0x01U,
92} HAL_WWDG_CallbackIDTypeDef;
93
97typedef void (*pWWDG_CallbackTypeDef)(WWDG_HandleTypeDef *hppp);
99#endif /* USE_HAL_WWDG_REGISTER_CALLBACKS */
104/* Exported constants --------------------------------------------------------*/
105
115#define WWDG_IT_EWI WWDG_CFR_EWI
125#define WWDG_FLAG_EWIF WWDG_SR_EWIF
134#define WWDG_PRESCALER_1 0x00000000u
135#define WWDG_PRESCALER_2 WWDG_CFR_WDGTB_0
136#define WWDG_PRESCALER_4 WWDG_CFR_WDGTB_1
137#define WWDG_PRESCALER_8 (WWDG_CFR_WDGTB_1 | WWDG_CFR_WDGTB_0)
138#define WWDG_PRESCALER_16 WWDG_CFR_WDGTB_2
139#define WWDG_PRESCALER_32 (WWDG_CFR_WDGTB_2 | WWDG_CFR_WDGTB_0)
140#define WWDG_PRESCALER_64 (WWDG_CFR_WDGTB_2 | WWDG_CFR_WDGTB_1)
141#define WWDG_PRESCALER_128 WWDG_CFR_WDGTB
150#define WWDG_EWI_DISABLE 0x00000000u
151#define WWDG_EWI_ENABLE WWDG_CFR_EWI
160/* Private macros ------------------------------------------------------------*/
161
166#define IS_WWDG_PRESCALER(__PRESCALER__) (((__PRESCALER__) == WWDG_PRESCALER_1) || \
167 ((__PRESCALER__) == WWDG_PRESCALER_2) || \
168 ((__PRESCALER__) == WWDG_PRESCALER_4) || \
169 ((__PRESCALER__) == WWDG_PRESCALER_8) || \
170 ((__PRESCALER__) == WWDG_PRESCALER_16) || \
171 ((__PRESCALER__) == WWDG_PRESCALER_32) || \
172 ((__PRESCALER__) == WWDG_PRESCALER_64) || \
173 ((__PRESCALER__) == WWDG_PRESCALER_128))
174
175#define IS_WWDG_WINDOW(__WINDOW__) (((__WINDOW__) >= WWDG_CFR_W_6) && ((__WINDOW__) <= WWDG_CFR_W))
176
177#define IS_WWDG_COUNTER(__COUNTER__) (((__COUNTER__) >= WWDG_CR_T_6) && ((__COUNTER__) <= WWDG_CR_T))
178
179#define IS_WWDG_EWI_MODE(__MODE__) (((__MODE__) == WWDG_EWI_ENABLE) || \
180 ((__MODE__) == WWDG_EWI_DISABLE))
186/* Exported macros ------------------------------------------------------------*/
187
198#define __HAL_WWDG_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CR, WWDG_CR_WDGA)
199
209#define __HAL_WWDG_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT((__HANDLE__)->Instance->CFR, (__INTERRUPT__))
210
219#define __HAL_WWDG_GET_IT(__HANDLE__, __INTERRUPT__) __HAL_WWDG_GET_FLAG((__HANDLE__),(__INTERRUPT__))
220
228#define __HAL_WWDG_CLEAR_IT(__HANDLE__, __INTERRUPT__) __HAL_WWDG_CLEAR_FLAG((__HANDLE__), (__INTERRUPT__))
229
238#define __HAL_WWDG_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR & (__FLAG__)) == (__FLAG__))
239
248#define __HAL_WWDG_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR = ~(__FLAG__))
249
257#define __HAL_WWDG_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CFR\
258 & (__INTERRUPT__)) == (__INTERRUPT__))
259
264/* Exported functions --------------------------------------------------------*/
265
273/* Initialization/de-initialization functions **********************************/
274HAL_StatusTypeDef HAL_WWDG_Init(WWDG_HandleTypeDef *hwwdg);
275void HAL_WWDG_MspInit(WWDG_HandleTypeDef *hwwdg);
276/* Callbacks Register/UnRegister functions ***********************************/
277#if (USE_HAL_WWDG_REGISTER_CALLBACKS == 1)
278HAL_StatusTypeDef HAL_WWDG_RegisterCallback(WWDG_HandleTypeDef *hwwdg, HAL_WWDG_CallbackIDTypeDef CallbackID,
279 pWWDG_CallbackTypeDef pCallback);
280HAL_StatusTypeDef HAL_WWDG_UnRegisterCallback(WWDG_HandleTypeDef *hwwdg, HAL_WWDG_CallbackIDTypeDef CallbackID);
281#endif /* USE_HAL_WWDG_REGISTER_CALLBACKS */
282
290/* I/O operation functions ******************************************************/
291HAL_StatusTypeDef HAL_WWDG_Refresh(WWDG_HandleTypeDef *hwwdg);
292void HAL_WWDG_IRQHandler(WWDG_HandleTypeDef *hwwdg);
293void HAL_WWDG_EarlyWakeupCallback(WWDG_HandleTypeDef *hwwdg);
310#ifdef __cplusplus
311}
312#endif
313
314#endif /* STM32H7xx_HAL_WWDG_H */
This file contains HAL common defines, enumeration, macros and structures definitions.
HAL_StatusTypeDef
HAL Status structures definition.
Definition: stm32h7xx_hal_def.h:47
WWDG handle Structure definition.
Definition: stm32h7xx_hal_wwdg.h:72
WWDG_InitTypeDef Init
Definition: stm32h7xx_hal_wwdg.h:75
WWDG_TypeDef * Instance
Definition: stm32h7xx_hal_wwdg.h:73
WWDG Init structure definition.
Definition: stm32h7xx_hal_wwdg.h:49
uint32_t Prescaler
Definition: stm32h7xx_hal_wwdg.h:50
uint32_t Counter
Definition: stm32h7xx_hal_wwdg.h:56
uint32_t Window
Definition: stm32h7xx_hal_wwdg.h:53
uint32_t EWIMode
Definition: stm32h7xx_hal_wwdg.h:59
Window WATCHDOG.
Definition: stm32h723xx.h:1633