/*
 * @Author       : ChenJie
 * @Date         : 2021-12-27 11:21:08
 * @Version      : V3.0
 * @LastEditors  : ChenJie
 * @LastEditTime : 2022-01-11 17:31:05
 * @Description  : file content
 * @FilePath     : \VehicleControl\VehicleControl\src\System\Vehicle\Communication\CanVar.h
 */
/*
 * CanVar.h
 *
 *  Created on: 2021年12月27日
 *  编码
 *      Author: QiXiang_CHENJIE
 */

#ifndef SYSTEM_VEHICLE_COMMUNICATION_CANVAR_H_
#define SYSTEM_VEHICLE_COMMUNICATION_CANVAR_H_
#include "Std_Types.h"
#include "HardwareLib.h"
/************************************************************
 *BCU->Ebc解码变量存放区
 ************************************************************/
extern UINT32 BcuInTable[130];
extern BOOL BcuRxShortError[130];
extern BOOL BcuRxLongError[130];
extern UINT8 BcuRxErrorCounter[130];
extern UINT8 BcuRxFlag[130];
extern UINT8 BMS13_ReqVIN;
extern UINT8 BMS11_Fult1_DelTemp;
extern UINT8 BMS11_Fult1_OverTemp;
extern UINT8 BMS11_Fult1_PackOverHVolt;
extern UINT8 BMS11_Fult1_PackLowHVolt;
extern UINT8 BMS11_Fult1_LowSOC;
extern UINT8 BMS11_Fult1_OverUcell;
extern UINT8 BMS11_Fult1_LowUcell;
extern UINT8 BMS11_Fult1_LowInsRes;
extern UINT8 BMS11_Fult1_UcellUniformity;
extern UINT8 BMS11_Fult1_OverChg;
extern UINT8 BMS11_Fult1_OverSOC;
extern UINT8 BMS11_Fult1_SOCChangeFast;
extern UINT8 BMS11_Fult1_BatSysNotMatch;
extern UINT8 BMS11_Fult1_HVILFault;
extern UINT8 BMS12_Fult2_FaultNum;
extern UINT8 BMS12_Fult2_CellOverDischrg;
extern UINT8 BMS12_Fult2_CellLowTemp;
extern UINT8 BMS12_Fult2_PackFireWarning;
extern UINT8 BMS12_Fult2_OverDischrgCurr;
extern UINT8 BMS12_Fult2_OverChrgCurrInTheDrive;
extern UINT8 BMS12_Fult2_CurrSensorErr;
extern UINT8 BMS12_Fult2_PowerSupplyErr;
extern UINT8 BMS12_Fult2_TMSErr;
extern UINT8 BMS12_Fult2_HeatingFilmErr;
extern UINT8 BMS12_Fult2_PackSelfProtect;
extern UINT8 BMS12_Fult2_MainLoopPrechrgErr;
extern UINT8 BMS12_Fult2_AuxLoopPrechrgErr;
extern UINT8 BMS12_Fult2_ChrgInsLowErr;
extern UINT8 BMS12_Fult2_ACANLost;
extern UINT8 BMS12_Fult2_InnerCommunicationErr;
extern UINT8 BMS12_Fult2_DCDCErr;
extern UINT8 BMS12_Fult2_BranchBreakErr;
extern UINT8 BMS12_Fult2_HeatRelayOpenErr;
extern UINT8 BMS12_Fult2_HeatRelayWeldErr;
extern UINT8 BMS12_Fult2_MainPosRelayOpenErr;
extern UINT8 BMS12_Fult2_MainPosRelayWeldErr;
extern UINT8 BMS12_Fult2_MainNegRelayOpenErr;
extern UINT8 BMS12_Fult2_MainNegRelayWeldErr;
extern UINT8 BMS12_Fult2_DCChrgPos1RelayOpenErr;
extern UINT8 BMS12_Fult2_DCChrgPos1RelayWeldErr;
extern UINT8 BMS12_Fult2_DCChrgNeg1RelayOpenErr;
extern UINT8 BMS12_Fult2_DCChrgNeg1RelayWeldErr;
extern UINT8 BMS12_Fult2_DCChrgPos2RelayOpenErr;
extern UINT8 BMS12_Fult2_DCChrgPos2RelayWeldErr;
extern UINT8 BMS12_Fult2_DCChrgNeg2RelayOpenErr;
extern UINT8 BMS12_Fult2_DCChrgNeg2RelayWeldErr;
extern UINT8 BMS12_Fult2_ChrgConnectErr;
extern UINT8 BMS12_ult2_OverDischrgCurrWhenInChrg;
extern UINT8 BMS12_Fult2_OverChrgCurrInTheChrg;
extern UINT8 BMS12_Fult2_ChrgNTCErr;
extern UINT8 BMS12_Fult2_ChrgNTCTempOver;
extern UINT8 BMS12_Fult2_ELockErr;
extern UINT8 BMS12_Fult2_FireDetectorEr;
extern UINT8 BMS12_Fult2_ContiDischrgCurrOverLoad;
extern UINT8 BMS12_Fult2_SOCDifferErr;
extern UINT8 BMS12_Fult2_ContiChrgCurrOverLoad;
extern UINT8 BMS1_MainPosRelaySt;
extern UINT8 BMS1_MainNegRelaySt;
extern UINT8 BMS1_PreChgRelaySt;
extern UINT8 BMS1_DCChrgPos1RelaySt;
extern UINT8 BMS1_DCChrgNeg1RelaySt;
extern UINT8 BMS1_DCChrgPos2RelaySt;
extern UINT8 BMS1_DCChrgNeg2RelaySt;
extern UINT8 BMS1_HeatPosRelaySt;
extern UINT8 BMS1_HeatNegRelaySt;
extern UINT8 BMS1_SysSts;
extern UINT8 BMS1_Life;
extern UINT8 BMS1_BalanceStatus;
extern UINT8 BMS1_DCChrgConnectSt;
extern UINT8 BMS1_ChrgMode;
extern UINT8 BMS1_ChrgStatus;
extern UINT8 BMS1_HeatingStatus;
extern UINT8 BMS1_CoolingStatus;
extern UINT8 BMS2_SOC;
extern UINT8 BMS2_SOH;
extern UINT8 BMS2_FaultCode;
extern UINT8 BMS2_FaultLevel;
extern UINT8 BMS2_RqHVPoerOff;
extern UINT8 BMS2_Life;
extern UINT8 BMS4_InsDetectorSt;
extern UINT8 BMS8_Max_Temp;
extern UINT8 BMS8_Min_Temp;
extern UINT8 BMS8_Avg_Temp;
extern UINT8 BMS8_MaxTempSysNr;
extern UINT8 BMS8_MaxTempNr;
extern UINT8 BMS8_MinTempSysNr;
extern UINT8 BMS8_MinTempNr;
extern UINT8 BMS7_MaxUcellSysNr;
extern UINT8 BMS7_MinUcellSysNr;
extern UINT8 BMS23_Gun1DCPosTemp;
extern UINT8 BMS23_Gun1DCNegTemp;
extern UINT8 BMS23_Gun2DCPosTemp;
extern UINT8 BMS23_Gun2DCNegTemp;
extern UINT8 BMS_Cell_TempN[64];
extern UINT8 BMS_SN_SysCode[24];
extern UINT8 BMS21_BattType;
extern UINT8 BMS21_CoolType;
extern UINT8 BMS21_Manufacture;
extern UINT8 BMS21_ProtocolEditionH;
extern UINT8 BMS21_ProtocolEditionL;
extern UINT8 BMS9_TotCSCNum;
extern UINT8 BMS9_PackTotTempNum;
extern UINT8 BMS9_HVBranchNum;
extern UINT8 BMS9_SingleHVBranchCellNum;
extern UINT8 BMS9_BattSysNum;
extern UINT8 BMS9_BattSysSeqNum;
extern UINT8 BMS22_AvaiMaxSOC;
extern UINT8 BMS22_AvaiMinSOC;
extern UINT8 BMS22_AvaiMaxTemp;
extern UINT8 BMS22_AvaiMinTemp;
extern UINT8 BMS10_SubSysEncodingLen;
extern UINT8 BMS10_SubSysIdx;
extern UINT8 BMS10_SubSysErrNum;
extern UINT8 BMS28_ReqMode;
extern UINT8 BMS28_HVCmd;
extern UINT8 BMS28_ChgSts;
extern UINT8 BMS28_HVRelaySts;
extern UINT8 BMS28_SetTemp;
extern UINT8 BMS28_Life;
extern UINT8 BMS28_CRC;
extern UINT8 TMS_WorkStatus;
extern UINT8 TMS_HVRelayST;
extern UINT8 TMS_OutletTemp;
extern UINT8 TMS_InletTemp;
extern UINT8 TMS_Version;
extern UINT8 TMS_ErrCode;
extern UINT8 TMS_FaultLevel;
extern UINT8 BCU_SnMsgFlag;
extern UINT16 BMS_Cell_Volt[384];
extern UINT16 BMS11_PackOutsideVolt;
extern UINT16 BMS2_PackCurrent;
extern UINT16 BMS2_PackInsideVolt;
extern UINT16 BMS4_PosIsolation;
extern UINT16 BMS4_NegIsolation;
extern UINT16 BMS4_SysInsRes;
extern UINT16 BMS6_Max_Ucell;
extern UINT16 BMS6_Min_Ucell;
extern UINT16 BMS6_Avg_Ucell;
extern UINT16 BMS6_SOE;
extern UINT16 BMS7_MaxUcellNr;
extern UINT16 BMS7_MinUcellNr;
extern UINT16 BMS23_RemainChgTi;
extern UINT16 BMS21_RateCap;
extern UINT16 BMS21_RateHVolt;
extern UINT16 BMS21_RatePower;
extern UINT16 BMS9_PackTotCellNum;
extern UINT16 BMS22_PackAvaiMaxVolt;
extern UINT16 BMS22_PackAvaiMinVolt;
extern UINT16 BMS_SoftwareVersion;
extern UINT16 BMS_HardwareVersion;
extern UINT16 BMS3_MaxDischgPow;
extern UINT16 BMS3_MaxChgPow;
extern UINT16 BMS3_MaxInstantDischgPow;
extern UINT16 BMS3_MaxiInstantChgPow;
extern UINT16 BMS5_DischgCurMaxAllw;
extern UINT16 BMS5_ChrgCurMaxAllw;
extern UINT16 BMS5_InstChrgCurMaxAllw;
extern UINT16 BMS5_InstDischrgCurMaxAllw;
extern UINT16 BMS26_Bat_InstantConsume;
extern UINT16 BMS26_Bat_TotalConsume;
extern UINT16 BMS26_ChgReqVoltage;
extern UINT16 BMS26_ChgReqCurrent;
extern UINT16 BMS28_HVVolt;
extern UINT16 TMS_ReqPow;
extern UINT32 BMS1_RechrgCycels;
extern UINT32 BMS14_TotalChargeAh;
extern UINT32 BMS14_TotalDischargeAh;
extern UINT32 BMS15_TotalChargeKwh;
extern UINT32 BMS15_TotalDischargeKwh;
extern UINT32 BMS16_TotalEneryECOChargeAh;
extern UINT32 BMS16_TotalEneryECOChargeKwh;
extern UINT32 BMS17_TotalStationChargeAh;
extern UINT32 BMS17_TotalStationChargeKwh;
extern UINT32 BMS18_TotalPoleChargeAh;
extern UINT32 BMS18_TotalPoleChargeKwh;
extern UINT32 BMS19_SingleChargeAh;
extern UINT32 BMS19_SingleChargeKwh;
/*************************************************************
 *Ebc->Bcu组码变量存放区
 ************************************************************/
