18#if VSF_HAL_USE_WDT == ENABLED
23#define vsf_real_wdt_t VSF_MCONNECT(VSF_WDT_CFG_IMP_PREFIX, _wdt_t)
24#define vsf_real_wdt_capability VSF_MCONNECT(VSF_WDT_CFG_IMP_PREFIX, _wdt_capability)
26#ifndef VSF_WDT_CFG_REIMPLEMENT_API_CAPABILITY
27# define VSF_WDT_CFG_REIMPLEMENT_API_CAPABILITY DISABLED
30#ifdef VSF_WDT_CFG_IMP_REMAP_PREFIX
31# undef VSF_WDT_CFG_REIMPLEMENT_API_CAPABILITY
32# define VSF_WDT_CFG_REIMPLEMENT_API_CAPABILITY ENABLED
35#if VSF_WDT_CFG_REIMPLEMENT_API_CAPABILITY == DISABLED
36# ifndef VSF_WDT_CFG_CAPABILITY_SUPPORT_EARLY_WAKEUP
37# define VSF_WDT_CFG_CAPABILITY_SUPPORT_EARLY_WAKEUP 1
39# ifndef VSF_WDT_CFG_CAPABILITY_SUPPORT_RESET_NONE
40# define VSF_WDT_CFG_CAPABILITY_SUPPORT_RESET_NONE 1
42# ifndef VSF_WDT_CFG_CAPABILITY_SUPPORT_RESET_CORE
43# define VSF_WDT_CFG_CAPABILITY_SUPPORT_RESET_CORE 1
45# ifndef VSF_WDT_CFG_CAPABILITY_SUPPORT_RESET_SOC
46# define VSF_WDT_CFG_CAPABILITY_SUPPORT_RESET_SOC 1
48# ifndef VSF_WDT_CFG_CAPABILITY_SUPPORT_DISABLE
49# define VSF_WDT_CFG_CAPABILITY_SUPPORT_DISABLE 1
51# ifndef VSF_WDT_CFG_CAPABILITY_MAX_TIMEOUT_MS
52# define VSF_WDT_CFG_CAPABILITY_MAX_TIMEOUT_MS (1000 * 1000)
59#if VSF_WDT_CFG_REIMPLEMENT_API_CAPABILITY == DISABLED
63 .support_early_wakeup = VSF_WDT_CFG_CAPABILITY_SUPPORT_EARLY_WAKEUP,
65 .support_reset_core = VSF_WDT_CFG_CAPABILITY_SUPPORT_RESET_CORE,
66 .support_reset_soc = VSF_WDT_CFG_CAPABILITY_SUPPORT_RESET_SOC,
67 .support_disable = VSF_WDT_CFG_CAPABILITY_SUPPORT_DISABLE,
68 .max_timeout_ms = VSF_WDT_CFG_CAPABILITY_MAX_TIMEOUT_MS,
71 return wdt_capability;
77#undef VSF_WDT_CFG_REIMPLEMENT_API_CAPABILITY
78#undef VSF_WDT_CFG_CAPABILITY_SUPPORT_EARLY_WAKEUP
79#undef VSF_WDT_CFG_CAPABILITY_SUPPORT_RESET_NONE
80#undef VSF_WDT_CFG_CAPABILITY_SUPPORT_RESET_CORE
81#undef VSF_WDT_CFG_CAPABILITY_SUPPORT_RESET_SOC
82#undef VSF_WDT_CFG_CAPABILITY_SUPPORT_DISABLE
83#undef VSF_WDT_CFG_CAPABILITY_MAX_TIMEOUT_MS
86#undef vsf_real_wdt_capability
90#ifdef VSF_WDT_CFG_IMP_REMAP_PREFIX
92# define vsf_imp_wdt_t VSF_MCONNECT(VSF_WDT_CFG_IMP_PREFIX, _wdt_t)
93# define vsf_imp_wdt_init VSF_MCONNECT(VSF_WDT_CFG_IMP_PREFIX, _wdt_init)
94# define vsf_imp_wdt_fini VSF_MCONNECT(VSF_WDT_CFG_IMP_PREFIX, _wdt_fini)
95# define vsf_imp_wdt_enable VSF_MCONNECT(VSF_WDT_CFG_IMP_PREFIX, _wdt_enable)
96# define vsf_imp_wdt_disable VSF_MCONNECT(VSF_WDT_CFG_IMP_PREFIX, _wdt_disable)
97# define vsf_imp_wdt_capability VSF_MCONNECT(VSF_WDT_CFG_IMP_PREFIX, _wdt_capability)
98# define vsf_imp_wdt_feed VSF_MCONNECT(VSF_WDT_CFG_IMP_PREFIX, _wdt_feed)
100# define vsf_remap_wdt_t VSF_MCONNECT(VSF_WDT_CFG_IMP_REMAP_PREFIX, _wdt_t)
101# define vsf_remap_wdt_init VSF_MCONNECT(VSF_WDT_CFG_IMP_REMAP_PREFIX, _wdt_init)
102# define vsf_remap_wdt_fini VSF_MCONNECT(VSF_WDT_CFG_IMP_REMAP_PREFIX, _wdt_fini)
103# define vsf_remap_wdt_enable VSF_MCONNECT(VSF_WDT_CFG_IMP_REMAP_PREFIX, _wdt_enable)
104# define vsf_remap_wdt_disable VSF_MCONNECT(VSF_WDT_CFG_IMP_REMAP_PREFIX, _wdt_disable)
105# define vsf_remap_wdt_capability VSF_MCONNECT(VSF_WDT_CFG_IMP_REMAP_PREFIX, _wdt_capability)
106# define vsf_remap_wdt_feed VSF_MCONNECT(VSF_WDT_CFG_IMP_REMAP_PREFIX, _wdt_feed)
108# define VSF_WDT_CFG_IMP_REMAP_FUNCTIONS \
109 vsf_err_t vsf_imp_wdt_init(vsf_imp_wdt_t *wdt_ptr, vsf_wdt_cfg_t *cfg_ptr) \
111 VSF_HAL_ASSERT(wdt_ptr != NULL); \
112 return vsf_remap_wdt_init(wdt_ptr, cfg_ptr); \
114 void vsf_imp_wdt_fini(vsf_imp_wdt_t *wdt_ptr) \
116 VSF_HAL_ASSERT(wdt_ptr != NULL); \
117 vsf_remap_wdt_fini(wdt_ptr); \
119 fsm_rt_t vsf_imp_wdt_enable(vsf_imp_wdt_t *wdt_ptr) \
121 VSF_HAL_ASSERT(wdt_ptr != NULL); \
122 return vsf_remap_wdt_enable(wdt_ptr); \
124 fsm_rt_t vsf_imp_wdt_disable(vsf_imp_wdt_t *wdt_ptr) \
126 VSF_HAL_ASSERT(wdt_ptr != NULL); \
127 return vsf_remap_wdt_disable(wdt_ptr); \
129 vsf_wdt_capability_t vsf_imp_wdt_capability(vsf_imp_wdt_t *wdt_ptr) \
131 VSF_HAL_ASSERT(wdt_ptr != NULL); \
132 return vsf_remap_wdt_capability(wdt_ptr); \
134 void vsf_imp_wdt_feed(vsf_imp_wdt_t *wdt_ptr) \
136 VSF_HAL_ASSERT(wdt_ptr != NULL); \
137 vsf_remap_wdt_feed(wdt_ptr); \
143#define VSF_HAL_TEMPLATE_IMP_NAME _wdt
144#define VSF_HAL_TEMPLATE_IMP_UPCASE_NAME _WDT
146#ifndef VSF_WDT_CFG_IMP_PREFIX
147# error "Please define VSF_WDT_CFG_IMP_PREFIX in wdt driver"
150#ifndef VSF_WDT_CFG_IMP_UPCASE_PREFIX
151# error "Please define VSF_WDT_CFG_IMP_UPCASE_PREFIX in wdt driver"
154#ifndef VSF_WDT_CFG_IMP_COUNT_MASK_PREFIX
155# define VSF_WDT_CFG_IMP_COUNT_MASK_PREFIX VSF_WDT_CFG_IMP_UPCASE_PREFIX
158#ifdef VSF_WDT_CFG_IMP_REMAP_FUNCTIONS
159# define VSF_HAL_CFG_IMP_REMAP_FUNCTIONS VSF_WDT_CFG_IMP_REMAP_FUNCTIONS
164#undef VSF_WDT_CFG_IMP_PREFIX
165#undef VSF_WDT_CFG_IMP_COUNT_MASK_PREFIX
166#undef VSF_WDT_CFG_IMP_UPCASE_PREFIX
167#undef VSF_WDT_CFG_IMP_LV0
168#undef VSF_WDT_CFG_IMP_REMAP_FUNCTIONS
169#undef VSF_WDT_CFG_IMP_HAS_OP
170#undef VSF_WDT_CFG_IMP_EXTERN_OP
173#undef vsf_imp_wdt_init
174#undef vsf_imp_wdt_fini
175#undef vsf_imp_wdt_enable
176#undef vsf_imp_wdt_disable
177#undef vsf_imp_wdt_capability
178#undef vsf_imp_wdt_feed
180#undef vsf_remap_wdt_t
181#undef vsf_remap_wdt_init
182#undef vsf_remap_wdt_fini
183#undef vsf_remap_wdt_enable
184#undef vsf_remap_wdt_disable
185#undef vsf_remap_wdt_capability
186#undef vsf_remap_wdt_feed
Definition vsf_template_wdt.h:143
inherit(vsf_peripheral_capability_t) uint8_t support_early_wakeup uint8_t support_reset_none
Definition vsf_template_wdt.h:145