Commit d175ad59 authored by 梁百峰's avatar 梁百峰

feat:发送函数

parent 484f5b83
......@@ -3,14 +3,175 @@
void R485_Send_0x40(void)
{
memset(R485_ID40h.Msg, 0, 64);
switch (HJ_OtherKeyCurrent.count)
{
case 0:
R485_ID40h.Sig.BackupZoneMainSoftwareVer = 1;
R485_ID40h.Sig.BOOTSoftwareUnderlyingVer = 1;
R485_ID40h.Sig.FlowCode4th = 1;
R485_ID40h.Sig.ProductModel1 = 1;
break;
case 1:
R485_ID40h.Sig.BackupZoneMainSoftwareVer = 0;
R485_ID40h.Sig.BOOTSoftwareUnderlyingVer = 0;
R485_ID40h.Sig.FlowCode4th = 0;
R485_ID40h.Sig.ProductModel1 = 0;
break;
case 2:
R485_ID40h.Sig.BackupZoneMainSoftwareVer = 1;
R485_ID40h.Sig.BOOTSoftwareUnderlyingVer = 1;
R485_ID40h.Sig.FlowCode4th = 1;
R485_ID40h.Sig.ProductModel1 = 1;
break;
case 3:
R485_ID40h.Sig.BackupZoneMainSoftwareVer = 0;
R485_ID40h.Sig.BOOTSoftwareUnderlyingVer = 0;
R485_ID40h.Sig.FlowCode4th = 0;
R485_ID40h.Sig.ProductModel1 = 0;
break;
case 4:
R485_ID40h.Sig.BackupZoneMainSoftwareVer = 1;
R485_ID40h.Sig.BOOTSoftwareUnderlyingVer = 1;
R485_ID40h.Sig.FlowCode4th = 1;
R485_ID40h.Sig.ProductModel1 = 1;
break;
case 5:
R485_ID40h.Sig.BackupZoneMainSoftwareVer = 0;
R485_ID40h.Sig.BOOTSoftwareUnderlyingVer = 0;
R485_ID40h.Sig.FlowCode4th = 0;
R485_ID40h.Sig.ProductModel1 = 0;
break;
case 6:
R485_ID40h.Sig.BackupZoneMainSoftwareVer = 1;
R485_ID40h.Sig.BOOTSoftwareUnderlyingVer = 1;
R485_ID40h.Sig.FlowCode4th = 1;
R485_ID40h.Sig.ProductModel1 = 1;
break;
case 7:
R485_ID40h.Sig.BackupZoneMainSoftwareVer = 0;
R485_ID40h.Sig.BOOTSoftwareUnderlyingVer = 0;
R485_ID40h.Sig.FlowCode4th = 0;
R485_ID40h.Sig.ProductModel1 = 0;
break;
case 8:
R485_ID40h.Sig.BackupZoneMainSoftwareVer = 1;
R485_ID40h.Sig.BOOTSoftwareUnderlyingVer = 1;
R485_ID40h.Sig.FlowCode4th = 1;
R485_ID40h.Sig.ProductModel1 = 1;
break;
case 9:
break;
default:
break;
}
R485_Send(0x40, R485_ID40h.Msg, sizeof(R485_ID40h.Msg));
}
void R485_Send_0x41(void)
{
memset(R485_ID41h.Msg, 0, 64);
R485_ID41h.Sig.AlarmStatus = 1;
R485_ID41h.Sig.ALMCommunicationStatus = 1;
switch (HJ_OtherKeyCurrent.count)
{
case 0:
break;
case 1:
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0; //速度 = (X * 0.512 * 3.14 * 1.05) / 30
R485_ID41h.Sig.TotalBatterySOC = 0x2; //电量
R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态
R485_ID41h.Sig.SpeedGear = 0x2; //挡位
//功率暂空一会做
R485_ID41h.Sig.IOTRealTime_Hour = 0; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 0; //时间:分
R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒
break;
case 2:
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0xC3; //速度 = (X * 0.512 * 3.14 * 1.05) / 30
R485_ID41h.Sig.TotalBatterySOC = 0x1E; //电量
R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态
R485_ID41h.Sig.SpeedGear = 0x3; //挡位
//功率暂空一会做
R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x1; // 自动大灯
R485_ID41h.Sig.IOTRealTime_Hour = 0xB; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 0xB; //时间:分
R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒
break;
case 3:
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0x186; //速度 = (X * 0.512 * 3.14 * 1.05) / 30
R485_ID41h.Sig.TotalBatterySOC = 0x2C; //电量
R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态
R485_ID41h.Sig.SpeedGear = 0x1; //挡位
//功率暂空一会做
R485_ID41h.Sig.IOTRealTime_Hour = 0x16; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 0x16; //时间:分
R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒
break;
case 4:
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0x240; //速度 = (X * 0.512 * 3.14 * 1.05) / 30
R485_ID41h.Sig.TotalBatterySOC = 0x42; //电量
R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态
R485_ID41h.Sig.SpeedGear = 0x0; //挡位
//功率暂空一会做
R485_ID41h.Sig.IOTRealTime_Hour = 0xD; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 21; //时间:分
R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒
break;
case 5:
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0xC3; //速度 = (X * 0.512 * 3.14 * 1.05) / 30
R485_ID41h.Sig.TotalBatterySOC = 0x1E; //电量
R485_ID41h.Sig.VehicleStatus = 0x1; //整车状态
R485_ID41h.Sig.SpeedGear = 0x3; //挡位
//功率暂空一会做
R485_ID41h.Sig.IOTRealTime_Hour = 0; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 0; //时间:分
R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒
break;
case 6:
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0xC3; //速度 = (X * 0.512 * 3.14 * 1.05) / 30
R485_ID41h.Sig.TotalBatterySOC = 0x1E; //电量
R485_ID41h.Sig.VehicleStatus = 0x1; //整车状态
R485_ID41h.Sig.SpeedGear = 0x3; //挡位
//功率暂空一会做
R485_ID41h.Sig.IOTRealTime_Hour = 0; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 0; //时间:分
R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒
break;
case 7:
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0xC3; //速度 = (X * 0.512 * 3.14 * 1.05) / 30
R485_ID41h.Sig.TotalBatterySOC = 0x1E; //电量
R485_ID41h.Sig.VehicleStatus = 0x1; //整车状态
R485_ID41h.Sig.SpeedGear = 0x3; //挡位
//功率暂空一会做
R485_ID41h.Sig.IOTRealTime_Hour = 0; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 0; //时间:分
R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒
break;
case 8:
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0xC3; //速度 = (X * 0.512 * 3.14 * 1.05) / 30
R485_ID41h.Sig.TotalBatterySOC = 0x1E; //电量
R485_ID41h.Sig.VehicleStatus = 0x1; //整车状态
R485_ID41h.Sig.SpeedGear = 0x3; //挡位
//功率暂空一会做
R485_ID41h.Sig.IOTRealTime_Hour = 0; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 0; //时间:分
R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒
break;
case 9:
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0xC3; //速度 = (X * 0.512 * 3.14 * 1.05) / 30
R485_ID41h.Sig.TotalBatterySOC = 0x1E; //电量
R485_ID41h.Sig.VehicleStatus = 0x1; //整车状态
R485_ID41h.Sig.SpeedGear = 0x3; //挡位
//功率暂空一会做
R485_ID41h.Sig.IOTRealTime_Hour = 0; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 0; //时间:分
R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒
break;
case 10:
break;
default:
break;
}
R485_Send(0x41, R485_ID41h.Msg, sizeof(R485_ID41h.Msg));
}
......
......@@ -198,42 +198,110 @@ void Api_GPIO_Init(void)
}
void ApiPowerSupply(void)
void Line_Temp(void)
{
//�ϵ�ʱ��
//DelayMs(6);//6ms
P_VCC4V2_EN_NEW(PortGpioLow);// P1_25 Pin97
//DelayMs(1000);//125ms
P_3V3MCU_EN(PortGpioHigh);//64pin 104
//DelayMs(1500);//1500ms
P_VCC3V3_EN(PortGpioHigh);//106pin 200
//DelayMs(2);//1ms
F_LCD_RESET(PortGpioHigh);//103pin 129
F_LCD_STBYB(PortGpioHigh);//6pin 004
//DelayMs(1);
P_1531_EN(PortGpioHigh);
//DelayMs(115);//115ms
P_61194_EN(PortGpioHigh);//125pin 213
P_APOWER_OUT(PortGpioHigh);//91pin 119
NEW_F_Sound_EN(PortGpioHigh);//����ʹ��
P_BD12_EN(PortGpioHigh);
P_TPA6211_EN(PortGpioHigh);
switch (HJ_OtherKeyCurrent.count)
{
case 0:
LINE_LampLowON;
LINE_LampHighOFF;
LINE_weizhiOFF;
LINE_TurnLeftOFF;
LINE_TurnRightOFF;
LINE_ABSOFF;
LINE_BLEOFF;
break;
case 1:
LINE_LampLowOFF;
LINE_LampHighON;
LINE_weizhiOFF;
LINE_TurnLeftON;
LINE_TurnRightOFF;
LINE_ABSOFF;
LINE_BLEOFF;
break;
case 2:
LINE_LampLowON;
LINE_LampHighOFF;
LINE_weizhiON;
LINE_TurnLeftOFF;
LINE_TurnRightON;
LINE_ABSOFF;
LINE_BLEOFF;
break;
case 3:
LINE_LampLowON;
LINE_LampHighOFF;
LINE_weizhiOFF;
LINE_TurnLeftOFF;
LINE_TurnRightOFF;
LINE_ABSOFF;
LINE_BLEOFF;
break;
case 4:
LINE_LampLowON;
LINE_LampHighOFF;
LINE_weizhiOFF;
LINE_TurnLeftOFF;
LINE_TurnRightOFF;
LINE_ABSOFF;
LINE_BLEOFF;
break;
case 5:
LINE_LampLowON;
LINE_LampHighOFF;
LINE_weizhiOFF;
LINE_TurnLeftOFF;
LINE_TurnRightOFF;
LINE_ABSOFF;
LINE_BLEOFF;
break;
case 6:
LINE_LampLowON;
LINE_LampHighOFF;
LINE_weizhiOFF;
LINE_TurnLeftOFF;
LINE_TurnRightOFF;
LINE_ABSON;
LINE_BLEOFF;
break;
case 7:
LINE_LampLowON;
LINE_LampHighOFF;
LINE_weizhiOFF;
LINE_TurnLeftOFF;
LINE_TurnRightOFF;
LINE_ABSOFF;
LINE_BLEON;
break;
case 8:
LINE_LampLowON;
LINE_LampHighOFF;
LINE_weizhiOFF;
LINE_TurnLeftOFF;
LINE_TurnRightOFF;
LINE_ABSOFF;
LINE_BLEOFF;
break;
case 9:
LINE_LampLowON;
LINE_LampHighON;
LINE_weizhiON;
LINE_TurnLeftON;
LINE_TurnRightON;
LINE_ABSON;
LINE_BLEON;
break;
default:
LINE_LampLowON;
LINE_LampHighOFF;
LINE_weizhiOFF;
LINE_TurnLeftOFF;
LINE_TurnRightOFF;
LINE_ABSOFF;
LINE_BLEOFF;
break;
}
}
......@@ -138,8 +138,28 @@ extern en_port_gpio_level_t BUTTON_GND_Signal3_IN;
extern en_port_gpio_level_t Can1Rx_IN;
#define GET_CAN1_RX_IN_LEVEL Port_GetPortPinLevel(0, 27, &Can1Rx_IN)
#define LINE_LampLowON Port_SetPortPinLevel(2,5,PortGpioHigh)
#define LINE_LampLowOFF Port_SetPortPinLevel(2,5,PortGpioLow)
#define LINE_LampHighON Port_SetPortPinLevel(2,0,PortGpioHigh)
#define LINE_LampHighOFF Port_SetPortPinLevel(2,0,PortGpioLow)
#define LINE_weizhiON Port_SetPortPinLevel(1,25,PortGpioHigh)
#define LINE_weizhiOFF Port_SetPortPinLevel(1,25,PortGpioLow)
#define LINE_TurnLeftON Port_SetPortPinLevel(2,27,PortGpioLow)
#define LINE_TurnLeftOFF Port_SetPortPinLevel(2,27,PortGpioHigh)
#define LINE_TurnRightON Port_SetPortPinLevel(2,29,PortGpioLow)
#define LINE_TurnRightOFF Port_SetPortPinLevel(2,29,PortGpioHigh)
#define LINE_ABSON Port_SetPortPinLevel(1,24,PortGpioHigh)
#define LINE_ABSOFF Port_SetPortPinLevel(1,24,PortGpioLow)
#define LINE_BLEON Port_SetPortPinLevel(1,24,PortGpioHigh)
#define LINE_BLEOFF Port_SetPortPinLevel(1,24,PortGpioLow)
extern void Api_GPIO_Init(void);
extern void ApiPowerSupply(void);
extern void Line_Temp(void);
#endif /* API_IOCONFIG_H_ */
//
......@@ -821,8 +821,8 @@ void CANInit(void)
g_UI_Language = NewData.Data2;
#endif
g_UI_SWHW = NewData.Data3;
UART_PORT_init();
UART_init();
// UART_PORT_init();
// UART_init();
HU_USM_E_04.CF_AVN_CluVoiceVolume = 0x3;
BarcodePartNumOffect = 14;
// Mfs_Uart_Write(UART0_Type, StartBuf, 8, TRUE);
......
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