/* * File: SIL_capi.c * * Code generated for Simulink model 'SIL'. * * Model version : 1.470 * Simulink Coder version : 9.0 (R2018b) 24-May-2018 * C/C++ source code generated on : Thu Oct 22 10:25:15 2020 * * Target selection: ert_shrlib.tlc * Embedded hardware selection: Intel->x86-64 (Windows64) * Code generation objectives: Unspecified * Validation result: Not run */ #include #include "rtw_capi.h" #ifdef HOST_CAPI_BUILD #include "SIL_capi_host.h" #define sizeof(s) ((size_t)(0xFFFF)) #undef rt_offsetof #define rt_offsetof(s,el) ((uint16_T)(0xFFFF)) #define TARGET_CONST #define TARGET_STRING(s) (s) #else /* HOST_CAPI_BUILD */ #include "builtin_typeid_types.h" #include "SIL.h" #include "SIL_capi.h" #include "SIL_private.h" #ifdef LIGHT_WEIGHT_CAPI #define TARGET_CONST #define TARGET_STRING(s) (NULL) #else #define TARGET_CONST const #define TARGET_STRING(s) (s) #endif #endif /* HOST_CAPI_BUILD */ /* Individual block tuning is not valid when inline parameters is * * selected. An empty map is produced to provide a consistent * * interface independent of inlining parameters. * */ static const rtwCAPI_BlockParameters rtBlockParameters[] = { /* addrMapIndex, blockPath, * paramName, dataTypeIndex, dimIndex, fixPtIdx */ { 0, (NULL), (NULL), 0, 0, 0 } }; /* Tunable variable parameters */ static const rtwCAPI_ModelParameters rtModelParameters[] = { /* addrMapIndex, varName, dataTypeIndex, dimIndex, fixPtIndex */ { 0, TARGET_STRING("AccelBias"), 0, 0, 0 }, { 1, TARGET_STRING("AccelScaleMatrix"), 0, 1, 0 }, { 2, TARGET_STRING("BoosterUncertGain"), 0, 2, 0 }, { 3, TARGET_STRING("CD0UncertVal"), 0, 2, 0 }, { 4, TARGET_STRING("CG_bias_m"), 0, 0, 0 }, { 5, TARGET_STRING("CL0UncertVal"), 0, 2, 0 }, { 6, TARGET_STRING("CLaUncertGain"), 0, 2, 0 }, { 7, TARGET_STRING("CLdeUncertGain"), 0, 2, 0 }, { 8, TARGET_STRING("CLqUncertGain"), 0, 2, 0 }, { 9, TARGET_STRING("CY0UncertVal"), 0, 2, 0 }, { 10, TARGET_STRING("CYbUncertGain"), 0, 2, 0 }, { 11, TARGET_STRING("CYdrUncertGain"), 0, 2, 0 }, { 12, TARGET_STRING("CYpUncertGain"), 0, 2, 0 }, { 13, TARGET_STRING("CYrUncertGain"), 0, 2, 0 }, { 14, TARGET_STRING("Cl0UncertVal"), 0, 2, 0 }, { 15, TARGET_STRING("ClbUncertGain"), 0, 2, 0 }, { 16, TARGET_STRING("CldaUncertGain"), 0, 2, 0 }, { 17, TARGET_STRING("CldrUncertGain"), 0, 2, 0 }, { 18, TARGET_STRING("ClpUncertGain"), 0, 2, 0 }, { 19, TARGET_STRING("ClrUncertGain"), 0, 2, 0 }, { 20, TARGET_STRING("Cm0UncertVal"), 0, 2, 0 }, { 21, TARGET_STRING("CmaUncertGain"), 0, 2, 0 }, { 22, TARGET_STRING("CmdeUncertGain"), 0, 2, 0 }, { 23, TARGET_STRING("CmqUncertGain"), 0, 2, 0 }, { 24, TARGET_STRING("Cn0UncertVal"), 0, 2, 0 }, { 25, TARGET_STRING("CnbUncertGain"), 0, 2, 0 }, { 26, TARGET_STRING("CndaUncertGain"), 0, 2, 0 }, { 27, TARGET_STRING("CndrUncertGain"), 0, 2, 0 }, { 28, TARGET_STRING("CnpUncertGain"), 0, 2, 0 }, { 29, TARGET_STRING("CnrUncertGain"), 0, 2, 0 }, { 30, TARGET_STRING("GyroBias"), 0, 0, 0 }, { 31, TARGET_STRING("GyroGBias"), 0, 0, 0 }, { 32, TARGET_STRING("GyroScaleMatrix"), 0, 1, 0 }, { 33, TARGET_STRING("IMUloc"), 0, 0, 0 }, { 34, TARGET_STRING("InertiaMoments_bias_kg_m2"), 0, 1, 0 }, { 35, TARGET_STRING("ThrustUncertGain"), 0, 2, 0 }, { 36, TARGET_STRING("booster_att_rad"), 0, 0, 0 }, { 37, TARGET_STRING("booster_pos_m"), 0, 0, 0 }, { 38, TARGET_STRING("engine_att_rad"), 0, 0, 0 }, { 39, TARGET_STRING("engine_pos_m"), 0, 0, 0 }, { 40, TARGET_STRING("force_CG"), 0, 2, 0 }, { 41, TARGET_STRING("force_CG_pos_m"), 0, 0, 0 }, { 42, TARGET_STRING("hground"), 0, 2, 0 }, { 43, TARGET_STRING("CLa"), 1, 2, 0 }, { 44, TARGET_STRING("Clda_lst"), 1, 3, 0 }, { 45, TARGET_STRING("Clp_lst"), 1, 3, 0 }, { 46, TARGET_STRING("Cmde_lst"), 1, 3, 0 }, { 47, TARGET_STRING("Cmq_lst"), 1, 3, 0 }, { 48, TARGET_STRING("Ixx"), 1, 2, 0 }, { 49, TARGET_STRING("Iyy"), 1, 2, 0 }, { 50, TARGET_STRING("Ma_lst"), 1, 3, 0 }, { 51, TARGET_STRING("RefArea"), 1, 2, 0 }, { 52, TARGET_STRING("RefLen"), 1, 2, 0 }, { 53, TARGET_STRING("RefSpan"), 1, 2, 0 }, { 54, TARGET_STRING("dal0"), 1, 2, 0 }, { 55, TARGET_STRING("dar0"), 1, 2, 0 }, { 56, TARGET_STRING("del0"), 1, 2, 0 }, { 57, TARGET_STRING("der0"), 1, 2, 0 }, { 58, TARGET_STRING("dr0"), 1, 2, 0 }, { 59, TARGET_STRING("h_thr2rpm"), 1, 0, 0 }, { 60, TARGET_STRING("k_dal"), 1, 2, 0 }, { 61, TARGET_STRING("k_dar"), 1, 2, 0 }, { 62, TARGET_STRING("k_del"), 1, 2, 0 }, { 63, TARGET_STRING("k_der"), 1, 2, 0 }, { 64, TARGET_STRING("k_dr"), 1, 2, 0 }, { 65, TARGET_STRING("ksi_v2tht"), 1, 2, 0 }, { 66, TARGET_STRING("m"), 1, 2, 0 }, { 67, TARGET_STRING("max_az"), 1, 2, 0 }, { 68, TARGET_STRING("max_da"), 1, 2, 0 }, { 69, TARGET_STRING("max_de"), 1, 2, 0 }, { 70, TARGET_STRING("max_dr"), 1, 2, 0 }, { 71, TARGET_STRING("max_hdot"), 1, 2, 0 }, { 72, TARGET_STRING("max_p"), 1, 2, 0 }, { 73, TARGET_STRING("max_phi"), 1, 2, 0 }, { 74, TARGET_STRING("max_q"), 1, 2, 0 }, { 75, TARGET_STRING("max_rpm"), 1, 0, 0 }, { 76, TARGET_STRING("max_thr"), 1, 2, 0 }, { 77, TARGET_STRING("max_tht"), 1, 2, 0 }, { 78, TARGET_STRING("min_de"), 1, 2, 0 }, { 79, TARGET_STRING("min_hdot"), 1, 2, 0 }, { 80, TARGET_STRING("min_rpm"), 1, 0, 0 }, { 81, TARGET_STRING("min_tht"), 1, 2, 0 }, { 82, TARGET_STRING("w_as"), 1, 2, 0 }, { 83, TARGET_STRING("w_v2tht"), 1, 2, 0 }, { 84, TARGET_STRING("w_x"), 1, 2, 0 }, { 85, TARGET_STRING("w_y"), 1, 2, 0 }, { 86, TARGET_STRING("washout_r_den"), 1, 4, 0 }, { 87, TARGET_STRING("washout_r_num"), 1, 4, 0 }, { 88, TARGET_STRING("system_id"), 2, 2, 0 }, { 89, TARGET_STRING("transrate"), 3, 2, 0 }, { 0, (NULL), 0, 0, 0 } }; #ifndef HOST_CAPI_BUILD /* Declare Data Addresses statically */ static void* rtDataAddrMap[] = { &SIL_P.AccelBias[0], /* 0: Model Parameter */ &SIL_P.AccelScaleMatrix[0], /* 1: Model Parameter */ &SIL_P.BoosterUncertGain, /* 2: Model Parameter */ &SIL_P.CD0UncertVal, /* 3: Model Parameter */ &SIL_P.CG_bias_m[0], /* 4: Model Parameter */ &SIL_P.CL0UncertVal, /* 5: Model Parameter */ &SIL_P.CLaUncertGain, /* 6: Model Parameter */ &SIL_P.CLdeUncertGain, /* 7: Model Parameter */ &SIL_P.CLqUncertGain, /* 8: Model Parameter */ &SIL_P.CY0UncertVal, /* 9: Model Parameter */ &SIL_P.CYbUncertGain, /* 10: Model Parameter */ &SIL_P.CYdrUncertGain, /* 11: Model Parameter */ &SIL_P.CYpUncertGain, /* 12: Model Parameter */ &SIL_P.CYrUncertGain, /* 13: Model Parameter */ &SIL_P.Cl0UncertVal, /* 14: Model Parameter */ &SIL_P.ClbUncertGain, /* 15: Model Parameter */ &SIL_P.CldaUncertGain, /* 16: Model Parameter */ &SIL_P.CldrUncertGain, /* 17: Model Parameter */ &SIL_P.ClpUncertGain, /* 18: Model Parameter */ &SIL_P.ClrUncertGain, /* 19: Model Parameter */ &SIL_P.Cm0UncertVal, /* 20: Model Parameter */ &SIL_P.CmaUncertGain, /* 21: Model Parameter */ &SIL_P.CmdeUncertGain, /* 22: Model Parameter */ &SIL_P.CmqUncertGain, /* 23: Model Parameter */ &SIL_P.Cn0UncertVal, /* 24: Model Parameter */ &SIL_P.CnbUncertGain, /* 25: Model Parameter */ &SIL_P.CndaUncertGain, /* 26: Model Parameter */ &SIL_P.CndrUncertGain, /* 27: Model Parameter */ &SIL_P.CnpUncertGain, /* 28: Model Parameter */ &SIL_P.CnrUncertGain, /* 29: Model Parameter */ &SIL_P.GyroBias[0], /* 30: Model Parameter */ &SIL_P.GyroGBias[0], /* 31: Model Parameter */ &SIL_P.GyroScaleMatrix[0], /* 32: Model Parameter */ &SIL_P.IMUloc[0], /* 33: Model Parameter */ &SIL_P.InertiaMoments_bias_kg_m2[0], /* 34: Model Parameter */ &SIL_P.ThrustUncertGain, /* 35: Model Parameter */ &SIL_P.booster_att_rad[0], /* 36: Model Parameter */ &SIL_P.booster_pos_m[0], /* 37: Model Parameter */ &SIL_P.engine_att_rad[0], /* 38: Model Parameter */ &SIL_P.engine_pos_m[0], /* 39: Model Parameter */ &SIL_P.force_CG, /* 40: Model Parameter */ &SIL_P.force_CG_pos_m[0], /* 41: Model Parameter */ &SIL_P.hground, /* 42: Model Parameter */ &SIL_P.CLa, /* 43: Model Parameter */ &SIL_P.Clda_lst[0], /* 44: Model Parameter */ &SIL_P.Clp_lst[0], /* 45: Model Parameter */ &SIL_P.Cmde_lst[0], /* 46: Model Parameter */ &SIL_P.Cmq_lst[0], /* 47: Model Parameter */ &SIL_P.Ixx, /* 48: Model Parameter */ &SIL_P.Iyy, /* 49: Model Parameter */ &SIL_P.Ma_lst[0], /* 50: Model Parameter */ &SIL_P.RefArea, /* 51: Model Parameter */ &SIL_P.RefLen, /* 52: Model Parameter */ &SIL_P.RefSpan, /* 53: Model Parameter */ &SIL_P.dal0, /* 54: Model Parameter */ &SIL_P.dar0, /* 55: Model Parameter */ &SIL_P.del0, /* 56: Model Parameter */ &SIL_P.der0, /* 57: Model Parameter */ &SIL_P.dr0, /* 58: Model Parameter */ &SIL_P.h_thr2rpm[0], /* 59: Model Parameter */ &SIL_P.k_dal, /* 60: Model Parameter */ &SIL_P.k_dar, /* 61: Model Parameter */ &SIL_P.k_del, /* 62: Model Parameter */ &SIL_P.k_der, /* 63: Model Parameter */ &SIL_P.k_dr, /* 64: Model Parameter */ &SIL_P.ksi_v2tht, /* 65: Model Parameter */ &SIL_P.m, /* 66: Model Parameter */ &SIL_P.max_az, /* 67: Model Parameter */ &SIL_P.max_da, /* 68: Model Parameter */ &SIL_P.max_de, /* 69: Model Parameter */ &SIL_P.max_dr, /* 70: Model Parameter */ &SIL_P.max_hdot, /* 71: Model Parameter */ &SIL_P.max_p, /* 72: Model Parameter */ &SIL_P.max_phi, /* 73: Model Parameter */ &SIL_P.max_q, /* 74: Model Parameter */ &SIL_P.max_rpm[0], /* 75: Model Parameter */ &SIL_P.max_thr, /* 76: Model Parameter */ &SIL_P.max_tht, /* 77: Model Parameter */ &SIL_P.min_de, /* 78: Model Parameter */ &SIL_P.min_hdot, /* 79: Model Parameter */ &SIL_P.min_rpm[0], /* 80: Model Parameter */ &SIL_P.min_tht, /* 81: Model Parameter */ &SIL_P.w_as, /* 82: Model Parameter */ &SIL_P.w_v2tht, /* 83: Model Parameter */ &SIL_P.w_x, /* 84: Model Parameter */ &SIL_P.w_y, /* 85: Model Parameter */ &SIL_P.washout_r_den[0], /* 86: Model Parameter */ &SIL_P.washout_r_num[0], /* 87: Model Parameter */ &SIL_P.system_id, /* 88: Model Parameter */ &transrate, /* 89: Model Parameter */ }; /* Declare Data Run-Time Dimension Buffer Addresses statically */ static int32_T* rtVarDimsAddrMap[] = { (NULL) }; #endif /* Data Type Map - use dataTypeMapIndex to access this structure */ static TARGET_CONST rtwCAPI_DataTypeMap rtDataTypeMap[] = { /* cName, mwName, numElements, elemMapIndex, dataSize, slDataId, * * isComplex, isPointer */ { "double", "real_T", 0, 0, sizeof(real_T), SS_DOUBLE, 0, 0 }, { "float", "real32_T", 0, 0, sizeof(real32_T), SS_SINGLE, 0, 0 }, { "unsigned short", "uint16_T", 0, 0, sizeof(uint16_T), SS_UINT16, 0, 0 }, { "unsigned int", "uint32_T", 0, 0, sizeof(uint32_T), SS_UINT32, 0, 0 } }; #ifdef HOST_CAPI_BUILD #undef sizeof #endif /* Structure Element Map - use elemMapIndex to access this structure */ static TARGET_CONST rtwCAPI_ElementMap rtElementMap[] = { /* elementName, elementOffset, dataTypeIndex, dimIndex, fxpIndex */ { (NULL), 0, 0, 0, 0 }, }; /* Dimension Map - use dimensionMapIndex to access elements of ths structure*/ static const rtwCAPI_DimensionMap rtDimensionMap[] = { /* dataOrientation, dimArrayIndex, numDims, vardimsIndex */ { rtwCAPI_VECTOR, 0, 2, 0 }, { rtwCAPI_MATRIX_COL_MAJOR, 2, 2, 0 }, { rtwCAPI_SCALAR, 4, 2, 0 }, { rtwCAPI_VECTOR, 6, 2, 0 }, { rtwCAPI_VECTOR, 8, 2, 0 } }; /* Dimension Array- use dimArrayIndex to access elements of this array */ static const uint_T rtDimensionArray[] = { 1, /* 0 */ 3, /* 1 */ 3, /* 2 */ 3, /* 3 */ 1, /* 4 */ 1, /* 5 */ 1, /* 6 */ 11, /* 7 */ 1, /* 8 */ 2 /* 9 */ }; /* Fixed Point Map */ static const rtwCAPI_FixPtMap rtFixPtMap[] = { /* fracSlopePtr, biasPtr, scaleType, wordLength, exponent, isSigned */ { (NULL), (NULL), rtwCAPI_FIX_RESERVED, 0, 0, 0 }, }; /* Sample Time Map - use sTimeIndex to access elements of ths structure */ static const rtwCAPI_SampleTimeMap rtSampleTimeMap[] = { /* samplePeriodPtr, sampleOffsetPtr, tid, samplingMode */ { (NULL), (NULL), 0, 0 } }; static rtwCAPI_ModelMappingStaticInfo mmiStatic = { /* Signals:{signals, numSignals, * rootInputs, numRootInputs, * rootOutputs, numRootOutputs}, * Params: {blockParameters, numBlockParameters, * modelParameters, numModelParameters}, * States: {states, numStates}, * Maps: {dataTypeMap, dimensionMap, fixPtMap, * elementMap, sampleTimeMap, dimensionArray}, * TargetType: targetType */ { (NULL), 0, (NULL), 0, (NULL), 0 }, { rtBlockParameters, 0, rtModelParameters, 90 }, { (NULL), 0 }, { rtDataTypeMap, rtDimensionMap, rtFixPtMap, rtElementMap, rtSampleTimeMap, rtDimensionArray }, "float", { 1933200694U, 935469783U, 3860272542U, 3263114025U }, (NULL), 0, 0 }; /* Function to get C API Model Mapping Static Info */ const rtwCAPI_ModelMappingStaticInfo* SIL_GetCAPIStaticMap(void) { return &mmiStatic; } /* Cache pointers into DataMapInfo substructure of RTModel */ #ifndef HOST_CAPI_BUILD void SIL_InitializeDataMapInfo(void) { /* Set C-API version */ rtwCAPI_SetVersion(SIL_M->DataMapInfo.mmi, 1); /* Cache static C-API data into the Real-time Model Data structure */ rtwCAPI_SetStaticMap(SIL_M->DataMapInfo.mmi, &mmiStatic); /* Cache static C-API logging data into the Real-time Model Data structure */ rtwCAPI_SetLoggingStaticMap(SIL_M->DataMapInfo.mmi, (NULL)); /* Cache C-API Data Addresses into the Real-Time Model Data structure */ rtwCAPI_SetDataAddressMap(SIL_M->DataMapInfo.mmi, rtDataAddrMap); /* Cache C-API Data Run-Time Dimension Buffer Addresses into the Real-Time Model Data structure */ rtwCAPI_SetVarDimsAddressMap(SIL_M->DataMapInfo.mmi, rtVarDimsAddrMap); /* Cache the instance C-API logging pointer */ rtwCAPI_SetInstanceLoggingInfo(SIL_M->DataMapInfo.mmi, (NULL)); /* Set reference to submodels */ rtwCAPI_SetChildMMIArray(SIL_M->DataMapInfo.mmi, (NULL)); rtwCAPI_SetChildMMIArrayLen(SIL_M->DataMapInfo.mmi, 0); } #else /* HOST_CAPI_BUILD */ #ifdef __cplusplus extern "C" { #endif void SIL_host_InitializeDataMapInfo(SIL_host_DataMapInfo_T *dataMap, const char *path) { /* Set C-API version */ rtwCAPI_SetVersion(dataMap->mmi, 1); /* Cache static C-API data into the Real-time Model Data structure */ rtwCAPI_SetStaticMap(dataMap->mmi, &mmiStatic); /* host data address map is NULL */ rtwCAPI_SetDataAddressMap(dataMap->mmi, NULL); /* host vardims address map is NULL */ rtwCAPI_SetVarDimsAddressMap(dataMap->mmi, NULL); /* Set Instance specific path */ rtwCAPI_SetPath(dataMap->mmi, path); rtwCAPI_SetFullPath(dataMap->mmi, NULL); /* Set reference to submodels */ rtwCAPI_SetChildMMIArray(dataMap->mmi, (NULL)); rtwCAPI_SetChildMMIArrayLen(dataMap->mmi, 0); } #ifdef __cplusplus } #endif #endif /* HOST_CAPI_BUILD */ /* * File trailer for generated code. * * [EOF] */