2 ** ###################################################################
3 ** Compilers: Keil ARM C/C++ Compiler
4 ** Freescale C/C++ for Embedded ARM
6 ** IAR ANSI C/C++ Compiler for ARM
8 ** Reference manual: K64P144M120SF5RM, Rev.2, January 2014
9 ** Version: rev. 2.5, 2014-02-10
13 ** Extension to the CMSIS register access layer header.
15 ** Copyright (c) 2014 Freescale Semiconductor, Inc.
16 ** All rights reserved.
18 ** Redistribution and use in source and binary forms, with or without modification,
19 ** are permitted provided that the following conditions are met:
21 ** o Redistributions of source code must retain the above copyright notice, this list
22 ** of conditions and the following disclaimer.
24 ** o Redistributions in binary form must reproduce the above copyright notice, this
25 ** list of conditions and the following disclaimer in the documentation and/or
26 ** other materials provided with the distribution.
28 ** o Neither the name of Freescale Semiconductor, Inc. nor the names of its
29 ** contributors may be used to endorse or promote products derived from this
30 ** software without specific prior written permission.
32 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
33 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
34 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35 ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
36 ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
37 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
38 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
39 ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
41 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 ** http: www.freescale.com
44 ** mail: support@freescale.com
47 ** - rev. 1.0 (2013-08-12)
49 ** - rev. 2.0 (2013-10-29)
50 ** Register accessor macros added to the memory map.
51 ** Symbols for Processor Expert memory map compatibility added to the memory map.
52 ** Startup file for gcc has been updated according to CMSIS 3.2.
53 ** System initialization updated.
54 ** MCG - registers updated.
55 ** PORTA, PORTB, PORTC, PORTE - registers for digital filter removed.
56 ** - rev. 2.1 (2013-10-30)
57 ** Definition of BITBAND macros updated to support peripherals with 32-bit acces disabled.
58 ** - rev. 2.2 (2013-12-09)
59 ** DMA - EARS register removed.
60 ** AIPS0, AIPS1 - MPRA register updated.
61 ** - rev. 2.3 (2014-01-24)
62 ** Update according to reference manual rev. 2
63 ** ENET, MCG, MCM, SIM, USB - registers updated
64 ** - rev. 2.4 (2014-02-10)
65 ** The declaration of clock configurations has been moved to separate header file system_MK64F12.h
66 ** Update of SystemInit() and SystemCoreClockUpdate() functions.
67 ** - rev. 2.5 (2014-02-10)
68 ** The declaration of clock configurations has been moved to separate header file system_MK64F12.h
69 ** Update of SystemInit() and SystemCoreClockUpdate() functions.
70 ** Module access macro module_BASES replaced by module_BASE_PTRS.
72 ** ###################################################################
76 * WARNING! DO NOT EDIT THIS FILE DIRECTLY!
78 * This file was generated automatically and any changes may be lost.
80 #ifndef __HW_WDOG_REGISTERS_H__
81 #define __HW_WDOG_REGISTERS_H__
84 #include "fsl_bitaccess.h"
89 * Generation 2008 Watchdog Timer
91 * Registers defined in this header file:
92 * - HW_WDOG_STCTRLH - Watchdog Status and Control Register High
93 * - HW_WDOG_STCTRLL - Watchdog Status and Control Register Low
94 * - HW_WDOG_TOVALH - Watchdog Time-out Value Register High
95 * - HW_WDOG_TOVALL - Watchdog Time-out Value Register Low
96 * - HW_WDOG_WINH - Watchdog Window Register High
97 * - HW_WDOG_WINL - Watchdog Window Register Low
98 * - HW_WDOG_REFRESH - Watchdog Refresh register
99 * - HW_WDOG_UNLOCK - Watchdog Unlock register
100 * - HW_WDOG_TMROUTH - Watchdog Timer Output Register High
101 * - HW_WDOG_TMROUTL - Watchdog Timer Output Register Low
102 * - HW_WDOG_RSTCNT - Watchdog Reset Count register
103 * - HW_WDOG_PRESC - Watchdog Prescaler register
105 * - hw_wdog_t - Struct containing all module registers.
108 #define HW_WDOG_INSTANCE_COUNT (1U) /*!< Number of instances of the WDOG module. */
110 /*******************************************************************************
111 * HW_WDOG_STCTRLH - Watchdog Status and Control Register High
112 ******************************************************************************/
115 * @brief HW_WDOG_STCTRLH - Watchdog Status and Control Register High (RW)
117 * Reset value: 0x01D3U
119 typedef union _hw_wdog_stctrlh
122 struct _hw_wdog_stctrlh_bitfields
124 uint16_t WDOGEN : 1; /*!< [0] */
125 uint16_t CLKSRC : 1; /*!< [1] */
126 uint16_t IRQRSTEN : 1; /*!< [2] */
127 uint16_t WINEN : 1; /*!< [3] */
128 uint16_t ALLOWUPDATE : 1; /*!< [4] */
129 uint16_t DBGEN : 1; /*!< [5] */
130 uint16_t STOPEN : 1; /*!< [6] */
131 uint16_t WAITEN : 1; /*!< [7] */
132 uint16_t RESERVED0 : 2; /*!< [9:8] */
133 uint16_t TESTWDOG : 1; /*!< [10] */
134 uint16_t TESTSEL : 1; /*!< [11] */
135 uint16_t BYTESEL : 2; /*!< [13:12] */
136 uint16_t DISTESTWDOG : 1; /*!< [14] */
137 uint16_t RESERVED1 : 1; /*!< [15] */
142 * @name Constants and macros for entire WDOG_STCTRLH register
145 #define HW_WDOG_STCTRLH_ADDR(x) ((x) + 0x0U)
147 #define HW_WDOG_STCTRLH(x) (*(__IO hw_wdog_stctrlh_t *) HW_WDOG_STCTRLH_ADDR(x))
148 #define HW_WDOG_STCTRLH_RD(x) (HW_WDOG_STCTRLH(x).U)
149 #define HW_WDOG_STCTRLH_WR(x, v) (HW_WDOG_STCTRLH(x).U = (v))
150 #define HW_WDOG_STCTRLH_SET(x, v) (HW_WDOG_STCTRLH_WR(x, HW_WDOG_STCTRLH_RD(x) | (v)))
151 #define HW_WDOG_STCTRLH_CLR(x, v) (HW_WDOG_STCTRLH_WR(x, HW_WDOG_STCTRLH_RD(x) & ~(v)))
152 #define HW_WDOG_STCTRLH_TOG(x, v) (HW_WDOG_STCTRLH_WR(x, HW_WDOG_STCTRLH_RD(x) ^ (v)))
156 * Constants & macros for individual WDOG_STCTRLH bitfields
160 * @name Register WDOG_STCTRLH, field WDOGEN[0] (RW)
162 * Enables or disables the WDOG's operation. In the disabled state, the watchdog
163 * timer is kept in the reset state, but the other exception conditions can
164 * still trigger a reset/interrupt. A change in the value of this bit must be held
165 * for more than one WDOG_CLK cycle for the WDOG to be enabled or disabled.
168 * - 0 - WDOG is disabled.
169 * - 1 - WDOG is enabled.
172 #define BP_WDOG_STCTRLH_WDOGEN (0U) /*!< Bit position for WDOG_STCTRLH_WDOGEN. */
173 #define BM_WDOG_STCTRLH_WDOGEN (0x0001U) /*!< Bit mask for WDOG_STCTRLH_WDOGEN. */
174 #define BS_WDOG_STCTRLH_WDOGEN (1U) /*!< Bit field size in bits for WDOG_STCTRLH_WDOGEN. */
176 /*! @brief Read current value of the WDOG_STCTRLH_WDOGEN field. */
177 #define BR_WDOG_STCTRLH_WDOGEN(x) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_WDOGEN))
179 /*! @brief Format value for bitfield WDOG_STCTRLH_WDOGEN. */
180 #define BF_WDOG_STCTRLH_WDOGEN(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_STCTRLH_WDOGEN) & BM_WDOG_STCTRLH_WDOGEN)
182 /*! @brief Set the WDOGEN field to a new value. */
183 #define BW_WDOG_STCTRLH_WDOGEN(x, v) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_WDOGEN) = (v))
187 * @name Register WDOG_STCTRLH, field CLKSRC[1] (RW)
189 * Selects clock source for the WDOG timer and other internal timing operations.
192 * - 0 - WDOG clock sourced from LPO .
193 * - 1 - WDOG clock sourced from alternate clock source.
196 #define BP_WDOG_STCTRLH_CLKSRC (1U) /*!< Bit position for WDOG_STCTRLH_CLKSRC. */
197 #define BM_WDOG_STCTRLH_CLKSRC (0x0002U) /*!< Bit mask for WDOG_STCTRLH_CLKSRC. */
198 #define BS_WDOG_STCTRLH_CLKSRC (1U) /*!< Bit field size in bits for WDOG_STCTRLH_CLKSRC. */
200 /*! @brief Read current value of the WDOG_STCTRLH_CLKSRC field. */
201 #define BR_WDOG_STCTRLH_CLKSRC(x) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_CLKSRC))
203 /*! @brief Format value for bitfield WDOG_STCTRLH_CLKSRC. */
204 #define BF_WDOG_STCTRLH_CLKSRC(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_STCTRLH_CLKSRC) & BM_WDOG_STCTRLH_CLKSRC)
206 /*! @brief Set the CLKSRC field to a new value. */
207 #define BW_WDOG_STCTRLH_CLKSRC(x, v) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_CLKSRC) = (v))
211 * @name Register WDOG_STCTRLH, field IRQRSTEN[2] (RW)
213 * Used to enable the debug breadcrumbs feature. A change in this bit is updated
214 * immediately, as opposed to updating after WCT.
217 * - 0 - WDOG time-out generates reset only.
218 * - 1 - WDOG time-out initially generates an interrupt. After WCT, it generates
222 #define BP_WDOG_STCTRLH_IRQRSTEN (2U) /*!< Bit position for WDOG_STCTRLH_IRQRSTEN. */
223 #define BM_WDOG_STCTRLH_IRQRSTEN (0x0004U) /*!< Bit mask for WDOG_STCTRLH_IRQRSTEN. */
224 #define BS_WDOG_STCTRLH_IRQRSTEN (1U) /*!< Bit field size in bits for WDOG_STCTRLH_IRQRSTEN. */
226 /*! @brief Read current value of the WDOG_STCTRLH_IRQRSTEN field. */
227 #define BR_WDOG_STCTRLH_IRQRSTEN(x) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_IRQRSTEN))
229 /*! @brief Format value for bitfield WDOG_STCTRLH_IRQRSTEN. */
230 #define BF_WDOG_STCTRLH_IRQRSTEN(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_STCTRLH_IRQRSTEN) & BM_WDOG_STCTRLH_IRQRSTEN)
232 /*! @brief Set the IRQRSTEN field to a new value. */
233 #define BW_WDOG_STCTRLH_IRQRSTEN(x, v) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_IRQRSTEN) = (v))
237 * @name Register WDOG_STCTRLH, field WINEN[3] (RW)
239 * Enables Windowing mode.
242 * - 0 - Windowing mode is disabled.
243 * - 1 - Windowing mode is enabled.
246 #define BP_WDOG_STCTRLH_WINEN (3U) /*!< Bit position for WDOG_STCTRLH_WINEN. */
247 #define BM_WDOG_STCTRLH_WINEN (0x0008U) /*!< Bit mask for WDOG_STCTRLH_WINEN. */
248 #define BS_WDOG_STCTRLH_WINEN (1U) /*!< Bit field size in bits for WDOG_STCTRLH_WINEN. */
250 /*! @brief Read current value of the WDOG_STCTRLH_WINEN field. */
251 #define BR_WDOG_STCTRLH_WINEN(x) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_WINEN))
253 /*! @brief Format value for bitfield WDOG_STCTRLH_WINEN. */
254 #define BF_WDOG_STCTRLH_WINEN(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_STCTRLH_WINEN) & BM_WDOG_STCTRLH_WINEN)
256 /*! @brief Set the WINEN field to a new value. */
257 #define BW_WDOG_STCTRLH_WINEN(x, v) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_WINEN) = (v))
261 * @name Register WDOG_STCTRLH, field ALLOWUPDATE[4] (RW)
263 * Enables updates to watchdog write-once registers, after the reset-triggered
264 * initial configuration window (WCT) closes, through unlock sequence.
267 * - 0 - No further updates allowed to WDOG write-once registers.
268 * - 1 - WDOG write-once registers can be unlocked for updating.
271 #define BP_WDOG_STCTRLH_ALLOWUPDATE (4U) /*!< Bit position for WDOG_STCTRLH_ALLOWUPDATE. */
272 #define BM_WDOG_STCTRLH_ALLOWUPDATE (0x0010U) /*!< Bit mask for WDOG_STCTRLH_ALLOWUPDATE. */
273 #define BS_WDOG_STCTRLH_ALLOWUPDATE (1U) /*!< Bit field size in bits for WDOG_STCTRLH_ALLOWUPDATE. */
275 /*! @brief Read current value of the WDOG_STCTRLH_ALLOWUPDATE field. */
276 #define BR_WDOG_STCTRLH_ALLOWUPDATE(x) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_ALLOWUPDATE))
278 /*! @brief Format value for bitfield WDOG_STCTRLH_ALLOWUPDATE. */
279 #define BF_WDOG_STCTRLH_ALLOWUPDATE(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_STCTRLH_ALLOWUPDATE) & BM_WDOG_STCTRLH_ALLOWUPDATE)
281 /*! @brief Set the ALLOWUPDATE field to a new value. */
282 #define BW_WDOG_STCTRLH_ALLOWUPDATE(x, v) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_ALLOWUPDATE) = (v))
286 * @name Register WDOG_STCTRLH, field DBGEN[5] (RW)
288 * Enables or disables WDOG in Debug mode.
291 * - 0 - WDOG is disabled in CPU Debug mode.
292 * - 1 - WDOG is enabled in CPU Debug mode.
295 #define BP_WDOG_STCTRLH_DBGEN (5U) /*!< Bit position for WDOG_STCTRLH_DBGEN. */
296 #define BM_WDOG_STCTRLH_DBGEN (0x0020U) /*!< Bit mask for WDOG_STCTRLH_DBGEN. */
297 #define BS_WDOG_STCTRLH_DBGEN (1U) /*!< Bit field size in bits for WDOG_STCTRLH_DBGEN. */
299 /*! @brief Read current value of the WDOG_STCTRLH_DBGEN field. */
300 #define BR_WDOG_STCTRLH_DBGEN(x) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_DBGEN))
302 /*! @brief Format value for bitfield WDOG_STCTRLH_DBGEN. */
303 #define BF_WDOG_STCTRLH_DBGEN(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_STCTRLH_DBGEN) & BM_WDOG_STCTRLH_DBGEN)
305 /*! @brief Set the DBGEN field to a new value. */
306 #define BW_WDOG_STCTRLH_DBGEN(x, v) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_DBGEN) = (v))
310 * @name Register WDOG_STCTRLH, field STOPEN[6] (RW)
312 * Enables or disables WDOG in Stop mode.
315 * - 0 - WDOG is disabled in CPU Stop mode.
316 * - 1 - WDOG is enabled in CPU Stop mode.
319 #define BP_WDOG_STCTRLH_STOPEN (6U) /*!< Bit position for WDOG_STCTRLH_STOPEN. */
320 #define BM_WDOG_STCTRLH_STOPEN (0x0040U) /*!< Bit mask for WDOG_STCTRLH_STOPEN. */
321 #define BS_WDOG_STCTRLH_STOPEN (1U) /*!< Bit field size in bits for WDOG_STCTRLH_STOPEN. */
323 /*! @brief Read current value of the WDOG_STCTRLH_STOPEN field. */
324 #define BR_WDOG_STCTRLH_STOPEN(x) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_STOPEN))
326 /*! @brief Format value for bitfield WDOG_STCTRLH_STOPEN. */
327 #define BF_WDOG_STCTRLH_STOPEN(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_STCTRLH_STOPEN) & BM_WDOG_STCTRLH_STOPEN)
329 /*! @brief Set the STOPEN field to a new value. */
330 #define BW_WDOG_STCTRLH_STOPEN(x, v) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_STOPEN) = (v))
334 * @name Register WDOG_STCTRLH, field WAITEN[7] (RW)
336 * Enables or disables WDOG in Wait mode.
339 * - 0 - WDOG is disabled in CPU Wait mode.
340 * - 1 - WDOG is enabled in CPU Wait mode.
343 #define BP_WDOG_STCTRLH_WAITEN (7U) /*!< Bit position for WDOG_STCTRLH_WAITEN. */
344 #define BM_WDOG_STCTRLH_WAITEN (0x0080U) /*!< Bit mask for WDOG_STCTRLH_WAITEN. */
345 #define BS_WDOG_STCTRLH_WAITEN (1U) /*!< Bit field size in bits for WDOG_STCTRLH_WAITEN. */
347 /*! @brief Read current value of the WDOG_STCTRLH_WAITEN field. */
348 #define BR_WDOG_STCTRLH_WAITEN(x) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_WAITEN))
350 /*! @brief Format value for bitfield WDOG_STCTRLH_WAITEN. */
351 #define BF_WDOG_STCTRLH_WAITEN(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_STCTRLH_WAITEN) & BM_WDOG_STCTRLH_WAITEN)
353 /*! @brief Set the WAITEN field to a new value. */
354 #define BW_WDOG_STCTRLH_WAITEN(x, v) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_WAITEN) = (v))
358 * @name Register WDOG_STCTRLH, field TESTWDOG[10] (RW)
360 * Puts the watchdog in the functional test mode. In this mode, the watchdog
361 * timer and the associated compare and reset generation logic is tested for correct
362 * operation. The clock for the timer is switched from the main watchdog clock
363 * to the fast clock input for watchdog functional test. The TESTSEL bit selects
364 * the test to be run.
367 #define BP_WDOG_STCTRLH_TESTWDOG (10U) /*!< Bit position for WDOG_STCTRLH_TESTWDOG. */
368 #define BM_WDOG_STCTRLH_TESTWDOG (0x0400U) /*!< Bit mask for WDOG_STCTRLH_TESTWDOG. */
369 #define BS_WDOG_STCTRLH_TESTWDOG (1U) /*!< Bit field size in bits for WDOG_STCTRLH_TESTWDOG. */
371 /*! @brief Read current value of the WDOG_STCTRLH_TESTWDOG field. */
372 #define BR_WDOG_STCTRLH_TESTWDOG(x) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_TESTWDOG))
374 /*! @brief Format value for bitfield WDOG_STCTRLH_TESTWDOG. */
375 #define BF_WDOG_STCTRLH_TESTWDOG(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_STCTRLH_TESTWDOG) & BM_WDOG_STCTRLH_TESTWDOG)
377 /*! @brief Set the TESTWDOG field to a new value. */
378 #define BW_WDOG_STCTRLH_TESTWDOG(x, v) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_TESTWDOG) = (v))
382 * @name Register WDOG_STCTRLH, field TESTSEL[11] (RW)
384 * Effective only if TESTWDOG is set. Selects the test to be run on the watchdog
388 * - 0 - Quick test. The timer runs in normal operation. You can load a small
389 * time-out value to do a quick test.
390 * - 1 - Byte test. Puts the timer in the byte test mode where individual bytes
391 * of the timer are enabled for operation and are compared for time-out
392 * against the corresponding byte of the programmed time-out value. Select the
393 * byte through BYTESEL[1:0] for testing.
396 #define BP_WDOG_STCTRLH_TESTSEL (11U) /*!< Bit position for WDOG_STCTRLH_TESTSEL. */
397 #define BM_WDOG_STCTRLH_TESTSEL (0x0800U) /*!< Bit mask for WDOG_STCTRLH_TESTSEL. */
398 #define BS_WDOG_STCTRLH_TESTSEL (1U) /*!< Bit field size in bits for WDOG_STCTRLH_TESTSEL. */
400 /*! @brief Read current value of the WDOG_STCTRLH_TESTSEL field. */
401 #define BR_WDOG_STCTRLH_TESTSEL(x) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_TESTSEL))
403 /*! @brief Format value for bitfield WDOG_STCTRLH_TESTSEL. */
404 #define BF_WDOG_STCTRLH_TESTSEL(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_STCTRLH_TESTSEL) & BM_WDOG_STCTRLH_TESTSEL)
406 /*! @brief Set the TESTSEL field to a new value. */
407 #define BW_WDOG_STCTRLH_TESTSEL(x, v) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_TESTSEL) = (v))
411 * @name Register WDOG_STCTRLH, field BYTESEL[13:12] (RW)
413 * This 2-bit field selects the byte to be tested when the watchdog is in the
417 * - 00 - Byte 0 selected
418 * - 01 - Byte 1 selected
419 * - 10 - Byte 2 selected
420 * - 11 - Byte 3 selected
423 #define BP_WDOG_STCTRLH_BYTESEL (12U) /*!< Bit position for WDOG_STCTRLH_BYTESEL. */
424 #define BM_WDOG_STCTRLH_BYTESEL (0x3000U) /*!< Bit mask for WDOG_STCTRLH_BYTESEL. */
425 #define BS_WDOG_STCTRLH_BYTESEL (2U) /*!< Bit field size in bits for WDOG_STCTRLH_BYTESEL. */
427 /*! @brief Read current value of the WDOG_STCTRLH_BYTESEL field. */
428 #define BR_WDOG_STCTRLH_BYTESEL(x) (HW_WDOG_STCTRLH(x).B.BYTESEL)
430 /*! @brief Format value for bitfield WDOG_STCTRLH_BYTESEL. */
431 #define BF_WDOG_STCTRLH_BYTESEL(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_STCTRLH_BYTESEL) & BM_WDOG_STCTRLH_BYTESEL)
433 /*! @brief Set the BYTESEL field to a new value. */
434 #define BW_WDOG_STCTRLH_BYTESEL(x, v) (HW_WDOG_STCTRLH_WR(x, (HW_WDOG_STCTRLH_RD(x) & ~BM_WDOG_STCTRLH_BYTESEL) | BF_WDOG_STCTRLH_BYTESEL(v)))
438 * @name Register WDOG_STCTRLH, field DISTESTWDOG[14] (RW)
440 * Allows the WDOG's functional test mode to be disabled permanently. After it
441 * is set, it can only be cleared by a reset. It cannot be unlocked for editing
445 * - 0 - WDOG functional test mode is not disabled.
446 * - 1 - WDOG functional test mode is disabled permanently until reset.
449 #define BP_WDOG_STCTRLH_DISTESTWDOG (14U) /*!< Bit position for WDOG_STCTRLH_DISTESTWDOG. */
450 #define BM_WDOG_STCTRLH_DISTESTWDOG (0x4000U) /*!< Bit mask for WDOG_STCTRLH_DISTESTWDOG. */
451 #define BS_WDOG_STCTRLH_DISTESTWDOG (1U) /*!< Bit field size in bits for WDOG_STCTRLH_DISTESTWDOG. */
453 /*! @brief Read current value of the WDOG_STCTRLH_DISTESTWDOG field. */
454 #define BR_WDOG_STCTRLH_DISTESTWDOG(x) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_DISTESTWDOG))
456 /*! @brief Format value for bitfield WDOG_STCTRLH_DISTESTWDOG. */
457 #define BF_WDOG_STCTRLH_DISTESTWDOG(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_STCTRLH_DISTESTWDOG) & BM_WDOG_STCTRLH_DISTESTWDOG)
459 /*! @brief Set the DISTESTWDOG field to a new value. */
460 #define BW_WDOG_STCTRLH_DISTESTWDOG(x, v) (BITBAND_ACCESS16(HW_WDOG_STCTRLH_ADDR(x), BP_WDOG_STCTRLH_DISTESTWDOG) = (v))
463 /*******************************************************************************
464 * HW_WDOG_STCTRLL - Watchdog Status and Control Register Low
465 ******************************************************************************/
468 * @brief HW_WDOG_STCTRLL - Watchdog Status and Control Register Low (RW)
470 * Reset value: 0x0001U
472 typedef union _hw_wdog_stctrll
475 struct _hw_wdog_stctrll_bitfields
477 uint16_t RESERVED0 : 15; /*!< [14:0] */
478 uint16_t INTFLG : 1; /*!< [15] */
483 * @name Constants and macros for entire WDOG_STCTRLL register
486 #define HW_WDOG_STCTRLL_ADDR(x) ((x) + 0x2U)
488 #define HW_WDOG_STCTRLL(x) (*(__IO hw_wdog_stctrll_t *) HW_WDOG_STCTRLL_ADDR(x))
489 #define HW_WDOG_STCTRLL_RD(x) (HW_WDOG_STCTRLL(x).U)
490 #define HW_WDOG_STCTRLL_WR(x, v) (HW_WDOG_STCTRLL(x).U = (v))
491 #define HW_WDOG_STCTRLL_SET(x, v) (HW_WDOG_STCTRLL_WR(x, HW_WDOG_STCTRLL_RD(x) | (v)))
492 #define HW_WDOG_STCTRLL_CLR(x, v) (HW_WDOG_STCTRLL_WR(x, HW_WDOG_STCTRLL_RD(x) & ~(v)))
493 #define HW_WDOG_STCTRLL_TOG(x, v) (HW_WDOG_STCTRLL_WR(x, HW_WDOG_STCTRLL_RD(x) ^ (v)))
497 * Constants & macros for individual WDOG_STCTRLL bitfields
501 * @name Register WDOG_STCTRLL, field INTFLG[15] (RW)
503 * Interrupt flag. It is set when an exception occurs. IRQRSTEN = 1 is a
504 * precondition to set this flag. INTFLG = 1 results in an interrupt being issued
505 * followed by a reset, WCT later. The interrupt can be cleared by writing 1 to this
506 * bit. It also gets cleared on a system reset.
509 #define BP_WDOG_STCTRLL_INTFLG (15U) /*!< Bit position for WDOG_STCTRLL_INTFLG. */
510 #define BM_WDOG_STCTRLL_INTFLG (0x8000U) /*!< Bit mask for WDOG_STCTRLL_INTFLG. */
511 #define BS_WDOG_STCTRLL_INTFLG (1U) /*!< Bit field size in bits for WDOG_STCTRLL_INTFLG. */
513 /*! @brief Read current value of the WDOG_STCTRLL_INTFLG field. */
514 #define BR_WDOG_STCTRLL_INTFLG(x) (BITBAND_ACCESS16(HW_WDOG_STCTRLL_ADDR(x), BP_WDOG_STCTRLL_INTFLG))
516 /*! @brief Format value for bitfield WDOG_STCTRLL_INTFLG. */
517 #define BF_WDOG_STCTRLL_INTFLG(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_STCTRLL_INTFLG) & BM_WDOG_STCTRLL_INTFLG)
519 /*! @brief Set the INTFLG field to a new value. */
520 #define BW_WDOG_STCTRLL_INTFLG(x, v) (BITBAND_ACCESS16(HW_WDOG_STCTRLL_ADDR(x), BP_WDOG_STCTRLL_INTFLG) = (v))
523 /*******************************************************************************
524 * HW_WDOG_TOVALH - Watchdog Time-out Value Register High
525 ******************************************************************************/
528 * @brief HW_WDOG_TOVALH - Watchdog Time-out Value Register High (RW)
530 * Reset value: 0x004CU
532 typedef union _hw_wdog_tovalh
535 struct _hw_wdog_tovalh_bitfields
537 uint16_t TOVALHIGH : 16; /*!< [15:0] */
542 * @name Constants and macros for entire WDOG_TOVALH register
545 #define HW_WDOG_TOVALH_ADDR(x) ((x) + 0x4U)
547 #define HW_WDOG_TOVALH(x) (*(__IO hw_wdog_tovalh_t *) HW_WDOG_TOVALH_ADDR(x))
548 #define HW_WDOG_TOVALH_RD(x) (HW_WDOG_TOVALH(x).U)
549 #define HW_WDOG_TOVALH_WR(x, v) (HW_WDOG_TOVALH(x).U = (v))
550 #define HW_WDOG_TOVALH_SET(x, v) (HW_WDOG_TOVALH_WR(x, HW_WDOG_TOVALH_RD(x) | (v)))
551 #define HW_WDOG_TOVALH_CLR(x, v) (HW_WDOG_TOVALH_WR(x, HW_WDOG_TOVALH_RD(x) & ~(v)))
552 #define HW_WDOG_TOVALH_TOG(x, v) (HW_WDOG_TOVALH_WR(x, HW_WDOG_TOVALH_RD(x) ^ (v)))
556 * Constants & macros for individual WDOG_TOVALH bitfields
560 * @name Register WDOG_TOVALH, field TOVALHIGH[15:0] (RW)
562 * Defines the upper 16 bits of the 32-bit time-out value for the watchdog
563 * timer. It is defined in terms of cycles of the watchdog clock.
566 #define BP_WDOG_TOVALH_TOVALHIGH (0U) /*!< Bit position for WDOG_TOVALH_TOVALHIGH. */
567 #define BM_WDOG_TOVALH_TOVALHIGH (0xFFFFU) /*!< Bit mask for WDOG_TOVALH_TOVALHIGH. */
568 #define BS_WDOG_TOVALH_TOVALHIGH (16U) /*!< Bit field size in bits for WDOG_TOVALH_TOVALHIGH. */
570 /*! @brief Read current value of the WDOG_TOVALH_TOVALHIGH field. */
571 #define BR_WDOG_TOVALH_TOVALHIGH(x) (HW_WDOG_TOVALH(x).U)
573 /*! @brief Format value for bitfield WDOG_TOVALH_TOVALHIGH. */
574 #define BF_WDOG_TOVALH_TOVALHIGH(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_TOVALH_TOVALHIGH) & BM_WDOG_TOVALH_TOVALHIGH)
576 /*! @brief Set the TOVALHIGH field to a new value. */
577 #define BW_WDOG_TOVALH_TOVALHIGH(x, v) (HW_WDOG_TOVALH_WR(x, v))
580 /*******************************************************************************
581 * HW_WDOG_TOVALL - Watchdog Time-out Value Register Low
582 ******************************************************************************/
585 * @brief HW_WDOG_TOVALL - Watchdog Time-out Value Register Low (RW)
587 * Reset value: 0x4B4CU
589 * The time-out value of the watchdog must be set to a minimum of four watchdog
590 * clock cycles. This is to take into account the delay in new settings taking
591 * effect in the watchdog clock domain.
593 typedef union _hw_wdog_tovall
596 struct _hw_wdog_tovall_bitfields
598 uint16_t TOVALLOW : 16; /*!< [15:0] */
603 * @name Constants and macros for entire WDOG_TOVALL register
606 #define HW_WDOG_TOVALL_ADDR(x) ((x) + 0x6U)
608 #define HW_WDOG_TOVALL(x) (*(__IO hw_wdog_tovall_t *) HW_WDOG_TOVALL_ADDR(x))
609 #define HW_WDOG_TOVALL_RD(x) (HW_WDOG_TOVALL(x).U)
610 #define HW_WDOG_TOVALL_WR(x, v) (HW_WDOG_TOVALL(x).U = (v))
611 #define HW_WDOG_TOVALL_SET(x, v) (HW_WDOG_TOVALL_WR(x, HW_WDOG_TOVALL_RD(x) | (v)))
612 #define HW_WDOG_TOVALL_CLR(x, v) (HW_WDOG_TOVALL_WR(x, HW_WDOG_TOVALL_RD(x) & ~(v)))
613 #define HW_WDOG_TOVALL_TOG(x, v) (HW_WDOG_TOVALL_WR(x, HW_WDOG_TOVALL_RD(x) ^ (v)))
617 * Constants & macros for individual WDOG_TOVALL bitfields
621 * @name Register WDOG_TOVALL, field TOVALLOW[15:0] (RW)
623 * Defines the lower 16 bits of the 32-bit time-out value for the watchdog
624 * timer. It is defined in terms of cycles of the watchdog clock.
627 #define BP_WDOG_TOVALL_TOVALLOW (0U) /*!< Bit position for WDOG_TOVALL_TOVALLOW. */
628 #define BM_WDOG_TOVALL_TOVALLOW (0xFFFFU) /*!< Bit mask for WDOG_TOVALL_TOVALLOW. */
629 #define BS_WDOG_TOVALL_TOVALLOW (16U) /*!< Bit field size in bits for WDOG_TOVALL_TOVALLOW. */
631 /*! @brief Read current value of the WDOG_TOVALL_TOVALLOW field. */
632 #define BR_WDOG_TOVALL_TOVALLOW(x) (HW_WDOG_TOVALL(x).U)
634 /*! @brief Format value for bitfield WDOG_TOVALL_TOVALLOW. */
635 #define BF_WDOG_TOVALL_TOVALLOW(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_TOVALL_TOVALLOW) & BM_WDOG_TOVALL_TOVALLOW)
637 /*! @brief Set the TOVALLOW field to a new value. */
638 #define BW_WDOG_TOVALL_TOVALLOW(x, v) (HW_WDOG_TOVALL_WR(x, v))
641 /*******************************************************************************
642 * HW_WDOG_WINH - Watchdog Window Register High
643 ******************************************************************************/
646 * @brief HW_WDOG_WINH - Watchdog Window Register High (RW)
648 * Reset value: 0x0000U
650 * You must set the Window Register value lower than the Time-out Value Register.
652 typedef union _hw_wdog_winh
655 struct _hw_wdog_winh_bitfields
657 uint16_t WINHIGH : 16; /*!< [15:0] */
662 * @name Constants and macros for entire WDOG_WINH register
665 #define HW_WDOG_WINH_ADDR(x) ((x) + 0x8U)
667 #define HW_WDOG_WINH(x) (*(__IO hw_wdog_winh_t *) HW_WDOG_WINH_ADDR(x))
668 #define HW_WDOG_WINH_RD(x) (HW_WDOG_WINH(x).U)
669 #define HW_WDOG_WINH_WR(x, v) (HW_WDOG_WINH(x).U = (v))
670 #define HW_WDOG_WINH_SET(x, v) (HW_WDOG_WINH_WR(x, HW_WDOG_WINH_RD(x) | (v)))
671 #define HW_WDOG_WINH_CLR(x, v) (HW_WDOG_WINH_WR(x, HW_WDOG_WINH_RD(x) & ~(v)))
672 #define HW_WDOG_WINH_TOG(x, v) (HW_WDOG_WINH_WR(x, HW_WDOG_WINH_RD(x) ^ (v)))
676 * Constants & macros for individual WDOG_WINH bitfields
680 * @name Register WDOG_WINH, field WINHIGH[15:0] (RW)
682 * Defines the upper 16 bits of the 32-bit window for the windowed mode of
683 * operation of the watchdog. It is defined in terms of cycles of the watchdog clock.
684 * In this mode, the watchdog can be refreshed only when the timer has reached a
685 * value greater than or equal to this window length. A refresh outside this
686 * window resets the system or if IRQRSTEN is set, it interrupts and then resets the
690 #define BP_WDOG_WINH_WINHIGH (0U) /*!< Bit position for WDOG_WINH_WINHIGH. */
691 #define BM_WDOG_WINH_WINHIGH (0xFFFFU) /*!< Bit mask for WDOG_WINH_WINHIGH. */
692 #define BS_WDOG_WINH_WINHIGH (16U) /*!< Bit field size in bits for WDOG_WINH_WINHIGH. */
694 /*! @brief Read current value of the WDOG_WINH_WINHIGH field. */
695 #define BR_WDOG_WINH_WINHIGH(x) (HW_WDOG_WINH(x).U)
697 /*! @brief Format value for bitfield WDOG_WINH_WINHIGH. */
698 #define BF_WDOG_WINH_WINHIGH(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_WINH_WINHIGH) & BM_WDOG_WINH_WINHIGH)
700 /*! @brief Set the WINHIGH field to a new value. */
701 #define BW_WDOG_WINH_WINHIGH(x, v) (HW_WDOG_WINH_WR(x, v))
704 /*******************************************************************************
705 * HW_WDOG_WINL - Watchdog Window Register Low
706 ******************************************************************************/
709 * @brief HW_WDOG_WINL - Watchdog Window Register Low (RW)
711 * Reset value: 0x0010U
713 * You must set the Window Register value lower than the Time-out Value Register.
715 typedef union _hw_wdog_winl
718 struct _hw_wdog_winl_bitfields
720 uint16_t WINLOW : 16; /*!< [15:0] */
725 * @name Constants and macros for entire WDOG_WINL register
728 #define HW_WDOG_WINL_ADDR(x) ((x) + 0xAU)
730 #define HW_WDOG_WINL(x) (*(__IO hw_wdog_winl_t *) HW_WDOG_WINL_ADDR(x))
731 #define HW_WDOG_WINL_RD(x) (HW_WDOG_WINL(x).U)
732 #define HW_WDOG_WINL_WR(x, v) (HW_WDOG_WINL(x).U = (v))
733 #define HW_WDOG_WINL_SET(x, v) (HW_WDOG_WINL_WR(x, HW_WDOG_WINL_RD(x) | (v)))
734 #define HW_WDOG_WINL_CLR(x, v) (HW_WDOG_WINL_WR(x, HW_WDOG_WINL_RD(x) & ~(v)))
735 #define HW_WDOG_WINL_TOG(x, v) (HW_WDOG_WINL_WR(x, HW_WDOG_WINL_RD(x) ^ (v)))
739 * Constants & macros for individual WDOG_WINL bitfields
743 * @name Register WDOG_WINL, field WINLOW[15:0] (RW)
745 * Defines the lower 16 bits of the 32-bit window for the windowed mode of
746 * operation of the watchdog. It is defined in terms of cycles of the pre-scaled
747 * watchdog clock. In this mode, the watchdog can be refreshed only when the timer
748 * reaches a value greater than or equal to this window length value. A refresh
749 * outside of this window resets the system or if IRQRSTEN is set, it interrupts and
750 * then resets the system.
753 #define BP_WDOG_WINL_WINLOW (0U) /*!< Bit position for WDOG_WINL_WINLOW. */
754 #define BM_WDOG_WINL_WINLOW (0xFFFFU) /*!< Bit mask for WDOG_WINL_WINLOW. */
755 #define BS_WDOG_WINL_WINLOW (16U) /*!< Bit field size in bits for WDOG_WINL_WINLOW. */
757 /*! @brief Read current value of the WDOG_WINL_WINLOW field. */
758 #define BR_WDOG_WINL_WINLOW(x) (HW_WDOG_WINL(x).U)
760 /*! @brief Format value for bitfield WDOG_WINL_WINLOW. */
761 #define BF_WDOG_WINL_WINLOW(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_WINL_WINLOW) & BM_WDOG_WINL_WINLOW)
763 /*! @brief Set the WINLOW field to a new value. */
764 #define BW_WDOG_WINL_WINLOW(x, v) (HW_WDOG_WINL_WR(x, v))
767 /*******************************************************************************
768 * HW_WDOG_REFRESH - Watchdog Refresh register
769 ******************************************************************************/
772 * @brief HW_WDOG_REFRESH - Watchdog Refresh register (RW)
774 * Reset value: 0xB480U
776 typedef union _hw_wdog_refresh
779 struct _hw_wdog_refresh_bitfields
781 uint16_t WDOGREFRESH : 16; /*!< [15:0] */
786 * @name Constants and macros for entire WDOG_REFRESH register
789 #define HW_WDOG_REFRESH_ADDR(x) ((x) + 0xCU)
791 #define HW_WDOG_REFRESH(x) (*(__IO hw_wdog_refresh_t *) HW_WDOG_REFRESH_ADDR(x))
792 #define HW_WDOG_REFRESH_RD(x) (HW_WDOG_REFRESH(x).U)
793 #define HW_WDOG_REFRESH_WR(x, v) (HW_WDOG_REFRESH(x).U = (v))
794 #define HW_WDOG_REFRESH_SET(x, v) (HW_WDOG_REFRESH_WR(x, HW_WDOG_REFRESH_RD(x) | (v)))
795 #define HW_WDOG_REFRESH_CLR(x, v) (HW_WDOG_REFRESH_WR(x, HW_WDOG_REFRESH_RD(x) & ~(v)))
796 #define HW_WDOG_REFRESH_TOG(x, v) (HW_WDOG_REFRESH_WR(x, HW_WDOG_REFRESH_RD(x) ^ (v)))
800 * Constants & macros for individual WDOG_REFRESH bitfields
804 * @name Register WDOG_REFRESH, field WDOGREFRESH[15:0] (RW)
806 * Watchdog refresh register. A sequence of 0xA602 followed by 0xB480 within 20
807 * bus clock cycles written to this register refreshes the WDOG and prevents it
808 * from resetting the system. Writing a value other than the above mentioned
809 * sequence or if the sequence is longer than 20 bus cycles, resets the system, or if
810 * IRQRSTEN is set, it interrupts and then resets the system.
813 #define BP_WDOG_REFRESH_WDOGREFRESH (0U) /*!< Bit position for WDOG_REFRESH_WDOGREFRESH. */
814 #define BM_WDOG_REFRESH_WDOGREFRESH (0xFFFFU) /*!< Bit mask for WDOG_REFRESH_WDOGREFRESH. */
815 #define BS_WDOG_REFRESH_WDOGREFRESH (16U) /*!< Bit field size in bits for WDOG_REFRESH_WDOGREFRESH. */
817 /*! @brief Read current value of the WDOG_REFRESH_WDOGREFRESH field. */
818 #define BR_WDOG_REFRESH_WDOGREFRESH(x) (HW_WDOG_REFRESH(x).U)
820 /*! @brief Format value for bitfield WDOG_REFRESH_WDOGREFRESH. */
821 #define BF_WDOG_REFRESH_WDOGREFRESH(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_REFRESH_WDOGREFRESH) & BM_WDOG_REFRESH_WDOGREFRESH)
823 /*! @brief Set the WDOGREFRESH field to a new value. */
824 #define BW_WDOG_REFRESH_WDOGREFRESH(x, v) (HW_WDOG_REFRESH_WR(x, v))
827 /*******************************************************************************
828 * HW_WDOG_UNLOCK - Watchdog Unlock register
829 ******************************************************************************/
832 * @brief HW_WDOG_UNLOCK - Watchdog Unlock register (RW)
834 * Reset value: 0xD928U
836 typedef union _hw_wdog_unlock
839 struct _hw_wdog_unlock_bitfields
841 uint16_t WDOGUNLOCK : 16; /*!< [15:0] */
846 * @name Constants and macros for entire WDOG_UNLOCK register
849 #define HW_WDOG_UNLOCK_ADDR(x) ((x) + 0xEU)
851 #define HW_WDOG_UNLOCK(x) (*(__IO hw_wdog_unlock_t *) HW_WDOG_UNLOCK_ADDR(x))
852 #define HW_WDOG_UNLOCK_RD(x) (HW_WDOG_UNLOCK(x).U)
853 #define HW_WDOG_UNLOCK_WR(x, v) (HW_WDOG_UNLOCK(x).U = (v))
854 #define HW_WDOG_UNLOCK_SET(x, v) (HW_WDOG_UNLOCK_WR(x, HW_WDOG_UNLOCK_RD(x) | (v)))
855 #define HW_WDOG_UNLOCK_CLR(x, v) (HW_WDOG_UNLOCK_WR(x, HW_WDOG_UNLOCK_RD(x) & ~(v)))
856 #define HW_WDOG_UNLOCK_TOG(x, v) (HW_WDOG_UNLOCK_WR(x, HW_WDOG_UNLOCK_RD(x) ^ (v)))
860 * Constants & macros for individual WDOG_UNLOCK bitfields
864 * @name Register WDOG_UNLOCK, field WDOGUNLOCK[15:0] (RW)
866 * Writing the unlock sequence values to this register to makes the watchdog
867 * write-once registers writable again. The required unlock sequence is 0xC520
868 * followed by 0xD928 within 20 bus clock cycles. A valid unlock sequence opens a
869 * window equal in length to the WCT within which you can update the registers.
870 * Writing a value other than the above mentioned sequence or if the sequence is
871 * longer than 20 bus cycles, resets the system or if IRQRSTEN is set, it interrupts
872 * and then resets the system. The unlock sequence is effective only if
873 * ALLOWUPDATE is set.
876 #define BP_WDOG_UNLOCK_WDOGUNLOCK (0U) /*!< Bit position for WDOG_UNLOCK_WDOGUNLOCK. */
877 #define BM_WDOG_UNLOCK_WDOGUNLOCK (0xFFFFU) /*!< Bit mask for WDOG_UNLOCK_WDOGUNLOCK. */
878 #define BS_WDOG_UNLOCK_WDOGUNLOCK (16U) /*!< Bit field size in bits for WDOG_UNLOCK_WDOGUNLOCK. */
880 /*! @brief Read current value of the WDOG_UNLOCK_WDOGUNLOCK field. */
881 #define BR_WDOG_UNLOCK_WDOGUNLOCK(x) (HW_WDOG_UNLOCK(x).U)
883 /*! @brief Format value for bitfield WDOG_UNLOCK_WDOGUNLOCK. */
884 #define BF_WDOG_UNLOCK_WDOGUNLOCK(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_UNLOCK_WDOGUNLOCK) & BM_WDOG_UNLOCK_WDOGUNLOCK)
886 /*! @brief Set the WDOGUNLOCK field to a new value. */
887 #define BW_WDOG_UNLOCK_WDOGUNLOCK(x, v) (HW_WDOG_UNLOCK_WR(x, v))
890 /*******************************************************************************
891 * HW_WDOG_TMROUTH - Watchdog Timer Output Register High
892 ******************************************************************************/
895 * @brief HW_WDOG_TMROUTH - Watchdog Timer Output Register High (RW)
897 * Reset value: 0x0000U
899 typedef union _hw_wdog_tmrouth
902 struct _hw_wdog_tmrouth_bitfields
904 uint16_t TIMEROUTHIGH : 16; /*!< [15:0] */
909 * @name Constants and macros for entire WDOG_TMROUTH register
912 #define HW_WDOG_TMROUTH_ADDR(x) ((x) + 0x10U)
914 #define HW_WDOG_TMROUTH(x) (*(__IO hw_wdog_tmrouth_t *) HW_WDOG_TMROUTH_ADDR(x))
915 #define HW_WDOG_TMROUTH_RD(x) (HW_WDOG_TMROUTH(x).U)
916 #define HW_WDOG_TMROUTH_WR(x, v) (HW_WDOG_TMROUTH(x).U = (v))
917 #define HW_WDOG_TMROUTH_SET(x, v) (HW_WDOG_TMROUTH_WR(x, HW_WDOG_TMROUTH_RD(x) | (v)))
918 #define HW_WDOG_TMROUTH_CLR(x, v) (HW_WDOG_TMROUTH_WR(x, HW_WDOG_TMROUTH_RD(x) & ~(v)))
919 #define HW_WDOG_TMROUTH_TOG(x, v) (HW_WDOG_TMROUTH_WR(x, HW_WDOG_TMROUTH_RD(x) ^ (v)))
923 * Constants & macros for individual WDOG_TMROUTH bitfields
927 * @name Register WDOG_TMROUTH, field TIMEROUTHIGH[15:0] (RW)
929 * Shows the value of the upper 16 bits of the watchdog timer.
932 #define BP_WDOG_TMROUTH_TIMEROUTHIGH (0U) /*!< Bit position for WDOG_TMROUTH_TIMEROUTHIGH. */
933 #define BM_WDOG_TMROUTH_TIMEROUTHIGH (0xFFFFU) /*!< Bit mask for WDOG_TMROUTH_TIMEROUTHIGH. */
934 #define BS_WDOG_TMROUTH_TIMEROUTHIGH (16U) /*!< Bit field size in bits for WDOG_TMROUTH_TIMEROUTHIGH. */
936 /*! @brief Read current value of the WDOG_TMROUTH_TIMEROUTHIGH field. */
937 #define BR_WDOG_TMROUTH_TIMEROUTHIGH(x) (HW_WDOG_TMROUTH(x).U)
939 /*! @brief Format value for bitfield WDOG_TMROUTH_TIMEROUTHIGH. */
940 #define BF_WDOG_TMROUTH_TIMEROUTHIGH(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_TMROUTH_TIMEROUTHIGH) & BM_WDOG_TMROUTH_TIMEROUTHIGH)
942 /*! @brief Set the TIMEROUTHIGH field to a new value. */
943 #define BW_WDOG_TMROUTH_TIMEROUTHIGH(x, v) (HW_WDOG_TMROUTH_WR(x, v))
946 /*******************************************************************************
947 * HW_WDOG_TMROUTL - Watchdog Timer Output Register Low
948 ******************************************************************************/
951 * @brief HW_WDOG_TMROUTL - Watchdog Timer Output Register Low (RW)
953 * Reset value: 0x0000U
955 * During Stop mode, the WDOG_TIMER_OUT will be caught at the pre-stop value of
956 * the watchdog timer. After exiting Stop mode, a maximum delay of 1 WDOG_CLK
957 * cycle + 3 bus clock cycles will occur before the WDOG_TIMER_OUT starts following
958 * the watchdog timer.
960 typedef union _hw_wdog_tmroutl
963 struct _hw_wdog_tmroutl_bitfields
965 uint16_t TIMEROUTLOW : 16; /*!< [15:0] */
970 * @name Constants and macros for entire WDOG_TMROUTL register
973 #define HW_WDOG_TMROUTL_ADDR(x) ((x) + 0x12U)
975 #define HW_WDOG_TMROUTL(x) (*(__IO hw_wdog_tmroutl_t *) HW_WDOG_TMROUTL_ADDR(x))
976 #define HW_WDOG_TMROUTL_RD(x) (HW_WDOG_TMROUTL(x).U)
977 #define HW_WDOG_TMROUTL_WR(x, v) (HW_WDOG_TMROUTL(x).U = (v))
978 #define HW_WDOG_TMROUTL_SET(x, v) (HW_WDOG_TMROUTL_WR(x, HW_WDOG_TMROUTL_RD(x) | (v)))
979 #define HW_WDOG_TMROUTL_CLR(x, v) (HW_WDOG_TMROUTL_WR(x, HW_WDOG_TMROUTL_RD(x) & ~(v)))
980 #define HW_WDOG_TMROUTL_TOG(x, v) (HW_WDOG_TMROUTL_WR(x, HW_WDOG_TMROUTL_RD(x) ^ (v)))
984 * Constants & macros for individual WDOG_TMROUTL bitfields
988 * @name Register WDOG_TMROUTL, field TIMEROUTLOW[15:0] (RW)
990 * Shows the value of the lower 16 bits of the watchdog timer.
993 #define BP_WDOG_TMROUTL_TIMEROUTLOW (0U) /*!< Bit position for WDOG_TMROUTL_TIMEROUTLOW. */
994 #define BM_WDOG_TMROUTL_TIMEROUTLOW (0xFFFFU) /*!< Bit mask for WDOG_TMROUTL_TIMEROUTLOW. */
995 #define BS_WDOG_TMROUTL_TIMEROUTLOW (16U) /*!< Bit field size in bits for WDOG_TMROUTL_TIMEROUTLOW. */
997 /*! @brief Read current value of the WDOG_TMROUTL_TIMEROUTLOW field. */
998 #define BR_WDOG_TMROUTL_TIMEROUTLOW(x) (HW_WDOG_TMROUTL(x).U)
1000 /*! @brief Format value for bitfield WDOG_TMROUTL_TIMEROUTLOW. */
1001 #define BF_WDOG_TMROUTL_TIMEROUTLOW(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_TMROUTL_TIMEROUTLOW) & BM_WDOG_TMROUTL_TIMEROUTLOW)
1003 /*! @brief Set the TIMEROUTLOW field to a new value. */
1004 #define BW_WDOG_TMROUTL_TIMEROUTLOW(x, v) (HW_WDOG_TMROUTL_WR(x, v))
1007 /*******************************************************************************
1008 * HW_WDOG_RSTCNT - Watchdog Reset Count register
1009 ******************************************************************************/
1012 * @brief HW_WDOG_RSTCNT - Watchdog Reset Count register (RW)
1014 * Reset value: 0x0000U
1016 typedef union _hw_wdog_rstcnt
1019 struct _hw_wdog_rstcnt_bitfields
1021 uint16_t RSTCNT : 16; /*!< [15:0] */
1026 * @name Constants and macros for entire WDOG_RSTCNT register
1029 #define HW_WDOG_RSTCNT_ADDR(x) ((x) + 0x14U)
1031 #define HW_WDOG_RSTCNT(x) (*(__IO hw_wdog_rstcnt_t *) HW_WDOG_RSTCNT_ADDR(x))
1032 #define HW_WDOG_RSTCNT_RD(x) (HW_WDOG_RSTCNT(x).U)
1033 #define HW_WDOG_RSTCNT_WR(x, v) (HW_WDOG_RSTCNT(x).U = (v))
1034 #define HW_WDOG_RSTCNT_SET(x, v) (HW_WDOG_RSTCNT_WR(x, HW_WDOG_RSTCNT_RD(x) | (v)))
1035 #define HW_WDOG_RSTCNT_CLR(x, v) (HW_WDOG_RSTCNT_WR(x, HW_WDOG_RSTCNT_RD(x) & ~(v)))
1036 #define HW_WDOG_RSTCNT_TOG(x, v) (HW_WDOG_RSTCNT_WR(x, HW_WDOG_RSTCNT_RD(x) ^ (v)))
1040 * Constants & macros for individual WDOG_RSTCNT bitfields
1044 * @name Register WDOG_RSTCNT, field RSTCNT[15:0] (RW)
1046 * Counts the number of times the watchdog resets the system. This register is
1047 * reset only on a POR. Writing 1 to the bit to be cleared enables you to clear
1048 * the contents of this register.
1051 #define BP_WDOG_RSTCNT_RSTCNT (0U) /*!< Bit position for WDOG_RSTCNT_RSTCNT. */
1052 #define BM_WDOG_RSTCNT_RSTCNT (0xFFFFU) /*!< Bit mask for WDOG_RSTCNT_RSTCNT. */
1053 #define BS_WDOG_RSTCNT_RSTCNT (16U) /*!< Bit field size in bits for WDOG_RSTCNT_RSTCNT. */
1055 /*! @brief Read current value of the WDOG_RSTCNT_RSTCNT field. */
1056 #define BR_WDOG_RSTCNT_RSTCNT(x) (HW_WDOG_RSTCNT(x).U)
1058 /*! @brief Format value for bitfield WDOG_RSTCNT_RSTCNT. */
1059 #define BF_WDOG_RSTCNT_RSTCNT(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_RSTCNT_RSTCNT) & BM_WDOG_RSTCNT_RSTCNT)
1061 /*! @brief Set the RSTCNT field to a new value. */
1062 #define BW_WDOG_RSTCNT_RSTCNT(x, v) (HW_WDOG_RSTCNT_WR(x, v))
1065 /*******************************************************************************
1066 * HW_WDOG_PRESC - Watchdog Prescaler register
1067 ******************************************************************************/
1070 * @brief HW_WDOG_PRESC - Watchdog Prescaler register (RW)
1072 * Reset value: 0x0400U
1074 typedef union _hw_wdog_presc
1077 struct _hw_wdog_presc_bitfields
1079 uint16_t RESERVED0 : 8; /*!< [7:0] */
1080 uint16_t PRESCVAL : 3; /*!< [10:8] */
1081 uint16_t RESERVED1 : 5; /*!< [15:11] */
1086 * @name Constants and macros for entire WDOG_PRESC register
1089 #define HW_WDOG_PRESC_ADDR(x) ((x) + 0x16U)
1091 #define HW_WDOG_PRESC(x) (*(__IO hw_wdog_presc_t *) HW_WDOG_PRESC_ADDR(x))
1092 #define HW_WDOG_PRESC_RD(x) (HW_WDOG_PRESC(x).U)
1093 #define HW_WDOG_PRESC_WR(x, v) (HW_WDOG_PRESC(x).U = (v))
1094 #define HW_WDOG_PRESC_SET(x, v) (HW_WDOG_PRESC_WR(x, HW_WDOG_PRESC_RD(x) | (v)))
1095 #define HW_WDOG_PRESC_CLR(x, v) (HW_WDOG_PRESC_WR(x, HW_WDOG_PRESC_RD(x) & ~(v)))
1096 #define HW_WDOG_PRESC_TOG(x, v) (HW_WDOG_PRESC_WR(x, HW_WDOG_PRESC_RD(x) ^ (v)))
1100 * Constants & macros for individual WDOG_PRESC bitfields
1104 * @name Register WDOG_PRESC, field PRESCVAL[10:8] (RW)
1106 * 3-bit prescaler for the watchdog clock source. A value of zero indicates no
1107 * division of the input WDOG clock. The watchdog clock is divided by (PRESCVAL +
1108 * 1) to provide the prescaled WDOG_CLK.
1111 #define BP_WDOG_PRESC_PRESCVAL (8U) /*!< Bit position for WDOG_PRESC_PRESCVAL. */
1112 #define BM_WDOG_PRESC_PRESCVAL (0x0700U) /*!< Bit mask for WDOG_PRESC_PRESCVAL. */
1113 #define BS_WDOG_PRESC_PRESCVAL (3U) /*!< Bit field size in bits for WDOG_PRESC_PRESCVAL. */
1115 /*! @brief Read current value of the WDOG_PRESC_PRESCVAL field. */
1116 #define BR_WDOG_PRESC_PRESCVAL(x) (HW_WDOG_PRESC(x).B.PRESCVAL)
1118 /*! @brief Format value for bitfield WDOG_PRESC_PRESCVAL. */
1119 #define BF_WDOG_PRESC_PRESCVAL(v) ((uint16_t)((uint16_t)(v) << BP_WDOG_PRESC_PRESCVAL) & BM_WDOG_PRESC_PRESCVAL)
1121 /*! @brief Set the PRESCVAL field to a new value. */
1122 #define BW_WDOG_PRESC_PRESCVAL(x, v) (HW_WDOG_PRESC_WR(x, (HW_WDOG_PRESC_RD(x) & ~BM_WDOG_PRESC_PRESCVAL) | BF_WDOG_PRESC_PRESCVAL(v)))
1125 /*******************************************************************************
1126 * hw_wdog_t - module struct
1127 ******************************************************************************/
1129 * @brief All WDOG module registers.
1132 typedef struct _hw_wdog
1134 __IO hw_wdog_stctrlh_t STCTRLH; /*!< [0x0] Watchdog Status and Control Register High */
1135 __IO hw_wdog_stctrll_t STCTRLL; /*!< [0x2] Watchdog Status and Control Register Low */
1136 __IO hw_wdog_tovalh_t TOVALH; /*!< [0x4] Watchdog Time-out Value Register High */
1137 __IO hw_wdog_tovall_t TOVALL; /*!< [0x6] Watchdog Time-out Value Register Low */
1138 __IO hw_wdog_winh_t WINH; /*!< [0x8] Watchdog Window Register High */
1139 __IO hw_wdog_winl_t WINL; /*!< [0xA] Watchdog Window Register Low */
1140 __IO hw_wdog_refresh_t REFRESH; /*!< [0xC] Watchdog Refresh register */
1141 __IO hw_wdog_unlock_t UNLOCK; /*!< [0xE] Watchdog Unlock register */
1142 __IO hw_wdog_tmrouth_t TMROUTH; /*!< [0x10] Watchdog Timer Output Register High */
1143 __IO hw_wdog_tmroutl_t TMROUTL; /*!< [0x12] Watchdog Timer Output Register Low */
1144 __IO hw_wdog_rstcnt_t RSTCNT; /*!< [0x14] Watchdog Reset Count register */
1145 __IO hw_wdog_presc_t PRESC; /*!< [0x16] Watchdog Prescaler register */
1149 /*! @brief Macro to access all WDOG registers. */
1150 /*! @param x WDOG module instance base address. */
1151 /*! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct,
1152 * use the '&' operator, like <code>&HW_WDOG(WDOG_BASE)</code>. */
1153 #define HW_WDOG(x) (*(hw_wdog_t *)(x))
1155 #endif /* __HW_WDOG_REGISTERS_H__ */