| Nano100AN Series BSP V3.02.002 The Board Support Package for Nano100AN Series

wdt.h
Go to the documentation of this file.
1 /**************************************************************************/
12 #ifndef __WDT_H__
13 #define __WDT_H__
14
15 #ifdef __cplusplus
16 extern "C"
17 {
18 #endif
19
20
32 #define WDT_TIMEOUT_2POW4 (0UL << WDT_CTL_WTIS_Pos)
33 #define WDT_TIMEOUT_2POW6 (1UL << WDT_CTL_WTIS_Pos)
34 #define WDT_TIMEOUT_2POW8 (2UL << WDT_CTL_WTIS_Pos)
35 #define WDT_TIMEOUT_2POW10 (3UL << WDT_CTL_WTIS_Pos)
36 #define WDT_TIMEOUT_2POW12 (4UL << WDT_CTL_WTIS_Pos)
37 #define WDT_TIMEOUT_2POW14 (5UL << WDT_CTL_WTIS_Pos)
38 #define WDT_TIMEOUT_2POW16 (6UL << WDT_CTL_WTIS_Pos)
39 #define WDT_TIMEOUT_2POW18 (7UL << WDT_CTL_WTIS_Pos)
41 /* end of group NANO100_WDT_EXPORTED_CONSTANTS */
42
43
54 #define WDT_CLEAR_RESET_FLAG() (WDT->ISR = WDT_ISR_RST_IS_Msk)
55
62 #define WDT_CLEAR_TIMEOUT_INT_FLAG() (WDT->ISR = WDT_ISR_IS_Msk)
63
70 #define WDT_CLEAR_TIMEOUT_WAKEUP_FLAG() (WDT->ISR = WDT_ISR_WAKE_IS_Msk)
71
79 #define WDT_GET_RESET_FLAG() (WDT->ISR & WDT_ISR_RST_IS_Msk ? 1 : 0)
80
88 #define WDT_GET_TIMEOUT_INT_FLAG() (WDT->ISR & WDT_ISR_IS_Msk ? 1 : 0)
89
97 #define WDT_GET_TIMEOUT_WAKEUP_FLAG() (WDT->ISR & WDT_ISR_WAKE_IS_Msk ? 1 : 0)
98
105 #define WDT_RESET_COUNTER() (WDT->CTL |= WDT_CTL_WTR_Msk)
106
112 __STATIC_INLINE void WDT_Close(void)
113 {
114 WDT->CTL = 0;
115 return;
116 }
117
123 __STATIC_INLINE void WDT_EnableInt(void)
124 {
125 WDT->IER = WDT_IER_IE_Msk;
126 return;
127 }
128
134 __STATIC_INLINE void WDT_DisableInt(void)
135 {
136 WDT->IER = 0;
137 return;
138 }
139
140 void WDT_Open(uint32_t u32TimeoutInterval,
141 uint32_t u32ResetDelay,
142 uint32_t u32EnableReset,
143 uint32_t u32EnableWakeup);
144 /* end of group NANO100_WDT_EXPORTED_FUNCTIONS */
146 /* end of group NANO100_WDT_Driver */
148 /* end of group NANO100_Device_Driver */
150
151 #ifdef __cplusplus
152 }
153 #endif
154
155 #endif //__WDT_H__
156
157 /*** (C) COPYRIGHT 2013 Nuvoton Technology Corp. ***/
WDT_Open
void WDT_Open(uint32_t u32TimeoutInterval, uint32_t u32ResetDelay, uint32_t u32EnableReset, uint32_t u32EnableWakeup)
This function make WDT module start counting with different time-out interval.
Definition: wdt.c:43
WDT_EnableInt
__STATIC_INLINE void WDT_EnableInt(void)
This function enables the WDT time-out interrupt.
Definition: wdt.h:123
WDT_Close
__STATIC_INLINE void WDT_Close(void)
This function stops WDT counting and disable WDT module.
Definition: wdt.h:112
WDT_DisableInt
__STATIC_INLINE void WDT_DisableInt(void)
This function disables the WDT time-out interrupt.
Definition: wdt.h:134
WDT
#define WDT
Pointer to WDT register structure.
Definition: Nano100Series.h:10099
WDT_IER_IE_Msk
#define WDT_IER_IE_Msk
Definition: Nano100Series.h:10019