1 /*
2  * Copyright 2020-2023 NXP
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 /* Prevention from multiple including the same header */
7 #ifndef TRGMUX_IP_TRUSTEDFUNCTIONS_H
8 #define TRGMUX_IP_TRUSTEDFUNCTIONS_H
9 
10 /**
11 *   @file    Trgmux_Ip_TrustedFunctions.h
12 *
13 *   @version 3.0.0
14 *
15 *   @brief   AUTOSAR Mcl - Trgmux Ip driver source file.
16 *   @details
17 *
18 *   @addtogroup TRGMUX_IP_DRIVER TRGMUX IP Driver
19 *   @{
20 */
21 
22 #ifdef __cplusplus
23 extern "C"{
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 ==================================================================================================*/
33 
34 #include "Trgmux_Ip_Types.h"
35 #include "Trgmux_Ip_Cfg_Defines.h"
36 
37 /*==================================================================================================
38 *                                 SOURCE FILE VERSION INFORMATION
39 ==================================================================================================*/
40 #define TRGMUX_IP_TRUSTEDFUNCTIONS_VENDOR_ID                       43
41 #define TRGMUX_IP_TRUSTEDFUNCTIONS_AR_RELEASE_MAJOR_VERSION        4
42 #define TRGMUX_IP_TRUSTEDFUNCTIONS_AR_RELEASE_MINOR_VERSION        7
43 #define TRGMUX_IP_TRUSTEDFUNCTIONS_AR_RELEASE_REVISION_VERSION     0
44 #define TRGMUX_IP_TRUSTEDFUNCTIONS_SW_MAJOR_VERSION                3
45 #define TRGMUX_IP_TRUSTEDFUNCTIONS_SW_MINOR_VERSION                0
46 #define TRGMUX_IP_TRUSTEDFUNCTIONS_SW_PATCH_VERSION                0
47 
48 /*==================================================================================================
49 *                                       FILE VERSION CHECKS
50 ==================================================================================================*/
51 #if (STD_ON == TRGMUX_IP_IS_AVAILABLE)
52 
53 /* Check if Trgmux_Ip_TrustedFunctions.h file and Trgmux_Ip_Types file are of the same vendor */
54 #if (TRGMUX_IP_TRUSTEDFUNCTIONS_VENDOR_ID != TRGMUX_IP_TYPES_VENDOR_ID)
55     #error "Trgmux_Ip_TrustedFunctions.h and Trgmux_Ip_Types have different vendor ids"
56 #endif
57 
58 /* Check if Trgmux_Ip_TrustedFunctions.h file and Trgmux_Ip_Types file are of the same Autosar version */
59 #if ((TRGMUX_IP_TRUSTEDFUNCTIONS_AR_RELEASE_MAJOR_VERSION != TRGMUX_IP_TYPES_AR_RELEASE_MAJOR_VERSION) || \
60      (TRGMUX_IP_TRUSTEDFUNCTIONS_AR_RELEASE_MINOR_VERSION != TRGMUX_IP_TYPES_AR_RELEASE_MINOR_VERSION) || \
61      (TRGMUX_IP_TRUSTEDFUNCTIONS_AR_RELEASE_REVISION_VERSION != TRGMUX_IP_TYPES_AR_RELEASE_REVISION_VERSION) \
62     )
63     #error "AutoSar Version Numbers of Trgmux_Ip_TrustedFunctions.h and Trgmux_Ip_Types are different"
64 #endif
65 
66 /* Check if Trgmux_Ip_TrustedFunctions.h file and Trgmux_Ip_Types file are of the same Software version */
67 #if ((TRGMUX_IP_TRUSTEDFUNCTIONS_SW_MAJOR_VERSION != TRGMUX_IP_TYPES_SW_MAJOR_VERSION) || \
68      (TRGMUX_IP_TRUSTEDFUNCTIONS_SW_MINOR_VERSION != TRGMUX_IP_TYPES_SW_MINOR_VERSION) || \
69      (TRGMUX_IP_TRUSTEDFUNCTIONS_SW_PATCH_VERSION != TRGMUX_IP_TYPES_SW_PATCH_VERSION) \
70     )
71     #error "Software Version Numbers of Trgmux_Ip_TrustedFunctions.h and Trgmux_Ip_Types are different"
72 #endif
73 
74 /* Check if Trgmux_Ip_TrustedFunctions.h file and Trgmux_Ip_Cfg_Defines file are of the same vendor */
75 #if (TRGMUX_IP_TRUSTEDFUNCTIONS_VENDOR_ID != TRGMUX_IP_CFG_DEFINES_VENDOR_ID)
76     #error "Trgmux_Ip_TrustedFunctions.h and Trgmux_Ip_Cfg_Defines have different vendor ids"
77 #endif
78 
79 
80 /* Check if Trgmux_Ip_TrustedFunctions.h file and Trgmux_Ip_Cfg_Defines file are of the same Autosar version */
81 #if ((TRGMUX_IP_TRUSTEDFUNCTIONS_AR_RELEASE_MAJOR_VERSION != TRGMUX_IP_CFG_DEFINES_AR_RELEASE_MAJOR_VERSION) || \
82      (TRGMUX_IP_TRUSTEDFUNCTIONS_AR_RELEASE_MINOR_VERSION != TRGMUX_IP_CFG_DEFINES_AR_RELEASE_MINOR_VERSION) || \
83      (TRGMUX_IP_TRUSTEDFUNCTIONS_AR_RELEASE_REVISION_VERSION != TRGMUX_IP_CFG_DEFINES_AR_RELEASE_REVISION_VERSION) \
84     )
85     #error "AutoSar Version Numbers of Trgmux_Ip_TrustedFunctions.h and Trgmux_Ip_Cfg_Defines are different"
86 #endif
87 
88 /* Check if Trgmux_Ip_TrustedFunctions.h file and Trgmux_Ip_Cfg_Defines file are of the same Software version */
89 #if ((TRGMUX_IP_TRUSTEDFUNCTIONS_SW_MAJOR_VERSION != TRGMUX_IP_CFG_DEFINES_SW_MAJOR_VERSION) || \
90      (TRGMUX_IP_TRUSTEDFUNCTIONS_SW_MINOR_VERSION != TRGMUX_IP_CFG_DEFINES_SW_MINOR_VERSION) || \
91      (TRGMUX_IP_TRUSTEDFUNCTIONS_SW_PATCH_VERSION != TRGMUX_IP_CFG_DEFINES_SW_PATCH_VERSION) \
92     )
93     #error "Software Version Numbers of Trgmux_Ip_TrustedFunctions.h and Trgmux_Ip_Cfg_Defines are different"
94 #endif
95 
96 /*==================================================================================================
97 *                                            CONSTANTS
98 ==================================================================================================*/
99 
100 /*==================================================================================================
101 *                                       DEFINES AND MACROS
102 ==================================================================================================*/
103 
104 /*==================================================================================================
105 *                                              ENUMS
106 ==================================================================================================*/
107 
108 /*==================================================================================================
109 *                                  STRUCTURES AND OTHER TYPEDEFS
110 ==================================================================================================*/
111 
112 /*==================================================================================================
113 *                                  GLOBAL VARIABLE DECLARATIONS
114 ==================================================================================================*/
115 
116 /*==================================================================================================
117 *                                       FUNCTION PROTOTYPES
118 ==================================================================================================*/
119 #if (defined(MCAL_ENABLE_USER_MODE_SUPPORT) && (STD_ON == TRGMUX_IP_USER_MODE_SUPPORT_IS_AVAILABLE))
120 
121 #define MCL_START_SEC_CODE
122 #include "Mcl_MemMap.h"
123 
124 /**
125  * @brief        Initialize the Trgmux
126  *
127  * @param[in]    pxTrgmuxInit     Pointer to the initialization structure.
128  * @return       None
129  *
130  */
131 extern Trgmux_Ip_StatusType hwAcc_Init(TRGMUX_Type * const pTrgmux);
132 
133 /**
134  * @brief        Mapping the Input for the Output
135  *
136  * @param[in]    pxTrgmuxInit     Pointer to the initialization structure.
137  * @param[in]    Input            Specifies the Input.
138  * @param[in]    Output           Specifies the Output
139  * @return       None
140  *
141  */
142 extern void hwAcc_SetInputForOutput(TRGMUX_Type * const pTrgmux, uint8 Instance, const uint32 Input, const uint32 Output);
143 
144 /**
145  * @brief        Lock the Output
146  *
147  * @param[in]    pxTrgmuxInit     Pointer to the initialization structure.
148  * @param[in]    Output           Specifies the Output
149  * @return       None
150  *
151  */
152 extern void hwAcc_SetLockForOutput(TRGMUX_Type * const pTrgmux, const uint32 Output);
153 
154 /**
155  * @brief        Get Lock status for the Output
156  *
157  * @param[in]    pxTrgmuxInit     Pointer to the initialization structure.
158  * @param[in]    Output           Specifies the Output
159  * @return       None
160  *
161  */
162 extern boolean hwAcc_GetLockForOutput(const TRGMUX_Type * const pTrgmux, const uint32 Output);
163 
164 #define MCL_STOP_SEC_CODE
165 #include "Mcl_MemMap.h"
166 
167 
168 #endif /* TRGMUX_IP_USER_MODE_SUPPORT_IS_AVAILABLE == STD_ON */
169 
170 #endif /* STD_ON == TRGMUX_IP_IS_AVAILABLE */
171 
172 #ifdef __cplusplus
173 }
174 #endif
175 
176 /** @} */
177 
178 #endif /* TRGMUX_IP_TRUSTEDFUNCTIONS_H */
179 
180 
181 /*==================================================================================================
182  *                                        END OF FILE
183 ==================================================================================================*/
184