Commit f5fd0db5 authored by 陈家乐's avatar 陈家乐

feat:添加CAN报文

parent 7ec241c4
This diff is collapsed.
......@@ -272,6 +272,8 @@ void SendCan0Message(void)
Can_Clear((uint8_t*)&TBOX.msg.data);
CanFD_Send_StandMsg(CANFD0_Type, 0x18203220, BUF_4, TX_ISR_EN, (uint8_t*)&CAN18203220.msg.data, 8);
Can_Clear((uint8_t*)&TBOX.msg.data);
CanFD_Send_StandMsg(CANFD0_Type, 0x18203020, BUF_4, TX_ISR_EN, (uint8_t*)&CAN18203020.msg.data, 8);
Can_Clear((uint8_t*)&TBOX.msg.data);
......
......@@ -2946,6 +2946,25 @@ typedef struct
}msg;
}CAN18203220_;
typedef struct
{
union
{
uint8_t data[8];
struct
{
unsigned int : 8;
unsigned int : 8 ;
unsigned int : 8 ;
unsigned int : 8 ;
unsigned int MBMS_StatSoc : 8 ;
unsigned int : 8 ;
unsigned int : 8 ;
unsigned int : 8 ;
}bits;
}msg;
}CAN18203020_;
//TCS_37B ID:37B
typedef struct
{
......@@ -3115,6 +3134,7 @@ EXTERN_VAR volatile CAN38E_ CAN38E;
EXTERN_VAR volatile CAN339_ CAN339;
EXTERN_VAR volatile CAN18202922_ CAN18202922;
EXTERN_VAR volatile CAN18203220_ CAN18203220;
EXTERN_VAR volatile CAN18203020_ CAN18203020;
//EXTERN_VAR volatile Send_111_ Send_111 ;
......
......@@ -497,6 +497,8 @@ void SPEED_Step()
CAN18203220.msg.bits.MBMS_StatBattChargeState = 0x05;
CAN18203220.msg.bits.MBMS_StatBattWorkState = 0xE;
CAN18203020.msg.bits.MBMS_StatSoc = 0;
break;
case 1:
LIG_left_OUT(PortGpioHigh);//草满指示灯
......@@ -505,6 +507,8 @@ void SPEED_Step()
CAN125.msg.bits.MMCU_TravelSpeedGear = 1;
CAN157.msg.bits.BMCU_BladeSpeedGear = 0;
CAN18203020.msg.bits.MBMS_StatSoc = 10;
break;
case 2:
LIG_left_OUT(PortGpioLow);//草满指示灯
......@@ -514,6 +518,9 @@ void SPEED_Step()
SOC2.msg.bits.MBMS_Soc = 30;
CAN125.msg.bits.MMCU_TravelSpeedGear = 2;
CAN157.msg.bits.BMCU_BladeSpeedGear = 1;
CAN18203020.msg.bits.MBMS_StatSoc = 20;
break;
case 3:
CAN38E.msg.bits.BMCU_Moto1_Locked_RotorFault = 0;//刀盘
......@@ -525,6 +532,9 @@ void SPEED_Step()
CAN125.msg.bits.MMCU_ParkingGearState = 1;//P档
CAN157.msg.bits.BMCU_BladeSpeedGear = 2;
CAN18203020.msg.bits.MBMS_StatSoc = 30;
break;
case 4:
CAN125.msg.bits.MMCU_SeatDetectState = 0;//座椅检测
......@@ -538,6 +548,9 @@ void SPEED_Step()
CAN157.msg.bits.BMCU_BladeSpeedGear = 3;
CAN18203020.msg.bits.MBMS_StatSoc = 40;
break;
case 5:
CAN18202922.msg.bits.MBMS_TOTALSigAcc = 0;//钥匙接入
......@@ -550,6 +563,9 @@ void SPEED_Step()
CAN125.msg.bits.MMCU_ParkingGearState = 1;//P档
CAN157.msg.bits.BMCU_BladeSpeedGear = 3;
CAN18203020.msg.bits.MBMS_StatSoc = 50;
break;
case 6:
CAN125.msg.bits.MMCU_PowerMode = 2;//READY灯
......@@ -566,6 +582,9 @@ void SPEED_Step()
CAN157.msg.bits.BMCU_BladeSpeedGear = 3;
CAN18203020.msg.bits.MBMS_StatSoc = 60;
break;
case 7:
......@@ -582,6 +601,9 @@ void SPEED_Step()
CAN125.msg.bits.MMCU_ParkingGearState = 1;//P档
CAN157.msg.bits.BMCU_BladeSpeedGear = 3;
CAN18203020.msg.bits.MBMS_StatSoc = 70;
break;
case 8:
CAN157.msg.bits.BMCU_PTOSwicthState = 0;//刀盘开关
......@@ -595,9 +617,23 @@ void SPEED_Step()
CAN125.msg.bits.MMCU_ParkingGearState = 1;//P档
CAN157.msg.bits.BMCU_BladeSpeedGear = 3;
CAN18203020.msg.bits.MBMS_StatSoc = 80;
break;
case 9:
LIG_right_OUT(PortGpioLow);
LIG_left_OUT(PortGpioLow);//草满指示灯
SOC1.msg.bits.MBMS_Soc = 100;
SOC2.msg.bits.MBMS_Soc = 100;
CAN125.msg.bits.MMCU_TravelSpeedGear = 0;
CAN125.msg.bits.MMCU_ParkingGearState = 1;//P档
CAN157.msg.bits.BMCU_BladeSpeedGear = 3;
CAN18203020.msg.bits.MBMS_StatSoc = 90;
break;
case 10:
LIG_right_OUT(PortGpioHigh);//大灯
......@@ -615,10 +651,16 @@ void SPEED_Step()
CAN18203220.msg.bits.MBMS_StatBattChargeState = 0x07;
CAN18203220.msg.bits.MBMS_StatBattWorkState = 0xF;
CAN157.msg.bits.BMCU_BladeSpeedGear = 0x7;
CAN157.msg.bits.BMCU_BladeSpeedGear = 3;
//CAN125.msg.bits.MMCU_TravelSpeedGear = 0x3;
CAN339.msg.bits.MMCU_AccumulatedWorkHour_L = (6006)&0xFF;
CAN339.msg.bits.MMCU_AccumulatedWorkHour_H = (6006>>8)&0xFF;
CAN125.msg.bits.MMCU_TravelSpeedGear = 0;
CAN125.msg.bits.MMCU_ParkingGearState = 1;//P档
CAN18203020.msg.bits.MBMS_StatSoc = 100;
break;
//case 11:
// TCS_125.msg.bits.TCS_WorkMode = 0x1; //TCSָʾ�ƿ���
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment