| NUC029FAE_BSP V3.02.000 The Board Support Package for NUC029FAE MCU

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_WTCR_WTIS_Pos)
33#define WDT_TIMEOUT_2POW6 (1UL << WDT_WTCR_WTIS_Pos)
34#define WDT_TIMEOUT_2POW8 (2UL << WDT_WTCR_WTIS_Pos)
35#define WDT_TIMEOUT_2POW10 (3UL << WDT_WTCR_WTIS_Pos)
36#define WDT_TIMEOUT_2POW12 (4UL << WDT_WTCR_WTIS_Pos)
37#define WDT_TIMEOUT_2POW14 (5UL << WDT_WTCR_WTIS_Pos)
38#define WDT_TIMEOUT_2POW16 (6UL << WDT_WTCR_WTIS_Pos)
39#define WDT_TIMEOUT_2POW18 (7UL << WDT_WTCR_WTIS_Pos) /* end of group NUC029FAE_WDT_EXPORTED_CONSTANTS */
42
43
52#define WDT_CLEAR_RESET_FLAG() (WDT->WTCR = (WDT->WTCR & ~(WDT_WTCR_WTIF_Msk | WDT_WTCR_WTWKF_Msk)) | WDT_WTCR_WTRF_Msk)
53
58#define WDT_CLEAR_TIMEOUT_INT_FLAG() (WDT->WTCR = (WDT->WTCR & ~(WDT_WTCR_WTRF_Msk | WDT_WTCR_WTWKF_Msk)) | WDT_WTCR_WTIF_Msk)
59
64#define WDT_CLEAR_TIMEOUT_WAKEUP_FLAG() (WDT->WTCR = (WDT->WTCR & ~(WDT_WTCR_WTRF_Msk | WDT_WTCR_WTIF_Msk)) | WDT_WTCR_WTWKF_Msk)
65
73#define WDT_GET_RESET_FLAG() (WDT->WTCR & WDT_WTCR_WTRF_Msk ? 1 : 0)
74
82#define WDT_GET_TIMEOUT_INT_FLAG() (WDT->WTCR & WDT_WTCR_WTIF_Msk ? 1 : 0)
83
91#define WDT_GET_TIMEOUT_WAKEUP_FLAG() (WDT->WTCR & WDT_WTCR_WTWKF_Msk ? 1 : 0)
92
99#define WDT_RESET_COUNTER() (WDT->WTCR = (WDT->WTCR & ~(WDT_WTCR_WTIF_Msk | WDT_WTCR_WTWKF_Msk | WDT_WTCR_WTRF_Msk)) | WDT_WTCR_WTR_Msk)
100
101
102 void WDT_Open(uint32_t u32TimeoutInterval,
103 uint32_t u32ResetDelay,
104 uint32_t u32EnableReset,
105 uint32_t u32EnableWakeup);
106 void WDT_Close(void);
107
108 void WDT_EnableInt(void);
109 void WDT_DisableInt(void);
110 /* end of group NUC029FAE_WDT_EXPORTED_FUNCTIONS */
112 /* end of group NUC029FAE_WDT_Driver */
114 /* end of group NUC029FAE_Device_Driver */
116
117#ifdef __cplusplus
118}
119#endif
120
121#endif //__WDT_H__
122
123/*** (C) COPYRIGHT 2013 Nuvoton Technology Corp. ***/
WDT_Close
void WDT_Close(void)
This function stops WDT counting and disable WDT module.
Definition: wdt.c:60
WDT_DisableInt
void WDT_DisableInt(void)
This function disables the WDT time-out interrupt.
Definition: wdt.c:82
WDT_EnableInt
void WDT_EnableInt(void)
This function enables the WDT time-out interrupt.
Definition: wdt.c:71
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