extern UINT32 Ebc2BcuOutTable[5][2];
// extern UINT8 VCU_Life;

extern UINT8 VCU_ReqHV;
extern UINT8 VCU_DCDCSts;
extern UINT8 VCU_DCACSts;
extern UINT8 VCU_DCAPSts;
// extern UINT8 VCU_VehicleSpeed;

extern UINT8 VCU_PosRlySts;
extern UINT8 VCU_PosRlyErrSts;
extern UINT8 VCU_PTCRlSts;
extern UINT8 VCU_PTCRlErrSts;
extern UINT8 VCU_StopChgCmd;
extern UINT8 VCU_HVInterlock;
extern UINT8 VCU_AssistRlySts;
extern UINT8 VCU_AssistRlyErrSts;
extern UINT8 VCU_ACRlySts;
extern UINT8 VCU_ACRlyErrSts;
extern UINT8 ISO_WorkStatus;
extern UINT8 ISO_FaultLevel;
extern UINT8 VIN_FrameNo;
extern UINT8 VCU_VIN[17];
extern UINT8 EBC_State;
extern UINT8 EBC_ForbidHVOn;
extern UINT8 EBC_RequestHVOff;
extern UINT8 EBC_ChgFaultFlag;
extern UINT8 EBC_LockupFaultFlag;
extern UINT8 EBC_ChgCnctOverTemp;
extern UINT8 EBC_DischgHIVLFlag;
extern UINT8 EBC_ChargeHIVLFlag;
extern UINT8 EBC_DChgCnctOverTemp;
extern UINT8 EBC_FaultLevel;
extern UINT8 EBC_FaultCode;
extern UINT8 EBC_ChargingStatus;
extern UINT8 EBC_ActiveHeatReq;
extern UINT8 EBC_AirPressure;
// extern UINT8 EBC_Life;
// extern UINT8 EBC_ChgPos1Temp;
// extern UINT8 EBC_ChgNeg1Temp;
// extern UINT8 EBC_ChgPos2Temp;
// extern UINT8 EBC_ChgNeg2Temp;
// extern UINT8 EBC_DchgPos1Temp;
// extern UINT8 EBC_DchgNeg1Temp;
// extern UINT8 EBC_DchgPos2Temp;
// extern UINT8 EBC_DchgNeg2Temp;
extern UINT16 ISO_PosResis;
extern UINT16 ISO_NegResis;
/*************************************************************
 *Vcu->Ebc组码变量存放区
 ************************************************************/
