| NUC029FAE BSP V3.01.002 The Board Support Package for NUC029FAE

wdt.c
Go to the documentation of this file.
1 /**************************************************************************/
12 #include "NUC029FAE.h"
13
43 void WDT_Open(uint32_t u32TimeoutInterval,
44 uint32_t u32ResetDelay,
45 uint32_t u32EnableReset,
46 uint32_t u32EnableWakeup)
47 {
48
49 WDT->WTCR = u32TimeoutInterval | WDT_WTCR_WTE_Msk |
50 (u32EnableReset << WDT_WTCR_WTRE_Pos) |
51 (u32EnableWakeup << WDT_WTCR_WTWKE_Pos);
52 return;
53 }
54
60 void WDT_Close(void)
61 {
62 WDT->WTCR = 0;
63 return;
64 }
65
71 void WDT_EnableInt(void)
72 {
73 WDT->WTCR = (WDT->WTCR & ~(WDT_WTCR_WTIF_Msk | WDT_WTCR_WTWKF_Msk | WDT_WTCR_WTRF_Msk)) | WDT_WTCR_WTIE_Msk;
74 return;
75 }
76
82 void WDT_DisableInt(void)
83 {
84 WDT->WTCR &= ~(WDT_WTCR_WTIF_Msk | WDT_WTCR_WTWKF_Msk | WDT_WTCR_WTRF_Msk | WDT_WTCR_WTIE_Msk);
85 return;
86 }
87
88
89 /* end of group NUC029FAE_WDT_EXPORTED_FUNCTIONS */
91 /* end of group NUC029FAE_WDT_Driver */
93 /* end of group NUC029FAE_Device_Driver */
95
96 /*** (C) COPYRIGHT 2013 Nuvoton Technology Corp. ***/
NUC029FAE.h
NUC029FAE peripheral access layer header file. This file contains all the peripheral register's defin...
WDT_Close
void WDT_Close(void)
This function stops WDT counting and disable WDT module.
Definition: wdt.c:60
WDT
#define WDT
Pointer to WDT register structure.
Definition: NUC029FAE.h:3217
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
WDT_DisableInt
void WDT_DisableInt(void)
This function disables the WDT time-out interrupt.
Definition: wdt.c:82