add debug CAN mapping

This commit is contained in:
Leonard Gies 2025-06-20 00:23:42 +02:00
parent dc8e0c806a
commit 63e3333260
Signed by: l.gies
GPG Key ID: 6F6FB9338EE44F71
2 changed files with 86 additions and 4 deletions

View File

@ -4,11 +4,12 @@
// CHOOSE ONE, comment the other or comment both and use -D SN_FRONT
//#define SN_FRONT
#define SN_REAR
// #define DEBUG
#ifdef SN_FRONT
#ifdef SN_REAR
#error "Choose to either #define SN_FRONT or SN_REAR, not both!"
#endif
#if (defined(SN_FRONT) && defined(SN_REAR)) || \
(defined(SN_FRONT) && defined(DEBUG)) || \
(defined(SN_REAR) && defined(DEBUG))
#error "Choose only one of #define SN_FRONT, #define SN_REAR, or #define DEBUG!"
#endif
#include <stdint.h>
@ -189,6 +190,58 @@ static can_pkt_t CAN_SIGNAL_MAP[NUM_TX_PKT] = {
#endif
#ifdef DEBUG
static can_pkt_t CAN_SIGNAL_MAP[NUM_TX_PKT] = {
{
.can_id = 0x044, .dlc = 6, .num_signals = 9, .period = 100, .signals = {
{ .type = DIN, .channel = L9, .start = 0, .length = 1, .factor = 1., .name = "" },
{ .type = DIN, .channel = LA, .start = 1, .length = 1, .factor = 1., .name = "" },
{ .type = DIN, .channel = LC, .start = 2, .length = 1, .factor = 1., .name = "" },
{ .type = DIN, .channel = R5, .start = 3, .length = 1, .factor = 1., .name = "" },
{ .type = DIN, .channel = R6, .start = 4, .length = 1, .factor = 1., .name = "" },
{ .type = DIN, .channel = R7, .start = 5, .length = 1, .factor = 1., .name = "" },
{ .type = AIN, .channel = L1, .start = 6+12*0, .length = 12, .factor = 1., .name = "" },
{ .type = AIN, .channel = L2, .start = 6+12*1, .length = 12, .factor = 1., .name = "" },
{ .type = AIN, .channel = L3, .start = 6+12*2, .length = 12, .factor = 1., .name = "" },
}
},
{
.can_id = 0x045, .dlc = 8, .num_signals = 5, .period = 100, .signals = {
{ .type = AIN, .channel = L4, .start = 12*0, .length = 12, .factor = 1., .name = "" },
{ .type = AIN, .channel = L5, .start = 12*1, .length = 12, .factor = 1., .name = "" },
{ .type = AIN, .channel = L6, .start = 12*2, .length = 12, .factor = 1., .name = "" },
{ .type = AIN, .channel = L7, .start = 12*3, .length = 12, .factor = 1., .name = "" },
{ .type = AIN, .channel = L8, .start = 12*4, .length = 12, .factor = 1., .name = "" },
}
},
{
.can_id = 0x046, .dlc = 8, .num_signals = 5, .period = 100, .signals = {
{ .type = AIN, .channel = R9, .start = 12*0, .length = 12, .factor = 1., .name = "" },
{ .type = AIN, .channel = RA, .start = 12*1, .length = 12, .factor = 1., .name = "" },
{ .type = AIN, .channel = RB, .start = 12*2, .length = 12, .factor = 1., .name = "" },
{ .type = AIN, .channel = RC, .start = 12*3, .length = 12, .factor = 1., .name = "" },
{ .type = AIN, .channel = RD, .start = 12*4, .length = 12, .factor = 1., .name = "" },
}
},
{
.can_id = 0x047, .dlc = 3, .num_signals = 2, .period = 100, .signals = {
{ .type = AIN, .channel = RE, .start = 12*0, .length = 12, .factor = 1., .name = "" },
{ .type = AIN, .channel = RF, .start = 12*1, .length = 12, .factor = 1., .name = "" },
{ .type = AIN, .channel = R0, .start = 12*2, .length = 12, .factor = 1., .name = "" },
}
},
};
#define CAN_PWM_DC_ID 0x0DA // UNUSED
#define CAN_PWM_CONF_ID 0x0DB // UNUSED
#define CAN_PWM_BASE_ID CAN_PWM_DC_ID
#define CAN_PWM_FILTER_MASK 0x7FE // Match both
#endif
/* user needs
TIM_HandleTypeDef* PWM_TIM_MAP[3] = {&htim1, &htim4, &htim3};
*/

View File

@ -0,0 +1,29 @@
BO_ 68 Sensornode_Debug_1: 6 Sensornode_F
SG_ Sensornode_Debug_L9 : 0|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ Sensornode_Debug_LA : 1|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ Sensornode_Debug_LC : 2|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ Sensornode_Debug_R5 : 3|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ Sensornode_Debug_R6 : 4|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ Sensornode_Debug_R7 : 5|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ Sensornode_Debug_L1 : 6|12@1+ (1,0) [0|1] "" Vector__XXX
SG_ Sensornode_Debug_L2 : 18|12@1+ (1,0) [0|1] "" Vector__XXX
SG_ Sensornode_Debug_L3 : 30|12@1+ (1,0) [0|1] "" Vector__XXX
BO_ 69 Sensornode_Debug_2: 8 Sensornode_F
SG_ Sensornode_Debug_L4 : 0|12@1+ (1,0) [0|1] "" Vector__XXX
SG_ Sensornode_Debug_L5 : 12|12@1+ (1,0) [0|1] "" Vector__XXX
SG_ Sensornode_Debug_L6 : 24|12@1+ (1,0) [0|1] "" Vector__XXX
SG_ Sensornode_Debug_L7 : 36|12@1+ (1,0) [0|1] "" Vector__XXX
SG_ Sensornode_Debug_L8 : 48|12@1+ (1,0) [0|1] "" Vector__XXX
BO_ 70 Sensornode_Debug_3: 8 Sensornode_F
SG_ Sensornode_Debug_R9 : 0|12@1+ (1,0) [0|1] "" Vector__XXX
SG_ Sensornode_Debug_RA : 12|12@1+ (1,0) [0|1] "" Vector__XXX
SG_ Sensornode_Debug_RB : 24|12@1+ (1,0) [0|1] "" Vector__XXX
SG_ Sensornode_Debug_RC : 36|12@1+ (1,0) [0|1] "" Vector__XXX
SG_ Sensornode_Debug_RD : 48|12@1+ (1,0) [0|1] "" Vector__XXX
BO_ 71 Sensornode_Debug_4: 3 Sensornode_F
SG_ Sensornode_Debug_RE : 0|12@1+ (1,0) [0|1] "" Vector__XXX
SG_ Sensornode_Debug_RF : 12|12@1+ (1,0) [0|1] "" Vector__XXX
SG_ Sensornode_Debug_R0 : 24|12@1+ (1,0) [0|1] "" Vector__XXX