330 lines
19 KiB
C
330 lines
19 KiB
C
|
||
#ifndef DCM_EXTERN_H
|
||
#define DCM_EXTERN_H
|
||
|
||
#include "appTask.h"
|
||
|
||
|
||
|
||
#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 EVA_SENSOR 0
|
||
#define OUTSIDE_SENSOR 1
|
||
#define INSIDE_SENSOR 2
|
||
#define KL30_VOLTAGE 3
|
||
#define TEMP_MOTOR 4
|
||
#define MODE_MOTOR 5
|
||
#define REC_MOTOR 6
|
||
|
||
|
||
|
||
extern const unsigned char DID_0xF110_VehicleNetworkConfiguration[8];
|
||
extern const unsigned char DID_0xF190_vehicleIdentificationNumber[17];
|
||
extern const unsigned char DID_0xF197_SystemNameOrEngineType[8];
|
||
extern const unsigned char DID_0xF198_RepairShopCodeOrTesterSerialNumber[16];
|
||
extern const unsigned char DID_0xF199_ProgrammingOrConfigurationDate[4];
|
||
extern const unsigned char DID_0xF19D_ECUInstallationDateDataIdentifier[4];
|
||
extern const unsigned char DID_0xF112_VehicleName[8];
|
||
|
||
/*****************************************/
|
||
// BLG?4Kdataflash,1?block1k //
|
||
// 0x000F1000-0x000F13FF??????//
|
||
//0x000F1400-0x000F17FF,0x000F1800-0x000F1AFF,0x000F1C00-0x000FEFF DTC//
|
||
/*****************************************/
|
||
|
||
//#define AC_MANUFACTURING_YEAR (0x17)
|
||
//#define AC_MANUFACTURING_MONTH (0x06)
|
||
//#define AC_MANUFACTURING_DAY (0x11)
|
||
|
||
|
||
typedef struct
|
||
{
|
||
unsigned char write;
|
||
unsigned char data;
|
||
}IO_parameter_t;
|
||
|
||
extern IO_parameter_t io_parameter[8];
|
||
|
||
|
||
/************************/
|
||
// DCM ����״̬�����ӿ�
|
||
/************************/
|
||
//��ϻỰģÊ?
|
||
|
||
//#define DCM_DEFAULT_SESSION 0x01 /*Ĭ��ģʽ*/
|
||
//#define DCM_PROGRAMME_SESSION 0x02 /*���ģÊ?*/
|
||
//#define DCM_EXTEND_SESSION 0x04 /*��չģʽ*/
|
||
|
||
extern uint8 MngDcm_GetDiagnosticSession(void);
|
||
|
||
|
||
//ͨ�ſ���״̬����
|
||
//0x00 ��ֹ�շ�
|
||
//0x01 ��������
|
||
//0x02 ��������
|
||
//0x03 �����շ�
|
||
|
||
extern uint8 GetNormalMsgSts(void);
|
||
extern uint8 GetNetworkMsgSts(void);
|
||
|
||
|
||
|
||
|
||
/************************************************************************************
|
||
// ������� ch : /
|
||
// 0: KL30��ѹ /
|
||
// 1: ��ʻԱ���¶ȵ��ڵ��������Ñ? /
|
||
// 2: ����ģʽ������������ѹ /
|
||
// 3: Ñ�����ŵ��ڵ��������Ñ? /
|
||
// 4���������¶ȴ�������ѹ /
|
||
// /
|
||
// ����ֵ�� /
|
||
// ��Ӧ�ĵ�ѹ*10�������صĵ�ѹֵ������0.1V�ģ� /
|
||
// /
|
||
************************************************************************************/
|
||
extern unsigned char GetVoltage(unsigned char ch);
|
||
|
||
/************************************************************************************
|
||
// ������� motor : /
|
||
// 1: ��ʻԱ���¶ȵ��ڵ�� /
|
||
// 2: ����ģʽ������ /
|
||
// 3: Ñ�����ŵ��ڵ�ï¿? /
|
||
// /
|
||
// ����ֵ�� /
|
||
// 0: ������ï¿? 1�������×? /
|
||
// /
|
||
************************************************************************************/
|
||
extern 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,�����22��2F���� /
|
||
************************************************************************************/
|
||
extern unsigned char GetIoParameter(unsigned char p);
|
||
|
||
/************************************************************************************
|
||
// ������� p : /
|
||
// 0: TEMP ��ʻԱ���¶ȷ���λ�� /
|
||
// 1: REC ����Ñ��ģʽ /
|
||
// 2: FAN ����Î? /
|
||
// 3: MODE ģʽ����λ�� /
|
||
// 4: DEFROST ��Ч /
|
||
// 5: REARDEF ���Ë?���� /
|
||
// 6: AC ��Ч /
|
||
// 7: K30 ��Ч /
|
||
// ����ֵ�� /
|
||
// /
|
||
************************************************************************************/
|
||
extern void WriteIoParameter(unsigned char p,unsigned char data);
|
||
|
||
/************************************************************************************
|
||
// ������� p : /
|
||
// /
|
||
// /
|
||
// ����ֵ�� /
|
||
// 0: IGN��Դ���� 1��IGN > 16V �� IGN < 9V /
|
||
// /
|
||
************************************************************************************/
|
||
extern unsigned char GetIgnVoltStatus(void);
|
||
|
||
/************************************************************************************
|
||
// ������� ID : CAN ID //
|
||
// ������� Dlc : CAN �������ݳ��� //
|
||
// ������� *Data : ָ�� CAN �������ݻ�������ָ�� //
|
||
// //
|
||
// ����ֵ�� //
|
||
// 0�� ���ͳɹ� ��0 ������ʧ�� //
|
||
************************************************************************************/
|
||
extern unsigned char TransmitCAN_Message(unsigned int ID,unsigned char Dlc,unsigned char *Data);
|
||
|
||
/************************************************************************************
|
||
// ������� write_buf : ָ�� ��Ҫд�����ݻ������ĵ�ַ //
|
||
// ������� data_num : ���ݴ��� //
|
||
// ������� len : д�����ݳ��� //
|
||
// //
|
||
// ����ֵ�� //
|
||
// 0�� д��ɹ� ��0 ��д��ʧ�� //
|
||
************************************************************************************/
|
||
extern unsigned char DF_Write(unsigned char* write_buf,unsigned char data_num,unsigned char len);
|
||
|
||
/************************************************************************************
|
||
// ������� read_buf : ָ���ȡ���ݴ���Ļ������ĵ�ַ //
|
||
// ������� data_num : ���ݴ��� //
|
||
// ������� len : ��ȡ���ݳ��� //
|
||
// //
|
||
// ����ֵ�� //
|
||
// 0�� ��ȡ�ɹ� ��0 ����ȡʧ�� //
|
||
************************************************************************************/
|
||
extern unsigned char DF_Read(unsigned char* read_buf,unsigned char data_num,unsigned char len);
|
||
|
||
/************************************************************************************
|
||
// //
|
||
// ����ֵ�� //
|
||
// ��ǰ32bit �� 1ms������ֵ //
|
||
***********************************************************************************/
|
||
extern uint32 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��������
|
||
// //
|
||
// ����ֵ�� //
|
||
// ���������� //
|
||
// //
|
||
************************************************************************************/
|
||
extern unsigned char GetIndexNumber(unsigned char code);
|
||
|
||
/************************************************************************************
|
||
// ��ȡACӲ���汾 //
|
||
// ������� hdv : //
|
||
// ָ���ȡ���ݴ���Ļ������ĵ�ַ //
|
||
// //
|
||
// ����ֵ�� //
|
||
// //
|
||
// //
|
||
************************************************************************************/
|
||
extern void GetHardwareVersion(unsigned char* hdv);
|
||
|
||
/************************************************************************************
|
||
// ��ȡAC�����汾 //
|
||
// ������� swv : //
|
||
// ָ���ȡ���ݴ���Ļ������ĵ�ַ //
|
||
// //
|
||
// ����ֵ�� //
|
||
// //
|
||
// //
|
||
************************************************************************************/
|
||
extern void GetSoftwareVersion(unsigned char* swv);
|
||
|
||
|
||
/************************************************************************************
|
||
// ��ȡAC��Ӧ�������汾 //
|
||
// ������� swv : //
|
||
// ָ���ȡ���ݴ���Ļ������ĵ�ַ //
|
||
// //
|
||
// ����ֵ�� //
|
||
// //
|
||
// //
|
||
************************************************************************************/
|
||
|
||
extern void GetSupplierSoftwareVersion(unsigned char* supswv);
|
||
|
||
|
||
|
||
/************************************************************************************
|
||
// ��ȡAC�������� //
|
||
// ������� *date : //
|
||
// data[0] = YEAR //
|
||
// data[1] = MONTH //
|
||
// data[0] = DAY //
|
||
// //
|
||
// ����ֵ�� //
|
||
// //
|
||
// //
|
||
************************************************************************************/
|
||
extern void GetManufacturingDate(unsigned char* date);
|
||
|
||
/************************************************************************************
|
||
// ��ȡCan���߳���״̬ //
|
||
// ������� �� //
|
||
// //
|
||
// ����ֵ�� Can���߳���״̬ //
|
||
// //
|
||
// //
|
||
************************************************************************************/
|
||
extern unsigned char GetCanBusOffErr(void);
|
||
|
||
/************************************************************************************
|
||
// ��ȡ��ʷ�ɹ���̴��� //
|
||
// ������� //
|
||
// //
|
||
// ����ֵ�� ��ʷ�ɹ���̴��� //
|
||
// //
|
||
// //
|
||
************************************************************************************/
|
||
extern unsigned char GetProgrammingCounter(void);
|
||
|
||
/************************************************************************************
|
||
// ��ȡ��ʷ��̴��� //
|
||
// ������� //
|
||
// //
|
||
// ����ֵ�� ��ʷ��̴��� //
|
||
// //
|
||
// //
|
||
************************************************************************************/
|
||
extern unsigned char GetProgrammingAttempCounter(void);
|
||
|
||
/************************************************************************************
|
||
// ���DTC���� //
|
||
// ������� //
|
||
// //
|
||
// ����ֵ�� ״̬ //
|
||
// //
|
||
// //
|
||
************************************************************************************/
|
||
extern unsigned char Clear_DTC_Data(void);
|
||
|
||
|
||
|
||
/************************************************************************************
|
||
// ��ȡBCM�ڵ㶪ʧ״̬ //
|
||
// ������� �� //
|
||
// //
|
||
// ����ֵ�� BCM�ڵ㶪ʧ״̬ //
|
||
// //
|
||
// //
|
||
************************************************************************************/
|
||
|
||
|
||
extern unsigned char GetBcmCommFault(void);
|
||
extern unsigned char GetAcpCommFault(void);
|
||
|
||
|
||
//S51EV
|
||
|
||
|
||
|
||
|
||
#endif
|
||
|