1 /*
2  * Copyright 2022 NXP
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef MRU_IP_CFG_H
8 #define MRU_IP_CFG_H
9 
10 /**
11 *   @file    Mru_Ip_Cfg.h
12 *   @version 0.9.0
13 *
14 *   @brief   AUTOSAR Platform - Mru configuration header file.
15 *   @details This file is the header containing all the necessary information for MRU
16 *            module configuration(s).
17 *   @addtogroup MRU_IP_DRIVER_CONFIGURATION Mru Ip Driver Configuration
18 *   @{
19 */
20 
21 #ifdef __cplusplus
22 extern "C"
23 {
24 #endif
25 
26 
27 /*==================================================================================================
28 *                                        INCLUDE FILES
29 * 1) system and project includes
30 * 2) needed interfaces from external units
31 * 3) internal and external interfaces from this unit
32 * 4) user callback header files
33 ==================================================================================================*/
34 #include <zephyr/devicetree.h>
35 #include "Mcal.h"
36 #include "OsIf.h"
37 #include "S32Z2_SMU_MRU.h"
38 #include "S32Z2_RTU_MRU.h"
39 #include "S32Z2_CE_MRU.h"
40 /*==================================================================================================
41 *                              SOURCE FILE VERSION INFORMATION
42 ==================================================================================================*/
43 #define MRU_IP_VENDOR_ID_CFG                       43
44 #define MRU_IP_AR_RELEASE_MAJOR_VERSION_CFG        4
45 #define MRU_IP_AR_RELEASE_MINOR_VERSION_CFG        7
46 #define MRU_IP_AR_RELEASE_REVISION_VERSION_CFG     0
47 #define MRU_IP_SW_MAJOR_VERSION_CFG                0
48 #define MRU_IP_SW_MINOR_VERSION_CFG                9
49 #define MRU_IP_SW_PATCH_VERSION_CFG                0
50 
51 /*==================================================================================================
52                                       FILE VERSION CHECKS
53 ==================================================================================================*/
54 #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
55     /* Check if current file and Mcal header file are of the same Autosar version */
56     #if ((MRU_IP_AR_RELEASE_MAJOR_VERSION_CFG != MCAL_AR_RELEASE_MAJOR_VERSION) || \
57          (MRU_IP_AR_RELEASE_MINOR_VERSION_CFG != MCAL_AR_RELEASE_MINOR_VERSION))
58     #error "AutoSar Version Numbers of Mru_Ip_Cfg.h and Mcal.h are different"
59     #endif
60 
61     /* Check if the current file and OsIf.h header file are of the same version */
62     #if ((MRU_IP_AR_RELEASE_MAJOR_VERSION_CFG != OSIF_AR_RELEASE_MAJOR_VERSION) || \
63          (MRU_IP_AR_RELEASE_MINOR_VERSION_CFG != OSIF_AR_RELEASE_MINOR_VERSION) \
64         )
65         #error "AutoSar Version Numbers of Mru_Ip_Cfg.h and OsIf.h are different"
66     #endif
67 #endif
68 /*==================================================================================================
69                                             CONSTANTS
70 ==================================================================================================*/
71  /**
72 * @brief          Enable User Mode Support.
73 * @details        When MruEnableUserModeSupport = TRUE,
74 *                 the MRU driver can be executed from both supervisor and user mode.
75 *
76 * @api
77 */
78 #define MRU_IP_ENABLE_USER_MODE_SUPPORT   (STD_OFF)
79 
80 #ifndef MCAL_ENABLE_USER_MODE_SUPPORT
81  #ifdef MRU_IP_ENABLE_USER_MODE_SUPPORT
82   #if (STD_ON == MRU_IP_ENABLE_USER_MODE_SUPPORT)
83    #error MCAL_ENABLE_USER_MODE_SUPPORT is not enabled. For running  Mru in user mode the MCAL_ENABLE_USER_MODE_SUPPORT needs to be defined
84   #endif /* (STD_ON == MRU_IP_ENABLE_USER_MODE_SUPPORT) */
85  #endif /* ifdef MCAL_ENABLE_USER_MODE_SUPPORT */
86 #endif /* ifndef MCAL_ENABLE_USER_MODE_SUPPORT*/
87 
88 /**
89 * @brief Switches ON or OFF for the detection and reporting of development errors(API parameter checking) at IP level.
90 */
91 /** @implements MRU_IP_DEV_ERROR_DETECT_define  */
92 #define MRU_IP_DEV_ERROR_DETECT     (STD_OFF)
93 /*==================================================================================================
94  *                                     DEFINES AND MACROS
95 ==================================================================================================*/
96 
97 /* Not used by Zephyr integration but required to build the drivers */
98 #define MRU_IP_CONFIG_EXT
99 
100 #if DT_NODE_HAS_STATUS(DT_NODELABEL(mru0), okay)
101 /**
102 * @brief RTU0_MRU0 is enabled and used.
103 */
104 #define RTU0_MRU0_ENABLED                  (STD_ON)
105 /**
106 * @brief Instance number for RTU0_MRU0.
107 */
108 #define MRU_IP_RTU0_MRU0_INSTANCE          (0U)
109 /**
110 * @brief Instance ID for RTU0_MRU0.
111 */
112 #define MRU_IP_RTU0_MRU0_ID                (0U)
113 #endif
114 #if DT_NODE_HAS_STATUS(DT_NODELABEL(mru1), okay)
115 /**
116 * @brief RTU0_MRU1 is enabled and used.
117 */
118 #define RTU0_MRU1_ENABLED                  (STD_ON)
119 /**
120 * @brief Instance number for RTU0_MRU1.
121 */
122 #define MRU_IP_RTU0_MRU1_INSTANCE          (1U)
123 /**
124 * @brief Instance ID for RTU0_MRU1.
125 */
126 #define MRU_IP_RTU0_MRU1_ID                (1U)
127 #endif
128 #if DT_NODE_HAS_STATUS(DT_NODELABEL(mru2), okay)
129 /**
130 * @brief RTU0_MRU2 is enabled and used.
131 */
132 #define RTU0_MRU2_ENABLED                  (STD_ON)
133 /**
134 * @brief Instance number for RTU0_MRU2.
135 */
136 #define MRU_IP_RTU0_MRU2_INSTANCE          (2U)
137 /**
138 * @brief Instance ID for RTU0_MRU2.
139 */
140 #define MRU_IP_RTU0_MRU2_ID                (2U)
141 #endif
142 #if DT_NODE_HAS_STATUS(DT_NODELABEL(mru3), okay)
143 /**
144 * @brief RTU0_MRU3 is enabled and used.
145 */
146 #define RTU0_MRU3_ENABLED                  (STD_ON)
147 /**
148 * @brief Instance number for RTU0_MRU3.
149 */
150 #define MRU_IP_RTU0_MRU3_INSTANCE          (3U)
151 /**
152 * @brief Instance ID for RTU0_MRU3.
153 */
154 #define MRU_IP_RTU0_MRU3_ID                (3U)
155 #endif
156 #if DT_NODE_HAS_STATUS(DT_NODELABEL(mru4), okay)
157 /**
158 * @brief RTU1_MRU4 is enabled and used.
159 */
160 #define RTU1_MRU4_ENABLED                  (STD_ON)
161 /**
162 * @brief Instance number for RTU1_MRU4.
163 */
164 #define MRU_IP_RTU1_MRU4_INSTANCE          (4U)
165 /**
166 * @brief Instance ID for RTU1_MRU4.
167 */
168 #define MRU_IP_RTU1_MRU4_ID                (4U)
169 #endif
170 #if DT_NODE_HAS_STATUS(DT_NODELABEL(mru5), okay)
171 /**
172 * @brief RTU1_MRU5 is enabled and used.
173 */
174 #define RTU1_MRU5_ENABLED                  (STD_ON)
175 /**
176 * @brief Instance number for RTU1_MRU5.
177 */
178 #define MRU_IP_RTU1_MRU5_INSTANCE          (5U)
179 /**
180 * @brief Instance ID for RTU1_MRU5.
181 */
182 #define MRU_IP_RTU1_MRU5_ID                (5U)
183 #endif
184 #if DT_NODE_HAS_STATUS(DT_NODELABEL(mru6), okay)
185 /**
186 * @brief RTU1_MRU6 is enabled and used.
187 */
188 #define RTU1_MRU6_ENABLED                  (STD_ON)
189 /**
190 * @brief Instance number for RTU1_MRU6.
191 */
192 #define MRU_IP_RTU1_MRU6_INSTANCE          (6U)
193 /**
194 * @brief Instance ID for RTU1_MRU6.
195 */
196 #define MRU_IP_RTU1_MRU6_ID                (6U)
197 #endif
198 #if DT_NODE_HAS_STATUS(DT_NODELABEL(mru7), okay)
199 /**
200 * @brief RTU1_MRU7 is enabled and used.
201 */
202 #define RTU1_MRU7_ENABLED                  (STD_ON)
203 /**
204 * @brief Instance number for RTU1_MRU7.
205 */
206 #define MRU_IP_RTU1_MRU7_INSTANCE          (7U)
207 /**
208 * @brief Instance ID for RTU1_MRU7.
209 */
210 #define MRU_IP_RTU1_MRU7_ID                (7U)
211 #endif
212 
213 /**
214 * @brief Number of instance is used by the driver.
215 */
216 #define MRU_IP_NUMBER_OF_INSTANCES    (8U)
217 
218 /**
219 * @brief ID for interrupt group 0.
220 */
221 #define MRU_IP_INT_GROUP_0  0
222 /**
223 * @brief ID for interrupt group 0.
224 */
225 #define MRU_IP_INT_GROUP_1  1
226 
227 /*==================================================================================================
228 *                                            ENUMS
229 ==================================================================================================*/
230 
231 
232 /*==================================================================================================
233 *                               STRUCTURES AND OTHER TYPEDEFS
234 ==================================================================================================*/
235 
236 
237 /*==================================================================================================
238 *                                GLOBAL VARIABLE DECLARATIONS
239 ==================================================================================================*/
240 #define PLATFORM_START_SEC_CONST_UNSPECIFIED
241 #include "Platform_MemMap.h"
242 extern RTU_MRU_Type* const Mru_Ip_apxRTU_Bases[RTU_MRU_INSTANCE_COUNT];
243 #define PLATFORM_STOP_SEC_CONST_UNSPECIFIED
244 #include "Platform_MemMap.h"
245 /*==================================================================================================
246 *                                    FUNCTION PROTOTYPES
247 ==================================================================================================*/
248 
249 
250 #ifdef __cplusplus
251 }
252 #endif
253 #endif
254 
255 /** @} */
256