1 /*
2  * Copyright (c) 2024 Microchip Technology Inc.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 #ifndef _MEC5_TACH_V1_H
7 #define _MEC5_TACH_V1_H
8 
9 /** @addtogroup Device_Peripheral_peripherals
10   * @{
11   */
12 
13 /**
14   * @brief Tachometer (MEC_TACH)
15   */
16 
17 typedef struct mec_tach_regs {                  /*!< (@ 0x40006000) MEC_TACH Structure                                        */
18   __IOM uint32_t  CTRL;                         /*!< (@ 0x00000000) Tachometer control                                         */
19   __IOM uint32_t  STATUS;                       /*!< (@ 0x00000004) Tachometer status                                          */
20   __IOM uint32_t  LIMIT_HI;                     /*!< (@ 0x00000008) Tachometer high limit                                      */
21   __IOM uint32_t  LIMIT_LO;                     /*!< (@ 0x0000000C) Tachometer low limit                                       */
22 } MEC_TACH_Type;                                /*!< Size = 16 (0x10)                                                          */
23 
24 /** @} */ /* End of group Device_Peripheral_peripherals */
25 
26 /** @addtogroup PosMask_peripherals
27   * @{
28   */
29 /* =========================================================  CTRL  ========================================================== */
30 #define MEC_TACH_CTRL_ENOOL_Pos           (0UL)                     /*!< ENOOL (Bit 0)                                         */
31 #define MEC_TACH_CTRL_ENOOL_Msk           (0x1UL)                   /*!< ENOOL (Bitfield-Mask: 0x01)                           */
32 #define MEC_TACH_CTRL_ENABLE_Pos          (1UL)                     /*!< ENABLE (Bit 1)                                        */
33 #define MEC_TACH_CTRL_ENABLE_Msk          (0x2UL)                   /*!< ENABLE (Bitfield-Mask: 0x01)                          */
34 #define MEC_TACH_CTRL_FILT_IN_Pos         (8UL)                     /*!< FILT_IN (Bit 8)                                       */
35 #define MEC_TACH_CTRL_FILT_IN_Msk         (0x100UL)                 /*!< FILT_IN (Bitfield-Mask: 0x01)                         */
36 #define MEC_TACH_CTRL_RDMODE_Pos          (10UL)                    /*!< RDMODE (Bit 10)                                       */
37 #define MEC_TACH_CTRL_RDMODE_Msk          (0x400UL)                 /*!< RDMODE (Bitfield-Mask: 0x01)                          */
38 #define MEC_TACH_CTRL_EDGES_Pos           (11UL)                    /*!< EDGES (Bit 11)                                        */
39 #define MEC_TACH_CTRL_EDGES_Msk           (0x1800UL)                /*!< EDGES (Bitfield-Mask: 0x03)                           */
40 #define MEC_TACH_CTRL_CNTRDY_IEN_Pos      (14UL)                    /*!< CNTRDY_IEN (Bit 14)                                   */
41 #define MEC_TACH_CTRL_CNTRDY_IEN_Msk      (0x4000UL)                /*!< CNTRDY_IEN (Bitfield-Mask: 0x01)                      */
42 #define MEC_TACH_CTRL_INTOG_IEN_Pos       (15UL)                    /*!< INTOG_IEN (Bit 15)                                    */
43 #define MEC_TACH_CTRL_INTOG_IEN_Msk       (0x8000UL)                /*!< INTOG_IEN (Bitfield-Mask: 0x01)                       */
44 #define MEC_TACH_CTRL_COUNT_Pos           (16UL)                    /*!< COUNT (Bit 16)                                        */
45 #define MEC_TACH_CTRL_COUNT_Msk           (0xffff0000UL)            /*!< COUNT (Bitfield-Mask: 0xffff)                         */
46 /* ========================================================  STATUS  ========================================================= */
47 #define MEC_TACH_STATUS_OOL_Pos           (0UL)                     /*!< OOL (Bit 0)                                           */
48 #define MEC_TACH_STATUS_OOL_Msk           (0x1UL)                   /*!< OOL (Bitfield-Mask: 0x01)                             */
49 #define MEC_TACH_STATUS_PIN_Pos           (1UL)                     /*!< PIN (Bit 1)                                           */
50 #define MEC_TACH_STATUS_PIN_Msk           (0x2UL)                   /*!< PIN (Bitfield-Mask: 0x01)                             */
51 #define MEC_TACH_STATUS_TOGL_Pos          (2UL)                     /*!< TOGL (Bit 2)                                          */
52 #define MEC_TACH_STATUS_TOGL_Msk          (0x4UL)                   /*!< TOGL (Bitfield-Mask: 0x01)                            */
53 #define MEC_TACH_STATUS_CNTRDY_Pos        (3UL)                     /*!< CNTRDY (Bit 3)                                        */
54 #define MEC_TACH_STATUS_CNTRDY_Msk        (0x8UL)                   /*!< CNTRDY (Bitfield-Mask: 0x01)                          */
55 
56 /** @} */ /* End of group PosMask_peripherals */
57 
58 /** @addtogroup EnumValue_peripherals
59   * @{
60   */
61 /* =========================================================  CTRL  ========================================================== */
62 /* ==============================================  MEC_TACH CTRL ENOOL [0..0]  ============================================== */
63 typedef enum {                                  /*!< MEC_TACH_CTRL_ENOOL                                                      */
64   MEC_TACH_CTRL_ENOOL_ON              = 1,     /*!< ON : Enable                                                               */
65 } MEC_TACH_CTRL_ENOOL_Enum;
66 
67 /* =============================================  MEC_TACH CTRL ENABLE [1..1]  ============================================== */
68 typedef enum {                                  /*!< MEC_TACH_CTRL_ENABLE                                                     */
69   MEC_TACH_CTRL_ENABLE_ON             = 1,     /*!< ON : Enable                                                               */
70 } MEC_TACH_CTRL_ENABLE_Enum;
71 
72 /* =============================================  MEC_TACH CTRL FILT_IN [8..8]  ============================================= */
73 typedef enum {                                  /*!< MEC_TACH_CTRL_FILT_IN                                                    */
74   MEC_TACH_CTRL_FILT_IN_EN            = 1,     /*!< EN : Enable                                                               */
75 } MEC_TACH_CTRL_FILT_IN_Enum;
76 
77 /* ============================================  MEC_TACH CTRL RDMODE [10..10]  ============================================= */
78 typedef enum {                                  /*!< MEC_TACH_CTRL_RDMODE                                                     */
79   MEC_TACH_CTRL_RDMODE_REPIN          = 0,     /*!< REPIN : Increment on rising edge of TACH input pin                        */
80   MEC_TACH_CTRL_RDMODE_RE100K         = 1,     /*!< RE100K : Increment on rising edge of 100K clock                           */
81 } MEC_TACH_CTRL_RDMODE_Enum;
82 
83 /* =============================================  MEC_TACH CTRL EDGES [11..12]  ============================================= */
84 typedef enum {                                  /*!< MEC_TACH_CTRL_EDGES                                                      */
85   MEC_TACH_CTRL_EDGES_E2              = 0,     /*!< E2 : Increment every two edges (1/2 period)                               */
86   MEC_TACH_CTRL_EDGES_E3              = 1,     /*!< E3 : Increment every 3 edges (1 period)                                   */
87   MEC_TACH_CTRL_EDGES_E5              = 2,     /*!< E5 : Increment every 5 edges (2 periods)                                  */
88   MEC_TACH_CTRL_EDGES_E9              = 3,     /*!< E9 : Increment every 9 edges (4 periods)                                  */
89 } MEC_TACH_CTRL_EDGES_Enum;
90 
91 /* ==========================================  MEC_TACH CTRL CNTRDY_IEN [14..14]  =========================================== */
92 typedef enum {                                  /*!< MEC_TACH_CTRL_CNTRDY_IEN                                                 */
93   MEC_TACH_CTRL_CNTRDY_IEN_ON         = 1,     /*!< ON : Enable                                                               */
94 } MEC_TACH_CTRL_CNTRDY_IEN_Enum;
95 
96 /* ===========================================  MEC_TACH CTRL INTOG_IEN [15..15]  =========================================== */
97 typedef enum {                                  /*!< MEC_TACH_CTRL_INTOG_IEN                                                  */
98   MEC_TACH_CTRL_INTOG_IEN_ON          = 1,     /*!< ON : Enable                                                               */
99 } MEC_TACH_CTRL_INTOG_IEN_Enum;
100 
101 /* ========================================================  STATUS  ========================================================= */
102 /* ==============================================  MEC_TACH STATUS OOL [0..0]  ============================================== */
103 typedef enum {                                  /*!< MEC_TACH_STATUS_OOL                                                      */
104   MEC_TACH_STATUS_OOL_ACTIVE          = 1,     /*!< ACTIVE : Status active                                                    */
105 } MEC_TACH_STATUS_OOL_Enum;
106 
107 /* ==============================================  MEC_TACH STATUS PIN [1..1]  ============================================== */
108 typedef enum {                                  /*!< MEC_TACH_STATUS_PIN                                                      */
109   MEC_TACH_STATUS_PIN_ACTIVE          = 1,     /*!< ACTIVE : Status active                                                    */
110 } MEC_TACH_STATUS_PIN_Enum;
111 
112 /* =============================================  MEC_TACH STATUS TOGL [2..2]  ============================================== */
113 typedef enum {                                  /*!< MEC_TACH_STATUS_TOGL                                                     */
114   MEC_TACH_STATUS_TOGL_ACTIVE         = 1,     /*!< ACTIVE : Status active                                                    */
115 } MEC_TACH_STATUS_TOGL_Enum;
116 
117 /* ============================================  MEC_TACH STATUS CNTRDY [3..3]  ============================================= */
118 typedef enum {                                  /*!< MEC_TACH_STATUS_CNTRDY                                                   */
119   MEC_TACH_STATUS_CNTRDY_ACTIVE       = 1,     /*!< ACTIVE : Status active                                                    */
120 } MEC_TACH_STATUS_CNTRDY_Enum;
121 
122 /** @} */ /* End of group EnumValue_peripherals */
123 
124 #endif /* _MEC5_TACH_V1_H */
125