140 lines
4.1 KiB
C
140 lines
4.1 KiB
C
//DCM_DTC.h
|
||
#ifndef DCM_DTC_H
|
||
#define DCM_DTC_H
|
||
|
||
#include "DCM_Types.h"
|
||
|
||
|
||
|
||
#define DCM_19SUPDTCEXTDATARECORD_COUNT (4U)
|
||
/* 19 06????DTCExtDataRecord ???????? */
|
||
#define DCM_SUPDTC_COUNT ( 11U )
|
||
/* ???????DTC???? */
|
||
|
||
|
||
#define DTC_TEST_CYCLE_TIM 40U // 40mS???????
|
||
|
||
#define ISO_15031_6_DTC_FORMAT 0U
|
||
#define ISO_14229_1_DTC_FORMAT 1U
|
||
|
||
|
||
#define DTC_STATUS_AVAILABILITY_MASK 0x09U
|
||
|
||
typedef uint8 (*ReportDTCExtDataFun)(uint8* LeDemDtcNum,uint8 LeDemParameter,uint8* LeDemDataRecord);
|
||
/*19 06 ???????? DTCExtDataRecordNumber ?<3F><>?????*/
|
||
typedef struct
|
||
{
|
||
uint8 DTCExtDataRecordNumber; /*???????number*/
|
||
ReportDTCExtDataFun Function; /*???????number ????????????????*/
|
||
}DTCExtDataRecordType;
|
||
|
||
typedef struct
|
||
{
|
||
uint8 DtcIndex;
|
||
uint8 DtcHigh; /*DTC ?????*/
|
||
uint8 DtcMiddle; /*DTC ?<3F><>????*/
|
||
uint8 DtcLow; /*DTC ?????*/
|
||
}TsDcm_h_DtcGroupType;
|
||
|
||
typedef enum
|
||
{
|
||
TestFailed = 0x01,
|
||
TestFailedThisOperationCycle = 0x02,
|
||
PendingDTC = 0x04,
|
||
ConfirmedDTC = 0x08,
|
||
TestNotCompletedSinceLastClea = 0x10,
|
||
TestFailedSinceLastClear = 0x20,
|
||
TestNotCompletedThisOperationCycle = 0x40,
|
||
WarningIndicatorRequested =0x80,
|
||
}StatusOfDtc_T;
|
||
|
||
/******************************************************************************
|
||
* Description: : Global Variable Declaration Section
|
||
******************************************************************************/
|
||
|
||
extern const TsDcm_h_DtcGroupType CaDcm_u_DtcTable[DCM_SUPDTC_COUNT];
|
||
extern const DTCExtDataRecordType CaDcm_h_19DTCExtDataRecordTable[DCM_19SUPDTCEXTDATARECORD_COUNT];
|
||
|
||
typedef struct{
|
||
uint8 DtcStutas;
|
||
bool1 EepWrtEnable;
|
||
}DtcStutas_T;
|
||
|
||
|
||
extern DtcStutas_T DtcStutas[DCM_SUPDTC_COUNT];
|
||
#if 0
|
||
#define AC_BusOff 0
|
||
#define AC_CommunicationLostWithHMI 1
|
||
#define AC_CommunicationLostWithVCU 2
|
||
#define AC_CommunicationLostWithComp 3
|
||
#define AC_PTC_PressureSensorShortCircuit 4
|
||
#define AC_PTC_PressureSensorOpenCircuit 5
|
||
#define AC_BlowermotorShortCircuit 6
|
||
#define AC_BlowermotorOpenCircuit 7
|
||
#define AC_PressureSensorShortCircuit 8
|
||
#define AC_PressureSensorOpenCircuit 9
|
||
#define AC_CoolingPressureTooHight 10
|
||
#define AC_CoolingPressureTooLow 11
|
||
#define AC_COMP_InternalVoltageFault 12
|
||
#define AC_COMP_UnderVoltageFault 13
|
||
#define AC_COMP_OverVoltageFault 14
|
||
#define AC_COMP_OverCurrentFault 15
|
||
#define AC_COMP_TemperatureFault 16
|
||
#define AC_COMP_BusOff 17
|
||
#define AC_COMP_LossCommunicationWithAC 18
|
||
#define AC_EvaporatorTemperatureSensorOpenCircuit 19
|
||
#define AC_EvaporatorTemperatureSensorShortCircuit 20
|
||
#define AC_ServoMotorShortCircuit 21
|
||
#define AC_ServoMotorPositionFault 22
|
||
#define AC_LoopMotorShortCircuit 23
|
||
#define AC_LoopMotorPositionFault 24
|
||
|
||
#endif
|
||
|
||
#define AC_LOW_VOLTAGE 0
|
||
#define AC_OVER_VOLTAGE 1
|
||
#define AC_BusOff 2
|
||
#define AC_KEY_OK_STICK 3
|
||
#define AC_KEY_UP_STICK 4
|
||
#define AC_KEY_DOWN_STICK 5
|
||
#define AC_KEY_LEFT_STICK 6
|
||
#define AC_KEY_RIGHT_STICK 7
|
||
#define AC_KEY_GRID_STICK 8
|
||
#define AC_ECM_LOST 9
|
||
#define AC_GBC_LOST 10
|
||
|
||
|
||
#define AC_TEMP_MOTOR_SHORT_CUT_TO_VCC 2
|
||
#define AC_TEMP_MOTOR_SHORT_CUT_TO_GND 3
|
||
#define AC_TEMP_MOTOR_LOCK 4
|
||
#define AC_MODE_MOTOR_SHORT_CUT_TO_VCC 5
|
||
#define AC_MODE_MOTOR_SHORT_CUT_TO_GND 6
|
||
#define AC_MODE_MOTOR_LOCK 7
|
||
#define AC_REC_MOTOR_SHORT_CUT_TO_VCC 8
|
||
#define AC_REC_MOTOR_SHORT_CUT_TO_GND 9
|
||
#define AC_REC_MOTOR_LOCK 10
|
||
#define AC_EVA_SENSOR_SHORT_CUT_TO_VCC 11
|
||
#define AC_EVA_SENSOR_SHORT_CUT_TO_GND 12
|
||
|
||
|
||
|
||
extern uint8_t BusOffCnt ;
|
||
|
||
|
||
extern void CanDTC_Task(void);
|
||
|
||
extern uint8 MngDcm_ReportNumberOfDTCByStatusMask(void);
|
||
extern uint8 MngDcm_ReportDTCByStatusMask(void);
|
||
//extern uint8 MngDcm_ReportDTCSnapshotRecordByDTCNumber(void);
|
||
//extern uint8 MngDcm_ReportDTCExtendedDataRecordByDTCNumber(void);
|
||
extern uint8 MngDcm_ReportSupportedDTC(void);
|
||
|
||
extern bool1 MngDcm_CleanDtc(void);
|
||
extern void DtcInit(void);
|
||
extern void DtcStutasInit(void);
|
||
extern void DtcDiagConditionChk(void);
|
||
|
||
void ClearDtcStutas(uint8 DtcIndex);
|
||
|
||
#endif
|