| MINI58_BSP V3.01.003 The Board Support Package for Mini58 Series MCU

wdt.c
Go to the documentation of this file.
1/**************************************************************************/
12#include "Mini58Series.h"
13
47 void WDT_Open(uint32_t u32TimeoutInterval,
48 uint32_t u32ResetDelay,
49 uint32_t u32EnableReset,
50 uint32_t u32EnableWakeup)
51{
52
53 WDT->CTL = u32TimeoutInterval | WDT_CTL_WDTEN_Msk |
54 (u32EnableReset << WDT_CTL_RSTEN_Pos) |
55 (u32EnableWakeup << WDT_CTL_WKEN_Pos);
56 WDT->ALTCTL = u32ResetDelay;
57 return;
58}
59
65 void WDT_Close(void)
66{
67 WDT->CTL = 0;
68 return;
69}
70
76 void WDT_EnableInt(void)
77{
78 WDT->CTL = (WDT->CTL & ~(WDT_CTL_IF_Msk | WDT_CTL_WKF_Msk | WDT_CTL_RSTF_Msk)) | WDT_CTL_INTEN_Msk;
79 return;
80}
81
87 void WDT_DisableInt(void)
88{
89 WDT->CTL &= ~(WDT_CTL_IF_Msk | WDT_CTL_WKF_Msk | WDT_CTL_RSTF_Msk | WDT_CTL_INTEN_Msk);
90 return;
91}
92
93
94 /* end of group Mini58_WDT_EXPORTED_FUNCTIONS */
96 /* end of group Mini58_WDT_Driver */
98 /* end of group Mini58_Device_Driver */
100
101/*** (C) COPYRIGHT 2022 Nuvoton Technology Corp. ***/
Mini58Series.h
Mini58 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: Mini58Series.h:11489
WDT_CTL_WKF_Msk
#define WDT_CTL_WKF_Msk
Definition: Mini58Series.h:11498
WDT_CTL_WDTEN_Msk
#define WDT_CTL_WDTEN_Msk
Definition: Mini58Series.h:11504
WDT_CTL_IF_Msk
#define WDT_CTL_IF_Msk
Definition: Mini58Series.h:11492
WDT_CTL_WKEN_Pos
#define WDT_CTL_WKEN_Pos
Definition: Mini58Series.h:11494
WDT_CTL_RSTEN_Pos
#define WDT_CTL_RSTEN_Pos
Definition: Mini58Series.h:11485
WDT_CTL_INTEN_Msk
#define WDT_CTL_INTEN_Msk
Definition: Mini58Series.h:11501
WDT
#define WDT
Pointer to WDT register structure.
Definition: Mini58Series.h:11713
WDT_Close
void WDT_Close(void)
This function stops WDT counting and disable WDT module.
Definition: wdt.c:65
WDT_DisableInt
void WDT_DisableInt(void)
This function disables the WDT time-out interrupt.
Definition: wdt.c:87
WDT_EnableInt
void WDT_EnableInt(void)
This function enables the WDT time-out interrupt.
Definition: wdt.c:76
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