1 /*
2  * Copyright (c) 2024 Microchip Technology Inc.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 #ifndef _MEC5_WDT_V2_H
7 #define _MEC5_WDT_V2_H
8 
9 /** @addtogroup Device_Peripheral_peripherals
10   * @{
11   */
12 
13 /**
14   * @brief Watch Dog Timer on 32KHz clock domain (MEC_WDT)
15   */
16 
17 typedef struct mec_wdt_regs {                   /*!< (@ 0x40000400) MEC_WDT Structure                                         */
18   __IOM uint32_t  LOAD;                         /*!< (@ 0x00000000) Value loaded into WDT counter upon start                   */
19   __IOM uint32_t  CTRL;                         /*!< (@ 0x00000004) WDT Control                                                */
20   __OM  uint32_t  KICK;                         /*!< (@ 0x00000008) WDT write only any value to reload counter                 */
21   __IM  uint32_t  COUNT;                        /*!< (@ 0x0000000C) WDT read only counter in units of 32KHz ticks              */
22   __IOM uint32_t  STATUS;                       /*!< (@ 0x00000010) WDT Status                                                 */
23   __IOM uint32_t  IEN;                          /*!< (@ 0x00000014) WDT interrupt enable                                       */
24 } MEC_WDT_Type;                                 /*!< Size = 24 (0x18)                                                          */
25 
26 /** @} */ /* End of group Device_Peripheral_peripherals */
27 
28 /** @addtogroup PosMask_peripherals
29   * @{
30   */
31 /* =========================================================  CTRL  ========================================================== */
32 #define MEC_WDT_CTRL_ENABLE_Pos           (0UL)                     /*!< ENABLE (Bit 0)                                        */
33 #define MEC_WDT_CTRL_ENABLE_Msk           (0x1UL)                   /*!< ENABLE (Bitfield-Mask: 0x01)                          */
34 #define MEC_WDT_CTRL_STALL_HTMR_Pos       (2UL)                     /*!< STALL_HTMR (Bit 2)                                    */
35 #define MEC_WDT_CTRL_STALL_HTMR_Msk       (0x4UL)                   /*!< STALL_HTMR (Bitfield-Mask: 0x01)                      */
36 #define MEC_WDT_CTRL_STALL_WKTMR_Pos      (3UL)                     /*!< STALL_WKTMR (Bit 3)                                   */
37 #define MEC_WDT_CTRL_STALL_WKTMR_Msk      (0x8UL)                   /*!< STALL_WKTMR (Bitfield-Mask: 0x01)                     */
38 #define MEC_WDT_CTRL_STALL_JTAG_Pos       (4UL)                     /*!< STALL_JTAG (Bit 4)                                    */
39 #define MEC_WDT_CTRL_STALL_JTAG_Msk       (0x10UL)                  /*!< STALL_JTAG (Bitfield-Mask: 0x01)                      */
40 #define MEC_WDT_CTRL_RST_MODE_INTR_Pos    (9UL)                     /*!< RST_MODE_INTR (Bit 9)                                 */
41 #define MEC_WDT_CTRL_RST_MODE_INTR_Msk    (0x200UL)                 /*!< RST_MODE_INTR (Bitfield-Mask: 0x01)                   */
42 /* ========================================================  STATUS  ========================================================= */
43 #define MEC_WDT_STATUS_ISTATUS_Pos        (0UL)                     /*!< ISTATUS (Bit 0)                                       */
44 #define MEC_WDT_STATUS_ISTATUS_Msk        (0x1UL)                   /*!< ISTATUS (Bitfield-Mask: 0x01)                         */
45 /* ==========================================================  IEN  ========================================================== */
46 #define MEC_WDT_IEN_INTREN_Pos            (0UL)                     /*!< INTREN (Bit 0)                                        */
47 #define MEC_WDT_IEN_INTREN_Msk            (0x1UL)                   /*!< INTREN (Bitfield-Mask: 0x01)                          */
48 
49 /** @} */ /* End of group PosMask_peripherals */
50 
51 /** @addtogroup EnumValue_peripherals
52   * @{
53   */
54 /* =========================================================  CTRL  ========================================================== */
55 /* ==============================================  MEC_WDT CTRL ENABLE [0..0]  ============================================== */
56 typedef enum {                                  /*!< MEC_WDT_CTRL_ENABLE                                                      */
57   MEC_WDT_CTRL_ENABLE_DIS             = 0,     /*!< DIS : Disables WDT                                                        */
58   MEC_WDT_CTRL_ENABLE_EN              = 1,     /*!< EN : Enables WDT                                                          */
59 } MEC_WDT_CTRL_ENABLE_Enum;
60 
61 /* ============================================  MEC_WDT CTRL STALL_HTMR [2..2]  ============================================ */
62 typedef enum {                                  /*!< MEC_WDT_CTRL_STALL_HTMR                                                  */
63   MEC_WDT_CTRL_STALL_HTMR_DIS         = 0,     /*!< DIS : Disables WDT count stall if any hibernation timer is running        */
64   MEC_WDT_CTRL_STALL_HTMR_EN          = 1,     /*!< EN : Enables WDT count stall if any hibernation timer is running          */
65 } MEC_WDT_CTRL_STALL_HTMR_Enum;
66 
67 /* ===========================================  MEC_WDT CTRL STALL_WKTMR [3..3]  ============================================ */
68 typedef enum {                                  /*!< MEC_WDT_CTRL_STALL_WKTMR                                                 */
69   MEC_WDT_CTRL_STALL_WKTMR_DIS        = 0,     /*!< DIS : Disables WDT count stall if the week timer is running               */
70   MEC_WDT_CTRL_STALL_WKTMR_EN         = 1,     /*!< EN : Enables WDT count stall if the week timer is running                 */
71 } MEC_WDT_CTRL_STALL_WKTMR_Enum;
72 
73 /* ============================================  MEC_WDT CTRL STALL_JTAG [4..4]  ============================================ */
74 typedef enum {                                  /*!< MEC_WDT_CTRL_STALL_JTAG                                                  */
75   MEC_WDT_CTRL_STALL_JTAG_DIS         = 0,     /*!< DIS : Disables WDT count stall if the any Core Debug halt/break
76                                                      is active                                                                 */
77   MEC_WDT_CTRL_STALL_JTAG_EN          = 1,     /*!< EN : Enables WDT count stall if the any Core Debug halt/break
78                                                      is active                                                                 */
79 } MEC_WDT_CTRL_STALL_JTAG_Enum;
80 
81 /* ==========================================  MEC_WDT CTRL RST_MODE_INTR [9..9]  =========================================== */
82 typedef enum {                                  /*!< MEC_WDT_CTRL_RST_MODE_INTR                                               */
83   MEC_WDT_CTRL_RST_MODE_INTR_RESET    = 0,     /*!< RESET : WDT asserts reset signal when WDT count down reaches
84                                                      0                                                                         */
85   MEC_WDT_CTRL_RST_MODE_INTR_RELOAD_IRQ = 1,   /*!< RELOAD_IRQ : Enables WDT generating an EC interrupt when WDT
86                                                      count down reaches 0 and reloads counter                                  */
87 } MEC_WDT_CTRL_RST_MODE_INTR_Enum;
88 
89 /* =========================================================  KICK  ========================================================== */
90 /* =========================================================  COUNT  ========================================================= */
91 /* ========================================================  STATUS  ========================================================= */
92 /* ============================================  MEC_WDT STATUS ISTATUS [0..0]  ============================================= */
93 typedef enum {                                  /*!< MEC_WDT_STATUS_ISTATUS                                                   */
94   MEC_WDT_STATUS_ISTATUS_nACTIVE      = 0,     /*!< nACTIVE : WDT counter expired event is not active                         */
95   MEC_WDT_STATUS_ISTATUS_ACTIVE       = 1,     /*!< ACTIVE : WDT counter expired event is active                              */
96 } MEC_WDT_STATUS_ISTATUS_Enum;
97 
98 /* ==========================================================  IEN  ========================================================== */
99 /* ==============================================  MEC_WDT IEN INTREN [0..0]  =============================================== */
100 typedef enum {                                  /*!< MEC_WDT_IEN_INTREN                                                       */
101   MEC_WDT_IEN_INTREN_DIS              = 0,     /*!< DIS : Disable(gate off) interrupt to EC on WDT counter expired
102                                                      event                                                                     */
103   MEC_WDT_IEN_INTREN_EN               = 1,     /*!< EN : Propagate WDT counter expired event interrupt to EC                  */
104 } MEC_WDT_IEN_INTREN_Enum;
105 
106 /** @} */ /* End of group EnumValue_peripherals */
107 
108 #endif /* _MEC5_WDT_V2_H */
109