Skip to content

Commit acbc59f

Browse files
committed
Adding CAN_IDs for MCV25
1 parent 5296e11 commit acbc59f

5 files changed

Lines changed: 324 additions & 0 deletions

File tree

can_ids.csv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,6 @@
7070
68,MSWI19,241,PUMPS,220,1,0.013,63,Pumps controller parameters
7171
69,MSWI19,241,MPPTS,221,1,0.014,71,Mppts controller parameters
7272
70,MSWI19,241,MCS,40,1,0.013,63,MCS controller parameters
73+
71,MCV25,242,STATE,90,0,0.0,71,Module state report
74+
72,MCV25,242,MOTOR,91,25,0.395,79,Motor controller parameters
75+
73,MCV25,242,MDE,92,25,0.355,71,Steereing wheel controls

can_ids.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,3 +1436,52 @@
14361436
#define CAN_MSG_MSWI19_MCS_BOAT_ON_BOAT_ON_BIT 0
14371437

14381438

1439+
// MCV25 - Modulo de Controle por Voz
1440+
#define CAN_SIGNATURE_MCV25 242
1441+
// MCV25 - STATE - Module state report
1442+
#define CAN_MSG_MCV25_STATE_ID 90
1443+
#define CAN_MSG_MCV25_STATE_LENGTH 3
1444+
#define CAN_MSG_MCV25_STATE_FREQUENCY 0
1445+
#define CAN_MSG_MCV25_STATE_SIGNATURE_BYTE 0 //<!" Senders signature
1446+
#define CAN_MSG_MCV25_STATE_SIGNATURE_TYPE uint8_t
1447+
#define CAN_MSG_MCV25_STATE_SIGNATURE_UNITS ""
1448+
#define CAN_MSG_MCV25_STATE_STATE_BYTE 1 //<!" State code
1449+
#define CAN_MSG_MCV25_STATE_STATE_TYPE uint8_t
1450+
#define CAN_MSG_MCV25_STATE_STATE_UNITS ""
1451+
#define CAN_MSG_MCV25_STATE_ERROR_BYTE 2 //<!" Error code
1452+
#define CAN_MSG_MCV25_STATE_ERROR_TYPE uint8_t
1453+
#define CAN_MSG_MCV25_STATE_ERROR_UNITS ""
1454+
// MCV25 - MOTOR - Motor controller parameters
1455+
#define CAN_MSG_MCV25_MOTOR_ID 91
1456+
#define CAN_MSG_MCV25_MOTOR_LENGTH 4
1457+
#define CAN_MSG_MCV25_MOTOR_FREQUENCY 25
1458+
#define CAN_MSG_MCV25_MOTOR_SIGNATURE_BYTE 0 //<!" Senders signature
1459+
#define CAN_MSG_MCV25_MOTOR_SIGNATURE_TYPE uint8_t
1460+
#define CAN_MSG_MCV25_MOTOR_SIGNATURE_UNITS ""
1461+
#define CAN_MSG_MCV25_MOTOR_MOTOR_BYTE 1 //<!" Motor state
1462+
#define CAN_MSG_MCV25_MOTOR_MOTOR_TYPE uint8_t
1463+
#define CAN_MSG_MCV25_MOTOR_MOTOR_UNITS ""
1464+
#define CAN_MSG_MCV25_MOTOR_MOTOR_MOTOR_ON_BIT 0
1465+
#define CAN_MSG_MCV25_MOTOR_MOTOR_DMS_ON_BIT 1
1466+
#define CAN_MSG_MCV25_MOTOR_MOTOR_REVERSE_BIT 2
1467+
#define CAN_MSG_MCV25_MOTOR_D_BYTE 2 //<!" Motor Duty Cycle
1468+
#define CAN_MSG_MCV25_MOTOR_D_TYPE uint8_t
1469+
#define CAN_MSG_MCV25_MOTOR_D_UNITS "%"
1470+
#define CAN_MSG_MCV25_MOTOR_I_BYTE 3 //<!" Motor Soft Start
1471+
#define CAN_MSG_MCV25_MOTOR_I_TYPE uint8_t
1472+
#define CAN_MSG_MCV25_MOTOR_I_UNITS "%"
1473+
// MCV25 - MDE - Steereing wheel controls
1474+
#define CAN_MSG_MCV25_MDE_ID 92
1475+
#define CAN_MSG_MCV25_MDE_LENGTH 3
1476+
#define CAN_MSG_MCV25_MDE_FREQUENCY 25
1477+
#define CAN_MSG_MCV25_MDE_SIGNATURE_BYTE 0 //<!" Senders signature
1478+
#define CAN_MSG_MCV25_MDE_SIGNATURE_TYPE uint8_t
1479+
#define CAN_MSG_MCV25_MDE_SIGNATURE_UNITS ""
1480+
#define CAN_MSG_MCV25_MDE_POSITION_L_BYTE 1 //<!" Steering wheel position, byte LOW
1481+
#define CAN_MSG_MCV25_MDE_POSITION_L_TYPE uint16_t
1482+
#define CAN_MSG_MCV25_MDE_POSITION_L_UNITS "°/100"
1483+
#define CAN_MSG_MCV25_MDE_POSITION_H_BYTE 2 //<!" Steering wheel position, byte HIGH
1484+
#define CAN_MSG_MCV25_MDE_POSITION_H_TYPE uint16_t
1485+
#define CAN_MSG_MCV25_MDE_POSITION_H_UNITS "°/100"
1486+
1487+

