HDG/ECU_APP/diagnose/Dcm_extern.h
2024-05-26 08:08:32 +08:00

248 lines
14 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

typedef struct
{
unsigned char write;
unsigned char data;
}IO_parameter_t;
#define IO_TEMP 0
#define IO_REC 1
#define IO_FAN 2
#define IO_MODE 3
#define IO_DEFROST 4
#define IO_REARDEF 5
#define IO_AC 6
#define IO_K30 7
#define KL30_VOLTAGE 0
#define TEMP_MOTOR 1
#define MODE_MOTOR 2
#define REC_MOTOR 3
#define EVA_SENSOR 4
#define INDEX_REPROGMA 0
#define INDEX_0xF190 1
#define INDEX_0xF198 2
#define INDEX_0xF199 3
#define INDEX_0xF19D 4
#define INDEX_0xF110 5
#define INDEX_0xF197 5
#define INDEX_0xF112 5
/************************************************************************************
// 输入参数 ch : /
// 0: KL30电压 /
// 1: 驾驶员侧温度调节电机反馈电压 /
// 2: 出风模式电机电机反馈电压 /
// 3: 循环风门调节电机反馈电压 /
// 4蒸发器温度传感器电压 /
// /
// 返回值: /
// 对应的电压*10即返回的电压值精度是0.1V的) /
// /
************************************************************************************/
unsigned char GetVoltage(unsigned char ch);
/************************************************************************************
// 输入参数 motor : /
// 1: 驾驶员侧温度调节电机 /
// 2: 出风模式电机电机 /
// 3: 循环风门调节电机 /
// /
// 返回值: /
// 0: 电机正常 1电机堵转 /
// /
************************************************************************************/
unsigned char GetMotorLockStatus(unsigned char motor);
/************************************************************************************
// 输入参数 p : /
// 0: TEMP 驾驶员侧温度风门位置 /
// 1: REC 内外循环模式 /
// 2: FAN 鼓风机档位 /
// 3: MODE 模式风门位置 /
// 4: DEFROST 除霜开关 /
// 5: REARDEF 后除霜控制 /
// 6: AC A/C制冷按键按键 /
// 7: K30 ECU Supplier voltage /
// /
// 返回值: /
// 0: 对应的data,具体见222F服务 /
************************************************************************************/
unsigned char GetIoParameter(unsigned char p);
/************************************************************************************
// 输入参数 p : /
// 0: TEMP 驾驶员侧温度风门位置 /
// 1: REC 内外循环模式 /
// 2: FAN 鼓风机档位 /
// 3: MODE 模式风门位置 /
// 4: DEFROST 无效 /
// 5: REARDEF 后除霜控制 /
// 6: AC 无效 /
// 7: K30 无效 /
// 返回值: /
// /
************************************************************************************/
void WriteIoParameter(unsigned char p,unsigned char data);
/************************************************************************************
// 输入参数 p : /
// /
// /
// 返回值: /
// 0: IGN电源正常 1IGN > 16V 或 IGN < 9V /
// /
************************************************************************************/
unsigned char GetIgnVoltStatus(void);
/************************************************************************************
// 输入参数 ID : CAN ID //
// 输入参数 Dlc : CAN 发送数据长度 //
// 输入参数 *Data : 指向 CAN 发送数据缓冲区的指针 //
// //
// 返回值: //
// 0 发送成功 非0 :发送失败 //
************************************************************************************/
unsigned char TransmitCAN_Message(unsigned int ID,unsigned char Dlc,unsigned char *Data);
/************************************************************************************
// 输入参数 write_buf : 指向 需要写入数据缓冲区的地址 //
// 输入参数 data_num : 数据代号 //
// 输入参数 len : 写入数据长度 //
// //
// 返回值: //
// 0 写入成功 非0 :写入失败 //
************************************************************************************/
unsigned char DF_Write(unsigned char* write_buf,unsigned char data_num,unsigned char len);
/************************************************************************************
// 输入参数 read_buf : 指向读取数据存入的缓冲区的地址 //
// 输入参数 data_num : 数据代号 //
// 输入参数 len : 读取数据长度 //
// //
// 返回值: //
// 0 读取成功 非0 :读取失败 //
************************************************************************************/
unsigned char DF_Read(unsigned char* read_buf,unsigned char data_num,unsigned char len);
/************************************************************************************
// //
// 返回值: //
// 当前32bit 的 1ms计数的值 //
***********************************************************************************/
unsigned long GetTimerCnt(void);
/************************************************************************************
// 获取data Flash数据存取索引号 //
// 输入参数 code : //
// 0 : 获取APP重编程请求标志索引号 //
// 1 : 获取2E服务0xF110的索引号 //
// 2 : 获取2E服务0xF190的索引号 //
// 3 : 获取2E服务0xF197的索引号 //
// 4 : 获取2E服务0xF198的索引号 //
// 5 : 获取2E服务0xF199的索引号 //
// 6 : 获取2E服务0xF19D的索引号 //
// 7 : 获取2E服务0xF112的索引号 //
// 8 : 获取19服务0xF00616的索引号 //
// 9 : 获取19服务0xF00617的索引号 //
// 10 : 获取19服务0x918112的索引号 //
// 11 : 获取19服务0x918114的索引号 //
// 12 : 获取19服务0x918171的索引号 //
// 13 : 获取19服务0x918312的索引号 //
// 14 : 获取19服务0x918314的索引号 //
// 15 : 获取19服务0x918371的索引号 //
// 16 : 获取19服务0x918412的索引号 //
// 17 : 获取19服务0x918414的索引号 //
// 18 : 获取19服务0x918471的索引号 //
// 19 : 获取19服务0x918611的索引号 //
// 20 : 获取19服务0x918614的索引号 //
// 21 : 获取19服务0xC07300的索引号
// //
// 返回值: //
// 数据索引号 //
// //
************************************************************************************/
unsigned char GetIndexNumber(unsigned char code);
/************************************************************************************
// 获取AC硬件版本 //
// 输入参数 hdv : //
// 指向读取数据存入的缓冲区的地址 //
// //
// 返回值: //
// //
// //
************************************************************************************/
void GetHardwareVersion(unsigned char* hdv);
/************************************************************************************
// 获取AC软件版本 //
// 输入参数 swv : //
// 指向读取数据存入的缓冲区的地址 //
// //
// 返回值: //
// //
// //
************************************************************************************/
void GetSoftwareVersion(unsigned char* swv);
/************************************************************************************
// 获取AC生产日期 //
// 输入参数 *date : //
// data[0] = YEAR //
// data[1] = MONTH //
// data[0] = DAY //
// //
// 返回值: //
// //
// //
************************************************************************************/
void GetManufacturingDate(unsigned char* date);
/************************************************************************************
// 获取Can总线出错状态 //
// 输入参数 //
// //
// 返回值: Can总线出错状态 //
// //
// //
************************************************************************************/
unsigned char GetCanBusOffErr(void);
/************************************************************************************
// 获取历史成功编程次数 //
// 输入参数 //
// //
// 返回值: 历史成功编程次数 //
// //
// //
************************************************************************************/
unsigned char GetProgrammingCounter(void);
/************************************************************************************
// 获取历史编程次数 //
// 输入参数 //
// //
// 返回值: 历史编程次数 //
// //
// //
************************************************************************************/
unsigned char GetProgrammingAttempCounter(void);
/************************************************************************************
// 清除DTC数据 //
// 输入参数 //
// //
// 返回值: 状态 //
// //
// //
************************************************************************************/
unsigned char Clear_DTC_Data(void);