extern UINT8 VcuRxFlag[8];
extern UINT32 VcuInTable[8];
extern BOOL VcuRxShortError[8];
extern BOOL VcuRxLongError[8];
extern UINT8 VcuRxErrorCount[8];
extern UINT8 Checksum;
extern UINT8 VCU_Life;
extern UINT8 VCU_HvOnOff;
extern UINT8 VCU_AuxOnOff;
extern UINT8 VCU_VehicleSpeed;
extern UINT8 VCU_HeatOnOff;
extern UINT8 VCU_MainPosRlySts;
extern UINT8 VCU_MainNegRlySts;
extern UINT8 VCU_PreChgRlySts;
extern UINT8 VCU_AuxRlySts;
extern UINT8 VCU_MainMotRlySts;
extern UINT8 VCU_MainMotRlyErrSts;
extern UINT8 VCU_Assist1RlySts;
extern UINT8 VCU_Assist1RlyErrSts;
extern UINT8 VCU_Assist2RlySts;
extern UINT8 VCU_Assist2RlyErrSts;
extern UINT8 VCU_Assist3RlySts;
extern UINT8 VCU_Assist3RlyErrSts;
extern UINT8 VCU_Assist4RlySts;
extern UINT8 VCU_Assist4RlyErrSts;
extern UINT8 VCU_VIN[17];
extern UINT8 DrvMotPosRySts;
extern UINT8 VehSts;
extern UINT8 BrakePedal;
extern UINT8 HandbrakeSts;
extern UINT8 GearPos;
extern UINT16 VehSpd;
extern UINT32 VCU_TotalDistance;
extern UINT8 EBC_VinMsgFlag;
/*************************************************************
 *Ebc->Vcu组码变量存放区
 ************************************************************/
