gr55xx_hal_wdt.h
Go to the documentation of this file.
1
51 /* Define to prevent recursive inclusion -------------------------------------*/
52 #ifndef __GR55xx_HAL_WDT_H__
53 #define __GR55xx_HAL_WDT_H__
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58
59 /* Includes ------------------------------------------------------------------*/
60 #include "gr55xx_ll_wdt.h"
61 #include "gr55xx_hal_def.h"
62
63 /* Exported types ------------------------------------------------------------*/
75 typedef struct _wdt_init
76 {
77 uint32_t counter;
80 uint32_t reset_mode ;
87 } wdt_init_t;
88
98 typedef struct _wdt_handle
99 {
100 wdt_regs_t *p_instance;
102 wdt_init_t init;
104 hal_lock_t lock;
106 } wdt_handle_t;
107
124 typedef struct _hal_wdt_callback
125 {
126 void (*wdt_msp_init)(wdt_handle_t *p_wdt);
127 void (*wdt_msp_deinit)(wdt_handle_t *p_wdt);
128 void (*wdt_period_elapsed_callback)(wdt_handle_t *p_wdt);
129 } hal_wdt_callback_t;
130
140 /* Exported constants --------------------------------------------------------*/
148 #define WDT_RESET_DISABLE (0x00000000U)
149 #define WDT_RESET_ENABLE (0x00000001U)
154 /* Private macros ------------------------------------------------------------*/
155
164 #define IS_WDT_RESET_MODE(__MODE__) (((__MODE__) == WDT_RESET_ENABLE) || \
165 ((__MODE__) == WDT_RESET_DISABLE))
166
170 /* Exported functions --------------------------------------------------------*/
204 hal_status_t hal_wdt_init(wdt_handle_t *p_wdt);
205
216 hal_status_t hal_wdt_deinit(wdt_handle_t *p_wdt);
217
228 void hal_wdt_msp_init(wdt_handle_t *p_wdt);
229
240 void hal_wdt_msp_deinit(wdt_handle_t *p_wdt);
241
271 hal_status_t hal_wdt_refresh(wdt_handle_t *p_wdt);
272
293 void hal_wdt_irq_handler(wdt_handle_t *p_wdt);
294
307 void hal_wdt_period_elapsed_callback(wdt_handle_t *p_wdt);
308
313 #ifdef __cplusplus
314 }
315 #endif
316
317 #endif /* __GR55xx_HAL_WDT_H__ */
318
hal_lock_t
hal_lock_t
HAL Lock structures definition.
Definition: gr55xx_hal_def.h:81
_hal_wdt_callback
HAL_WDT Callback function definition.
Definition: gr55xx_hal_wdt.h:125
hal_wdt_deinit
hal_status_t hal_wdt_deinit(wdt_handle_t *p_wdt)
De-initialize the WDT peripheral.
hal_wdt_callback_t
struct _hal_wdt_callback hal_wdt_callback_t
HAL_WDT Callback function definition.
hal_wdt_period_elapsed_callback
void hal_wdt_period_elapsed_callback(wdt_handle_t *p_wdt)
WDT count complete(counter reaches to 0) callback.
hal_wdt_msp_init
void hal_wdt_msp_init(wdt_handle_t *p_wdt)
Initialize the WDT MSP.
hal_wdt_irq_handler
void hal_wdt_irq_handler(wdt_handle_t *p_wdt)
Handle WDT interrupt request.
wdt_handle_t
struct _wdt_handle wdt_handle_t
WDT handle Structure definition.
wdt_init_t
struct _wdt_init wdt_init_t
WDT init structure definition.
_hal_wdt_callback::wdt_msp_deinit
void(* wdt_msp_deinit)(wdt_handle_t *p_wdt)
Definition: gr55xx_hal_wdt.h:127
hal_wdt_msp_deinit
void hal_wdt_msp_deinit(wdt_handle_t *p_wdt)
De-initialize the WDT MSP.
_wdt_handle::p_instance
wdt_regs_t * p_instance
Definition: gr55xx_hal_wdt.h:100
_wdt_handle::lock
hal_lock_t lock
Definition: gr55xx_hal_wdt.h:104
hal_wdt_init
hal_status_t hal_wdt_init(wdt_handle_t *p_wdt)
Initialize the WDT according to the specified parameters in the wdt_init_t of associated handle.
hal_status_t
hal_status_t
HAL Status structures definition.
Definition: gr55xx_hal_def.h:70
_wdt_handle
WDT handle Structure definition.
Definition: gr55xx_hal_wdt.h:99
gr55xx_ll_wdt.h
Header file containing functions prototypes of WDT LL library.
hal_wdt_refresh
hal_status_t hal_wdt_refresh(wdt_handle_t *p_wdt)
Refresh the WDT.
_wdt_init::reset_mode
uint32_t reset_mode
Definition: gr55xx_hal_wdt.h:80
_hal_wdt_callback::wdt_msp_init
void(* wdt_msp_init)(wdt_handle_t *p_wdt)
Definition: gr55xx_hal_wdt.h:126
_wdt_handle::init
wdt_init_t init
Definition: gr55xx_hal_wdt.h:102
_wdt_init::counter
uint32_t counter
Definition: gr55xx_hal_wdt.h:77
_wdt_init
WDT init structure definition.
Definition: gr55xx_hal_wdt.h:76
gr55xx_hal_def.h
This file contains HAL common definitions, enumeration, macros and structures definitions.
_hal_wdt_callback::wdt_period_elapsed_callback
void(* wdt_period_elapsed_callback)(wdt_handle_t *p_wdt)
Definition: gr55xx_hal_wdt.h:128