1 /*
2  * Copyright 2020-2023 NXP
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 /* Prevention from multiple including the same header */
8 #ifndef TRGMUX_IP_TYPES_H_
9 #define TRGMUX_IP_TYPES_H_
10 
11 /**
12 *   @file    Trgmux_Ip_Types.h
13 *
14 *   @version 3.0.0
15 *
16 *   @brief   AUTOSAR Mcl - Trgmux Ip driver header file.
17 *   @details
18 *
19 *   @addtogroup TRGMUX_IP_DRIVER TRGMUX IP Driver
20 *   @{
21 */
22 
23 #ifdef __cplusplus
24 extern "C"{
25 #endif
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 ==================================================================================================*/
33 #include "StandardTypes.h"
34 #include "Mcal.h"
35 #include "Trgmux_Ip_Cfg_Defines.h"
36 #include "Trgmux_Ip_Cfg_DeviceRegisters.h"
37 
38 /*==================================================================================================
39 *                                 SOURCE FILE VERSION INFORMATION
40 ==================================================================================================*/
41 #define TRGMUX_IP_TYPES_VENDOR_ID                    43
42 #define TRGMUX_IP_TYPES_MODULE_ID                    255
43 #define TRGMUX_IP_TYPES_AR_RELEASE_MAJOR_VERSION     4
44 #define TRGMUX_IP_TYPES_AR_RELEASE_MINOR_VERSION     7
45 #define TRGMUX_IP_TYPES_AR_RELEASE_REVISION_VERSION  0
46 #define TRGMUX_IP_TYPES_SW_MAJOR_VERSION             3
47 #define TRGMUX_IP_TYPES_SW_MINOR_VERSION             0
48 #define TRGMUX_IP_TYPES_SW_PATCH_VERSION             0
49 
50 /*==================================================================================================
51                                       FILE VERSION CHECKS
52 ==================================================================================================*/
53 
54 #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
55 /* Check if header file and StandardTypes header file are of the same Autosar version */
56 #if ((TRGMUX_IP_TYPES_AR_RELEASE_MAJOR_VERSION != STD_AR_RELEASE_MAJOR_VERSION) || \
57      (TRGMUX_IP_TYPES_AR_RELEASE_MINOR_VERSION != STD_AR_RELEASE_MINOR_VERSION))
58     #error "AutoSar Version Numbers of Trgmux_Ip_Types.h and StandardTypes.h are different"
59 #endif
60 
61 /* Check if header file and Mcal header file are of the same Autosar version */
62 #if ((TRGMUX_IP_TYPES_AR_RELEASE_MAJOR_VERSION != MCAL_AR_RELEASE_MAJOR_VERSION) || \
63      (TRGMUX_IP_TYPES_AR_RELEASE_MINOR_VERSION != MCAL_AR_RELEASE_MINOR_VERSION))
64     #error "AutoSar Version Numbers of Trgmux_Ip_Types.h and Mcal.h are different"
65 #endif
66 #endif /* DISABLE_MCAL_INTERMODULE_ASR_CHECK */
67 
68 /* Check if header file and Trgmux_Ip_Cfg_Defines.h file are of the same vendor */
69 #if (TRGMUX_IP_TYPES_VENDOR_ID != TRGMUX_IP_CFG_DEFINES_VENDOR_ID)
70     #error "Trgmux_Ip_Types.h and Trgmux_Ip_Cfg_Defines.h have different vendor ids"
71 #endif
72 
73 /* Check if header file and Trgmux_Ip_Cfg_Defines.h file are of the same Autosar version */
74 #if ((TRGMUX_IP_TYPES_AR_RELEASE_MAJOR_VERSION != TRGMUX_IP_CFG_DEFINES_AR_RELEASE_MAJOR_VERSION) || \
75      (TRGMUX_IP_TYPES_AR_RELEASE_MINOR_VERSION != TRGMUX_IP_CFG_DEFINES_AR_RELEASE_MINOR_VERSION) || \
76      (TRGMUX_IP_TYPES_AR_RELEASE_REVISION_VERSION != TRGMUX_IP_CFG_DEFINES_AR_RELEASE_REVISION_VERSION) \
77     )
78     #error "AutoSar Version Numbers of Trgmux_Ip_Types.h and Trgmux_Ip_Cfg_Defines.h are different"
79 #endif
80 
81 /* Check if header file and Trgmux_Ip_Cfg_Defines.h file are of the same Software version */
82 #if ((TRGMUX_IP_TYPES_SW_MAJOR_VERSION != TRGMUX_IP_CFG_DEFINES_SW_MAJOR_VERSION) || \
83      (TRGMUX_IP_TYPES_SW_MINOR_VERSION != TRGMUX_IP_CFG_DEFINES_SW_MINOR_VERSION) || \
84      (TRGMUX_IP_TYPES_SW_PATCH_VERSION != TRGMUX_IP_CFG_DEFINES_SW_PATCH_VERSION) \
85     )
86     #error "Software Version Numbers of Trgmux_Ip_Types.h and Trgmux_Ip_Cfg_Defines.h are different"
87 #endif
88 
89 /* Check if header file and Trgmux_Ip_Cfg_DeviceRegisters.h file are of the same vendor */
90 #if (TRGMUX_IP_TYPES_VENDOR_ID != TRGMUX_IP_CFG_DEVICEREGISTERS_VENDOR_ID)
91     #error "Trgmux_Ip_Types.h and Trgmux_Ip_Cfg_DeviceRegisters.h have different vendor ids"
92 #endif
93 
94 /* Check if header file and Trgmux_Ip_Cfg_DeviceRegisters.h file are of the same Autosar version */
95 #if ((TRGMUX_IP_TYPES_AR_RELEASE_MAJOR_VERSION != TRGMUX_IP_CFG_DEVICEREGISTERS_AR_RELEASE_MAJOR_VERSION) || \
96      (TRGMUX_IP_TYPES_AR_RELEASE_MINOR_VERSION != TRGMUX_IP_CFG_DEVICEREGISTERS_AR_RELEASE_MINOR_VERSION) || \
97      (TRGMUX_IP_TYPES_AR_RELEASE_REVISION_VERSION != TRGMUX_IP_CFG_DEVICEREGISTERS_AR_RELEASE_REVISION_VERSION) \
98     )
99     #error "AutoSar Version Numbers of Trgmux_Ip_Types.h and Trgmux_Ip_Cfg_DeviceRegisters.h are different"
100 #endif
101 
102 /* Check if header file and Trgmux_Ip_Cfg_DeviceRegisters.h file are of the same Software version */
103 #if ((TRGMUX_IP_TYPES_SW_MAJOR_VERSION != TRGMUX_IP_CFG_DEVICEREGISTERS_SW_MAJOR_VERSION) || \
104      (TRGMUX_IP_TYPES_SW_MINOR_VERSION != TRGMUX_IP_CFG_DEVICEREGISTERS_SW_MINOR_VERSION) || \
105      (TRGMUX_IP_TYPES_SW_PATCH_VERSION != TRGMUX_IP_CFG_DEVICEREGISTERS_SW_PATCH_VERSION) \
106     )
107     #error "Software Version Numbers of Trgmux_Ip_Types.h and Trgmux_Ip_Cfg_DeviceRegisters.h are different"
108 #endif
109 
110 #if (STD_ON == TRGMUX_IP_IS_AVAILABLE)
111 /*==================================================================================================
112 *                                            CONSTANTS
113 ==================================================================================================*/
114 
115 /*==================================================================================================
116 *                                       DEFINES AND MACROS
117 ==================================================================================================*/
118 
119 /*==================================================================================================
120 *                                              ENUMS
121 ==================================================================================================*/
122 typedef enum{
123     TRGMUX_IP_STATUS_SUCCESS = 0U,
124     TRGMUX_IP_STATUS_LOCKED  = 1U,
125 #if (STD_ON == TRGMUX_IP_MULTICORE_IS_AVAILABLE)
126     TRGMUX_IP_STATUS_WRONG_CORE   = 2U,
127 #endif /* STD_ON == TRGMUX_IP_MULTICORE_IS_AVAILABLE */
128 }Trgmux_Ip_StatusType;
129 
130 /*==================================================================================================
131 *                                  STRUCTURES AND OTHER TYPEDEFS
132 ==================================================================================================*/
133 typedef struct{
134     uint8 LogicChannel;
135     uint8 Output;
136     uint8 Input;
137     uint8 HwInstId;
138     boolean Lock;
139 #if (STD_ON == TRGMUX_IP_MULTICORE_IS_AVAILABLE)
140     uint8 CoreId;
141 #endif /* STD_ON == TRGMUX_IP_MULTICORE_IS_AVAILABLE */
142 }Trgmux_Ip_LogicTriggerType;
143 
144 typedef struct{
145     const Trgmux_Ip_LogicTriggerType * const paxLogicTrigger[TRGMUX_IP_NOF_CFG_LOGIC_TRIGGERS];
146 }Trgmux_Ip_InitType;
147 
148 /*==================================================================================================
149 *                                  GLOBAL VARIABLE DECLARATIONS
150 ==================================================================================================*/
151 
152 /*==================================================================================================
153 *                                       FUNCTION PROTOTYPES
154 ==================================================================================================*/
155 
156 #endif /* TRGMUX_IP_IS_AVAILABLE */
157 
158 #ifdef __cplusplus
159 }
160 #endif
161 
162 /** @} */
163 
164 #endif  /* #ifndef TRGMUX_IP_TYPES_H_ */
165