extern UINT32 Ebc2VcuOutTable[25][2];
extern UINT8 ReqVIN;
extern UINT8 ReqHVOff;
extern UINT8 ChgSysNum;
extern UINT8 Fult2_MainPosRelayWeldErr;
extern UINT8 Fult2_MainNegRelayWeldErr;
extern UINT8 Fult2_DCChgPos1RelayWeldErr;
extern UINT8 Fult2_DCChgNeg1RelayWeldErr;
extern UINT8 Fult2_DCChgPos2RelayWeldErr;
extern UINT8 Fult2_DCChgNeg2RelayWeldErr;
extern UINT8 HeatPosRelayWeldErr;
extern UINT8 HeatNegRelayWeldErr;
extern UINT8 MainPosRelaySt;
extern UINT8 MainNegRelaySt;
extern UINT8 PreChgRelaySt;
extern UINT8 DCChrgPos1RelaySt;
extern UINT8 DCChrgNeg1RelaySt;
extern UINT8 DCChrgPos2RelaySt;
extern UINT8 DCChrgNeg2RelaySt;
extern UINT8 AuxRelayWeldErr;
extern UINT8 Fult2_BranchBreakErr;
extern UINT8 Fult2_OverChrgCurrInTheDrive;
extern UINT8 Fult2_MainPosRelayOpenErr;
extern UINT8 Fult2_MainNegRelayOpenErr;
extern UINT8 Fult2_DCChgPos1RelayOpenErr;
extern UINT8 Fult2_DCChgPos2RelayOpenErr;
extern UINT8 Fult2_DCChgNeg1RelayOpenErr;
extern UINT8 Fult2_DCChgNeg2RelayOpenErr;
extern UINT8 Fult2_HeatRelayWeldErr;
extern UINT8 Fult2_HeatRelayOpenErr;
extern UINT8 Fult2_TMSErr;
extern UINT8 Fult2_PowerSupplyErr;
extern UINT8 Fult2_PackSelfProtect;
extern UINT8 Fult2_ChrgNTCTempOver;
extern UINT8 BattSysNum;
extern UINT8 BatSysFaultCode;
extern UINT8 ST1_CheckSum;
extern UINT8 ST1_Life;
extern UINT8 BMS_SysSts;
extern UINT8 AssisRelaySts;
extern UINT8 BlanceSts;
extern UINT8 DCChrgConnectSt;
extern UINT8 ChrgMode;
extern UINT8 ChrgStatus;
extern UINT8 FaultLevel;
extern UINT8 Fult1_DelTemp;
extern UINT8 Fult1_OverTemp;
extern UINT8 Fult1_PackOverHVolt;
extern UINT8 Fult1_PackLowHVolt;
extern UINT8 Fult1_LowSOC;
extern UINT8 Fult1_OverUcell;
extern UINT8 Fult1_LowUcell;
extern UINT8 Fult1_LowInsRes;
extern UINT8 Fult1_UcellUniformity;
extern UINT8 Fult2_CellLowTemp;
extern UINT8 Fult2_OverDischrgCurr;
extern UINT8 Fult2_OverChrgCurrInTheChrg;
extern UINT8 Fult_BranchVolUniformity;
extern UINT8 Fult_BMSHardware;
extern UINT8 Fult1_OverSOC;
extern UINT8 Fult1_SOCChangeFast;
extern UINT8 Fult2_InnerCommunicationErr;
extern UINT8 Fult1_BatSysNotMatch;
extern UINT8 Fult1_HVILFault;
extern UINT8 Fult2_FireDetectorEr;
extern UINT8 Fult2_PackFireWarning;
extern UINT8 Fult2_FaultNum;
extern UINT8 SOC;
extern UINT8 SOH;
extern UINT8 Max_Temp;
extern UINT8 Min_Temp;
extern UINT8 Avg_Temp;
extern UINT8 MaxTempSysNr;
extern UINT8 MaxTempNr;
extern UINT8 MinTempSysNr;
extern UINT8 MinTempNr;
extern UINT8 MaxUcellSysNr;
extern UINT8 MaxUcellNr;
extern UINT8 MinUcellSysNr;
extern UINT8 MinUcellNr;
extern UINT8 Gun1DCNegTemp;
extern UINT8 Gun1DCPosTemp;
extern UINT8 Gun2DCNegTemp;
extern UINT8 Gun2DCPosTemp;
extern UINT8 HeatPosRelaySt;
extern UINT8 HeatNegRelaySt;
extern UINT8 UcellFrameNum;
extern UINT8 UcellCSCNum;
extern UINT8 TempFrameNum;
extern UINT8 TempCSCNum;
// extern UINT8 CurCSC_TempN;
// extern UINT8 CurCSC_TempN1;
// extern UINT8 CurCSC_TempN2;
// extern UINT8 CurCSC_TempN3;
// extern UINT8 CurCSC_TempN4;
// extern UINT8 CurCSC_TempN5;

