1 /*
2  * Copyright 1997-2016 Freescale Semiconductor, Inc.
3  * Copyright 2016-2024 NXP
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 /*!
9  * @file S32Z2_SEMA42.h
10  * @version 2.3
11  * @date 2024-05-03
12  * @brief Peripheral Access Layer for S32Z2_SEMA42
13  *
14  * This file contains register definitions and macros for easy access to their
15  * bit fields.
16  *
17  * This file assumes LITTLE endian system.
18  */
19 
20 /**
21 * @page misra_violations MISRA-C:2012 violations
22 *
23 * @section [global]
24 * Violates MISRA 2012 Advisory Rule 2.3, local typedef not referenced
25 * The SoC header defines typedef for all modules.
26 *
27 * @section [global]
28 * Violates MISRA 2012 Advisory Rule 2.5, local macro not referenced
29 * The SoC header defines macros for all modules and registers.
30 *
31 * @section [global]
32 * Violates MISRA 2012 Advisory Directive 4.9, Function-like macro
33 * These are generated macros used for accessing the bit-fields from registers.
34 *
35 * @section [global]
36 * Violates MISRA 2012 Required Rule 5.1, identifier clash
37 * The supported compilers use more than 31 significant characters for identifiers.
38 *
39 * @section [global]
40 * Violates MISRA 2012 Required Rule 5.2, identifier clash
41 * The supported compilers use more than 31 significant characters for identifiers.
42 *
43 * @section [global]
44 * Violates MISRA 2012 Required Rule 5.4, identifier clash
45 * The supported compilers use more than 31 significant characters for identifiers.
46 *
47 * @section [global]
48 * Violates MISRA 2012 Required Rule 5.5, identifier clash
49 * The supported compilers use more than 31 significant characters for identifiers.
50 *
51 * @section [global]
52 * Violates MISRA 2012 Required Rule 21.1, defined macro '__I' is reserved to the compiler
53 * This type qualifier is needed to ensure correct I/O access and addressing.
54 */
55 
56 /* Prevention from multiple including the same memory map */
57 #if !defined(S32Z2_SEMA42_H_)  /* Check if memory map has not been already included */
58 #define S32Z2_SEMA42_H_
59 
60 #include "S32Z2_COMMON.h"
61 
62 /* ----------------------------------------------------------------------------
63    -- SEMA42 Peripheral Access Layer
64    ---------------------------------------------------------------------------- */
65 
66 /*!
67  * @addtogroup SEMA42_Peripheral_Access_Layer SEMA42 Peripheral Access Layer
68  * @{
69  */
70 
71 /** SEMA42 - Size of Registers Arrays */
72 #define SEMA42_GATE_COUNT                         16u
73 
74 /** SEMA42 - Register Layout Typedef */
75 typedef struct {
76   __IO uint8_t GATE[SEMA42_GATE_COUNT];            /**< Gate, array offset: 0x0, array step: 0x1 */
77   uint8_t RESERVED_0[50];
78   union {                                          /* offset: 0x42 */
79     __I  uint16_t R;                                 /**< Reset Gate Read, offset: 0x42 */
80     __O  uint16_t W;                                 /**< Reset Gate Write, offset: 0x42 */
81   } RSTGT;
82 } SEMA42_Type, *SEMA42_MemMapPtr;
83 
84 /** Number of instances of the SEMA42 module. */
85 #define SEMA42_INSTANCE_COUNT                    (6u)
86 
87 /* SEMA42 - Peripheral instance base addresses */
88 /** Peripheral SEMA42_0 base address */
89 #define IP_SEMA42_0_BASE                         (0x400D0000u)
90 /** Peripheral SEMA42_0 base pointer */
91 #define IP_SEMA42_0                              ((SEMA42_Type *)IP_SEMA42_0_BASE)
92 /** Peripheral SEMA42_1 base address */
93 #define IP_SEMA42_1_BASE                         (0x408D0000u)
94 /** Peripheral SEMA42_1 base pointer */
95 #define IP_SEMA42_1                              ((SEMA42_Type *)IP_SEMA42_1_BASE)
96 /** Peripheral SEMA42_2 base address */
97 #define IP_SEMA42_2_BASE                         (0x410D0000u)
98 /** Peripheral SEMA42_2 base pointer */
99 #define IP_SEMA42_2                              ((SEMA42_Type *)IP_SEMA42_2_BASE)
100 /** Peripheral SEMA42_3 base address */
101 #define IP_SEMA42_3_BASE                         (0x418D0000u)
102 /** Peripheral SEMA42_3 base pointer */
103 #define IP_SEMA42_3                              ((SEMA42_Type *)IP_SEMA42_3_BASE)
104 /** Peripheral SEMA42_4 base address */
105 #define IP_SEMA42_4_BASE                         (0x420D0000u)
106 /** Peripheral SEMA42_4 base pointer */
107 #define IP_SEMA42_4                              ((SEMA42_Type *)IP_SEMA42_4_BASE)
108 /** Peripheral SEMA42_5 base address */
109 #define IP_SEMA42_5_BASE                         (0x428D0000u)
110 /** Peripheral SEMA42_5 base pointer */
111 #define IP_SEMA42_5                              ((SEMA42_Type *)IP_SEMA42_5_BASE)
112 /** Array initializer of SEMA42 peripheral base addresses */
113 #define IP_SEMA42_BASE_ADDRS                     { IP_SEMA42_0_BASE, IP_SEMA42_1_BASE, IP_SEMA42_2_BASE, IP_SEMA42_3_BASE, IP_SEMA42_4_BASE, IP_SEMA42_5_BASE }
114 /** Array initializer of SEMA42 peripheral base pointers */
115 #define IP_SEMA42_BASE_PTRS                      { IP_SEMA42_0, IP_SEMA42_1, IP_SEMA42_2, IP_SEMA42_3, IP_SEMA42_4, IP_SEMA42_5 }
116 
117 /* ----------------------------------------------------------------------------
118    -- SEMA42 Register Masks
119    ---------------------------------------------------------------------------- */
120 
121 /*!
122  * @addtogroup SEMA42_Register_Masks SEMA42 Register Masks
123  * @{
124  */
125 
126 /*! @name GATE - Gate */
127 /*! @{ */
128 
129 #define SEMA42_GATE_GTFSM_MASK                   (0xFU)
130 #define SEMA42_GATE_GTFSM_SHIFT                  (0U)
131 #define SEMA42_GATE_GTFSM_WIDTH                  (4U)
132 #define SEMA42_GATE_GTFSM(x)                     (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE_GTFSM_SHIFT)) & SEMA42_GATE_GTFSM_MASK)
133 /*! @} */
134 
135 /*! @name R - Reset Gate Read */
136 /*! @{ */
137 
138 #define SEMA42_R_RSTGTN_MASK                     (0xFFU)
139 #define SEMA42_R_RSTGTN_SHIFT                    (0U)
140 #define SEMA42_R_RSTGTN_WIDTH                    (8U)
141 #define SEMA42_R_RSTGTN(x)                       (((uint16_t)(((uint16_t)(x)) << SEMA42_R_RSTGTN_SHIFT)) & SEMA42_R_RSTGTN_MASK)
142 
143 #define SEMA42_R_RSTGMS_MASK                     (0xF00U)
144 #define SEMA42_R_RSTGMS_SHIFT                    (8U)
145 #define SEMA42_R_RSTGMS_WIDTH                    (4U)
146 #define SEMA42_R_RSTGMS(x)                       (((uint16_t)(((uint16_t)(x)) << SEMA42_R_RSTGMS_SHIFT)) & SEMA42_R_RSTGMS_MASK)
147 
148 #define SEMA42_R_RSTGSM_MASK                     (0x3000U)
149 #define SEMA42_R_RSTGSM_SHIFT                    (12U)
150 #define SEMA42_R_RSTGSM_WIDTH                    (2U)
151 #define SEMA42_R_RSTGSM(x)                       (((uint16_t)(((uint16_t)(x)) << SEMA42_R_RSTGSM_SHIFT)) & SEMA42_R_RSTGSM_MASK)
152 /*! @} */
153 
154 /*! @name W - Reset Gate Write */
155 /*! @{ */
156 
157 #define SEMA42_W_RSTGTN_MASK                     (0xFFU)
158 #define SEMA42_W_RSTGTN_SHIFT                    (0U)
159 #define SEMA42_W_RSTGTN_WIDTH                    (8U)
160 #define SEMA42_W_RSTGTN(x)                       (((uint16_t)(((uint16_t)(x)) << SEMA42_W_RSTGTN_SHIFT)) & SEMA42_W_RSTGTN_MASK)
161 
162 #define SEMA42_W_RSTGDP_MASK                     (0xFF00U)
163 #define SEMA42_W_RSTGDP_SHIFT                    (8U)
164 #define SEMA42_W_RSTGDP_WIDTH                    (8U)
165 #define SEMA42_W_RSTGDP(x)                       (((uint16_t)(((uint16_t)(x)) << SEMA42_W_RSTGDP_SHIFT)) & SEMA42_W_RSTGDP_MASK)
166 /*! @} */
167 
168 /*!
169  * @}
170  */ /* end of group SEMA42_Register_Masks */
171 
172 /*!
173  * @}
174  */ /* end of group SEMA42_Peripheral_Access_Layer */
175 
176 #endif  /* #if !defined(S32Z2_SEMA42_H_) */
177