HPM SDK
HPMicro Software Development Kit
hpm_ewdg_regs.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021-2025 HPMicro
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 
9 #ifndef HPM_EWDG_H
10 #define HPM_EWDG_H
11 
12 typedef struct {
13  __RW uint32_t CTRL0; /* 0x0: wdog ctrl register 0
14 Note: Parity check is required once writing to this register. The result should be zero by modular two addition of all bits */
15  __RW uint32_t CTRL1; /* 0x4: wdog ctrl register 1
16 Note: Parity check is required once writing to this register. The result should be zero by modular two addition of all bits */
17  __RW uint32_t OT_INT_VAL; /* 0x8: wdog timeout interrupt counter value */
18  __RW uint32_t OT_RST_VAL; /* 0xC: wdog timeout reset counter value */
19  __W uint32_t WDT_REFRESH_REG; /* 0x10: wdog refresh register */
20  __W uint32_t WDT_STATUS; /* 0x14: wdog status register */
21  __RW uint32_t CFG_PROT; /* 0x18: ctrl register protection register */
22  __RW uint32_t REF_PROT; /* 0x1C: refresh protection register */
23  __RW uint32_t WDT_EN; /* 0x20: Wdog enable */
24  __RW uint32_t REF_TIME; /* 0x24: Refresh period value */
25 } EWDG_Type;
26 
27 
28 /* Bitfield definition for register: CTRL0 */
29 /*
30  * CLK_SEL (RW)
31  *
32  * clock select
33  * 0:bus clock
34  * 1:ext clock
35  */
36 #define EWDG_CTRL0_CLK_SEL_MASK (0x20000000UL)
37 #define EWDG_CTRL0_CLK_SEL_SHIFT (29U)
38 #define EWDG_CTRL0_CLK_SEL_SET(x) (((uint32_t)(x) << EWDG_CTRL0_CLK_SEL_SHIFT) & EWDG_CTRL0_CLK_SEL_MASK)
39 #define EWDG_CTRL0_CLK_SEL_GET(x) (((uint32_t)(x) & EWDG_CTRL0_CLK_SEL_MASK) >> EWDG_CTRL0_CLK_SEL_SHIFT)
40 
41 /*
42  * DIV_VALUE (RW)
43  *
44  * clock divider, the clock divider works as 2 ^ div_value for wdt counter
45  */
46 #define EWDG_CTRL0_DIV_VALUE_MASK (0xE000000UL)
47 #define EWDG_CTRL0_DIV_VALUE_SHIFT (25U)
48 #define EWDG_CTRL0_DIV_VALUE_SET(x) (((uint32_t)(x) << EWDG_CTRL0_DIV_VALUE_SHIFT) & EWDG_CTRL0_DIV_VALUE_MASK)
49 #define EWDG_CTRL0_DIV_VALUE_GET(x) (((uint32_t)(x) & EWDG_CTRL0_DIV_VALUE_MASK) >> EWDG_CTRL0_DIV_VALUE_SHIFT)
50 
51 /*
52  * WIN_EN (RW)
53  *
54  * window mode enable
55  */
56 #define EWDG_CTRL0_WIN_EN_MASK (0x1000000UL)
57 #define EWDG_CTRL0_WIN_EN_SHIFT (24U)
58 #define EWDG_CTRL0_WIN_EN_SET(x) (((uint32_t)(x) << EWDG_CTRL0_WIN_EN_SHIFT) & EWDG_CTRL0_WIN_EN_MASK)
59 #define EWDG_CTRL0_WIN_EN_GET(x) (((uint32_t)(x) & EWDG_CTRL0_WIN_EN_MASK) >> EWDG_CTRL0_WIN_EN_SHIFT)
60 
61 /*
62  * WIN_LOWER (RW)
63  *
64  * Once window mode is opened, the lower counter value to refresh wdt
65  * 00: 4/8 overtime value
66  * 01: 5/8 of overtime value
67  * 10: 6/8 of overtime value
68  * 11: 7/8 of overtime value
69  */
70 #define EWDG_CTRL0_WIN_LOWER_MASK (0xC00000UL)
71 #define EWDG_CTRL0_WIN_LOWER_SHIFT (22U)
72 #define EWDG_CTRL0_WIN_LOWER_SET(x) (((uint32_t)(x) << EWDG_CTRL0_WIN_LOWER_SHIFT) & EWDG_CTRL0_WIN_LOWER_MASK)
73 #define EWDG_CTRL0_WIN_LOWER_GET(x) (((uint32_t)(x) & EWDG_CTRL0_WIN_LOWER_MASK) >> EWDG_CTRL0_WIN_LOWER_SHIFT)
74 
75 /*
76  * CFG_LOCK (RW)
77  *
78  * The register is locked and unlock is needed before re-config registers
79  * Once the lock mechanism takes effect, the CTRL0, CTRL1, timeout int register, timeout rst register, needs unlock before re-config them.
80  * The register update needs to be finished in the required period defined by UPD_OT_TIME register
81  */
82 #define EWDG_CTRL0_CFG_LOCK_MASK (0x200000UL)
83 #define EWDG_CTRL0_CFG_LOCK_SHIFT (21U)
84 #define EWDG_CTRL0_CFG_LOCK_SET(x) (((uint32_t)(x) << EWDG_CTRL0_CFG_LOCK_SHIFT) & EWDG_CTRL0_CFG_LOCK_MASK)
85 #define EWDG_CTRL0_CFG_LOCK_GET(x) (((uint32_t)(x) & EWDG_CTRL0_CFG_LOCK_MASK) >> EWDG_CTRL0_CFG_LOCK_SHIFT)
86 
87 /*
88  * REF_OT_REQ (RW)
89  *
90  * If refresh event has to be limited into a period after refresh unlocked.
91  * Note: the refresh overtime counter works in bus clock domain, not in wdt function clock domain. The wdt divider doesn't take effect for refresh counter
92  */
93 #define EWDG_CTRL0_REF_OT_REQ_MASK (0x8000U)
94 #define EWDG_CTRL0_REF_OT_REQ_SHIFT (15U)
95 #define EWDG_CTRL0_REF_OT_REQ_SET(x) (((uint32_t)(x) << EWDG_CTRL0_REF_OT_REQ_SHIFT) & EWDG_CTRL0_REF_OT_REQ_MASK)
96 #define EWDG_CTRL0_REF_OT_REQ_GET(x) (((uint32_t)(x) & EWDG_CTRL0_REF_OT_REQ_MASK) >> EWDG_CTRL0_REF_OT_REQ_SHIFT)
97 
98 /*
99  * WIN_UPPER (RW)
100  *
101  * The upper threshold of window value
102  * The window period upper limit is: lower_limit + (overtime_rst_value / 16) * upper_reg_value
103  * If this register value is zero, then no upper level limitation
104  */
105 #define EWDG_CTRL0_WIN_UPPER_MASK (0x7000U)
106 #define EWDG_CTRL0_WIN_UPPER_SHIFT (12U)
107 #define EWDG_CTRL0_WIN_UPPER_SET(x) (((uint32_t)(x) << EWDG_CTRL0_WIN_UPPER_SHIFT) & EWDG_CTRL0_WIN_UPPER_MASK)
108 #define EWDG_CTRL0_WIN_UPPER_GET(x) (((uint32_t)(x) & EWDG_CTRL0_WIN_UPPER_MASK) >> EWDG_CTRL0_WIN_UPPER_SHIFT)
109 
110 /*
111  * REF_LOCK (RW)
112  *
113  * WDT refresh has to be unlocked firstly once refresh lock is enable.
114  */
115 #define EWDG_CTRL0_REF_LOCK_MASK (0x20U)
116 #define EWDG_CTRL0_REF_LOCK_SHIFT (5U)
117 #define EWDG_CTRL0_REF_LOCK_SET(x) (((uint32_t)(x) << EWDG_CTRL0_REF_LOCK_SHIFT) & EWDG_CTRL0_REF_LOCK_MASK)
118 #define EWDG_CTRL0_REF_LOCK_GET(x) (((uint32_t)(x) & EWDG_CTRL0_REF_LOCK_MASK) >> EWDG_CTRL0_REF_LOCK_SHIFT)
119 
120 /*
121  * REF_UNLOCK_MEC (RW)
122  *
123  * Unlock refresh mechanism
124  * 00: the required unlock password is the same with refresh_psd_register
125  * 01: the required unlock password is a ring shift left value of refresh_psd_register
126  * 10: the required unlock password is always 16'h55AA, no matter what refresh_psd_register is
127  * 11: the required unlock password is a LSFR result of refresh_psd_register, the characteristic polynomial is X^15 + 1
128  */
129 #define EWDG_CTRL0_REF_UNLOCK_MEC_MASK (0x18U)
130 #define EWDG_CTRL0_REF_UNLOCK_MEC_SHIFT (3U)
131 #define EWDG_CTRL0_REF_UNLOCK_MEC_SET(x) (((uint32_t)(x) << EWDG_CTRL0_REF_UNLOCK_MEC_SHIFT) & EWDG_CTRL0_REF_UNLOCK_MEC_MASK)
132 #define EWDG_CTRL0_REF_UNLOCK_MEC_GET(x) (((uint32_t)(x) & EWDG_CTRL0_REF_UNLOCK_MEC_MASK) >> EWDG_CTRL0_REF_UNLOCK_MEC_SHIFT)
133 
134 /*
135  * EN_DBG (RW)
136  *
137  * WTD enable or not in debug mode
138  */
139 #define EWDG_CTRL0_EN_DBG_MASK (0x4U)
140 #define EWDG_CTRL0_EN_DBG_SHIFT (2U)
141 #define EWDG_CTRL0_EN_DBG_SET(x) (((uint32_t)(x) << EWDG_CTRL0_EN_DBG_SHIFT) & EWDG_CTRL0_EN_DBG_MASK)
142 #define EWDG_CTRL0_EN_DBG_GET(x) (((uint32_t)(x) & EWDG_CTRL0_EN_DBG_MASK) >> EWDG_CTRL0_EN_DBG_SHIFT)
143 
144 /*
145  * EN_LP (RW)
146  *
147  * WDT enable or not in low power mode
148  * 2'b00: wdt is halted once in low power mode
149  * 2'b01: wdt will work with 1/4 normal clock freq in low power mode
150  * 2'b10: wdt will work with 1/2 normal clock freq in low power mode
151  * 2'b11: wdt will work with normal clock freq in low power mode
152  */
153 #define EWDG_CTRL0_EN_LP_MASK (0x3U)
154 #define EWDG_CTRL0_EN_LP_SHIFT (0U)
155 #define EWDG_CTRL0_EN_LP_SET(x) (((uint32_t)(x) << EWDG_CTRL0_EN_LP_SHIFT) & EWDG_CTRL0_EN_LP_MASK)
156 #define EWDG_CTRL0_EN_LP_GET(x) (((uint32_t)(x) & EWDG_CTRL0_EN_LP_MASK) >> EWDG_CTRL0_EN_LP_SHIFT)
157 
158 /* Bitfield definition for register: CTRL1 */
159 /*
160  * REF_FAIL_RST_EN (RW)
161  *
162  * Refresh violation will trigger an reset.
163  * These event will be taken as a refresh violation:
164  * 1) Not refresh in the window once window mode is enabled
165  * 2) Not unlock refresh firstly if unlock is required
166  * 3) Not refresh in the required time after unlock, once refresh unlock overtime is enabled.
167  * 4) Not write the required word to refresh wdt.
168  */
169 #define EWDG_CTRL1_REF_FAIL_RST_EN_MASK (0x800000UL)
170 #define EWDG_CTRL1_REF_FAIL_RST_EN_SHIFT (23U)
171 #define EWDG_CTRL1_REF_FAIL_RST_EN_SET(x) (((uint32_t)(x) << EWDG_CTRL1_REF_FAIL_RST_EN_SHIFT) & EWDG_CTRL1_REF_FAIL_RST_EN_MASK)
172 #define EWDG_CTRL1_REF_FAIL_RST_EN_GET(x) (((uint32_t)(x) & EWDG_CTRL1_REF_FAIL_RST_EN_MASK) >> EWDG_CTRL1_REF_FAIL_RST_EN_SHIFT)
173 
174 /*
175  * REF_FAIL_INT_EN (RW)
176  *
177  * Refresh violation will trigger an interrupt
178  */
179 #define EWDG_CTRL1_REF_FAIL_INT_EN_MASK (0x400000UL)
180 #define EWDG_CTRL1_REF_FAIL_INT_EN_SHIFT (22U)
181 #define EWDG_CTRL1_REF_FAIL_INT_EN_SET(x) (((uint32_t)(x) << EWDG_CTRL1_REF_FAIL_INT_EN_SHIFT) & EWDG_CTRL1_REF_FAIL_INT_EN_MASK)
182 #define EWDG_CTRL1_REF_FAIL_INT_EN_GET(x) (((uint32_t)(x) & EWDG_CTRL1_REF_FAIL_INT_EN_MASK) >> EWDG_CTRL1_REF_FAIL_INT_EN_SHIFT)
183 
184 /*
185  * UNL_REF_FAIL_RST_EN (RW)
186  *
187  * Refresh unlock fail will trigger a reset
188  */
189 #define EWDG_CTRL1_UNL_REF_FAIL_RST_EN_MASK (0x200000UL)
190 #define EWDG_CTRL1_UNL_REF_FAIL_RST_EN_SHIFT (21U)
191 #define EWDG_CTRL1_UNL_REF_FAIL_RST_EN_SET(x) (((uint32_t)(x) << EWDG_CTRL1_UNL_REF_FAIL_RST_EN_SHIFT) & EWDG_CTRL1_UNL_REF_FAIL_RST_EN_MASK)
192 #define EWDG_CTRL1_UNL_REF_FAIL_RST_EN_GET(x) (((uint32_t)(x) & EWDG_CTRL1_UNL_REF_FAIL_RST_EN_MASK) >> EWDG_CTRL1_UNL_REF_FAIL_RST_EN_SHIFT)
193 
194 /*
195  * UNL_REF_FAIL_INT_EN (RW)
196  *
197  * Refresh unlock fail will trigger a interrupt
198  */
199 #define EWDG_CTRL1_UNL_REF_FAIL_INT_EN_MASK (0x100000UL)
200 #define EWDG_CTRL1_UNL_REF_FAIL_INT_EN_SHIFT (20U)
201 #define EWDG_CTRL1_UNL_REF_FAIL_INT_EN_SET(x) (((uint32_t)(x) << EWDG_CTRL1_UNL_REF_FAIL_INT_EN_SHIFT) & EWDG_CTRL1_UNL_REF_FAIL_INT_EN_MASK)
202 #define EWDG_CTRL1_UNL_REF_FAIL_INT_EN_GET(x) (((uint32_t)(x) & EWDG_CTRL1_UNL_REF_FAIL_INT_EN_MASK) >> EWDG_CTRL1_UNL_REF_FAIL_INT_EN_SHIFT)
203 
204 /*
205  * OT_RST_EN (RW)
206  *
207  * WDT overtime will generate a reset
208  */
209 #define EWDG_CTRL1_OT_RST_EN_MASK (0x20000UL)
210 #define EWDG_CTRL1_OT_RST_EN_SHIFT (17U)
211 #define EWDG_CTRL1_OT_RST_EN_SET(x) (((uint32_t)(x) << EWDG_CTRL1_OT_RST_EN_SHIFT) & EWDG_CTRL1_OT_RST_EN_MASK)
212 #define EWDG_CTRL1_OT_RST_EN_GET(x) (((uint32_t)(x) & EWDG_CTRL1_OT_RST_EN_MASK) >> EWDG_CTRL1_OT_RST_EN_SHIFT)
213 
214 /*
215  * OT_INT_EN (RW)
216  *
217  * WDT can generate an interrupt warning before timeout
218  */
219 #define EWDG_CTRL1_OT_INT_EN_MASK (0x10000UL)
220 #define EWDG_CTRL1_OT_INT_EN_SHIFT (16U)
221 #define EWDG_CTRL1_OT_INT_EN_SET(x) (((uint32_t)(x) << EWDG_CTRL1_OT_INT_EN_SHIFT) & EWDG_CTRL1_OT_INT_EN_MASK)
222 #define EWDG_CTRL1_OT_INT_EN_GET(x) (((uint32_t)(x) & EWDG_CTRL1_OT_INT_EN_MASK) >> EWDG_CTRL1_OT_INT_EN_SHIFT)
223 
224 /*
225  * CTL_VIO_RST_EN (RW)
226  *
227  * Ctrl update violation will trigger a reset
228  * The violation event is to try updating the locked register before unlock them
229  */
230 #define EWDG_CTRL1_CTL_VIO_RST_EN_MASK (0x80U)
231 #define EWDG_CTRL1_CTL_VIO_RST_EN_SHIFT (7U)
232 #define EWDG_CTRL1_CTL_VIO_RST_EN_SET(x) (((uint32_t)(x) << EWDG_CTRL1_CTL_VIO_RST_EN_SHIFT) & EWDG_CTRL1_CTL_VIO_RST_EN_MASK)
233 #define EWDG_CTRL1_CTL_VIO_RST_EN_GET(x) (((uint32_t)(x) & EWDG_CTRL1_CTL_VIO_RST_EN_MASK) >> EWDG_CTRL1_CTL_VIO_RST_EN_SHIFT)
234 
235 /*
236  * CTL_VIO_INT_EN (RW)
237  *
238  * Ctrl update violation will trigger a interrupt
239  */
240 #define EWDG_CTRL1_CTL_VIO_INT_EN_MASK (0x40U)
241 #define EWDG_CTRL1_CTL_VIO_INT_EN_SHIFT (6U)
242 #define EWDG_CTRL1_CTL_VIO_INT_EN_SET(x) (((uint32_t)(x) << EWDG_CTRL1_CTL_VIO_INT_EN_SHIFT) & EWDG_CTRL1_CTL_VIO_INT_EN_MASK)
243 #define EWDG_CTRL1_CTL_VIO_INT_EN_GET(x) (((uint32_t)(x) & EWDG_CTRL1_CTL_VIO_INT_EN_MASK) >> EWDG_CTRL1_CTL_VIO_INT_EN_SHIFT)
244 
245 /*
246  * UNL_CTL_FAIL_RST_EN (RW)
247  *
248  * Unlock register update failure will trigger a reset
249  */
250 #define EWDG_CTRL1_UNL_CTL_FAIL_RST_EN_MASK (0x20U)
251 #define EWDG_CTRL1_UNL_CTL_FAIL_RST_EN_SHIFT (5U)
252 #define EWDG_CTRL1_UNL_CTL_FAIL_RST_EN_SET(x) (((uint32_t)(x) << EWDG_CTRL1_UNL_CTL_FAIL_RST_EN_SHIFT) & EWDG_CTRL1_UNL_CTL_FAIL_RST_EN_MASK)
253 #define EWDG_CTRL1_UNL_CTL_FAIL_RST_EN_GET(x) (((uint32_t)(x) & EWDG_CTRL1_UNL_CTL_FAIL_RST_EN_MASK) >> EWDG_CTRL1_UNL_CTL_FAIL_RST_EN_SHIFT)
254 
255 /*
256  * UNL_CTL_FAIL_INT_EN (RW)
257  *
258  * Unlock register update failure will trigger a interrupt
259  */
260 #define EWDG_CTRL1_UNL_CTL_FAIL_INT_EN_MASK (0x10U)
261 #define EWDG_CTRL1_UNL_CTL_FAIL_INT_EN_SHIFT (4U)
262 #define EWDG_CTRL1_UNL_CTL_FAIL_INT_EN_SET(x) (((uint32_t)(x) << EWDG_CTRL1_UNL_CTL_FAIL_INT_EN_SHIFT) & EWDG_CTRL1_UNL_CTL_FAIL_INT_EN_MASK)
263 #define EWDG_CTRL1_UNL_CTL_FAIL_INT_EN_GET(x) (((uint32_t)(x) & EWDG_CTRL1_UNL_CTL_FAIL_INT_EN_MASK) >> EWDG_CTRL1_UNL_CTL_FAIL_INT_EN_SHIFT)
264 
265 /*
266  * PARITY_FAIL_RST_EN (RW)
267  *
268  * Parity error will trigger a reset
269  * A parity check is required once writing to ctrl0 and ctrl1 register. The result should be zero by modular two addition of all bits
270  */
271 #define EWDG_CTRL1_PARITY_FAIL_RST_EN_MASK (0x8U)
272 #define EWDG_CTRL1_PARITY_FAIL_RST_EN_SHIFT (3U)
273 #define EWDG_CTRL1_PARITY_FAIL_RST_EN_SET(x) (((uint32_t)(x) << EWDG_CTRL1_PARITY_FAIL_RST_EN_SHIFT) & EWDG_CTRL1_PARITY_FAIL_RST_EN_MASK)
274 #define EWDG_CTRL1_PARITY_FAIL_RST_EN_GET(x) (((uint32_t)(x) & EWDG_CTRL1_PARITY_FAIL_RST_EN_MASK) >> EWDG_CTRL1_PARITY_FAIL_RST_EN_SHIFT)
275 
276 /*
277  * PARITY_FAIL_INT_EN (RW)
278  *
279  * Parity error will trigger a interrupt
280  */
281 #define EWDG_CTRL1_PARITY_FAIL_INT_EN_MASK (0x4U)
282 #define EWDG_CTRL1_PARITY_FAIL_INT_EN_SHIFT (2U)
283 #define EWDG_CTRL1_PARITY_FAIL_INT_EN_SET(x) (((uint32_t)(x) << EWDG_CTRL1_PARITY_FAIL_INT_EN_SHIFT) & EWDG_CTRL1_PARITY_FAIL_INT_EN_MASK)
284 #define EWDG_CTRL1_PARITY_FAIL_INT_EN_GET(x) (((uint32_t)(x) & EWDG_CTRL1_PARITY_FAIL_INT_EN_MASK) >> EWDG_CTRL1_PARITY_FAIL_INT_EN_SHIFT)
285 
286 /* Bitfield definition for register: OT_INT_VAL */
287 /*
288  * OT_INT_VAL (RW)
289  *
290  * WDT timeout interrupt value
291  */
292 #define EWDG_OT_INT_VAL_OT_INT_VAL_MASK (0xFFFFU)
293 #define EWDG_OT_INT_VAL_OT_INT_VAL_SHIFT (0U)
294 #define EWDG_OT_INT_VAL_OT_INT_VAL_SET(x) (((uint32_t)(x) << EWDG_OT_INT_VAL_OT_INT_VAL_SHIFT) & EWDG_OT_INT_VAL_OT_INT_VAL_MASK)
295 #define EWDG_OT_INT_VAL_OT_INT_VAL_GET(x) (((uint32_t)(x) & EWDG_OT_INT_VAL_OT_INT_VAL_MASK) >> EWDG_OT_INT_VAL_OT_INT_VAL_SHIFT)
296 
297 /* Bitfield definition for register: OT_RST_VAL */
298 /*
299  * OT_RST_VAL (RW)
300  *
301  * WDT timeout reset value
302  */
303 #define EWDG_OT_RST_VAL_OT_RST_VAL_MASK (0xFFFFU)
304 #define EWDG_OT_RST_VAL_OT_RST_VAL_SHIFT (0U)
305 #define EWDG_OT_RST_VAL_OT_RST_VAL_SET(x) (((uint32_t)(x) << EWDG_OT_RST_VAL_OT_RST_VAL_SHIFT) & EWDG_OT_RST_VAL_OT_RST_VAL_MASK)
306 #define EWDG_OT_RST_VAL_OT_RST_VAL_GET(x) (((uint32_t)(x) & EWDG_OT_RST_VAL_OT_RST_VAL_MASK) >> EWDG_OT_RST_VAL_OT_RST_VAL_SHIFT)
307 
308 /* Bitfield definition for register: WDT_REFRESH_REG */
309 /*
310  * WDT_REFRESH_REG (WO)
311  *
312  * Write this register by 32'h5A45_524F to refresh wdog
313  * Note: Reading this register can read back wdt real time counter value, while it is only used by debug purpose
314  */
315 #define EWDG_WDT_REFRESH_REG_WDT_REFRESH_REG_MASK (0xFFFFFFFFUL)
316 #define EWDG_WDT_REFRESH_REG_WDT_REFRESH_REG_SHIFT (0U)
317 #define EWDG_WDT_REFRESH_REG_WDT_REFRESH_REG_SET(x) (((uint32_t)(x) << EWDG_WDT_REFRESH_REG_WDT_REFRESH_REG_SHIFT) & EWDG_WDT_REFRESH_REG_WDT_REFRESH_REG_MASK)
318 #define EWDG_WDT_REFRESH_REG_WDT_REFRESH_REG_GET(x) (((uint32_t)(x) & EWDG_WDT_REFRESH_REG_WDT_REFRESH_REG_MASK) >> EWDG_WDT_REFRESH_REG_WDT_REFRESH_REG_SHIFT)
319 
320 /* Bitfield definition for register: WDT_STATUS */
321 /*
322  * PARITY_ERROR (W1C)
323  *
324  * parity error
325  * Write one to clear the bit
326  */
327 #define EWDG_WDT_STATUS_PARITY_ERROR_MASK (0x40U)
328 #define EWDG_WDT_STATUS_PARITY_ERROR_SHIFT (6U)
329 #define EWDG_WDT_STATUS_PARITY_ERROR_SET(x) (((uint32_t)(x) << EWDG_WDT_STATUS_PARITY_ERROR_SHIFT) & EWDG_WDT_STATUS_PARITY_ERROR_MASK)
330 #define EWDG_WDT_STATUS_PARITY_ERROR_GET(x) (((uint32_t)(x) & EWDG_WDT_STATUS_PARITY_ERROR_MASK) >> EWDG_WDT_STATUS_PARITY_ERROR_SHIFT)
331 
332 /*
333  * OT_RST (W1C)
334  *
335  * Timeout happens, a reset will happen once enable bit set
336  * This bit can be cleared only by refreshing wdt or reset
337  */
338 #define EWDG_WDT_STATUS_OT_RST_MASK (0x20U)
339 #define EWDG_WDT_STATUS_OT_RST_SHIFT (5U)
340 #define EWDG_WDT_STATUS_OT_RST_SET(x) (((uint32_t)(x) << EWDG_WDT_STATUS_OT_RST_SHIFT) & EWDG_WDT_STATUS_OT_RST_MASK)
341 #define EWDG_WDT_STATUS_OT_RST_GET(x) (((uint32_t)(x) & EWDG_WDT_STATUS_OT_RST_MASK) >> EWDG_WDT_STATUS_OT_RST_SHIFT)
342 
343 /*
344  * OT_INT (W1C)
345  *
346  * Timeout happens, a interrupt will happen once enable bit set
347  * This bit can be cleared only by refreshing wdt or reset
348  */
349 #define EWDG_WDT_STATUS_OT_INT_MASK (0x10U)
350 #define EWDG_WDT_STATUS_OT_INT_SHIFT (4U)
351 #define EWDG_WDT_STATUS_OT_INT_SET(x) (((uint32_t)(x) << EWDG_WDT_STATUS_OT_INT_SHIFT) & EWDG_WDT_STATUS_OT_INT_MASK)
352 #define EWDG_WDT_STATUS_OT_INT_GET(x) (((uint32_t)(x) & EWDG_WDT_STATUS_OT_INT_MASK) >> EWDG_WDT_STATUS_OT_INT_SHIFT)
353 
354 /*
355  * CTL_UNL_FAIL (W1C)
356  *
357  * Unlock ctrl reg update protection fail
358  * Write one to clear the bit
359  */
360 #define EWDG_WDT_STATUS_CTL_UNL_FAIL_MASK (0x8U)
361 #define EWDG_WDT_STATUS_CTL_UNL_FAIL_SHIFT (3U)
362 #define EWDG_WDT_STATUS_CTL_UNL_FAIL_SET(x) (((uint32_t)(x) << EWDG_WDT_STATUS_CTL_UNL_FAIL_SHIFT) & EWDG_WDT_STATUS_CTL_UNL_FAIL_MASK)
363 #define EWDG_WDT_STATUS_CTL_UNL_FAIL_GET(x) (((uint32_t)(x) & EWDG_WDT_STATUS_CTL_UNL_FAIL_MASK) >> EWDG_WDT_STATUS_CTL_UNL_FAIL_SHIFT)
364 
365 /*
366  * CTL_VIO (W1C)
367  *
368  * Violate register update protection mechanism
369  * Write one to clear the bit
370  */
371 #define EWDG_WDT_STATUS_CTL_VIO_MASK (0x4U)
372 #define EWDG_WDT_STATUS_CTL_VIO_SHIFT (2U)
373 #define EWDG_WDT_STATUS_CTL_VIO_SET(x) (((uint32_t)(x) << EWDG_WDT_STATUS_CTL_VIO_SHIFT) & EWDG_WDT_STATUS_CTL_VIO_MASK)
374 #define EWDG_WDT_STATUS_CTL_VIO_GET(x) (((uint32_t)(x) & EWDG_WDT_STATUS_CTL_VIO_MASK) >> EWDG_WDT_STATUS_CTL_VIO_SHIFT)
375 
376 /*
377  * REF_UNL_FAIL (W1C)
378  *
379  * Refresh unlock fail
380  * Write one to clear the bit
381  */
382 #define EWDG_WDT_STATUS_REF_UNL_FAIL_MASK (0x2U)
383 #define EWDG_WDT_STATUS_REF_UNL_FAIL_SHIFT (1U)
384 #define EWDG_WDT_STATUS_REF_UNL_FAIL_SET(x) (((uint32_t)(x) << EWDG_WDT_STATUS_REF_UNL_FAIL_SHIFT) & EWDG_WDT_STATUS_REF_UNL_FAIL_MASK)
385 #define EWDG_WDT_STATUS_REF_UNL_FAIL_GET(x) (((uint32_t)(x) & EWDG_WDT_STATUS_REF_UNL_FAIL_MASK) >> EWDG_WDT_STATUS_REF_UNL_FAIL_SHIFT)
386 
387 /*
388  * REF_VIO (W1C)
389  *
390  * Refresh fail
391  * Write one to clear the bit
392  */
393 #define EWDG_WDT_STATUS_REF_VIO_MASK (0x1U)
394 #define EWDG_WDT_STATUS_REF_VIO_SHIFT (0U)
395 #define EWDG_WDT_STATUS_REF_VIO_SET(x) (((uint32_t)(x) << EWDG_WDT_STATUS_REF_VIO_SHIFT) & EWDG_WDT_STATUS_REF_VIO_MASK)
396 #define EWDG_WDT_STATUS_REF_VIO_GET(x) (((uint32_t)(x) & EWDG_WDT_STATUS_REF_VIO_MASK) >> EWDG_WDT_STATUS_REF_VIO_SHIFT)
397 
398 /* Bitfield definition for register: CFG_PROT */
399 /*
400  * UPD_OT_TIME (RW)
401  *
402  * The period in which register update has to be in after unlock
403  * The required period is less than: 128 * 2 ^ UPD_OT_TIME * bus_clock_cycle
404  */
405 #define EWDG_CFG_PROT_UPD_OT_TIME_MASK (0xF0000UL)
406 #define EWDG_CFG_PROT_UPD_OT_TIME_SHIFT (16U)
407 #define EWDG_CFG_PROT_UPD_OT_TIME_SET(x) (((uint32_t)(x) << EWDG_CFG_PROT_UPD_OT_TIME_SHIFT) & EWDG_CFG_PROT_UPD_OT_TIME_MASK)
408 #define EWDG_CFG_PROT_UPD_OT_TIME_GET(x) (((uint32_t)(x) & EWDG_CFG_PROT_UPD_OT_TIME_MASK) >> EWDG_CFG_PROT_UPD_OT_TIME_SHIFT)
409 
410 /*
411  * UPD_PSD (RW)
412  *
413  * The password of unlocking register update
414  */
415 #define EWDG_CFG_PROT_UPD_PSD_MASK (0xFFFFU)
416 #define EWDG_CFG_PROT_UPD_PSD_SHIFT (0U)
417 #define EWDG_CFG_PROT_UPD_PSD_SET(x) (((uint32_t)(x) << EWDG_CFG_PROT_UPD_PSD_SHIFT) & EWDG_CFG_PROT_UPD_PSD_MASK)
418 #define EWDG_CFG_PROT_UPD_PSD_GET(x) (((uint32_t)(x) & EWDG_CFG_PROT_UPD_PSD_MASK) >> EWDG_CFG_PROT_UPD_PSD_SHIFT)
419 
420 /* Bitfield definition for register: REF_PROT */
421 /*
422  * REF_UNL_PSD (RW)
423  *
424  * The password to unlock refreshing
425  */
426 #define EWDG_REF_PROT_REF_UNL_PSD_MASK (0xFFFFU)
427 #define EWDG_REF_PROT_REF_UNL_PSD_SHIFT (0U)
428 #define EWDG_REF_PROT_REF_UNL_PSD_SET(x) (((uint32_t)(x) << EWDG_REF_PROT_REF_UNL_PSD_SHIFT) & EWDG_REF_PROT_REF_UNL_PSD_MASK)
429 #define EWDG_REF_PROT_REF_UNL_PSD_GET(x) (((uint32_t)(x) & EWDG_REF_PROT_REF_UNL_PSD_MASK) >> EWDG_REF_PROT_REF_UNL_PSD_SHIFT)
430 
431 /* Bitfield definition for register: WDT_EN */
432 /*
433  * WDOG_EN (RW)
434  *
435  * Wdog is enabled, the re-written of this register is impacted by enable lock function
436  */
437 #define EWDG_WDT_EN_WDOG_EN_MASK (0x1U)
438 #define EWDG_WDT_EN_WDOG_EN_SHIFT (0U)
439 #define EWDG_WDT_EN_WDOG_EN_SET(x) (((uint32_t)(x) << EWDG_WDT_EN_WDOG_EN_SHIFT) & EWDG_WDT_EN_WDOG_EN_MASK)
440 #define EWDG_WDT_EN_WDOG_EN_GET(x) (((uint32_t)(x) & EWDG_WDT_EN_WDOG_EN_MASK) >> EWDG_WDT_EN_WDOG_EN_SHIFT)
441 
442 /* Bitfield definition for register: REF_TIME */
443 /*
444  * REFRESH_PERIOD (RW)
445  *
446  * The refresh period after refresh unlocked
447  * Note: the refresh overtime counter works in bus clock domain, not in wdt function clock domain. The wdt divider doesn't take effect for refresh counter
448  */
449 #define EWDG_REF_TIME_REFRESH_PERIOD_MASK (0xFFFFU)
450 #define EWDG_REF_TIME_REFRESH_PERIOD_SHIFT (0U)
451 #define EWDG_REF_TIME_REFRESH_PERIOD_SET(x) (((uint32_t)(x) << EWDG_REF_TIME_REFRESH_PERIOD_SHIFT) & EWDG_REF_TIME_REFRESH_PERIOD_MASK)
452 #define EWDG_REF_TIME_REFRESH_PERIOD_GET(x) (((uint32_t)(x) & EWDG_REF_TIME_REFRESH_PERIOD_MASK) >> EWDG_REF_TIME_REFRESH_PERIOD_SHIFT)
453 
454 
455 
456 
457 #endif /* HPM_EWDG_H */
Definition: hpm_ewdg_regs.h:12