extern UINT8 BattType;
extern UINT8 CoolType;
extern UINT8 TotCSCNum;
extern UINT8 CellVoltPlat;
extern UINT8 MinAvlCellVolt;
extern UINT8 MaxAvlCellVolt;
extern UINT8 EBC_DchgPos1Temp;
extern UINT8 EBC_DchgNeg1Temp;
extern UINT8 EBC_DchgPos2Temp;
extern UINT8 EBC_DchgNeg2Temp;
extern UINT8 EBC_ChgPos1Temp;
extern UINT8 EBC_ChgNeg1Temp;
extern UINT8 EBC_ChgPos2Temp;
extern UINT8 EBC_ChgNeg2Temp;
extern UINT8 ReqMode;
extern UINT8 HVCmd;
extern UINT8 ChgSts;
extern UINT8 HVRelaySts;
extern UINT8 SetTemp;
extern UINT8 Bms_Life;
extern UINT8 CRC;
extern UINT8 TMS_WorkStatus;
extern UINT8 TMS_HVRelayST;
extern UINT8 TMS_OutletTemp;
extern UINT8 TMS_InletTemp;
extern UINT8 TMS_ErrCode;
extern UINT8 TMS_FaultLevel;
// extern UINT8 EBC_Life;

extern UINT8 EBC_LockupSts;
extern UINT8 EBC_ConnectorSts;
extern UINT8 EBC_DischgConnectorSts;
extern UINT8 EBC_ChgConnectorSts;
extern UINT8 EBC_FaultLevel;
extern UINT8 EBC_FaultCode;
extern UINT16 BMS_SoftwareVersion;
extern UINT16 BMS_HardwareVersion;
extern UINT16 PackCurrent;
extern UINT16 InstChrgCurMaxAllw;
extern UINT16 InstDischrgCurMaxAllw;
extern UINT16 PosIsolation;
extern UINT16 NegIsolation;
extern UINT16 PackInsideVolt;
extern UINT16 PackOutsideVolt;
extern UINT16 Max_Ucell;
extern UINT16 Avg_Ucell;
extern UINT16 Min_Ucell;
extern UINT16 ChrgCurMaxAllw;
// extern UINT16 CurCSC_UCellN;
// extern UINT16 CurCSC_UCellN1;
// extern UINT16 CurCSC_UCellN2;

