1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#ifndef CAN_FUNC_H
#define CAN_FUNC_H
#include "TYW_stdint.h"
#define DTCNumberBuf 50u
typedef struct
{
uint32_t TripA_Fuel;
uint32_t TripA_Average_Speed;
uint32_t TripA_Fuel_Consume;
uint32_t TripA_Idling;
uint32_t TripA_Runing;
uint32_t TripB_Fuel;
uint32_t TripB_Average_Speed;
uint32_t TripB_Fuel_Consume;
uint32_t TripB_Idling;
uint32_t TripB_Runing;
uint32_t Engine_Oil;
uint32_t Engine_Surplus;
} USER_ECU;
extern USER_ECU User_ECU;
//extern uint32_t DisDTCNumber[50];
extern uint32_t DTCNumberEngine[DTCNumberBuf];
extern uint32_t DTCNumberBrake[DTCNumberBuf];
extern uint32_t DTCNumberAMT[DTCNumberBuf];
extern uint32_t DTCNumberRadar[DTCNumberBuf];
extern uint32_t DTCNumberCamera[DTCNumberBuf];
extern uint32_t DTCNumberRetarder[DTCNumberBuf];
//extern uint32_t DisDTCNum;
extern uint32_t DisDTCNumEngine ;
extern uint32_t DisDTCNumBrake ;
extern uint32_t DisDTCNumAMT ;
extern uint32_t DisDTCNumRadar ;
extern uint32_t DisDTCNumCamera ;
extern uint32_t DisDTCNumRetarder ;
#define MAX_MULCANDATALEN 100
typedef union
{
struct
{
uint32_t StructDTC[25];
} SubDTC;
uint8_t UnionDTC[100];
} _DATADTC;
typedef struct //7 bytes
{
uint16_t wPGN; //打包消息的参数组编号
uint8_t bPackage; //全部数据包的数
uint8_t bLength; //整个消息大小的字节数
uint8_t bCtrByte; //控制字节
uint8_t bRcvInfoFlg; //有效接收标志,接收到该报文=1
uint8_t bRcvBusy; // 本标志位有效,表明正在接收多包信息。
uint8_t bPrePckNum; //上一个包序号
_DATADTC DataDTC; //多包信息缓冲区
} MULCANMSG;
extern MULCANMSG ECM18EBFF00;
extern MULCANMSG ECM18EBFF03;
extern MULCANMSG ECM18EBFF0B;
extern MULCANMSG ECM18EBFF10;
extern MULCANMSG ECM18EBFFA0;
extern MULCANMSG ECM18EBFFE8;
extern void Can_Set_Buff_18FEAE17(uint8_t CopyData[]);
extern void Can_Set_Buff_18FF3E17(uint8_t CopyData[]);
extern void Can_Set_Buff_18FED917(uint8_t CopyData[]);
extern void Can_Set_Buff_18FEE617(uint8_t CopyData[]);
extern void Can_Set_Buff_18EF1817(uint8_t CopyData[]);
extern void Can_Set_Buff_18FEE017(uint8_t CopyData[]);
extern void Can_Set_Buff_18FEFC17(uint8_t CopyData[]);
extern void Can_Set_Buff_18FF2517(uint8_t CopyData[]);
extern void Can_Set_Buff_18FF2A17(uint8_t CopyData[]);
extern void Can_Set_Buff_18FF9D17(uint8_t CopyData[]);
extern void Can_Set_Buff_18FFE517(uint8_t CopyData[]);
extern void Can_Set_Buff_18EF2D17(uint8_t CopyData[]);
extern void Can_Set_Buff_18033317(uint8_t CopyData[]);
extern void Can_Set_Buff_180433A2(uint8_t CopyData[]);
extern void Can_Set_Buff_18EA0017(uint8_t CopyData[]);
void Drive_Info_IC1_STATUS_Rx(void);
void Drive_Info_IC3_STATUS_Rx(void);
uint32_t Common_Data_Get_TripA_Fuel(void);
uint32_t Common_Data_Get_TripA_Average_Speed(void);
uint32_t Common_Data_Get_TripB_Fuel(void);
uint32_t Common_Data_Get_TripB_Average_Speed(void);
void Common_SetTXNum_18033317(void);
uint8_t Common_GetTXNum_18033317(void);
void Id18EF1817_Send_Service(void);
void Id18033317_Send_Service(void);
void Id18FFE517_Send_Service(void);
void MSG_18021733_REC_COPY(uint8_t copy[]);
void Common_SetId18FFE517Msg_TXSUCCESS(void);
uint8_t Common_GetId18FFE517Msg_TXSUCCESS(void);
void Common_Set_LDWS_Flag_Sta(uint8_t Vol);
uint8_t Common_Get_LDWS_Flag_Sta(void);
uint8_t Common_Get_Water_Temp_Level_Flag(void);
void Common_DTCEngine_Server(void);
void Common_DTCBrake_Server(void);
void Common_DTCAMT_Server(void);
void Common_DTCRadar_Server(void);
void Common_DTCCamera_Server(void);
void Common_DTCRetarder_Server(void);
void GetAllDtcEngineFault(uint32_t* pCurFault, uint8_t* pCurFaultNum, uint32_t* pHisFault, uint8_t* pHisFaultNum);
void GetAllDtcBrakeFault(uint32_t* pCurFault, uint8_t* pCurFaultNum, uint32_t* pHisFault, uint8_t* pHisFaultNum);
void GetAllDtcAMTFault(uint32_t* pCurFault, uint8_t* pCurFaultNum, uint32_t* pHisFault, uint8_t* pHisFaultNum);
void GetAllDtcRadarFault(uint32_t* pCurFault, uint8_t* pCurFaultNum, uint32_t* pHisFault, uint8_t* pHisFaultNum);
void GetAllDtcCameraFault(uint32_t* pCurFault, uint8_t* pCurFaultNum, uint32_t* pHisFault, uint8_t* pHisFaultNum);
void GetAllDtcRetarderFault(uint32_t* pCurFault, uint8_t* pCurFaultNum, uint32_t* pHisFault, uint8_t* pHisFaultNum);
void swap32(uint32_t *DwData);
void DoCAN_Get_Multi_frame00_Recv(void);
void DoCAN_Get_Multi_frame03_Recv(void);
void DoCAN_Get_Multi_frame0B_Recv(void);
void DoCAN_Get_Multi_frame10_Recv(void);
void DoCAN_Get_Multi_frameA0_Recv(void);
void DoCAN_Get_Multi_frameE8_Recv(void);
#endif