can_ids.json

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3226,6 +3226,124 @@
32263226
"frame_length": 63
32273227
}
32283228
]
3229+
},
3230+
{
3231+
"name": "MCV25",
3232+
"description": "Modulo de Controle por Voz",
3233+
"signature": 242,
3234+
"topics": [
3235+
{
3236+
"name": "STATE",
3237+
"description": "Module state report",
3238+
"id": 90,
3239+
"bytes": [
3240+
{
3241+
"name": "SIGNATURE",
3242+
"description": "Senders signature",
3243+
"type": "uint8_t",
3244+
"units": ""
3245+
},
3246+
{
3247+
"name": "STATE",
3248+
"description": "State code",
3249+
"type": "uint8_t",
3250+
"units": ""
3251+
},
3252+
{
3253+
"name": "ERROR",
3254+
"description": "Error code",
3255+
"type": "uint8_t",
3256+
"units": ""
3257+
},
3258+
null,
3259+
null,
3260+
null,
3261+
null,
3262+
null
3263+
],
3264+
"frequency": 0,
3265+
"frame_length": 71
3266+
},
3267+
{
3268+
"name": "MOTOR",
3269+
"description": "Motor controller parameters",
3270+
"id": 91,
3271+
"bytes": [
3272+
{
3273+
"name": "SIGNATURE",
3274+
"description": "Senders signature",
3275+
"type": "uint8_t",
3276+
"units": ""
3277+
},
3278+
{
3279+
"name": "MOTOR",
3280+
"description": "Motor state",
3281+
"type": "bitfield",
3282+
"units": "",
3283+
"bits": [
3284+
"MOTOR_ON",
3285+
"DMS_ON",
3286+
"REVERSE",
3287+
null,
3288+
null,
3289+
null,
3290+
null,
3291+
null
3292+
]
3293+
},
3294+
{
3295+
"name": "D",
3296+
"description": "Motor Duty Cycle",
3297+
"type": "uint8_t",
3298+
"units": "%"
3299+
},
3300+
{
3301+
"name": "I",
3302+
"description": "Motor Soft Start",
3303+
"type": "uint8_t",
3304+
"units": "%"
3305+
},
3306+
null,
3307+
null,
3308+
null,
3309+
null
3310+
],
3311+
"frequency": 25,
3312+
"frame_length": 79
3313+
},
3314+
{
3315+
"name": "MDE",
3316+
"description": "Steereing wheel controls",
3317+
"id": 92,
3318+
"bytes": [
3319+
{
3320+
"name": "SIGNATURE",
3321+
"description": "Senders signature",
3322+
"type": "uint8_t",
3323+
"units": ""
3324+
},
3325+
{
3326+
"name": "POSITION_L",
3327+
"description": "Steering wheel position, byte LOW",
3328+
"type": "uint16_t",
3329+
"units": "\u00b0/100"
3330+
},
3331+
{
3332+
"name": "POSITION_H",
3333+
"description": "Steering wheel position, byte HIGH",
3334+
"type": "uint16_t",
3335+
"units": "\u00b0/100"
3336+
},
3337+
null,
3338+
null,
3339+
null,
3340+
null,
3341+
null
3342+
],
3343+
"frequency": 25,
3344+
"frame_length": 71
3345+
}
3346+
]
32293347
}
32303348
],
32313349
"bitrate": 500000.0