extern UINT16 Pack_RateCap;
extern UINT16 Pack_RateHVolt;
extern UINT16 Pack_RatePower;
extern UINT16 PackTotCellNum;
extern UINT16 PackTotTempNum;
extern UINT16 SingleChargeKwh;
extern UINT16 HVVolt;
// extern UINT16 TMS_ReqPow;

extern UINT32 TotalChargeKwh;
extern UINT32 TotalDischargeKwh;
extern UINT32 TotalEneryECOChargeKwh;
extern UINT32 TotalStationChargeKwh;
extern UINT32 TotalPoleChargeKwh;
/*************************************************************
 *Ebc->ble组码变量存放区
 ************************************************************/
// Ble
extern uint16 bcud_E_snglChrg;       //单次充电能量，精度0.1kwh
extern uint16 ebcd_Nr_swapBatt;      //换电次数
extern uint16 ebcd_Nr_swapSucBatt;   //换电成功次数
extern uint16 bcud_pct_soc;          //电池SOC，精度0.1
extern uint16 bcud_Q_snglChrg;       //单次充电容量，精度0.1Ah
extern uint16 bcud_V_battU;          //电池电压 精度0.1V
extern uint32 bcud_E_accChrg;        //累计充电能量，精度0.1kwh
extern uint32 bcud_E_accDischrg;     //累计放电能量，精度0.1kwh
extern uint32 bcud_E_accPlugInChrg;  //累计插枪充电能量，精度0.1kwh
extern uint32 bcud_E_accRecovry;     //累计回收能量，精度0.1kwh
extern uint32 bcud_E_accSwapBatt;    //累计换电站能量，精度0.1kwh
extern uint32 bcud_Q_accChrg;        //累计充电容量，精度0.1ah
extern uint32 bcud_Q_accDischrg;     //累计放电容量，精度0.1ah
extern uint32 bcud_Q_accPlugInChrg;  //累计插枪充电容量，精度0.1ah
extern uint32 bcud_Q_accRecovry;     //累计回收容量，精度0.1ah
extern uint32 bcud_Q_accSwapBatt;    //累计换电站容量，精度0.1ah
extern uint32 vcud_M_accDrv;         //累计行驶里程,精度0.1km
extern uint8 bcud_pct_bcuSoh;        //电池Soh，精度0.4%
extern uint8 bcud_st_bcuComun;       //电池通讯状态,0-通信中断,1-通信正常
extern uint8 bcud_st_bcuMainRelay;   //主继电器信号,0-保留 1-断开,2-关闭 3-异常
extern uint8 bcud_st_bcuTmsLiquid;   //热管理液位状态,1-液位正常,0-液位过低
extern uint8 bcud_st_hvWork;         //电池高压状态，0-高压开启 1-预充，2-高压关断，3-高压上电故障
extern uint8 bcuv_Num_battSn[32];    //电池SN号码
extern uint8 ebcd_flg_pluginLockSig; //互锁接插件信号状态,1-触发,0-无触发
extern uint8 ebcd_flg_swapAdmit;     //允许换电判断：0-不允许,1-允许
extern uint8 ebcd_Nr_errMax;         //故障等级：当前故障最大等级
extern uint8 ebcd_Num_err1;          //故障码1
extern uint8 ebcd_Num_err2;          //故障码2
extern uint8 ebcd_st_ebcConnect;     // Ebc通讯模式，0-无线蓝牙，1-有线连接 ，默认0
extern uint8 ebcd_st_ebcLockWork;    // Ebc解锁模式，0-单步模式，1-自动模式
extern uint8 ebcd_st_ebcWork;        // Ebc当前状态 0-行车，1-通讯，2-换电
extern uint8 ebcd_st_errTable1;      //故障表1，bit0-气压异常，bit1-液位异常，bit2-Flash读取异常
extern uint8 ebcd_st_errTable2;      //故障表2，bit0-互锁异常，bit1-整车CAN异常，bit2-电池CAN异常，bit3-锁钩异常，bit4-升降机异常，bit5-电池位置异常
extern uint8 ebcd_st_errTable3;      //故障表3，bit0-放电互锁异常，bit1-充电互锁异常，bit2-整车高压互锁异常
extern uint8 ebcd_st_lockSensor;     //锁紧传感器信号：bit0-bit3：传感器0-3的状态每，bit：1-触发，0-不触发
extern uint8 ebcd_st_lockSucJug;     //锁紧完成判断：0-完全未锁紧,1-完全锁紧,2-未完全锁紧"
extern uint8 ebcd_st_pedstSensor;    //底座落座传感器：bit0-bit1：传感器0-1的状态,每bit：1-触发，0-无触发
extern uint8 ebcd_st_pedstSucJug;    //电池底座到位判断：0-完全未到位,1-完全到位,2-未完全到位
extern uint8 ebcd_st_pluginLockSig;  //互锁接插件信号具体状态,1-触发,0-无触发
extern uint8 ebcd_st_unlockSensor;   //解锁传感器信号：bit0-bit3：传感器0-3的状态每，bit：1-触发，0-不触发
extern uint8 ebcd_st_unlockSucJug;   //解锁完成判断：0-完全未解锁，1-完全解锁，2-未完全解锁
// extern uint8 vcud_P_airSensor;            //压力传感器气压值：单位Mpa，精度0.01Mpa
extern uint8 vcud_P_airSensorBack;        //后桥气压值，单位Mpa，精度0.01Mpa
extern uint8 vcud_P_airSensorForward;     //前桥气压值，单位Mpa，精度0.01Mpa
extern uint8 vcud_st_carStart;            //整车启动状态，0001-车辆启动状态，0010-熄火，0011-其他状态，1111-无效
extern uint8 vcud_st_footbrake;           //脚刹信号，0-无效，1-有效
extern uint8 vcud_st_gear;                //档位信号，FF-倒挡（R），0-空挡（N），X-前进档（DX）X取1-12
extern uint8 vcud_st_handbrake;           //手刹信号，0-无效，1-有效
extern uint8 vcud_st_keyOn;               //钥匙信号，1-上电，0-下电
extern uint8 vcud_st_Steer;               //方向盘信号，bit0-左侧转向灯，bit1-右侧转向灯，每bit 0-OFF，1-ON
extern uint8 vcud_st_vcuComun;            // vcu通讯状态，0-通信中断,1-通信正常
extern uint8 vcuv_Num_vin[17];            // VIN码
extern uint8 bled_flg_lockCmd;            //锁钩电磁阀锁紧命令，1-有效，0-无效
extern uint8 bled_flg_unlockCmd;          //锁钩电磁阀解锁命令，1-有效，0-无效
extern uint8 bled_flg_lockCmdForce;       //锁钩电磁阀锁紧强制命令，1-有效，0-无效
extern uint8 bled_flg_unlockCmdForce;     //锁钩电磁阀解锁强制命令，1-有效，0-无效
extern uint8 bled_flg_topAscendCmd;       //顶板上升命令，1-有效，0-无效
extern uint8 bled_flg_topDescendCmd;      //顶板下降命令，1-有效，0-无效
extern uint8 bled_flg_topAscendCmdForce;  //顶板强制上升命令，1-有效，0-无效
extern uint8 bled_flg_topDescendCmdForce; //顶板强制下降命令，1-有效，0-无效
extern uint8 bled_flg_openDustReCmd;      //除尘打开指令，1-有效，0-无效
extern uint8 bled_flg_closeDustReCmd;     //除尘关闭指令，1-有效，0-无效
extern uint8 bled_flg_Heart;              //心跳维持指令
extern uint8 bled_flg_getEbcData;         //获取ebc数据指令
extern uint8 bled_flg_getVcuData;         //获取vcu数据指令
extern uint8 bled_flg_getBmsData;         //获取bms数据指令
extern uint8 bled_flg_handShake;          //握手指令
extern uint8 bled_flg_swapBattDone;       //换电完成指令
extern uint8 bled_flg_backToDrv;          //回到行驶状态指令
extern uint8 bled_flg_autoLock;           //自动锁定指令
extern uint8 bled_flg_autoUnlock;         //自动解锁指令
extern uint8 bled_flg_toSwapMod;          //换到换电状态
extern uint8 bled_flg_safeStopCmd;        //急停指令
extern uint32 bled_Nr_softVer;            // BLE软件版本
extern uint8 bled_flg_role;               // ble的主从模式 01-主，02-从
extern uint8 bled_flg_bleConn;            // ble蓝牙连接状态
extern uint8 bled_flg_bleDisconn;         // ble蓝牙断开状态
//正式变量
extern uint8 ebcd_flg_Can2SendEnbale;
extern uint8 ebcd_st_toBleAns;
extern uint8 ebcd_P_airSensor;
extern uint8 ebcd_T_plugin[4];          //四个接插件温度
extern uint8 ebcd_flg_forbidHVOn;       //禁止高压上电
extern uint8 ebcb_flg_reqHvOff;         //请求高压下电
extern uint8 ebcd_flg_LockErr;          //锁紧机构故障状态
extern uint8 ebcd_flg_dChrgLockErr;     //放电互锁故障状态
extern uint8 ebcd_flg_chrgLockErr;      //充电互锁故障状态
extern uint8 ebcd_flg_dChgCnctOverTemp; //放电连接器过温标志
extern uint8 ebcd_st_ebcWork;           // Ebc当前状态 0-行车，1-通讯，2-换电
extern uint8 ebcd_Nr_errMax;      //故障等级：当前故障最大等级
extern uint8 ebcd_Num_faultCode;  // ebc故障码，未定义
extern uint8 ebcd_st_chargingMod; //充电模式，1-车载充电，2-换电站充电
extern uint8 ebdc_st_lockUpState; //锁止机构状态，0-故障，1-解锁成功，2-上锁成功
extern uint8 ebdc_st_ConnecState; //换电连接器状态（充电回路&放电回路同时闭合代表闭合，有一路断开则为断开），0_未连接 1_连接

