Nano103 BSP  V3.01.002
The Board Support Package for Nano103 Series
wwdt.c
Go to the documentation of this file.
1 /**************************************************************************/
12 #include "Nano103.h"
13 
54 void WWDT_Open(uint32_t u32PreScale, uint32_t u32CmpValue, uint32_t u32EnableInt)
55 {
56  /* Window compared value should be between 2 to 0x3E */
57  if (u32CmpValue > 0x3E)
58  u32CmpValue = 0x3E;
59  if (u32CmpValue < 2)
60  u32CmpValue = 2;
61 
62  WWDT->INTEN = u32EnableInt;
63  WWDT->CTL = u32PreScale | (u32CmpValue << WWDT_CTL_WINCMP_Pos) | WWDT_CTL_WWDTEN_Msk;
64  return;
65 }
66 
67 
68 
69  /* end of group NANO103_WDT_EXPORTED_FUNCTIONS */
71  /* end of group NANO103_WDT_Driver */
73  /* end of group NANO103_Device_Driver */
75 
76 /*** (C) COPYRIGHT 2015 Nuvoton Technology Corp. ***/
void WWDT_Open(uint32_t u32PreScale, uint32_t u32CmpValue, uint32_t u32EnableInt)
This function make WWDT module start counting with different counter period and compared window value...
Definition: wwdt.c:54
#define WWDT_CTL_WINCMP_Pos
Definition: Nano103.h:17840
#define WWDT
Pointer to WWDT register structure.
Definition: Nano103.h:24862
NANO103 peripheral access layer header file. This file contains all the peripheral register's definit...
#define WWDT_CTL_WWDTEN_Msk
Definition: Nano103.h:17835