1.5wuling_zhuanjietou/UDS/diagnosis_mid.h

108 lines
3.4 KiB
C
Raw Normal View History

2024-10-17 01:06:51 +00:00
#ifndef __DIAGNOSIS_MID_H__
#define __DIAGNOSIS_MID_H__
#include "uds_config.h"
#pragma anon_unions
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>uds
typedef struct {
uint8_t IgnSts : 1; //ign״̬ 0:OFF 1:ON
// uint8_t IgnOff2On : 1; //ign״̬<D7B4><CCAC>OFF<46><46>ΪON<4F><4E><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ
uint8_t BattLow : 1; //<2F><>ƿ<EFBFBD><C6BF>ѹ
uint8_t BattHigh : 1; //<2F><>ƿ<EFBFBD><C6BF>ѹ
uint8_t Limphome : 1; //
uint8_t InOverVoltFault : 1; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>
uint8_t InUnderVoltFault : 1; //<2F><><EFBFBD><EFBFBD>Ƿѹ<C7B7><D1B9><EFBFBD><EFBFBD>
uint8_t OutOverVoltFault : 1; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>
uint8_t OutUnderVoltFault : 1; //<2F><><EFBFBD><EFBFBD>Ƿѹ<C7B7><D1B9><EFBFBD><EFBFBD>
uint8_t InOverCurFault : 1; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
uint8_t OutOverCurFault : 1; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
uint8_t OverTemperture : 1; //<2F><><EFBFBD>¹<EFBFBD><C2B9><EFBFBD>
uint8_t BusoffCnt; //busoff<66><66><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>busoff<66><66>ÿ<EFBFBD>ָ<EFBFBD>һ<EFBFBD>ξ<EFBFBD><CEBE>ۼ<EFBFBD>1<EFBFBD><31>CAN<41><4E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>busoff<66><66><EFBFBD><EFBFBD><EFBFBD>
DTC_SnapshotType Snapshot;
}VehicleInfo2UdsType;
typedef struct {
uint8_t NcmRxEnable : 1;
uint8_t NcmTxEnable : 1;
uint8_t NmcmRxEnable : 1;
uint8_t NmcmTxEnable : 1;
uint8_t UdsOffLine : 1;
uint8_t EcuConfig;
}UdsInfo2VehicleType;
extern VehicleInfo2UdsType vehicleInfo2uds;
extern UdsInfo2VehicleType udsInfo2Vehicle;
extern INT32U g_ulRand;
extern uint32_t g_ulCanStatus;
extern uint8_t seed_value[2];
extern uint8_t key_value[2];
extern uint8_t UdsSelfCheckFlag;
extern uint8_t UdsCalibrationFlag;
extern uint8_t EraseFlashMemory(uint32_t addr,uint32_t length);
extern uint8_t EraseEepromMemory(uint32_t addr,uint32_t length);
extern void GenRand(void);
extern INT8U Get0x19SerDiagData(INT8U *pOut,INT8U Type,INT8U *pdata);
extern INT16U Get0x22SerDiagData(INT8U *pOut);
extern INT8U Set0x2EDidDiagData(INT8U *pIn,INT16U PLen);
extern void SaveDtcRecode(INT16U Addr,INT32U DtcCode,INT8U Status,INT8U Acccnt);
extern void CheckDtcHsCanError(void);
extern void UdsQueueCanOut(void);
extern uint8_t GenerateSID27SeedValue(uint8_t *seed);
extern uint16_t GenerateSID27KeyValue(uint16_t seed);
extern INT8U Set0x2FDiagData(INT8U *pIn,INT16U PLen,INT8U *pOut,INT16U *RLen);
extern INT8U Set0x31DiagData(INT8U *pIn,INT16U PLen,INT8U *pOut,INT16U *RLen);
extern INT8U Set0x36DiagData(INT8U *pIn,INT16U PLen,INT8U *pOut,INT16U *RLen);
extern uint8_t EE_Write(uint8_t *pImage, const uint8_t *pData, uint32_t Len, void (*pCbFn)(uint32_t));
extern uint8_t EE_Read(uint8_t *pImage, uint8_t **pData);
extern void SetUdsUpdataFlag(void);
extern void DTC_SignalRecover(void);
extern uint8_t ClearCurrentDTCData(uint8_t i);
extern void ClearDtc(void);
extern void IO_InputOutputRelease(void);
extern void UdsEncryptDate_Crc32Cal_Init(void);
extern void UdsEncryptDate_Crc32Cal_Update(const u8 *pData, u32 size);
extern uint32_t UdsEncryptDate_Crc32Cal_Final(void);
extern uint16_t UdsEncryptDate_Decrypt(uint8_t *src,uint16_t size_src);
extern void UdsEncryptDate_Xor(uint8_t *src,uint16_t size_src);
bool CheckVechileStatus(void);
bool CheckIsBatteryLow(void);
bool CheckIsBatteryHigh(void);
bool CheckIsIgnON(void);
bool CheckIsIgnOff2ON(void);
bool CheckIsTurnLeft_Short2Gnd(void);
bool CheckIsTurnLeft_Openload(void);
bool CheckIsTurnLeft_Normal(void);
bool CheckIsTurnRight_Short2Gnd(void);
bool CheckIsTurnRight_Openload(void);
bool CheckIsTurnRight_Normal(void);
bool CheckIsDRL_Short2Gnd(void);
bool CheckIsDRL_Openload(void);
bool CheckIsDRL_Normal(void);
bool CheckIsPosition_Short2Gnd(void);
bool CheckIsPosition_Openload(void);
bool CheckIsPosition_Normal(void);
bool CheckIsCanBusoff(void);
bool CheckIsNM_Limphome(void);
bool CheckIsFobUnlearn(void);
bool CheckIsVinUnwrite(void);
#endif