| MINI55_BSP V3.03.000 The Board Support Package for Mini55 Series MCU

wdt.c
Go to the documentation of this file.
1/**************************************************************************/
12#include "Mini55Series.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->CTL = u32TimeoutInterval | WDT_CTL_WDTEN_Msk |
50 (u32EnableReset << WDT_CTL_RSTEN_Pos) |
51 (u32EnableWakeup << WDT_CTL_WKEN_Pos);
52 return;
53}
54
60 void WDT_Close(void)
61{
62 WDT->CTL = 0;
63 return;
64}
65
71 void WDT_EnableInt(void)
72{
73 WDT->CTL = (WDT->CTL & ~(WDT_CTL_IF_Msk | WDT_CTL_WKF_Msk | WDT_CTL_RSTF_Msk)) | WDT_CTL_INTEN_Msk;
74 return;
75}
76
82 void WDT_DisableInt(void)
83{
84 WDT->CTL &= ~(WDT_CTL_IF_Msk | WDT_CTL_WKF_Msk | WDT_CTL_RSTF_Msk | WDT_CTL_INTEN_Msk);
85 return;
86}
87
88
89 /* end of group MINI55_WDT_EXPORTED_FUNCTIONS */
91 /* end of group MINI55_WDT_Driver */
93 /* end of group MINI55_Device_Driver */
95
96/*** (C) COPYRIGHT 2014 Nuvoton Technology Corp. ***/
Mini55Series.h
Mini55 series peripheral access layer header file. This file contains all the peripheral register's d...
WDT_CTL_RSTF_Msk
#define WDT_CTL_RSTF_Msk
Definition: Mini55Series.h:6912
WDT_CTL_WKF_Msk
#define WDT_CTL_WKF_Msk
Definition: Mini55Series.h:6921
WDT_CTL_WDTEN_Msk
#define WDT_CTL_WDTEN_Msk
Definition: Mini55Series.h:6927
WDT_CTL_IF_Msk
#define WDT_CTL_IF_Msk
Definition: Mini55Series.h:6915
WDT_CTL_WKEN_Pos
#define WDT_CTL_WKEN_Pos
Definition: Mini55Series.h:6917
WDT_CTL_RSTEN_Pos
#define WDT_CTL_RSTEN_Pos
Definition: Mini55Series.h:6908
WDT_CTL_INTEN_Msk
#define WDT_CTL_INTEN_Msk
Definition: Mini55Series.h:6924
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
WDT
#define WDT
Pointer to WDT register structure.
Definition: Mini55Series.h:6994