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

wdt.c
Go to the documentation of this file.
1 /**************************************************************************/
12 #include "Mini51Series.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 MINI51_WDT_EXPORTED_FUNCTIONS */
91 /* end of group MINI51_WDT_Driver */
93 /* end of group MINI51_Device_Driver */
95
96 /*** (C) COPYRIGHT 2013 Nuvoton Technology Corp. ***/
WDT_WTCR_WTRF_Msk
#define WDT_WTCR_WTRF_Msk
Definition: Mini51Series.h:9844
WDT_WTCR_WTWKE_Pos
#define WDT_WTCR_WTWKE_Pos
Definition: Mini51Series.h:9849
Mini51Series.h
Mini51 series peripheral access layer header file. This file contains all the peripheral register's d...
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_WTCR_WTIE_Msk
#define WDT_WTCR_WTIE_Msk
Definition: Mini51Series.h:9856
WDT_WTCR_WTIF_Msk
#define WDT_WTCR_WTIF_Msk
Definition: Mini51Series.h:9847
WDT_WTCR_WTRE_Pos
#define WDT_WTCR_WTRE_Pos
Definition: Mini51Series.h:9840
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
#define WDT
Pointer to WDT register structure.
Definition: Mini51Series.h:9923
WDT_EnableInt
void WDT_EnableInt(void)
This function enables the WDT time-out interrupt.
Definition: wdt.c:71
WDT_WTCR_WTE_Msk
#define WDT_WTCR_WTE_Msk
Definition: Mini51Series.h:9859
WDT_WTCR_WTWKF_Msk
#define WDT_WTCR_WTWKF_Msk
Definition: Mini51Series.h:9853