| NANO100_BSP V3.05.000 The Board Support Package for Nano100BN 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#define WDT_RESET_DELAY_3CLK (3UL << WDT_CTL_WTRDSEL_Pos)
42#define WDT_RESET_DELAY_18CLK (2UL << WDT_CTL_WTRDSEL_Pos)
43#define WDT_RESET_DELAY_130CLK (1UL << WDT_CTL_WTRDSEL_Pos)
44#define WDT_RESET_DELAY_1026CLK (0UL << WDT_CTL_WTRDSEL_Pos) /* end of group NANO100_WDT_EXPORTED_CONSTANTS */
47
48
59#define WDT_CLEAR_RESET_FLAG() (WDT->ISR = WDT_ISR_RST_IS_Msk)
60
67#define WDT_CLEAR_TIMEOUT_INT_FLAG() (WDT->ISR = WDT_ISR_IS_Msk)
68
75#define WDT_CLEAR_TIMEOUT_WAKEUP_FLAG() (WDT->ISR = WDT_ISR_WAKE_IS_Msk)
76
84#define WDT_GET_RESET_FLAG() (WDT->ISR & WDT_ISR_RST_IS_Msk ? 1 : 0)
85
93#define WDT_GET_TIMEOUT_INT_FLAG() (WDT->ISR & WDT_ISR_IS_Msk ? 1 : 0)
94
102#define WDT_GET_TIMEOUT_WAKEUP_FLAG() (WDT->ISR & WDT_ISR_WAKE_IS_Msk ? 1 : 0)
103
110#define WDT_RESET_COUNTER() (WDT->CTL |= WDT_CTL_WTR_Msk)
111
117__STATIC_INLINE void WDT_Close(void)
118{
119 WDT->CTL = 0;
120 return;
121}
122
128__STATIC_INLINE void WDT_EnableInt(void)
129{
130 WDT->IER = WDT_IER_IE_Msk;
131 return;
132}
133
139__STATIC_INLINE void WDT_DisableInt(void)
140{
141 WDT->IER = 0;
142 return;
143}
144
145 void WDT_Open(uint32_t u32TimeoutInterval,
146 uint32_t u32ResetDelay,
147 uint32_t u32EnableReset,
148 uint32_t u32EnableWakeup);
149 /* end of group NANO100_WDT_EXPORTED_FUNCTIONS */
151 /* end of group NANO100_WDT_Driver */
153 /* end of group NANO100_Device_Driver */
155
156#ifdef __cplusplus
157}
158#endif
159
160#endif //__WDT_H__
161
162/*** (C) COPYRIGHT 2013 Nuvoton Technology Corp. ***/
WDT_IER_IE_Msk
#define WDT_IER_IE_Msk
Definition: Nano100Series.h:11447
WDT
#define WDT
Pointer to WDT register structure.
Definition: Nano100Series.h:11666
WDT_Close
__STATIC_INLINE void WDT_Close(void)
This function stops WDT counting and disable WDT module.
Definition: wdt.h:117
WDT_EnableInt
__STATIC_INLINE void WDT_EnableInt(void)
This function enables the WDT time-out interrupt.
Definition: wdt.h:128
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:47
WDT_DisableInt
__STATIC_INLINE void WDT_DisableInt(void)
This function disables the WDT time-out interrupt.
Definition: wdt.h:139