Skip to content

Commit

Permalink
Unified XCPlite and xcp-lite record layout names
Browse files Browse the repository at this point in the history
  • Loading branch information
RainerZ committed Nov 12, 2024
1 parent 7f1e9ca commit e7a07ae
Show file tree
Hide file tree
Showing 8 changed files with 212 additions and 334 deletions.
96 changes: 47 additions & 49 deletions CPP_Demo/CPP_Demo.a2l
Original file line number Diff line number Diff line change
Expand Up @@ -15,50 +15,50 @@ ALIGNMENT_FLOAT64_IEEE 1
ALIGNMENT_INT64 1
/end MOD_COMMON

/begin RECORD_LAYOUT R_FLOAT64_IEEE FNC_VALUES 1 FLOAT64_IEEE ROW_DIR DIRECT /end RECORD_LAYOUT
/begin TYPEDEF_MEASUREMENT M_FLOAT64_IEEE "" FLOAT64_IEEE NO_COMPU_METHOD 0 0 -1E12 1E12 /end TYPEDEF_MEASUREMENT
/begin TYPEDEF_CHARACTERISTIC C_FLOAT64_IEEE "" VALUE R_FLOAT64_IEEE 0 NO_COMPU_METHOD -1E12 1E12 /end TYPEDEF_CHARACTERISTIC
/begin RECORD_LAYOUT R_FLOAT32_IEEE FNC_VALUES 1 FLOAT32_IEEE ROW_DIR DIRECT /end RECORD_LAYOUT
/begin TYPEDEF_MEASUREMENT M_FLOAT32_IEEE "" FLOAT32_IEEE NO_COMPU_METHOD 0 0 -1E12 1E12 /end TYPEDEF_MEASUREMENT
/begin TYPEDEF_CHARACTERISTIC C_FLOAT32_IEEE "" VALUE R_FLOAT32_IEEE 0 NO_COMPU_METHOD -1E12 1E12 /end TYPEDEF_CHARACTERISTIC
/begin RECORD_LAYOUT R_A_INT64 FNC_VALUES 1 A_INT64 ROW_DIR DIRECT /end RECORD_LAYOUT
/begin TYPEDEF_MEASUREMENT M_A_INT64 "" A_INT64 NO_COMPU_METHOD 0 0 -1E12 1E12 /end TYPEDEF_MEASUREMENT
/begin TYPEDEF_CHARACTERISTIC C_A_INT64 "" VALUE R_A_INT64 0 NO_COMPU_METHOD -1E12 1E12 /end TYPEDEF_CHARACTERISTIC
/begin RECORD_LAYOUT R_SLONG FNC_VALUES 1 SLONG ROW_DIR DIRECT /end RECORD_LAYOUT
/begin TYPEDEF_MEASUREMENT M_SLONG "" SLONG NO_COMPU_METHOD 0 0 -2147483648 2147483647 /end TYPEDEF_MEASUREMENT
/begin TYPEDEF_CHARACTERISTIC C_SLONG "" VALUE R_SLONG 0 NO_COMPU_METHOD -2147483648 2147483647 /end TYPEDEF_CHARACTERISTIC
/begin RECORD_LAYOUT R_SWORD FNC_VALUES 1 SWORD ROW_DIR DIRECT /end RECORD_LAYOUT
/begin TYPEDEF_MEASUREMENT M_SWORD "" SWORD NO_COMPU_METHOD 0 0 -32768 32767 /end TYPEDEF_MEASUREMENT
/begin TYPEDEF_CHARACTERISTIC C_SWORD "" VALUE R_SWORD 0 NO_COMPU_METHOD -32768 32767 /end TYPEDEF_CHARACTERISTIC
/begin RECORD_LAYOUT R_SBYTE FNC_VALUES 1 SBYTE ROW_DIR DIRECT /end RECORD_LAYOUT
/begin TYPEDEF_MEASUREMENT M_SBYTE "" SBYTE NO_COMPU_METHOD 0 0 -128 127 /end TYPEDEF_MEASUREMENT
/begin TYPEDEF_CHARACTERISTIC C_SBYTE "" VALUE R_SBYTE 0 NO_COMPU_METHOD -128 127 /end TYPEDEF_CHARACTERISTIC
/begin RECORD_LAYOUT R_UBYTE FNC_VALUES 1 UBYTE ROW_DIR DIRECT /end RECORD_LAYOUT
/begin TYPEDEF_MEASUREMENT M_UBYTE "" UBYTE NO_COMPU_METHOD 0 0 0 255 /end TYPEDEF_MEASUREMENT
/begin TYPEDEF_CHARACTERISTIC C_UBYTE "" VALUE R_UBYTE 0 NO_COMPU_METHOD 0 255 /end TYPEDEF_CHARACTERISTIC
/begin RECORD_LAYOUT R_UWORD FNC_VALUES 1 UWORD ROW_DIR DIRECT /end RECORD_LAYOUT
/begin TYPEDEF_MEASUREMENT M_UWORD "" UWORD NO_COMPU_METHOD 0 0 0 65535 /end TYPEDEF_MEASUREMENT
/begin TYPEDEF_CHARACTERISTIC C_UWORD "" VALUE R_UWORD 0 NO_COMPU_METHOD 0 65535 /end TYPEDEF_CHARACTERISTIC
/begin RECORD_LAYOUT R_ULONG FNC_VALUES 1 ULONG ROW_DIR DIRECT /end RECORD_LAYOUT
/begin TYPEDEF_MEASUREMENT M_ULONG "" ULONG NO_COMPU_METHOD 0 0 0 4294967295 /end TYPEDEF_MEASUREMENT
/begin TYPEDEF_CHARACTERISTIC C_ULONG "" VALUE R_ULONG 0 NO_COMPU_METHOD 0 4294967295 /end TYPEDEF_CHARACTERISTIC
/begin RECORD_LAYOUT R_A_UINT64 FNC_VALUES 1 A_UINT64 ROW_DIR DIRECT /end RECORD_LAYOUT
/begin TYPEDEF_MEASUREMENT M_A_UINT64 "" A_UINT64 NO_COMPU_METHOD 0 0 0 1E12 /end TYPEDEF_MEASUREMENT
/begin TYPEDEF_CHARACTERISTIC C_A_UINT64 "" VALUE R_A_UINT64 0 NO_COMPU_METHOD 0 1E12 /end TYPEDEF_CHARACTERISTIC
/begin RECORD_LAYOUT F64 FNC_VALUES 1 FLOAT64_IEEE ROW_DIR DIRECT /end RECORD_LAYOUT
/begin TYPEDEF_MEASUREMENT M_F64 "" FLOAT64_IEEE NO_COMPU_METHOD 0 0 -1E12 1E12 /end TYPEDEF_MEASUREMENT
/begin TYPEDEF_CHARACTERISTIC C_F64 "" VALUE F64 0 NO_COMPU_METHOD -1E12 1E12 /end TYPEDEF_CHARACTERISTIC
/begin RECORD_LAYOUT F32 FNC_VALUES 1 FLOAT32_IEEE ROW_DIR DIRECT /end RECORD_LAYOUT
/begin TYPEDEF_MEASUREMENT M_F32 "" FLOAT32_IEEE NO_COMPU_METHOD 0 0 -1E12 1E12 /end TYPEDEF_MEASUREMENT
/begin TYPEDEF_CHARACTERISTIC C_F32 "" VALUE F32 0 NO_COMPU_METHOD -1E12 1E12 /end TYPEDEF_CHARACTERISTIC
/begin RECORD_LAYOUT S64 FNC_VALUES 1 A_INT64 ROW_DIR DIRECT /end RECORD_LAYOUT
/begin TYPEDEF_MEASUREMENT M_S64 "" A_INT64 NO_COMPU_METHOD 0 0 -1E12 1E12 /end TYPEDEF_MEASUREMENT
/begin TYPEDEF_CHARACTERISTIC C_S64 "" VALUE S64 0 NO_COMPU_METHOD -1E12 1E12 /end TYPEDEF_CHARACTERISTIC
/begin RECORD_LAYOUT S32 FNC_VALUES 1 SLONG ROW_DIR DIRECT /end RECORD_LAYOUT
/begin TYPEDEF_MEASUREMENT M_S32 "" SLONG NO_COMPU_METHOD 0 0 -2147483648 2147483647 /end TYPEDEF_MEASUREMENT
/begin TYPEDEF_CHARACTERISTIC C_S32 "" VALUE S32 0 NO_COMPU_METHOD -2147483648 2147483647 /end TYPEDEF_CHARACTERISTIC
/begin RECORD_LAYOUT S16 FNC_VALUES 1 SWORD ROW_DIR DIRECT /end RECORD_LAYOUT
/begin TYPEDEF_MEASUREMENT M_S16 "" SWORD NO_COMPU_METHOD 0 0 -32768 32767 /end TYPEDEF_MEASUREMENT
/begin TYPEDEF_CHARACTERISTIC C_S16 "" VALUE S16 0 NO_COMPU_METHOD -32768 32767 /end TYPEDEF_CHARACTERISTIC
/begin RECORD_LAYOUT S8 FNC_VALUES 1 SBYTE ROW_DIR DIRECT /end RECORD_LAYOUT
/begin TYPEDEF_MEASUREMENT M_S8 "" SBYTE NO_COMPU_METHOD 0 0 -128 127 /end TYPEDEF_MEASUREMENT
/begin TYPEDEF_CHARACTERISTIC C_S8 "" VALUE S8 0 NO_COMPU_METHOD -128 127 /end TYPEDEF_CHARACTERISTIC
/begin RECORD_LAYOUT U8 FNC_VALUES 1 UBYTE ROW_DIR DIRECT /end RECORD_LAYOUT
/begin TYPEDEF_MEASUREMENT M_U8 "" UBYTE NO_COMPU_METHOD 0 0 0 255 /end TYPEDEF_MEASUREMENT
/begin TYPEDEF_CHARACTERISTIC C_U8 "" VALUE U8 0 NO_COMPU_METHOD 0 255 /end TYPEDEF_CHARACTERISTIC
/begin RECORD_LAYOUT U16 FNC_VALUES 1 UWORD ROW_DIR DIRECT /end RECORD_LAYOUT
/begin TYPEDEF_MEASUREMENT M_U16 "" UWORD NO_COMPU_METHOD 0 0 0 65535 /end TYPEDEF_MEASUREMENT
/begin TYPEDEF_CHARACTERISTIC C_U16 "" VALUE U16 0 NO_COMPU_METHOD 0 65535 /end TYPEDEF_CHARACTERISTIC
/begin RECORD_LAYOUT U32 FNC_VALUES 1 ULONG ROW_DIR DIRECT /end RECORD_LAYOUT
/begin TYPEDEF_MEASUREMENT M_U32 "" ULONG NO_COMPU_METHOD 0 0 0 4294967295 /end TYPEDEF_MEASUREMENT
/begin TYPEDEF_CHARACTERISTIC C_U32 "" VALUE U32 0 NO_COMPU_METHOD 0 4294967295 /end TYPEDEF_CHARACTERISTIC
/begin RECORD_LAYOUT U64 FNC_VALUES 1 A_UINT64 ROW_DIR DIRECT /end RECORD_LAYOUT
/begin TYPEDEF_MEASUREMENT M_U64 "" A_UINT64 NO_COMPU_METHOD 0 0 0 1E12 /end TYPEDEF_MEASUREMENT
/begin TYPEDEF_CHARACTERISTIC C_U64 "" VALUE U64 0 NO_COMPU_METHOD 0 1E12 /end TYPEDEF_CHARACTERISTIC

