Commit c0648dbb authored by 李俭双's avatar 李俭双

feat:增加外发信号,过后补充接口

parent b21e326f
...@@ -8,10 +8,10 @@ st_CanMsgTxOp CAN_CH0_CanMsgTxOp; ...@@ -8,10 +8,10 @@ st_CanMsgTxOp CAN_CH0_CanMsgTxOp;
const st_CAN_SendAttribute CAN_CH0_CANSendAttr[CAN_CH0_ID_SEND_TOTAL] = const st_CAN_SendAttribute CAN_CH0_CANSendAttr[CAN_CH0_ID_SEND_TOTAL] =
{ {
{0x220ul, 8ul * 1000ul, 7ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_500, (void *)0}, {0x220ul, 50ul * 1000ul, 7ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_220, (void *)0},
{0x6EEul, 8ul * 1000ul, 7ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_500, (void *)0}, {0x6EEul, 8ul * 1000ul, 7ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_6EE, (void *)0},
{0x6EFul, 8ul * 1000ul, 7ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_500, (void *)0}, {0x6EFul, 8ul * 1000ul, 7ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_6EF, (void *)0},
{0x450ul, 8ul * 1000ul, 7ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_500, (void *)0}, {0x450ul, 8ul * 1000ul, 7ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_450, (void *)0},
}; };
const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] = const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
......
#include "Can_App.h" #include "Can_App.h"
#include "Components.h"
void Can_Set_Buff_500(canlib_uint8_t CopyData[]) void Can_Set_Buff_220(canlib_uint8_t CopyData[])
{ {
CANMsg500Union *p500; CANMsg220Union *p220;
uint8_t i = 0; uint8_t i = 0;
for (i = 0; i < 8; i++)
p220 = (CANMsg220Union *)CopyData;
if ( p220 != ( void * )0 )
{
for ( i = 0u; i < 8u; i++ )
{
p220->Msg [ i ] = 0xFFu;
}
}
p220 -> Sig.TCS_TX = Get_Dis_Tcs_Val();
}
void Can_Set_Buff_6EE(canlib_uint8_t CopyData[])
{
CANMsg6EEUnion *p6EE;
uint8_t i = 0;
p6EE = (CANMsg6EEUnion *)CopyData;
if ( p6EE != ( void * )0 )
{
for ( i = 0u; i < 8u; i++ )
{
p6EE->Msg [ i ] = 0xFFu;
}
}
}
void Can_Set_Buff_6EF(canlib_uint8_t CopyData[])
{
CANMsg6EFUnion *p6EF;
uint8_t i = 0;
p6EF = (CANMsg6EFUnion *)CopyData;
if ( p6EF != ( void * )0 )
{ {
CopyData[i] = 0xFFU; for ( i = 0u; i < 8u; i++ )
{
p6EF->Msg [ i ] = 0xFFu;
}
} }
p500 = (CANMsg500Union *)CopyData; }
if (p500 != (void *)0) void Can_Set_Buff_450(canlib_uint8_t CopyData[])
{
CANMsg450Union *p450;
uint8_t i = 0;
p450 = (CANMsg450Union *)CopyData;
if ( p450 != ( void * )0 )
{ {
//p500->Sig.Key_ISTOP = Auto_Start_Stop; for ( i = 0u; i < 8u; i++ )
p500->Msg[1] = 0x00; {
p500->Msg[2] = 0x00; p450->Msg [ i ] = 0xFFu;
p500->Msg[3] = 0x00; }
p500->Msg[4] = 0x00;
p500->Msg[5] = 0x00;
p500->Msg[6] = 0x00;
p500->Msg[7] = 0x00;
} }
} }
...@@ -11,22 +11,88 @@ typedef union ...@@ -11,22 +11,88 @@ typedef union
uint8_t Msg [ 8 ]; uint8_t Msg [ 8 ];
struct struct
{ {
uint8_t Key_ISTOP : 8; uint32_t Res0 : 3;
uint8_t Res1: 8; uint32_t TCS_TX : 1;
uint8_t Res2: 8; uint32_t Res1: 4;
uint8_t Res3: 8;
uint32_t Res2: 8;
uint8_t Res4: 8; uint32_t Res3: 16;
uint8_t Res5: 8; uint32_t Res4: 32;
uint8_t Res6 : 8;
uint8_t Res7 : 8; } Sig;
} CANMsg220Union;
typedef union
{
uint8_t Msg [ 8 ];
struct
{
uint32_t Coolant_Seg_TX : 4;
uint32_t Fuel_Seg_TX : 4;
uint32_t Res0 : 8;
uint32_t Fuel_Res_TX : 8;
uint32_t Vsppe_H3_TX : 3;
uint32_t Res1 : 1;
uint32_t Coolant_Warn_TX : 1;
uint32_t Res2 : 2;
uint32_t Uint_TX : 1;
uint32_t Vsppe_L8_TX : 8;
uint32_t ODO_TX : 24;
} Sig;
} CANMsg6EEUnion;
typedef union
{
uint8_t Msg [ 8 ];
struct
{
uint32_t Espeed_TX : 8;
uint32_t Coolant_TX : 8;
uint32_t TripA : 16;
uint32_t TripB : 16;
uint32_t Res1 : 16;
} Sig;
} CANMsg6EFUnion;
typedef union
{
uint8_t Msg [ 8 ];
struct
{
uint32_t Front_Pressure_TX : 16;
uint32_t Rear_Pressure_TX : 16;
uint32_t Front_Air_Leakage_TX : 1;
uint32_t Rear_Air_Leakage_TX : 1;
uint32_t Front_Low_Voltage_TX : 1;
uint32_t Rear_Low_Voltage_TX : 1;
uint32_t Front_High_Temp_TX : 1;
uint32_t Rear_High_Temp_TX : 1;
uint32_t Res0 : 2;
uint32_t Res1 : 24;
} Sig; } Sig;
} CANMsg500Union; } CANMsg450Union;
void Can_Set_Buff_500(canlib_uint8_t CopyData[]); void Can_Set_Buff_220(canlib_uint8_t CopyData[]);
void Can_Set_Buff_6EE(canlib_uint8_t CopyData[]);
void Can_Set_Buff_6EF(canlib_uint8_t CopyData[]);
void Can_Set_Buff_450(canlib_uint8_t CopyData[]);
#endif #endif
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