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 LCU_IP_HW_ACCESS_H_ 9 #define LCU_IP_HW_ACCESS_H_ 10 11 /** 12 * @file Lcu_Ip_Hw_Access.h 13 * 14 * @version 3.0.0 15 * 16 * @brief AUTOSAR Mcl - Lcu Ip driver source file. 17 * @details 18 * 19 * @addtogroup LCU_IP_DRIVER LCU 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 "Lcu_Ip.h" 34 #include "Lcu_Ip_Devassert.h" 35 36 /*================================================================================================== 37 SOURCE FILE VERSION INFORMATION 38 ==================================================================================================*/ 39 #define LCU_IP_HW_ACCESS_VENDOR_ID 43 40 #define LCU_IP_HW_ACCESS_AR_RELEASE_MAJOR_VERSION 4 41 #define LCU_IP_HW_ACCESS_AR_RELEASE_MINOR_VERSION 7 42 #define LCU_IP_HW_ACCESS_AR_RELEASE_REVISION_VERSION 0 43 #define LCU_IP_HW_ACCESS_SW_MAJOR_VERSION 3 44 #define LCU_IP_HW_ACCESS_SW_MINOR_VERSION 0 45 #define LCU_IP_HW_ACCESS_SW_PATCH_VERSION 0 46 47 /*================================================================================================== 48 FILE VERSION CHECKS 49 ==================================================================================================*/ 50 /* Check if header file and Lcu_Ip.h file are of the same vendor */ 51 #if (LCU_IP_HW_ACCESS_VENDOR_ID != LCU_IP_VENDOR_ID) 52 #error "Lcu_Ip_Hw_Access.h and Lcu_Ip.h have different vendor ids" 53 #endif 54 55 /* Check if header file and Lcu_Ip.h file are of the same Autosar version */ 56 #if ((LCU_IP_HW_ACCESS_AR_RELEASE_MAJOR_VERSION != LCU_IP_AR_RELEASE_MAJOR_VERSION) || \ 57 (LCU_IP_HW_ACCESS_AR_RELEASE_MINOR_VERSION != LCU_IP_AR_RELEASE_MINOR_VERSION) || \ 58 (LCU_IP_HW_ACCESS_AR_RELEASE_REVISION_VERSION != LCU_IP_AR_RELEASE_REVISION_VERSION) \ 59 ) 60 #error "AutoSar Version Numbers of Lcu_Ip_Hw_Access.h and Lcu_Ip.h are different" 61 #endif 62 63 /* Check if header file and Lcu_Ip.h file are of the same Software version */ 64 #if ((LCU_IP_HW_ACCESS_SW_MAJOR_VERSION != LCU_IP_SW_MAJOR_VERSION) || \ 65 (LCU_IP_HW_ACCESS_SW_MINOR_VERSION != LCU_IP_SW_MINOR_VERSION) || \ 66 (LCU_IP_HW_ACCESS_SW_PATCH_VERSION != LCU_IP_SW_PATCH_VERSION) \ 67 ) 68 #error "Software Version Numbers of Lcu_Ip_Hw_Access.h and Lcu_Ip.h are different" 69 #endif 70 71 /* Check if header file and Lcu_Ip_Devassert.h file are of the same vendor */ 72 #if (LCU_IP_HW_ACCESS_VENDOR_ID != LCU_IP_DEVASSERT_VENDOR_ID) 73 #error "Lcu_Ip_Hw_Access.h and Lcu_Ip_Devassert.h have different vendor ids" 74 #endif 75 76 /* Check if header file and Lcu_Ip_Devassert.h file are of the same Autosar version */ 77 #if ((LCU_IP_HW_ACCESS_AR_RELEASE_MAJOR_VERSION != LCU_IP_DEVASSERT_AR_RELEASE_MAJOR_VERSION) || \ 78 (LCU_IP_HW_ACCESS_AR_RELEASE_MINOR_VERSION != LCU_IP_DEVASSERT_AR_RELEASE_MINOR_VERSION) || \ 79 (LCU_IP_HW_ACCESS_AR_RELEASE_REVISION_VERSION != LCU_IP_DEVASSERT_AR_RELEASE_REVISION_VERSION) \ 80 ) 81 #error "AutoSar Version Numbers of Lcu_Ip_Hw_Access.h and Lcu_Ip_Devassert.h are different" 82 #endif 83 84 /* Check if header file and Lcu_Ip_Devassert.h file are of the same Software version */ 85 #if ((LCU_IP_HW_ACCESS_SW_MAJOR_VERSION != LCU_IP_DEVASSERT_SW_MAJOR_VERSION) || \ 86 (LCU_IP_HW_ACCESS_SW_MINOR_VERSION != LCU_IP_DEVASSERT_SW_MINOR_VERSION) || \ 87 (LCU_IP_HW_ACCESS_SW_PATCH_VERSION != LCU_IP_DEVASSERT_SW_PATCH_VERSION) \ 88 ) 89 #error "Software Version Numbers of Lcu_Ip_Hw_Access.h and Lcu_Ip_Devassert.h are different" 90 #endif 91 92 #if (STD_ON == LCU_IP_IS_AVAILABLE) 93 /*================================================================================================== 94 * CONSTANTS 95 ==================================================================================================*/ 96 97 /*================================================================================================== 98 * DEFINES AND MACROS 99 ==================================================================================================*/ 100 101 /*================================================================================================== 102 * ENUMS 103 ==================================================================================================*/ 104 105 /*================================================================================================== 106 * STRUCTURES AND OTHER TYPEDEFS 107 ==================================================================================================*/ 108 109 /*================================================================================================== 110 * GLOBAL VARIABLE DECLARATIONS 111 ==================================================================================================*/ 112 extern LCU_Type * const Lcu_Ip_paxBaseInst[LCU_INSTANCE_COUNT]; 113 114 /*================================================================================================== 115 * FUNCTION PROTOTYPES 116 ==================================================================================================*/ 117 #define MCL_START_SEC_CODE 118 #include "Mcl_MemMap.h" 119 120 void HwAcc_Lcu_SetHwOutputSetState(const uint8 LcuId, const uint8 HwLcOutputId, Lcu_Ip_HwOutputStateType * SetState); 121 122 /* Input Configuration */ 123 void HwAcc_Lcu_AsyncSetInputMuxSelect(const uint8 LcuId, const uint8 HwLcInputId, uint8 MaskValue); 124 125 void HwAcc_Lcu_AsyncSetInputSwOverrideValue(const uint8 LcuId, const uint8 HwLcInputId, uint8 MaskValue); 126 127 void HwAcc_Lcu_AsyncSetInputSwSyncMode(const uint8 LcuId, const uint8 HwLcInputId, uint8 MaskValue); 128 129 void HwAcc_Lcu_AsyncSetInputSwOverrideEnable(const uint8 LcuId, const uint8 HwLcInputId, uint8 MaskValue); 130 131 /* Output Configuration */ 132 133 boolean HwAcc_Lcu_AsyncSetOutputEnable(const uint8 LcuId, const uint8 HwLcOutputId, uint16 MaskValue); 134 135 boolean HwAcc_Lcu_AsyncSetOutputDebugMode(const uint8 LcuId, const uint8 HwLcOutputId, uint16 MaskValue); 136 137 boolean HwAcc_Lcu_AsyncSetOutputForceInputSensitivity(const uint8 LcuId, const uint8 HwLcOutputId, uint16 MaskValue); 138 139 boolean HwAcc_Lcu_AsyncSetOutputForceClearingMode(const uint8 LcuId, const uint8 HwLcOutputId, uint16 MaskValue); 140 141 boolean HwAcc_Lcu_AsyncSetOutputForceSyncSelect(const uint8 LcuId, const uint8 HwLcOutputId, uint16 MaskValue); 142 143 boolean HwAcc_Lcu_AsyncSetOutputPolarity(const uint8 LcuId, const uint8 HwLcOutputId, uint16 MaskValue); 144 145 boolean HwAcc_Lcu_AsyncClearOutputForceEvent(const uint8 LcuId, const uint8 HwLcOutputId, uint16 MaskValue); 146 147 boolean HwAcc_Lcu_AsyncSetOutputForceDma(const uint8 LcuId, const uint8 HwLcOutputId, uint16 MaskValue); 148 149 boolean HwAcc_Lcu_AsyncSetOutputForceInt(const uint8 LcuId, const uint8 HwLcOutputId, uint16 MaskValue); 150 151 boolean HwAcc_Lcu_AsyncSetOutputLutDma(const uint8 LcuId, const uint8 HwLcOutputId, uint16 MaskValue); 152 153 boolean HwAcc_Lcu_AsyncSetOutputLutInt(const uint8 LcuId, const uint8 HwLcOutputId, uint16 MaskValue); 154 155 boolean HwAcc_Lcu_AsyncSetOutputFallFilter(const uint8 LcuId, const uint8 HwLcOutputId, uint16 MaskValue); 156 157 boolean HwAcc_Lcu_AsyncSetOutputRiseFilter(const uint8 LcuId, const uint8 HwLcOutputId, uint16 MaskValue); 158 159 boolean HwAcc_Lcu_AsyncSetOutputLutControl(const uint8 LcuId, const uint8 HwLcOutputId, uint16 MaskValue); 160 161 uint8 HwAcc_Lcu_AsyncGetCombineForceInput(const uint8 LcuId, const uint8 HwLcOutputId); 162 163 /* LC/LCU Configuration */ 164 void HwAcc_Lcu_SetForceFilter(const uint8 LcuId, const uint8 LcId, uint8 MaskValue); 165 166 void HwAcc_Lcu_SetForcePolarity(const uint8 LcuId, const uint8 LcId, uint8 MaskValue); 167 168 void HwAcc_Lcu_SetCombineEnable(const uint8 LcuId, const uint8 LcId, uint8 MaskValue); 169 170 void HwAcc_Lcu_SetSwSyncSelect(const uint8 LcuId, const uint8 LcId, uint8 MaskValue); 171 172 void HwAcc_Lcu_SetWriteProtect(const uint8 LcuId); 173 174 Lcu_Ip_ReturnType HwAcc_Lcu_GetWriteProtect(const uint8 LcuId); 175 176 #if (STD_ON == LCU_IP_ASYNC_FUNC_IS_AVAILABLE) 177 void HwAcc_Lcu_AsyncSetInputList(const uint32 Parameter, const uint8 LcuId, const uint8 HwLcInputId, uint8 MaskValue); 178 179 boolean HwAcc_Lcu_AsyncSetOutputList(const uint32 Parameter, const uint8 LcuId, const uint8 HwLcOutputId, uint16 MaskValue); 180 #endif /* #if (STD_ON == LCU_IP_ASYNC_FUNC_IS_AVAILABLE) */ 181 182 void HwAcc_Lcu_SetHwOutputCallbackState(const uint8 LcuId, const uint8 HwLcOutputId, Lcu_Ip_Callback IntCallback); 183 184 Lcu_Ip_HwOutputStateType * HwAcc_Lcu_GetHwOutputStatePointer(const uint8 LcuId, const uint8 LcId, const uint8 OutputId); 185 186 /* Set Status Register to reset value */ 187 void HwAcc_Lcu_AsyncClearAllForceEvent(uint8 LcuId, uint8 LcId); 188 189 void HwAcc_Lcu_AsyncClearAllLutEvent(uint8 LcuId, uint8 LcId); 190 191 void HwAcc_Lcu_AsynGetInputInfo(const uint8 Param, const uint8 LcuId, const uint8 HwLcInputId, uint8 * const Value); 192 193 void HwAcc_Lcu_AsynGetOutputInfo(const uint8 Param, const uint8 LcuId, const uint8 HwLcOutputId, uint8 * const Value); 194 195 void HwAcc_Lcu_SetInstanceOperationMode(const uint8 LucId, const uint8 OperationMode); 196 197 /* Set FCTRL value */ 198 void HwAcc_Lcu_SetLcForceControl(const uint8 LcuId, const uint8 HwLcOutputId, const Lcu_Ip_LogicOutputConfigType * const pConfig); 199 200 #define MCL_STOP_SEC_CODE 201 #include "Mcl_MemMap.h" 202 203 #endif /* #if (STD_ON == LCU_IP_IS_AVAILABLE) */ 204 205 #ifdef __cplusplus 206 } 207 #endif 208 209 /** @} */ 210 211 #endif /* #ifndef LCU_IP_HW_ACCESS_H_ */ 212 213 /*================================================================================================== 214 * END OF FILE 215 ==================================================================================================*/ 216