1 /**************************************************************************//**
\r
4 * @brief WDT register definition header file
\r
6 * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved.
\r
7 *****************************************************************************/
\r
8 #ifndef __WDT_REG_H__
\r
9 #define __WDT_REG_H__
\r
11 /** @addtogroup REGISTER Control Register
\r
18 /*---------------------- Watch Dog Timer Controller -------------------------*/
\r
20 @addtogroup WDT Watch Dog Timer Controller(WDT)
\r
21 Memory Mapped Structure for WDT Controller
\r
30 * Offset: 0x00 WDT Control Register
\r
31 * ---------------------------------------------------------------------------------------------------
\r
32 * |Bits |Field |Descriptions
\r
33 * | :----: | :----: | :---- |
\r
34 * |[1] |RSTEN |WDT Time-out Reset Enable Control (Write Protect)
\r
35 * | | |Setting this bit will enable the WDT time-out reset system function If the WDT up counter value has not been cleared after the specific WDT reset delay period expires.
\r
36 * | | |0 = WDT time-out reset system function Disabled.
\r
37 * | | |1 = WDT time-out reset system function Enabled.
\r
38 * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register.
\r
39 * |[2] |RSTF |WDT Time-out Reset Flag
\r
40 * | | |This bit indicates the system has been reset by WDT time-out reset system event or not.
\r
41 * | | |0 = WDT time-out reset system event did not occur.
\r
42 * | | |1 = WDT time-out reset system event has been occurred.
\r
43 * | | |Note: This bit is cleared by writing 1 to it.
\r
44 * |[3] |IF |WDT Time-out Interrupt Flag
\r
45 * | | |This bit will set to 1 while WDT up counter value reaches the selected WDT time-out interval
\r
46 * | | |0 = WDT time-out interrupt event interrupt did not occur.
\r
47 * | | |1 = WDT time-out interrupt interrupt event occurred.
\r
48 * | | |Note: This bit is cleared by writing 1 to it.
\r
49 * |[4] |WKEN |WDT Time-out Wake-up Function Control (Write Protect)
\r
50 * | | |If this bit is set to 1, while WDT time-out interrupt flag IF (WDT_CTL[3]) is generated to 1 and interrupt enable bit INTEN (WDT_CTL[6]) is enabled, the WDT time-out interrupt signal will generate a event to trigger CPU wake-up trigger event to chip.
\r
51 * | | |0 = Trigger wWake-up trigger event function Disabled if WDT time-out interrupt signal generated.
\r
52 * | | |1 = Trigger Wake-up trigger event function Enabled if WDT time-out interrupt signal generated.
\r
53 * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register.
\r
54 * | | |Note2: Chip can be woken-up by while WDT time-out interrupt signal generated only if WDT clock source is selected to 10 kHz (LIRC (10 kHz) or LXT (32 kHz).
\r
55 * |[5] |WKF |WDT Time-out Wake-up Flag (Write Protect)
\r
56 * | | |This bit indicates the WDT time-out event has triggered interrupt chip wake-up or not.flag status of WDT
\r
57 * | | |0 = WDT does not cause chip wake-up.
\r
58 * | | |1 = Chip wake-up from Idle or Power-down mode if when WDT time-out interrupt signal is generated.
\r
59 * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register.
\r
60 * | | |Note2: This bit is cleared by writing 1 to it.
\r
61 * |[6] |INTEN |WDT Time-out Interrupt Enable Control (Write Protect)
\r
62 * | | |If this bit is enabled, when WDT time-out event occurs, the IF (WDT_CTL[3]) will be set to 1 and the WDT time-out interrupt signal is generated and inform to CPU.
\r
63 * | | |0 = WDT time-out interrupt Disabled.
\r
64 * | | |1 = WDT time-out interrupt Enabled.
\r
65 * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register.
\r
66 * |[7] |WDTEN |WDT Enable Control (Write Protect)
\r
67 * | | |0 = Set WDT counter stop Disabled, and (This action will reset the internal up counter value will be reset also).
\r
68 * | | |1 = Set WDT counter start Enabled.
\r
69 * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register.
\r
70 * | | |Note2: Perform enable or disable WDTEN bit needs 2 * WDT_CLK period to become active, user can read SYNC (WDT_CTL[30]) to check enable/disable command is completed or not.
\r
71 * | | |Note32: If CWDTEN[2:0] (combined by with Config0[31] and Config0[4:3]) bits is not configure to 0x111, this bit is forced as 1 and user cannot change this bit to 0.
\r
72 * | | |Note3: This bit disabled needs 2 * WDT_CLK.
\r
73 * |[10:8] |TOUTSEL |WDT Time-out Interval Selection (Write Protect)
\r
74 * | | |These three bits select the time-out interval period after for the WDT starts counting.
\r
75 * | | |000 = 24 * WDT_CLK.
\r
76 * | | |001 = 26 * WDT_CLK.
\r
77 * | | |010 = 28 * WDT_CLK.
\r
78 * | | |011 = 210 * WDT_CLK.
\r
79 * | | |100 = 212 * WDT_CLK.
\r
80 * | | |101 = 214 * WDT_CLK.
\r
81 * | | |110 = 216 * WDT_CLK.
\r
82 * | | |111 = 218 * WDT_CLK.
\r
83 * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register.
\r
84 * |[30] |SYNC |WDT Enable Control SYNC SYNC Flag Indicator (Read Only)
\r
85 * | | |If use to synchronization, software er can check execute enable/disable this flag after enable WDTEN (WDT_CTL[7]), this flag can be indicated enable/disable WDTEN function is become completed or not active or not..
\r
86 * | | |SYNC delay is
\r
87 * | | |0 = Set WDTEN bit is WDT enable control synccompletedhronizing is completion.
\r
88 * | | |1 = Set WDTEN bit WDT enable control is synchronizing and not become active yet..
\r
89 * | | |Note: Perform enable or disable WDTEN bit
\r
90 * | | |This bit enabled needs 2 * WDT_CLK period to become active.
\r
91 * |[31] |ICEDEBUG |ICE Debug Mode Acknowledge Disable Control (Write Protect)
\r
92 * | | |0 = ICE debug mode acknowledgment affects WDT counting.
\r
93 * | | |WDT up counter will be held while CPU is held by ICE.
\r
94 * | | |1 = ICE debug mode acknowledgment Disabled.
\r
95 * | | |WDT up counter will keep going no matter CPU is held by ICE or not.
\r
96 * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register.
\r
97 * @var WDT_T::ALTCTL
\r
98 * Offset: 0x04 WDT Alternative Control Register
\r
99 * ---------------------------------------------------------------------------------------------------
\r
100 * |Bits |Field |Descriptions
\r
101 * | :----: | :----: | :---- |
\r
102 * |[1:0] |RSTDSEL |WDT Reset Delay Period Selection (Write Protect)
\r
103 * | | |When WDT time-out event happened, user has a time named WDT Reset Delay Period to clear execute WDT counter by setting RSTCNT (WDT_CTL[0]) reset to prevent WDT time-out reset system occurred happened
\r
104 * | | |User can select a suitable setting of RSTDSEL for different application program WDT Reset Delay Period.
\r
105 * | | |00 = WDT Reset Delay Period is 1026 * WDT_CLK.
\r
106 * | | |01 = WDT Reset Delay Period is 130 * WDT_CLK.
\r
107 * | | |10 = WDT Reset Delay Period is 18 * WDT_CLK.
\r
108 * | | |11 = WDT Reset Delay Period is 3 * WDT_CLK.
\r
109 * | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register.
\r
110 * | | |Note2: This register will be reset to 0 if WDT time-out reset system event occurred happened.
\r
111 * @var WDT_T::RSTCNT
\r
112 * Offset: 0x08 WDT Reset Counter Register
\r
113 * ---------------------------------------------------------------------------------------------------
\r
114 * |Bits |Field |Descriptions
\r
115 * | :----: | :----: | :---- |
\r
116 * |[31:0] |RSTCNT |WDT Reset Counter Register
\r
117 * | | |Writing 0x00005AA5 to this register field will reset the internal 18-bit WDT up counter value to 0.
\r
118 * | | |Note: This WDT_RSTCNT is not write protected, but this RSTCNT (WDT_CTL[0]) is write protected.
\r
119 * | | |Note: Perform RSTCNT to reset counter needs 2 * WDT_CLK period to become active.
\r
121 __IO uint32_t CTL; /*!< [0x0000] WDT Control Register */
\r
122 __IO uint32_t ALTCTL; /*!< [0x0004] WDT Alternative Control Register */
\r
123 __O uint32_t RSTCNT; /*!< [0x0008] WDT Reset Counter Register */
\r
128 @addtogroup WDT_CONST WDT Bit Field Definition
\r
129 Constant Definitions for WDT Controller
\r
132 #define WDT_CTL_RSTEN_Pos (1) /*!< WDT_T::CTL: RSTEN Position */
\r
133 #define WDT_CTL_RSTEN_Msk (0x1ul << WDT_CTL_RSTEN_Pos) /*!< WDT_T::CTL: RSTEN Mask */
\r
135 #define WDT_CTL_RSTF_Pos (2) /*!< WDT_T::CTL: RSTF Position */
\r
136 #define WDT_CTL_RSTF_Msk (0x1ul << WDT_CTL_RSTF_Pos) /*!< WDT_T::CTL: RSTF Mask */
\r
138 #define WDT_CTL_IF_Pos (3) /*!< WDT_T::CTL: IF Position */
\r
139 #define WDT_CTL_IF_Msk (0x1ul << WDT_CTL_IF_Pos) /*!< WDT_T::CTL: IF Mask */
\r
141 #define WDT_CTL_WKEN_Pos (4) /*!< WDT_T::CTL: WKEN Position */
\r
142 #define WDT_CTL_WKEN_Msk (0x1ul << WDT_CTL_WKEN_Pos) /*!< WDT_T::CTL: WKEN Mask */
\r
144 #define WDT_CTL_WKF_Pos (5) /*!< WDT_T::CTL: WKF Position */
\r
145 #define WDT_CTL_WKF_Msk (0x1ul << WDT_CTL_WKF_Pos) /*!< WDT_T::CTL: WKF Mask */
\r
147 #define WDT_CTL_INTEN_Pos (6) /*!< WDT_T::CTL: INTEN Position */
\r
148 #define WDT_CTL_INTEN_Msk (0x1ul << WDT_CTL_INTEN_Pos) /*!< WDT_T::CTL: INTEN Mask */
\r
150 #define WDT_CTL_WDTEN_Pos (7) /*!< WDT_T::CTL: WDTEN Position */
\r
151 #define WDT_CTL_WDTEN_Msk (0x1ul << WDT_CTL_WDTEN_Pos) /*!< WDT_T::CTL: WDTEN Mask */
\r
153 #define WDT_CTL_TOUTSEL_Pos (8) /*!< WDT_T::CTL: TOUTSEL Position */
\r
154 #define WDT_CTL_TOUTSEL_Msk (0x7ul << WDT_CTL_TOUTSEL_Pos) /*!< WDT_T::CTL: TOUTSEL Mask */
\r
156 #define WDT_CTL_SYNC_Pos (30) /*!< WDT_T::CTL: SYNC Position */
\r
157 #define WDT_CTL_SYNC_Msk (0x1ul << WDT_CTL_SYNC_Pos) /*!< WDT_T::CTL: SYNC Mask */
\r
159 #define WDT_CTL_ICEDEBUG_Pos (31) /*!< WDT_T::CTL: ICEDEBUG Position */
\r
160 #define WDT_CTL_ICEDEBUG_Msk (0x1ul << WDT_CTL_ICEDEBUG_Pos) /*!< WDT_T::CTL: ICEDEBUG Mask */
\r
162 #define WDT_ALTCTL_RSTDSEL_Pos (0) /*!< WDT_T::ALTCTL: RSTDSEL Position */
\r
163 #define WDT_ALTCTL_RSTDSEL_Msk (0x3ul << WDT_ALTCTL_RSTDSEL_Pos) /*!< WDT_T::ALTCTL: RSTDSEL Mask */
\r
165 #define WDT_RSTCNT_RSTCNT_Pos (0) /*!< WDT_T::RSTCNT: RSTCNT Position */
\r
166 #define WDT_RSTCNT_RSTCNT_Msk (0xfffffffful << WDT_RSTCNT_RSTCNT_Pos) /*!< WDT_T::RSTCNT: RSTCNT Mask */
\r
169 /**@}*/ /* WDT_CONST */
\r
170 /**@}*/ /* end of WDT register group */
\r
171 /**@}*/ /* end of REGISTER group */
\r
173 #endif /* __WDT_REG_H__ */
\r