/begin TYPEDEF_STRUCTURE gSignalParameters "This is the global signal parameters structure type" 0x18 SYMBOL_TYPE_LINK "gSignalParameters"
/begin STRUCTURE_COMPONENT ampl C_FLOAT64_IEEE 0x0 SYMBOL_TYPE_LINK "ampl" /end STRUCTURE_COMPONENT
/begin STRUCTURE_COMPONENT offset C_FLOAT64_IEEE 0x8 SYMBOL_TYPE_LINK "offset" /end STRUCTURE_COMPONENT
/begin STRUCTURE_COMPONENT phase C_FLOAT64_IEEE 0x10 SYMBOL_TYPE_LINK "phase" /end STRUCTURE_COMPONENT
/begin TYPEDEF_STRUCTURE sSignalParameters "This is the global signal parameters structure type" 0x18 SYMBOL_TYPE_LINK "sSignalParameters"
/begin STRUCTURE_COMPONENT ampl C_F64 0x0 SYMBOL_TYPE_LINK "ampl" /end STRUCTURE_COMPONENT
/begin STRUCTURE_COMPONENT offset C_F64 0x8 SYMBOL_TYPE_LINK "offset" /end STRUCTURE_COMPONENT
/begin STRUCTURE_COMPONENT phase C_F64 0x10 SYMBOL_TYPE_LINK "phase" /end STRUCTURE_COMPONENT
/end TYPEDEF_STRUCTURE
/begin INSTANCE gSignalParameters "This is the global signal parameters structure instance" sSignalParameters 0x2F58000 /end INSTANCE
/begin CHARACTERISTIC gPeriod "Period of sinus signal in s" VALUE 0x2F58018 R_FLOAT64_IEEE 0 NO_COMPU_METHOD 0 10 PHYS_UNIT "s" SYMBOL_LINK "gPeriod" 0 /end CHARACTERISTIC
/begin CHARACTERISTIC gCycleTime "Cycle time of demo event loop in us" VALUE 0x2F58020 R_SLONG 0 NO_COMPU_METHOD 0 1e+06 PHYS_UNIT "us" SYMBOL_LINK "gCycleTime" 0 /end CHARACTERISTIC
/begin CHARACTERISTIC gDebugLevel "Console output verbosity level" VALUE 0x2F58024 R_SBYTE 0 NO_COMPU_METHOD -128 127 SYMBOL_LINK "gDebugLevel" 0 /end CHARACTERISTIC
/begin INSTANCE gSignalParameters "This is the global signal parameters structure instance" sSignalParameters 0x2FF4000 /end INSTANCE
/begin CHARACTERISTIC gPeriod "Period of sinus signal in s" VALUE 0x2FF4018 F64 0 NO_COMPU_METHOD 0 10 PHYS_UNIT "s" SYMBOL_LINK "gPeriod" 0 /end CHARACTERISTIC
/begin CHARACTERISTIC gCycleTime "Cycle time of demo event loop in us" VALUE 0x2FF4020 S32 0 NO_COMPU_METHOD 0 1e+06 PHYS_UNIT "us" SYMBOL_LINK "gCycleTime" 0 /end CHARACTERISTIC
/begin CHARACTERISTIC gDebugLevel "Console output verbosity level" VALUE 0x2FF4024 S8 0 NO_COMPU_METHOD -128 127 SYMBOL_LINK "gDebugLevel" 0 /end CHARACTERISTIC
/begin COMPU_METHOD gChannel1.Conversion "" LINEAR "%6.3" "V" COEFFS_LINEAR 1 0 /end COMPU_METHOD
/begin MEASUREMENT gChannel1 "Sinus signal as double with physical conversion rule" FLOAT64_IEEE gChannel1.Conversion 0 0 -1000000000000.0000 1000000000000.00000 ECU_ADDRESS 0x2F58038 PHYS_UNIT "V" READ_WRITE SYMBOL_LINK "gChannel1" 0 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 0x0 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT
/begin MEASUREMENT gChannel1 "Sinus signal as double with physical conversion rule" FLOAT64_IEEE gChannel1.Conversion 0 0 -1000000000000.0000 1000000000000.00000 ECU_ADDRESS 0x2FF4038 PHYS_UNIT "V" READ_WRITE SYMBOL_LINK "gChannel1" 0 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 0x0 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT
/begin COMPU_METHOD gCounter.Conversion "" LINEAR "%6.3" "" COEFFS_LINEAR 1 0 /end COMPU_METHOD
/begin MEASUREMENT gCounter "Event counter as uint32" SWORD gCounter.Conversion 0 0 -32768.000000 32767.000000 ECU_ADDRESS 0x2F58040 READ_WRITE SYMBOL_LINK "gCounter" 0 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 0x0 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT
/begin MEASUREMENT gCounter "Event counter as uint32" SWORD gCounter.Conversion 0 0 -32768.000000 32767.000000 ECU_ADDRESS 0x2FF4040 READ_WRITE SYMBOL_LINK "gCounter" 0 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 0x0 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT
/begin INSTANCE SigGen1 "" SigGen 0x10000 ECU_ADDRESS_EXTENSION 1 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 0x1 /end DAQ_EVENT /end IF_DATA /end INSTANCE
/begin INSTANCE SigGen2 "" SigGen 0x20000 ECU_ADDRESS_EXTENSION 1 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 0x2 /end DAQ_EVENT /end IF_DATA /end INSTANCE
/begin INSTANCE SigGen3 "" SigGen 0x30000 ECU_ADDRESS_EXTENSION 1 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 0x3 /end DAQ_EVENT /end IF_DATA /end INSTANCE
Expand All @@ -70,26 +70,23 @@ ALIGNMENT_INT64 1
/begin INSTANCE SigGen9 "" SigGen 0x90000 ECU_ADDRESS_EXTENSION 1 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 0x9 /end DAQ_EVENT /end IF_DATA /end INSTANCE
/begin INSTANCE SigGen10 "" SigGen 0xA0000 ECU_ADDRESS_EXTENSION 1 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 0xA /end DAQ_EVENT /end IF_DATA /end INSTANCE
/begin TYPEDEF_STRUCTURE SigGen "" 0x48 SYMBOL_TYPE_LINK "SigGen"
/begin STRUCTURE_COMPONENT xcpInstanceId M_SWORD 0x14 SYMBOL_TYPE_LINK "xcpInstanceId" /end STRUCTURE_COMPONENT
/begin STRUCTURE_COMPONENT value M_FLOAT64_IEEE 0x38 SYMBOL_TYPE_LINK "value" /end STRUCTURE_COMPONENT
/begin STRUCTURE_COMPONENT par_ampl C_FLOAT64_IEEE 0x20 SYMBOL_TYPE_LINK "par_ampl" /end STRUCTURE_COMPONENT
/begin STRUCTURE_COMPONENT par_phase C_FLOAT64_IEEE 0x28 SYMBOL_TYPE_LINK "par_phase" /end STRUCTURE_COMPONENT
/begin STRUCTURE_COMPONENT par_offset C_FLOAT64_IEEE 0x30 SYMBOL_TYPE_LINK "par_offset" /end STRUCTURE_COMPONENT
/begin STRUCTURE_COMPONENT xcpInstanceId M_S16 0x14 SYMBOL_TYPE_LINK "xcpInstanceId" /end STRUCTURE_COMPONENT
/begin STRUCTURE_COMPONENT value M_F64 0x38 SYMBOL_TYPE_LINK "value" /end STRUCTURE_COMPONENT
/begin STRUCTURE_COMPONENT par_ampl C_F64 0x20 SYMBOL_TYPE_LINK "par_ampl" /end STRUCTURE_COMPONENT
/begin STRUCTURE_COMPONENT par_phase C_F64 0x28 SYMBOL_TYPE_LINK "par_phase" /end STRUCTURE_COMPONENT
/begin STRUCTURE_COMPONENT par_offset C_F64 0x30 SYMBOL_TYPE_LINK "par_offset" /end STRUCTURE_COMPONENT
/end TYPEDEF_STRUCTURE

