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_H_ 9 #define TRGMUX_IP_H_ 10 11 /** 12 * @file Trgmux_Ip.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 "Trgmux_Ip_Cfg.h" 34 35 /*================================================================================================== 36 * SOURCE FILE VERSION INFORMATION 37 ==================================================================================================*/ 38 #define TRGMUX_IP_VENDOR_ID 43 39 #define TRGMUX_IP_MODULE_ID 255 40 #define TRGMUX_IP_AR_RELEASE_MAJOR_VERSION 4 41 #define TRGMUX_IP_AR_RELEASE_MINOR_VERSION 7 42 #define TRGMUX_IP_AR_RELEASE_REVISION_VERSION 0 43 #define TRGMUX_IP_SW_MAJOR_VERSION 3 44 #define TRGMUX_IP_SW_MINOR_VERSION 0 45 #define TRGMUX_IP_SW_PATCH_VERSION 0 46 47 /*================================================================================================== 48 FILE VERSION CHECKS 49 ==================================================================================================*/ 50 51 /* Check if header file and Trgmux_Ip_Cfg.h file are of the same vendor */ 52 #if (TRGMUX_IP_VENDOR_ID != TRGMUX_IP_CFG_VENDOR_ID) 53 #error "Trgmux_Ip.h and Trgmux_Ip_Cfg.h have different vendor ids" 54 #endif 55 56 /* Check if header file and Trgmux_Ip_Cfg.h file are of the same Autosar version */ 57 #if ((TRGMUX_IP_AR_RELEASE_MAJOR_VERSION != TRGMUX_IP_CFG_AR_RELEASE_MAJOR_VERSION) || \ 58 (TRGMUX_IP_AR_RELEASE_MINOR_VERSION != TRGMUX_IP_CFG_AR_RELEASE_MINOR_VERSION) || \ 59 (TRGMUX_IP_AR_RELEASE_REVISION_VERSION != TRGMUX_IP_CFG_AR_RELEASE_REVISION_VERSION) \ 60 ) 61 #error "AutoSar Version Numbers of Trgmux_Ip.h and Trgmux_Ip_Cfg.h are different" 62 #endif 63 64 /* Check if header file and Trgmux_Ip_Cfg.h file are of the same Software version */ 65 #if ((TRGMUX_IP_SW_MAJOR_VERSION != TRGMUX_IP_CFG_SW_MAJOR_VERSION) || \ 66 (TRGMUX_IP_SW_MINOR_VERSION != TRGMUX_IP_CFG_SW_MINOR_VERSION) || \ 67 (TRGMUX_IP_SW_PATCH_VERSION != TRGMUX_IP_CFG_SW_PATCH_VERSION) \ 68 ) 69 #error "Software Version Numbers of Trgmux_Ip.h and Trgmux_Ip_Cfg.h are different" 70 #endif 71 72 #if (STD_ON == TRGMUX_IP_IS_AVAILABLE) 73 /*================================================================================================== 74 * CONSTANTS 75 ==================================================================================================*/ 76 77 /*================================================================================================== 78 * DEFINES AND MACROS 79 ==================================================================================================*/ 80 81 /*================================================================================================== 82 * ENUMS 83 ==================================================================================================*/ 84 85 /*================================================================================================== 86 * STRUCTURES AND OTHER TYPEDEFS 87 ==================================================================================================*/ 88 89 /*================================================================================================== 90 * GLOBAL VARIABLE DECLARATIONS 91 ==================================================================================================*/ 92 93 /*================================================================================================== 94 * FUNCTION PROTOTYPES 95 ==================================================================================================*/ 96 #define MCL_START_SEC_CODE 97 #include "Mcl_MemMap.h" 98 99 /** 100 * @brief This function initializes the Trgmux Ip Driver. 101 * @details This service is a non reentrant function that shall initialize the Trgmux Ip driver. 102 * 103 * @param[in] pxTrgmuxInit Pointer to the initialization structure. 104 * 105 * @return TRGMUX_IP_STATUS_LOCKED The trigger is locked. 106 * TRGMUX_IP_STATUS_SUCCESS The initialization was successful. 107 * 108 * @implements Trgmux_Ip_Init_Activity 109 * */ 110 Trgmux_Ip_StatusType Trgmux_Ip_Init(const Trgmux_Ip_InitType * const pxTrgmuxInit); 111 112 /** 113 * @brief This function sets the Trgmux Ip Input. 114 * @details This service is a reentrant function that shall set the Trgmux Ip Input. 115 * 116 * @param[in] LogicTrigger The logic trigger id. 117 * @param[in] Input The input value. 118 * 119 * @return TRGMUX_IP_STATUS_LOCKED The trigger is locked. 120 * TRGMUX_IP_STATUS_SUCCESS The initialization was successful. 121 * 122 * @implements Trgmux_Ip_SetInput_Activity 123 * */ 124 Trgmux_Ip_StatusType Trgmux_Ip_SetInput(const uint32 LogicTrigger, const uint32 Input); 125 126 /** 127 * @brief This function locks the Trgmux Ip Trigger. 128 * @details This service is a reentrant function that shall lock the Trgmux Ip Trigger. 129 * 130 * @param[in] LogicTrigger The logic trigger id. 131 * 132 * @return TRGMUX_IP_STATUS_LOCKED The trigger is locked. 133 * TRGMUX_IP_STATUS_SUCCESS The initialization was successful. 134 * 135 * @implements Trgmux_Ip_SetLock_Activity 136 * */ 137 Trgmux_Ip_StatusType Trgmux_Ip_SetLock(const uint32 LogicTrigger); 138 139 #define MCL_STOP_SEC_CODE 140 #include "Mcl_MemMap.h" 141 142 #endif /* TRGMUX_IP_IS_AVAILABLE */ 143 144 #ifdef __cplusplus 145 } 146 #endif 147 148 /** @} */ 149 150 #endif /* #ifndef TRGMUX_IP_H_ */ 151