extern uint16 Test_LockPressure;

#define EEPDATA_START_SEC_VAR
#include "MemMap.h"
extern uint8 ebcd_flg_ebcEolDone;		 // EBC下线检测状态完成标志位
extern uint32 Control_Times;
#define EEPDATA_STOP_SEC_VAR
#include "MemMap.h"
extern const uint8 T_table[240];
extern const uint32 R_table[240];
extern const uint8 DataPackCounter[21];
extern const uint8 DataPackBegin[21];
#ifdef _APP_TEST_CODE
extern uint16 CANNet_rAccPedUW;
extern uint32 PressureValue;
extern uint16 Distence1;
extern uint16 Distence2;
extern uint8 Switch1;
extern uint8 Switch2;
extern uint8 ControlState;
extern uint32 Control_Times;
extern uint32 PressureValueBuffer;
extern uint32 VehCo_fInputUIA[2];
extern uint16 VehCo_rInputUWA[2];
extern uint16 VehCo_uADChanUWA[_ATD_NUM_CHAN];
extern uint8 VehCo_bDINChanUBA[_DIN_NUM_CHAN];
extern float32 VehCo_uBattF;
extern uint16 VehCo_uAccPedUW;
#define EEPDATA_START_SEC_VAR
#include "MemMap.h"
extern uint32 VehCo_ctEEPTestUB;
extern uint32 VehCo_ctEEPTestUI; //在定义时给EEPROM里的变量赋初值
extern uint32 Control_Times;
#define EEPDATA_STOP_SEC_VAR
#include "MemMap.h"
#endif
#ifdef _APP_TEST_MOTOR_CODE
extern uint8 MotorControlCmd;     //电机自动控制模式，0-不控制，1-控制锁紧，2-控制解锁
extern uint8 MotorDebugCmd;       //电机调试模式。0-不控制，1-持续锁紧，2-持续解锁
extern uint8 MotorControlEnable;  //电机控制使能，每bit代表一个电机从低位开始， 0-不控制，1-控制
extern uint8 MotorControlLockNum; //调试参数
extern uint8 MotorControlunLockNum;
extern uint8 MotorLifeTestCmd;
#define EEPDATA_START_SEC_VAR
#include "MemMap.h"
extern uint16 RunFailedDelay; //电机最大运动时间，超时则取消控制
extern uint16 LockDelay;      //电机传感器到位后，延时锁紧时间
extern uint16 LifeTestCounter;
#define EEPDATA_STOP_SEC_VAR
#include "MemMap.h"
#endif
#endif /* SYSTEM_VEHICLE_COMMUNICATION_CANVAR_H_ */
