1 /*
2  * Copyright 1997-2016 Freescale Semiconductor, Inc.
3  * Copyright 2016-2021 NXP
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 /*!
9  * @file S32K344_SEMA42.h
10  * @version 1.9
11  * @date 2021-10-27
12  * @brief Peripheral Access Layer for S32K344_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(S32K344_SEMA42_H_)  /* Check if memory map has not been already included */
58 #define S32K344_SEMA42_H_
59 
60 #include "S32K344_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 Register, 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                    (1u)
86 
87 /* SEMA42 - Peripheral instance base addresses */
88 /** Peripheral SEMA42 base address */
89 #define IP_SEMA42_BASE                           (0x40460000u)
90 /** Peripheral SEMA42 base pointer */
91 #define IP_SEMA42                                ((SEMA42_Type *)IP_SEMA42_BASE)
92 /** Array initializer of SEMA42 peripheral base addresses */
93 #define IP_SEMA42_BASE_ADDRS                     { IP_SEMA42_BASE }
94 /** Array initializer of SEMA42 peripheral base pointers */
95 #define IP_SEMA42_BASE_PTRS                      { IP_SEMA42 }
96 
97 /* ----------------------------------------------------------------------------
98    -- SEMA42 Register Masks
99    ---------------------------------------------------------------------------- */
100 
101 /*!
102  * @addtogroup SEMA42_Register_Masks SEMA42 Register Masks
103  * @{
104  */
105 
106 /*! @name GATE - Gate Register */
107 /*! @{ */
108 
109 #define SEMA42_GATE_GTFSM_MASK                   (0xFU)
110 #define SEMA42_GATE_GTFSM_SHIFT                  (0U)
111 #define SEMA42_GATE_GTFSM_WIDTH                  (4U)
112 #define SEMA42_GATE_GTFSM(x)                     (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE_GTFSM_SHIFT)) & SEMA42_GATE_GTFSM_MASK)
113 /*! @} */
114 
115 /*! @name R - Reset Gate Read */
116 /*! @{ */
117 
118 #define SEMA42_R_RSTGTN_MASK                     (0xFFU)
119 #define SEMA42_R_RSTGTN_SHIFT                    (0U)
120 #define SEMA42_R_RSTGTN_WIDTH                    (8U)
121 #define SEMA42_R_RSTGTN(x)                       (((uint16_t)(((uint16_t)(x)) << SEMA42_R_RSTGTN_SHIFT)) & SEMA42_R_RSTGTN_MASK)
122 
123 #define SEMA42_R_RSTGMS_MASK                     (0xF00U)
124 #define SEMA42_R_RSTGMS_SHIFT                    (8U)
125 #define SEMA42_R_RSTGMS_WIDTH                    (4U)
126 #define SEMA42_R_RSTGMS(x)                       (((uint16_t)(((uint16_t)(x)) << SEMA42_R_RSTGMS_SHIFT)) & SEMA42_R_RSTGMS_MASK)
127 
128 #define SEMA42_R_RSTGSM_MASK                     (0x3000U)
129 #define SEMA42_R_RSTGSM_SHIFT                    (12U)
130 #define SEMA42_R_RSTGSM_WIDTH                    (2U)
131 #define SEMA42_R_RSTGSM(x)                       (((uint16_t)(((uint16_t)(x)) << SEMA42_R_RSTGSM_SHIFT)) & SEMA42_R_RSTGSM_MASK)
132 
133 #define SEMA42_R_ROZ_MASK                        (0xC000U)
134 #define SEMA42_R_ROZ_SHIFT                       (14U)
135 #define SEMA42_R_ROZ_WIDTH                       (2U)
136 #define SEMA42_R_ROZ(x)                          (((uint16_t)(((uint16_t)(x)) << SEMA42_R_ROZ_SHIFT)) & SEMA42_R_ROZ_MASK)
137 /*! @} */
138 
139 /*! @name W - Reset Gate Write */
140 /*! @{ */
141 
142 #define SEMA42_W_RSTGTN_MASK                     (0xFFU)
143 #define SEMA42_W_RSTGTN_SHIFT                    (0U)
144 #define SEMA42_W_RSTGTN_WIDTH                    (8U)
145 #define SEMA42_W_RSTGTN(x)                       (((uint16_t)(((uint16_t)(x)) << SEMA42_W_RSTGTN_SHIFT)) & SEMA42_W_RSTGTN_MASK)
146 
147 #define SEMA42_W_RSTGDP_MASK                     (0xFF00U)
148 #define SEMA42_W_RSTGDP_SHIFT                    (8U)
149 #define SEMA42_W_RSTGDP_WIDTH                    (8U)
150 #define SEMA42_W_RSTGDP(x)                       (((uint16_t)(((uint16_t)(x)) << SEMA42_W_RSTGDP_SHIFT)) & SEMA42_W_RSTGDP_MASK)
151 /*! @} */
152 
153 /*!
154  * @}
155  */ /* end of group SEMA42_Register_Masks */
156 
157 /*!
158  * @}
159  */ /* end of group SEMA42_Peripheral_Access_Layer */
160 
161 #endif  /* #if !defined(S32K344_SEMA42_H_) */
162