18#ifndef __ST_HAL_WWDG_H__
19#define __ST_HAL_WWDG_H__
31#define WWDG_IT_EWI WWDG_CFR_EWI
33#define WWDG_FLAG_EWIF WWDG_SR_EWIF
35#define WWDG_PRESCALER_1 0x00000000u
36#define WWDG_PRESCALER_2 WWDG_CFR_WDGTB_0
37#define WWDG_PRESCALER_4 WWDG_CFR_WDGTB_1
38#define WWDG_PRESCALER_8 (WWDG_CFR_WDGTB_1 | WWDG_CFR_WDGTB_0)
40#define WWDG_EWI_DISABLE 0x00000000u
41#define WWDG_EWI_ENABLE WWDG_CFR_EWI
43#define IS_WWDG_PRESCALER(__PRESCALER__) \
44 (((__PRESCALER__) == WWDG_PRESCALER_1) || \
45 ((__PRESCALER__) == WWDG_PRESCALER_2) || \
46 ((__PRESCALER__) == WWDG_PRESCALER_4) || \
47 ((__PRESCALER__) == WWDG_PRESCALER_8))
49#define IS_WWDG_WINDOW(__WINDOW__) \
50 (((__WINDOW__) >= WWDG_CFR_W_6) && ((__WINDOW__) <= WWDG_CFR_W))
52#define IS_WWDG_COUNTER(__COUNTER__) \
53 (((__COUNTER__) >= WWDG_CR_T_6) && ((__COUNTER__) <= WWDG_CR_T))
55#define IS_WWDG_EWI_MODE(__MODE__) \
56 (((__MODE__) == WWDG_EWI_ENABLE) || ((__MODE__) == WWDG_EWI_DISABLE))
58#define __HAL_WWDG_ENABLE(__HANDLE__) \
59 SET_BIT((__HANDLE__)->Instance->CR, WWDG_CR_WDGA)
61#define __HAL_WWDG_ENABLE_IT(__HANDLE__, __INTERRUPT__) \
62 SET_BIT((__HANDLE__)->Instance->CFR, (__INTERRUPT__))
64#define __HAL_WWDG_GET_IT(__HANDLE__, __INTERRUPT__) \
65 __HAL_WWDG_GET_FLAG((__HANDLE__), (__INTERRUPT__))
67#define __HAL_WWDG_CLEAR_IT(__HANDLE__, __INTERRUPT__) \
68 __HAL_WWDG_CLEAR_FLAG((__HANDLE__), (__INTERRUPT__))
70#define __HAL_WWDG_GET_FLAG(__HANDLE__, __FLAG__) \
71 (((__HANDLE__)->Instance->SR & (__FLAG__)) == (__FLAG__))
73#define __HAL_WWDG_CLEAR_FLAG(__HANDLE__, __FLAG__) \
74 ((__HANDLE__)->Instance->SR = ~(__FLAG__))
76#define __HAL_WWDG_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) \
77 (((__HANDLE__)->Instance->CFR & (__INTERRUPT__)) == (__INTERRUPT__))
92#if (USE_HAL_WWDG_REGISTER_CALLBACKS == 1)
93typedef struct __WWDG_HandleTypeDef
101#if (USE_HAL_WWDG_REGISTER_CALLBACKS == 1)
102 void (*EwiCallback)(
struct __WWDG_HandleTypeDef *hwwdg);
103 void (*MspInitCallback)(
struct __WWDG_HandleTypeDef *hwwdg);
107#if (USE_HAL_WWDG_REGISTER_CALLBACKS == 1)
110 HAL_WWDG_EWI_CB_ID = 0x00U,
111 HAL_WWDG_MSPINIT_CB_ID = 0x01U,
112} HAL_WWDG_CallbackIDTypeDef;
123#if (USE_HAL_WWDG_REGISTER_CALLBACKS == 1)
126 pWWDG_CallbackTypeDef pCallback);
unsigned int uint32_t
Definition lvgl.h:43
HAL_StatusTypeDef
Definition sthal_def.h:65
void HAL_WWDG_IRQHandler(WWDG_HandleTypeDef *hwwdg)
Definition sthal_wwdg.c:98
HAL_StatusTypeDef HAL_WWDG_Init(WWDG_HandleTypeDef *hwwdg)
Definition sthal_wwdg.c:33
void HAL_WWDG_MspInit(WWDG_HandleTypeDef *hwwdg)
Definition sthal_wwdg.c:43
vsf_wdt_t WWDG_TypeDef
Definition sthal_wwdg.h:82
void HAL_WWDG_EarlyWakeupCallback(WWDG_HandleTypeDef *hwwdg)
Definition sthal_wwdg.c:101
HAL_StatusTypeDef HAL_WWDG_Refresh(WWDG_HandleTypeDef *hwwdg)
Definition sthal_wwdg.c:93
Definition sthal_wwdg.h:97
WWDG_InitTypeDef Init
Definition sthal_wwdg.h:99
WWDG_TypeDef * Instance
Definition sthal_wwdg.h:98
Definition sthal_wwdg.h:84
uint32_t Prescaler
Definition sthal_wwdg.h:85
uint32_t Counter
Definition sthal_wwdg.h:87
uint32_t Window
Definition sthal_wwdg.h:86
uint32_t EWIMode
Definition sthal_wwdg.h:88
Definition vsf_template_wdt.h:165