From 23b3ce33ddcbdc31cf977dfd522c237b3bbebe8c Mon Sep 17 00:00:00 2001 From: sunbeam Date: Wed, 18 Dec 2024 17:06:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BF=A1=E5=8F=B7=E7=9F=A9?= =?UTF-8?q?=E9=98=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cva_asw_m0146/src/CANmatrix/dbc/说明.txt | 2 +- .../src/CANmatrix/lib/canmatrix-fmon.h | 4 +- cva_asw_m0146/src/CANmatrix/lib/canmatrix.c | 46 +++++++++------- cva_asw_m0146/src/CANmatrix/lib/canmatrix.h | 52 ++++++++++++++----- 4 files changed, 67 insertions(+), 37 deletions(-) diff --git a/cva_asw_m0146/src/CANmatrix/dbc/说明.txt b/cva_asw_m0146/src/CANmatrix/dbc/说明.txt index 68db2b1..4a281a5 100644 --- a/cva_asw_m0146/src/CANmatrix/dbc/说明.txt +++ b/cva_asw_m0146/src/CANmatrix/dbc/说明.txt @@ -1,6 +1,6 @@ 参考https://github.com/astand/c-coderdbc 生成指令 -./coderdbc -dbc DMK-RP-01_CAN_V0.1_20241207.dbc -out ./gen/ -drvname CANmatrix -nodeutils -rw -driverdir -gendate +./coderdbc.exe -dbc DMK-RP-01_CAN_V0.1.dbc -out ./gen/ -drvname CANmatrix -nodeutils -rw -driverdir -gendate 打包 tar -czvf CANmatrix.tar.gz CANmatrix diff --git a/cva_asw_m0146/src/CANmatrix/lib/canmatrix-fmon.h b/cva_asw_m0146/src/CANmatrix/lib/canmatrix-fmon.h index 4a2c6f0..8a35505 100644 --- a/cva_asw_m0146/src/CANmatrix/lib/canmatrix-fmon.h +++ b/cva_asw_m0146/src/CANmatrix/lib/canmatrix-fmon.h @@ -1,6 +1,6 @@ // Generator version : v3.1 -// Generation time : 2024.12.07 08:59:44 -// DBC filename : DMK-RP-01_CAN_V0.1_20241118.dbc +// Generation time : 2024.12.17 14:33:44 +// DBC filename : DMK-RP-01_CAN_V0.1.dbc #pragma once #ifdef __cplusplus diff --git a/cva_asw_m0146/src/CANmatrix/lib/canmatrix.c b/cva_asw_m0146/src/CANmatrix/lib/canmatrix.c index 288b7dc..b76189b 100644 --- a/cva_asw_m0146/src/CANmatrix/lib/canmatrix.c +++ b/cva_asw_m0146/src/CANmatrix/lib/canmatrix.c @@ -1,6 +1,6 @@ // Generator version : v3.1 -// Generation time : 2024.12.07 13:45:35 -// DBC filename : DMK-RP-01_CAN_V0.1_20241207.dbc +// Generation time : 2024.12.17 14:33:44 +// DBC filename : DMK-RP-01_CAN_V0.1.dbc #include "canmatrix.h" @@ -196,7 +196,8 @@ uint32_t Unpack_SCM_DEBUG1_CANmatrix(SCM_DEBUG1_t* _m, const uint8_t* _d, uint8_ { (void)dlc_; _m->DEBUG_MOTOR_HG_CURRENT = (uint8_t) ( (_d[0] & (0xFFU)) ); - _m->DEBUG_MOTOR_HG_STATUS = (uint8_t) ( (_d[1] & (0xFFU)) ); + _m->DEBUG_MOTOR_HG_STATUS = (uint8_t) ( (_d[1] & (0x03U)) ); + _m->DEBUG_MOTOR_HG_HALLIO = (uint8_t) ( ((_d[1] >> 2U) & (0x01U)) ); _m->DEBUG_MOTOR_HG_LOC = (uint16_t) ( ((_d[3] & (0xFFU)) << 8U) | (_d[2] & (0xFFU)) ); _m->DEBUG_MOTOR_HG_STOP_1 = (uint16_t) ( ((_d[5] & (0xFFU)) << 8U) | (_d[4] & (0xFFU)) ); _m->DEBUG_MOTOR_HG_STOP_2 = (uint16_t) ( ((_d[7] & (0xFFU)) << 8U) | (_d[6] & (0xFFU)) ); @@ -219,7 +220,7 @@ uint32_t Pack_SCM_DEBUG1_CANmatrix(SCM_DEBUG1_t* _m, __CoderDbcCanFrame_t__* cfr uint8_t i; for (i = 0u; i < CANMATRIX_VALIDATE_DLC(SCM_DEBUG1_DLC); cframe->Data[i++] = CANMATRIX_INITIAL_BYTE_VALUE); cframe->Data[0] |= (uint8_t) ( (_m->DEBUG_MOTOR_HG_CURRENT & (0xFFU)) ); - cframe->Data[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_HG_STATUS & (0xFFU)) ); + cframe->Data[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_HG_STATUS & (0x03U)) | ((_m->DEBUG_MOTOR_HG_HALLIO & (0x01U)) << 2U) ); cframe->Data[2] |= (uint8_t) ( (_m->DEBUG_MOTOR_HG_LOC & (0xFFU)) ); cframe->Data[3] |= (uint8_t) ( ((_m->DEBUG_MOTOR_HG_LOC >> 8U) & (0xFFU)) ); cframe->Data[4] |= (uint8_t) ( (_m->DEBUG_MOTOR_HG_STOP_1 & (0xFFU)) ); @@ -240,7 +241,7 @@ uint32_t Pack_SCM_DEBUG1_CANmatrix(SCM_DEBUG1_t* _m, uint8_t* _d, uint8_t* _len, uint8_t i; for (i = 0u; i < CANMATRIX_VALIDATE_DLC(SCM_DEBUG1_DLC); _d[i++] = CANMATRIX_INITIAL_BYTE_VALUE); _d[0] |= (uint8_t) ( (_m->DEBUG_MOTOR_HG_CURRENT & (0xFFU)) ); - _d[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_HG_STATUS & (0xFFU)) ); + _d[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_HG_STATUS & (0x03U)) | ((_m->DEBUG_MOTOR_HG_HALLIO & (0x01U)) << 2U) ); _d[2] |= (uint8_t) ( (_m->DEBUG_MOTOR_HG_LOC & (0xFFU)) ); _d[3] |= (uint8_t) ( ((_m->DEBUG_MOTOR_HG_LOC >> 8U) & (0xFFU)) ); _d[4] |= (uint8_t) ( (_m->DEBUG_MOTOR_HG_STOP_1 & (0xFFU)) ); @@ -259,7 +260,8 @@ uint32_t Unpack_SCM_DEBUG2_CANmatrix(SCM_DEBUG2_t* _m, const uint8_t* _d, uint8_ { (void)dlc_; _m->DEBUG_MOTOR_KB_CURRENT = (uint8_t) ( (_d[0] & (0xFFU)) ); - _m->DEBUG_MOTOR_KB_STATUS = (uint8_t) ( (_d[1] & (0xFFU)) ); + _m->DEBUG_MOTOR_KB_STATUS = (uint8_t) ( (_d[1] & (0x03U)) ); + _m->DEBUG_MOTOR_KB_HALLIO = (uint8_t) ( ((_d[1] >> 2U) & (0x01U)) ); _m->DEBUG_MOTOR_KB_LOC = (uint16_t) ( ((_d[3] & (0xFFU)) << 8U) | (_d[2] & (0xFFU)) ); _m->DEBUG_MOTOR_KB_STOP_1 = (uint16_t) ( ((_d[5] & (0xFFU)) << 8U) | (_d[4] & (0xFFU)) ); _m->DEBUG_MOTOR_KB_STOP_2 = (uint16_t) ( ((_d[7] & (0xFFU)) << 8U) | (_d[6] & (0xFFU)) ); @@ -282,7 +284,7 @@ uint32_t Pack_SCM_DEBUG2_CANmatrix(SCM_DEBUG2_t* _m, __CoderDbcCanFrame_t__* cfr uint8_t i; for (i = 0u; i < CANMATRIX_VALIDATE_DLC(SCM_DEBUG2_DLC); cframe->Data[i++] = CANMATRIX_INITIAL_BYTE_VALUE); cframe->Data[0] |= (uint8_t) ( (_m->DEBUG_MOTOR_KB_CURRENT & (0xFFU)) ); - cframe->Data[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_KB_STATUS & (0xFFU)) ); + cframe->Data[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_KB_STATUS & (0x03U)) | ((_m->DEBUG_MOTOR_KB_HALLIO & (0x01U)) << 2U) ); cframe->Data[2] |= (uint8_t) ( (_m->DEBUG_MOTOR_KB_LOC & (0xFFU)) ); cframe->Data[3] |= (uint8_t) ( ((_m->DEBUG_MOTOR_KB_LOC >> 8U) & (0xFFU)) ); cframe->Data[4] |= (uint8_t) ( (_m->DEBUG_MOTOR_KB_STOP_1 & (0xFFU)) ); @@ -303,7 +305,7 @@ uint32_t Pack_SCM_DEBUG2_CANmatrix(SCM_DEBUG2_t* _m, uint8_t* _d, uint8_t* _len, uint8_t i; for (i = 0u; i < CANMATRIX_VALIDATE_DLC(SCM_DEBUG2_DLC); _d[i++] = CANMATRIX_INITIAL_BYTE_VALUE); _d[0] |= (uint8_t) ( (_m->DEBUG_MOTOR_KB_CURRENT & (0xFFU)) ); - _d[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_KB_STATUS & (0xFFU)) ); + _d[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_KB_STATUS & (0x03U)) | ((_m->DEBUG_MOTOR_KB_HALLIO & (0x01U)) << 2U) ); _d[2] |= (uint8_t) ( (_m->DEBUG_MOTOR_KB_LOC & (0xFFU)) ); _d[3] |= (uint8_t) ( ((_m->DEBUG_MOTOR_KB_LOC >> 8U) & (0xFFU)) ); _d[4] |= (uint8_t) ( (_m->DEBUG_MOTOR_KB_STOP_1 & (0xFFU)) ); @@ -322,7 +324,8 @@ uint32_t Unpack_SCM_DEBUG3_CANmatrix(SCM_DEBUG3_t* _m, const uint8_t* _d, uint8_ { (void)dlc_; _m->DEBUG_MOTOR_TT_CURRENT = (uint8_t) ( (_d[0] & (0xFFU)) ); - _m->DEBUG_MOTOR_TT_STATUS = (uint8_t) ( (_d[1] & (0xFFU)) ); + _m->DEBUG_MOTOR_TT_STATUS = (uint8_t) ( (_d[1] & (0x03U)) ); + _m->DEBUG_MOTOR_TT_HALLIO = (uint8_t) ( ((_d[1] >> 2U) & (0x01U)) ); _m->DEBUG_MOTOR_TT_LOC = (uint16_t) ( ((_d[3] & (0xFFU)) << 8U) | (_d[2] & (0xFFU)) ); _m->DEBUG_MOTOR_TT_STOP_1 = (uint16_t) ( ((_d[5] & (0xFFU)) << 8U) | (_d[4] & (0xFFU)) ); _m->DEBUG_MOTOR_TT_STOP_2 = (uint16_t) ( ((_d[7] & (0xFFU)) << 8U) | (_d[6] & (0xFFU)) ); @@ -345,7 +348,7 @@ uint32_t Pack_SCM_DEBUG3_CANmatrix(SCM_DEBUG3_t* _m, __CoderDbcCanFrame_t__* cfr uint8_t i; for (i = 0u; i < CANMATRIX_VALIDATE_DLC(SCM_DEBUG3_DLC); cframe->Data[i++] = CANMATRIX_INITIAL_BYTE_VALUE); cframe->Data[0] |= (uint8_t) ( (_m->DEBUG_MOTOR_TT_CURRENT & (0xFFU)) ); - cframe->Data[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_TT_STATUS & (0xFFU)) ); + cframe->Data[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_TT_STATUS & (0x03U)) | ((_m->DEBUG_MOTOR_TT_HALLIO & (0x01U)) << 2U) ); cframe->Data[2] |= (uint8_t) ( (_m->DEBUG_MOTOR_TT_LOC & (0xFFU)) ); cframe->Data[3] |= (uint8_t) ( ((_m->DEBUG_MOTOR_TT_LOC >> 8U) & (0xFFU)) ); cframe->Data[4] |= (uint8_t) ( (_m->DEBUG_MOTOR_TT_STOP_1 & (0xFFU)) ); @@ -366,7 +369,7 @@ uint32_t Pack_SCM_DEBUG3_CANmatrix(SCM_DEBUG3_t* _m, uint8_t* _d, uint8_t* _len, uint8_t i; for (i = 0u; i < CANMATRIX_VALIDATE_DLC(SCM_DEBUG3_DLC); _d[i++] = CANMATRIX_INITIAL_BYTE_VALUE); _d[0] |= (uint8_t) ( (_m->DEBUG_MOTOR_TT_CURRENT & (0xFFU)) ); - _d[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_TT_STATUS & (0xFFU)) ); + _d[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_TT_STATUS & (0x03U)) | ((_m->DEBUG_MOTOR_TT_HALLIO & (0x01U)) << 2U) ); _d[2] |= (uint8_t) ( (_m->DEBUG_MOTOR_TT_LOC & (0xFFU)) ); _d[3] |= (uint8_t) ( ((_m->DEBUG_MOTOR_TT_LOC >> 8U) & (0xFFU)) ); _d[4] |= (uint8_t) ( (_m->DEBUG_MOTOR_TT_STOP_1 & (0xFFU)) ); @@ -385,7 +388,8 @@ uint32_t Unpack_SCM_DEBUG4_CANmatrix(SCM_DEBUG4_t* _m, const uint8_t* _d, uint8_ { (void)dlc_; _m->DEBUG_MOTOR_ZY_CURRENT = (uint8_t) ( (_d[0] & (0xFFU)) ); - _m->DEBUG_MOTOR_ZY_STATUS = (uint8_t) ( (_d[1] & (0xFFU)) ); + _m->DEBUG_MOTOR_ZY_STATUS = (uint8_t) ( (_d[1] & (0x03U)) ); + _m->DEBUG_MOTOR_ZY_HALLIO = (uint8_t) ( ((_d[1] >> 2U) & (0x01U)) ); _m->DEBUG_MOTOR_ZY_LOC = (uint16_t) ( ((_d[3] & (0xFFU)) << 8U) | (_d[2] & (0xFFU)) ); _m->DEBUG_MOTOR_ZY_STOP_1 = (uint16_t) ( ((_d[5] & (0xFFU)) << 8U) | (_d[4] & (0xFFU)) ); _m->DEBUG_MOTOR_ZY_STOP_2 = (uint16_t) ( ((_d[7] & (0xFFU)) << 8U) | (_d[6] & (0xFFU)) ); @@ -408,7 +412,7 @@ uint32_t Pack_SCM_DEBUG4_CANmatrix(SCM_DEBUG4_t* _m, __CoderDbcCanFrame_t__* cfr uint8_t i; for (i = 0u; i < CANMATRIX_VALIDATE_DLC(SCM_DEBUG4_DLC); cframe->Data[i++] = CANMATRIX_INITIAL_BYTE_VALUE); cframe->Data[0] |= (uint8_t) ( (_m->DEBUG_MOTOR_ZY_CURRENT & (0xFFU)) ); - cframe->Data[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_ZY_STATUS & (0xFFU)) ); + cframe->Data[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_ZY_STATUS & (0x03U)) | ((_m->DEBUG_MOTOR_ZY_HALLIO & (0x01U)) << 2U) ); cframe->Data[2] |= (uint8_t) ( (_m->DEBUG_MOTOR_ZY_LOC & (0xFFU)) ); cframe->Data[3] |= (uint8_t) ( ((_m->DEBUG_MOTOR_ZY_LOC >> 8U) & (0xFFU)) ); cframe->Data[4] |= (uint8_t) ( (_m->DEBUG_MOTOR_ZY_STOP_1 & (0xFFU)) ); @@ -429,7 +433,7 @@ uint32_t Pack_SCM_DEBUG4_CANmatrix(SCM_DEBUG4_t* _m, uint8_t* _d, uint8_t* _len, uint8_t i; for (i = 0u; i < CANMATRIX_VALIDATE_DLC(SCM_DEBUG4_DLC); _d[i++] = CANMATRIX_INITIAL_BYTE_VALUE); _d[0] |= (uint8_t) ( (_m->DEBUG_MOTOR_ZY_CURRENT & (0xFFU)) ); - _d[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_ZY_STATUS & (0xFFU)) ); + _d[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_ZY_STATUS & (0x03U)) | ((_m->DEBUG_MOTOR_ZY_HALLIO & (0x01U)) << 2U) ); _d[2] |= (uint8_t) ( (_m->DEBUG_MOTOR_ZY_LOC & (0xFFU)) ); _d[3] |= (uint8_t) ( ((_m->DEBUG_MOTOR_ZY_LOC >> 8U) & (0xFFU)) ); _d[4] |= (uint8_t) ( (_m->DEBUG_MOTOR_ZY_STOP_1 & (0xFFU)) ); @@ -448,7 +452,8 @@ uint32_t Unpack_SCM_DEBUG5_CANmatrix(SCM_DEBUG5_t* _m, const uint8_t* _d, uint8_ { (void)dlc_; _m->DEBUG_MOTOR_TZ_CURRENT = (uint8_t) ( (_d[0] & (0xFFU)) ); - _m->DEBUG_MOTOR_TZ_STATUS = (uint8_t) ( (_d[1] & (0xFFU)) ); + _m->DEBUG_MOTOR_TZ_STATUS = (uint8_t) ( (_d[1] & (0x03U)) ); + _m->DEBUG_MOTOR_TZ_HALLIO = (uint8_t) ( ((_d[1] >> 2U) & (0x01U)) ); _m->DEBUG_MOTOR_TZ_LOC = (uint16_t) ( ((_d[3] & (0xFFU)) << 8U) | (_d[2] & (0xFFU)) ); _m->DEBUG_MOTOR_TZ_STOP_1 = (uint16_t) ( ((_d[5] & (0xFFU)) << 8U) | (_d[4] & (0xFFU)) ); _m->DEBUG_MOTOR_TZ_STOP_2 = (uint16_t) ( ((_d[7] & (0xFFU)) << 8U) | (_d[6] & (0xFFU)) ); @@ -471,7 +476,7 @@ uint32_t Pack_SCM_DEBUG5_CANmatrix(SCM_DEBUG5_t* _m, __CoderDbcCanFrame_t__* cfr uint8_t i; for (i = 0u; i < CANMATRIX_VALIDATE_DLC(SCM_DEBUG5_DLC); cframe->Data[i++] = CANMATRIX_INITIAL_BYTE_VALUE); cframe->Data[0] |= (uint8_t) ( (_m->DEBUG_MOTOR_TZ_CURRENT & (0xFFU)) ); - cframe->Data[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_TZ_STATUS & (0xFFU)) ); + cframe->Data[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_TZ_STATUS & (0x03U)) | ((_m->DEBUG_MOTOR_TZ_HALLIO & (0x01U)) << 2U) ); cframe->Data[2] |= (uint8_t) ( (_m->DEBUG_MOTOR_TZ_LOC & (0xFFU)) ); cframe->Data[3] |= (uint8_t) ( ((_m->DEBUG_MOTOR_TZ_LOC >> 8U) & (0xFFU)) ); cframe->Data[4] |= (uint8_t) ( (_m->DEBUG_MOTOR_TZ_STOP_1 & (0xFFU)) ); @@ -492,7 +497,7 @@ uint32_t Pack_SCM_DEBUG5_CANmatrix(SCM_DEBUG5_t* _m, uint8_t* _d, uint8_t* _len, uint8_t i; for (i = 0u; i < CANMATRIX_VALIDATE_DLC(SCM_DEBUG5_DLC); _d[i++] = CANMATRIX_INITIAL_BYTE_VALUE); _d[0] |= (uint8_t) ( (_m->DEBUG_MOTOR_TZ_CURRENT & (0xFFU)) ); - _d[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_TZ_STATUS & (0xFFU)) ); + _d[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_TZ_STATUS & (0x03U)) | ((_m->DEBUG_MOTOR_TZ_HALLIO & (0x01U)) << 2U) ); _d[2] |= (uint8_t) ( (_m->DEBUG_MOTOR_TZ_LOC & (0xFFU)) ); _d[3] |= (uint8_t) ( ((_m->DEBUG_MOTOR_TZ_LOC >> 8U) & (0xFFU)) ); _d[4] |= (uint8_t) ( (_m->DEBUG_MOTOR_TZ_STOP_1 & (0xFFU)) ); @@ -511,7 +516,8 @@ uint32_t Unpack_SCM_DEBUG6_CANmatrix(SCM_DEBUG6_t* _m, const uint8_t* _d, uint8_ { (void)dlc_; _m->DEBUG_MOTOR_YT_CURRENT = (uint8_t) ( (_d[0] & (0xFFU)) ); - _m->DEBUG_MOTOR_YT_STATUS = (uint8_t) ( (_d[1] & (0xFFU)) ); + _m->DEBUG_MOTOR_YT_STATUS = (uint8_t) ( (_d[1] & (0x03U)) ); + _m->DEBUG_MOTOR_YT_HALLIO = (uint8_t) ( ((_d[1] >> 2U) & (0x01U)) ); _m->DEBUG_MOTOR_YT_LOC = (uint16_t) ( ((_d[3] & (0xFFU)) << 8U) | (_d[2] & (0xFFU)) ); _m->DEBUG_MOTOR_YT_STOP_1 = (uint16_t) ( ((_d[5] & (0xFFU)) << 8U) | (_d[4] & (0xFFU)) ); _m->DEBUG_MOTOR_YT_STOP_2 = (uint16_t) ( ((_d[7] & (0xFFU)) << 8U) | (_d[6] & (0xFFU)) ); @@ -534,7 +540,7 @@ uint32_t Pack_SCM_DEBUG6_CANmatrix(SCM_DEBUG6_t* _m, __CoderDbcCanFrame_t__* cfr uint8_t i; for (i = 0u; i < CANMATRIX_VALIDATE_DLC(SCM_DEBUG6_DLC); cframe->Data[i++] = CANMATRIX_INITIAL_BYTE_VALUE); cframe->Data[0] |= (uint8_t) ( (_m->DEBUG_MOTOR_YT_CURRENT & (0xFFU)) ); - cframe->Data[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_YT_STATUS & (0xFFU)) ); + cframe->Data[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_YT_STATUS & (0x03U)) | ((_m->DEBUG_MOTOR_YT_HALLIO & (0x01U)) << 2U) ); cframe->Data[2] |= (uint8_t) ( (_m->DEBUG_MOTOR_YT_LOC & (0xFFU)) ); cframe->Data[3] |= (uint8_t) ( ((_m->DEBUG_MOTOR_YT_LOC >> 8U) & (0xFFU)) ); cframe->Data[4] |= (uint8_t) ( (_m->DEBUG_MOTOR_YT_STOP_1 & (0xFFU)) ); @@ -555,7 +561,7 @@ uint32_t Pack_SCM_DEBUG6_CANmatrix(SCM_DEBUG6_t* _m, uint8_t* _d, uint8_t* _len, uint8_t i; for (i = 0u; i < CANMATRIX_VALIDATE_DLC(SCM_DEBUG6_DLC); _d[i++] = CANMATRIX_INITIAL_BYTE_VALUE); _d[0] |= (uint8_t) ( (_m->DEBUG_MOTOR_YT_CURRENT & (0xFFU)) ); - _d[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_YT_STATUS & (0xFFU)) ); + _d[1] |= (uint8_t) ( (_m->DEBUG_MOTOR_YT_STATUS & (0x03U)) | ((_m->DEBUG_MOTOR_YT_HALLIO & (0x01U)) << 2U) ); _d[2] |= (uint8_t) ( (_m->DEBUG_MOTOR_YT_LOC & (0xFFU)) ); _d[3] |= (uint8_t) ( ((_m->DEBUG_MOTOR_YT_LOC >> 8U) & (0xFFU)) ); _d[4] |= (uint8_t) ( (_m->DEBUG_MOTOR_YT_STOP_1 & (0xFFU)) ); diff --git a/cva_asw_m0146/src/CANmatrix/lib/canmatrix.h b/cva_asw_m0146/src/CANmatrix/lib/canmatrix.h index 074e559..b9c0d63 100644 --- a/cva_asw_m0146/src/CANmatrix/lib/canmatrix.h +++ b/cva_asw_m0146/src/CANmatrix/lib/canmatrix.h @@ -1,6 +1,6 @@ // Generator version : v3.1 -// Generation time : 2024.12.07 13:54:48 -// DBC filename : DMK-RP-01_CAN_V0.1_20241207.dbc +// Generation time : 2024.12.17 14:33:44 +// DBC filename : DMK-RP-01_CAN_V0.1.dbc #pragma once #ifdef __cplusplus @@ -797,7 +797,9 @@ typedef struct uint8_t DEBUG_MOTOR_HG_CURRENT; // Bits= 8 - uint8_t DEBUG_MOTOR_HG_STATUS; // Bits= 8 + uint8_t DEBUG_MOTOR_HG_STATUS : 2; // Bits= 2 + + uint8_t DEBUG_MOTOR_HG_HALLIO : 1; // Bits= 1 uint16_t DEBUG_MOTOR_HG_LOC; // Bits=16 @@ -809,7 +811,9 @@ typedef struct uint8_t DEBUG_MOTOR_HG_CURRENT; // Bits= 8 - uint8_t DEBUG_MOTOR_HG_STATUS; // Bits= 8 + uint8_t DEBUG_MOTOR_HG_STATUS; // Bits= 2 + + uint8_t DEBUG_MOTOR_HG_HALLIO; // Bits= 1 uint16_t DEBUG_MOTOR_HG_LOC; // Bits=16 @@ -839,7 +843,9 @@ typedef struct uint8_t DEBUG_MOTOR_KB_CURRENT; // Bits= 8 - uint8_t DEBUG_MOTOR_KB_STATUS; // Bits= 8 + uint8_t DEBUG_MOTOR_KB_STATUS : 2; // Bits= 2 + + uint8_t DEBUG_MOTOR_KB_HALLIO : 1; // Bits= 1 uint16_t DEBUG_MOTOR_KB_LOC; // Bits=16 @@ -851,7 +857,9 @@ typedef struct uint8_t DEBUG_MOTOR_KB_CURRENT; // Bits= 8 - uint8_t DEBUG_MOTOR_KB_STATUS; // Bits= 8 + uint8_t DEBUG_MOTOR_KB_STATUS; // Bits= 2 + + uint8_t DEBUG_MOTOR_KB_HALLIO; // Bits= 1 uint16_t DEBUG_MOTOR_KB_LOC; // Bits=16 @@ -881,7 +889,9 @@ typedef struct uint8_t DEBUG_MOTOR_TT_CURRENT; // Bits= 8 - uint8_t DEBUG_MOTOR_TT_STATUS; // Bits= 8 + uint8_t DEBUG_MOTOR_TT_STATUS : 2; // Bits= 2 + + uint8_t DEBUG_MOTOR_TT_HALLIO : 1; // Bits= 1 uint16_t DEBUG_MOTOR_TT_LOC; // Bits=16 @@ -893,7 +903,9 @@ typedef struct uint8_t DEBUG_MOTOR_TT_CURRENT; // Bits= 8 - uint8_t DEBUG_MOTOR_TT_STATUS; // Bits= 8 + uint8_t DEBUG_MOTOR_TT_STATUS; // Bits= 2 + + uint8_t DEBUG_MOTOR_TT_HALLIO; // Bits= 1 uint16_t DEBUG_MOTOR_TT_LOC; // Bits=16 @@ -923,7 +935,9 @@ typedef struct uint8_t DEBUG_MOTOR_ZY_CURRENT; // Bits= 8 - uint8_t DEBUG_MOTOR_ZY_STATUS; // Bits= 8 + uint8_t DEBUG_MOTOR_ZY_STATUS : 2; // Bits= 2 + + uint8_t DEBUG_MOTOR_ZY_HALLIO : 1; // Bits= 1 uint16_t DEBUG_MOTOR_ZY_LOC; // Bits=16 @@ -935,7 +949,9 @@ typedef struct uint8_t DEBUG_MOTOR_ZY_CURRENT; // Bits= 8 - uint8_t DEBUG_MOTOR_ZY_STATUS; // Bits= 8 + uint8_t DEBUG_MOTOR_ZY_STATUS; // Bits= 2 + + uint8_t DEBUG_MOTOR_ZY_HALLIO; // Bits= 1 uint16_t DEBUG_MOTOR_ZY_LOC; // Bits=16 @@ -965,7 +981,9 @@ typedef struct uint8_t DEBUG_MOTOR_TZ_CURRENT; // Bits= 8 - uint8_t DEBUG_MOTOR_TZ_STATUS; // Bits= 8 + uint8_t DEBUG_MOTOR_TZ_STATUS : 2; // Bits= 2 + + uint8_t DEBUG_MOTOR_TZ_HALLIO : 1; // Bits= 1 uint16_t DEBUG_MOTOR_TZ_LOC; // Bits=16 @@ -977,7 +995,9 @@ typedef struct uint8_t DEBUG_MOTOR_TZ_CURRENT; // Bits= 8 - uint8_t DEBUG_MOTOR_TZ_STATUS; // Bits= 8 + uint8_t DEBUG_MOTOR_TZ_STATUS; // Bits= 2 + + uint8_t DEBUG_MOTOR_TZ_HALLIO; // Bits= 1 uint16_t DEBUG_MOTOR_TZ_LOC; // Bits=16 @@ -1007,7 +1027,9 @@ typedef struct uint8_t DEBUG_MOTOR_YT_CURRENT; // Bits= 8 - uint8_t DEBUG_MOTOR_YT_STATUS; // Bits= 8 + uint8_t DEBUG_MOTOR_YT_STATUS : 2; // Bits= 2 + + uint8_t DEBUG_MOTOR_YT_HALLIO : 1; // Bits= 1 uint16_t DEBUG_MOTOR_YT_LOC; // Bits=16 @@ -1019,7 +1041,9 @@ typedef struct uint8_t DEBUG_MOTOR_YT_CURRENT; // Bits= 8 - uint8_t DEBUG_MOTOR_YT_STATUS; // Bits= 8 + uint8_t DEBUG_MOTOR_YT_STATUS; // Bits= 2 + + uint8_t DEBUG_MOTOR_YT_HALLIO; // Bits= 1 uint16_t DEBUG_MOTOR_YT_LOC; // Bits=16