/begin IF_DATA XCP
/begin PROTOCOL_LAYER
0x0103 1000 2000 0 0 0 0 0 248 1468 BYTE_ORDER_MSB_LAST ADDRESS_GRANULARITY_BYTE
0x0104 1000 2000 0 0 0 0 0 248 1468 BYTE_ORDER_MSB_LAST ADDRESS_GRANULARITY_BYTE
OPTIONAL_CMD GET_COMM_MODE_INFO
OPTIONAL_CMD GET_ID
OPTIONAL_CMD SET_MTA
OPTIONAL_CMD UPLOAD
OPTIONAL_CMD SHORT_UPLOAD
OPTIONAL_CMD DOWNLOAD
OPTIONAL_CMD SHORT_DOWNLOAD
OPTIONAL_CMD GET_CAL_PAGE
OPTIONAL_CMD SET_CAL_PAGE
OPTIONAL_CMD BUILD_CHECKSUM
OPTIONAL_CMD GET_DAQ_RESOLUTION_INFO
OPTIONAL_CMD GET_DAQ_PROCESSOR_INFO
OPTIONAL_CMD FREE_DAQ
Expand All @@ -105,6 +102,7 @@ OPTIONAL_CMD START_STOP_DAQ_LIST
OPTIONAL_CMD GET_DAQ_CLOCK
OPTIONAL_CMD WRITE_DAQ_MULTIPLE
OPTIONAL_CMD TIME_CORRELATION_PROPERTIES
OPTIONAL_LEVEL1_CMD GET_VERSION
/end PROTOCOL_LAYER
/begin DAQ
DYNAMIC 0 11 0 OPTIMISATION_TYPE_DEFAULT ADDRESS_EXTENSION_FREE IDENTIFICATION_FIELD_TYPE_RELATIVE_BYTE GRANULARITY_ODT_ENTRY_SIZE_DAQ_BYTE 0xF8 OVERLOAD_INDICATION_PID
Expand Down
Loading

0 comments on commit e7a07ae

Please sign in to comment.