can_ids_generator.py

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,3 +1602,101 @@
16021602
module_mswi19.add_topic(topic_mppts)
16031603
module_mswi19.add_topic(topic_mcs)
16041604
can.add_module(module_mswi19)
1605+
1606+
################################################################################
1607+
### MODULE: MCV25
1608+
module_mcv25 = can.Module(
1609+
name="mcv25",
1610+
signature=242,
1611+
description="Modulo de Controle por Voz"
1612+
)
1613+
#### TOPIC: STATE
1614+
topic_state = can.Topic(
1615+
msg="state",
1616+
id=90,
1617+
description="Module state report",
1618+
frequency = 0
1619+
)
1620+
topic_state.describe_byte(
1621+
name="state",
1622+
byte=1,
1623+
description="State code",
1624+
btype="uint8_t",
1625+
units=""
1626+
)
1627+
topic_state.describe_byte(
1628+
name="error",
1629+
byte=2,
1630+
description="Error code",
1631+
btype="uint8_t",
1632+
units=""
1633+
)
1634+
#### TOPIC: MOTOR
1635+
topic_motor = can.Topic(
1636+
msg="motor",
1637+
id=91,
1638+
frequency=25,
1639+
description="Motor controller parameters"
1640+
)
1641+
topic_motor.describe_byte(
1642+
name="motor",
1643+
byte=1,
1644+
description="Motor state",
1645+
btype="bitfield",
1646+
units=""
1647+
)
1648+
topic_motor.describe_bit(
1649+
name="motor on",
1650+
byte=1,
1651+
bit=0
1652+
)
1653+
topic_motor.describe_bit(
1654+
name="dms on",
1655+
byte=1,
1656+
bit=1
1657+
)
1658+
topic_motor.describe_bit(
1659+
name="reverse",
1660+
byte=1,
1661+
bit=2
1662+
)
1663+
topic_motor.describe_byte(
1664+
name="D",
1665+
byte=2,
1666+
description="Motor Duty Cycle",
1667+
btype="uint8_t",
1668+
units="%"
1669+
)
1670+
topic_motor.describe_byte(
1671+
name="I",
1672+
byte=3,
1673+
description="Motor Soft Start",
1674+
btype="uint8_t",
1675+
units="%"
1676+
)
1677+
#### TOPIC: MDE
1678+
topic_mde = can.Topic(
1679+
msg="mde",
1680+
id=92,
1681+
frequency = 25,
1682+
description="Steereing wheel controls",
1683+
)
1684+
topic_mde.describe_byte(
1685+
name="position_l",
1686+
byte=1,
1687+
description="Steering wheel position, byte LOW",
1688+
btype="uint16_t",
1689+
units="°/100"
1690+
)
1691+
topic_mde.describe_byte(
1692+
name="position_h",
1693+
byte=2,
1694+
description="Steering wheel position, byte HIGH",
1695+
btype="uint16_t",
1696+
units="°/100"
1697+
)
1698+
1699+
module_mcv25.add_topic(topic_state)
1700+
module_mcv25.add_topic(topic_motor)
1701+
module_mcv25.add_topic(topic_mde)
1702+
can.add_module(module_mcv25)

can_parser_types.h

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,6 +1568,59 @@ typedef struct
15681568
};
15691569
} can_mswi19_mcs_msg_t;
15701570

1571+
// Module state report
1572+
#pragma pack(push, 1) /* Ensure struct is packed */
1573+
typedef struct
1574+
{
1575+
union {
1576+
uint8_t raw[8];
1577+
struct {
1578+
uint8_t signature; // Senders signature. Units:
1579+
uint8_t state; // State code. Units:
1580+
uint8_t error; // Error code. Units:
1581+
};
1582+
};
1583+
} can_mcv25_state_msg_t;
1584+
1585+
// Motor controller parameters
1586+
#pragma pack(push, 1) /* Ensure struct is packed */
1587+
typedef struct
1588+
{
1589+
union {
1590+
uint8_t raw[8];
1591+
struct {
1592+
uint8_t signature; // Senders signature. Units:
1593+
struct { // Motor state
1594+
uint8_t motor_on : 1;
1595+
uint8_t dms_on : 1;
1596+
uint8_t reverse : 1;
1597+
uint8_t _unused : 5;
1598+
} motor;
1599+
uint8_t d; // Motor Duty Cycle. Units: %
1600+
uint8_t i; // Motor Soft Start. Units: %
1601+
};
1602+
};
1603+
} can_mcv25_motor_msg_t;
1604+
1605+
// Steereing wheel controls
1606+
#pragma pack(push, 1) /* Ensure struct is packed */
1607+
typedef struct
1608+
{
1609+
union {
1610+
uint8_t raw[8];
1611+
struct {
1612+
uint8_t signature; // Senders signature. Units:
1613+
union { // Steering wheel position, byte HIGH. Units: °/100
1614+
uint16_t position;
1615+
struct {
1616+
uint8_t position_l;
1617+
uint8_t position_h;
1618+
};
1619+
};
1620+
};
1621+
};
1622+
} can_mcv25_mde_msg_t;
1623+
15711624
typedef struct {
15721625
uint32_t id;
15731626
uint8_t dlc;
@@ -1644,6 +1697,9 @@ typedef struct {
16441697
can_mswi19_pumps_msg_t mswi19_pumps;
16451698
can_mswi19_mppts_msg_t mswi19_mppts;
16461699
can_mswi19_mcs_msg_t mswi19_mcs;
1700+
can_mcv25_state_msg_t mcv25_state;
1701+
can_mcv25_motor_msg_t mcv25_motor;
1702+
can_mcv25_mde_msg_t mcv25_mde;
16471703
};
16481704
} can_msg_t;
16491705

0 commit comments

Comments
 (0)