AppGlobalVar.h 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. /*
  2. * @Author : ChenJie
  3. * @Date : 2022-01-23 13:45:09
  4. * @Version : V3.0
  5. * @LastEditors : ChenJie
  6. * @LastEditTime : 2022-05-17 18:37:07
  7. * @Description : file content
  8. * @FilePath : \S32K146_4G\src\AppGlobalVar.h
  9. */
  10. /*
  11. * AppGlobal.h
  12. *Ӧ�ò�ȫ�ֱ���
  13. * Created on: 2022��1��19��
  14. * Author: QiXiang_CHENJIE
  15. */
  16. #ifndef APPGLOBALVAR_H_
  17. #define APPGLOBALVAR_H_
  18. //#define APP_UART0_ENABLE //ƽ����Ŀ
  19. #define APP_CAN_ENABLE //�ؿ���Ŀ
  20. #include "hal_adapter.h"
  21. // test Var
  22. #define defaultSn "GYTEST00000000001"
  23. // #define defaultSn "PZLCLL128N2236001"
  24. #define BATT_SN_LEN 17
  25. #define HWVERSION 0x0001
  26. #define BLSWVERSION 0x00000001
  27. #define DRVSWVERSION 0x00000001
  28. #define APPSWVERSION 0x00000104
  29. #define BMS_MANUFACTURE 0xFF
  30. #define BMS_INFO 0xFF
  31. #define DATA_MODULE_TYPE 0x02
  32. #define BMS_CELL_MAX_NUM 384
  33. #define BMS_TEMP_MAX_NUM 64
  34. typedef struct _AppDataType
  35. {
  36. uint8 BattCellCount;
  37. uint8 BattTempCount;
  38. } AppDataBody;
  39. extern bool TcpSysReboot;
  40. extern uint8 TcpbattSN[17];
  41. extern uint8 VIN[17];
  42. extern volatile uint32 TimerCounter;
  43. extern uint32 BattTempR[4];
  44. extern uint16 ErrorArray[10];
  45. extern uint8 Fota_update_flag;
  46. extern uint8 Fota_error_flag;
  47. typedef struct
  48. {
  49. uint8 RealLen;
  50. uint8 *DataPtr;
  51. } QueueDataTrans_Type;
  52. /*GPS*/
  53. extern QueueHandle_t GpsDataQueueHandle;
  54. extern sint16 xyzData[3];
  55. /*Hal_Can*/
  56. extern uint8 CanIf_u8TxConfirmCnt;
  57. extern boolean CanIf_bTxFlag;
  58. extern uint8 CanIf_u8RxIndicationCnt;
  59. extern boolean CanIf_bRxFlag;
  60. extern QueueHandle_t CanRecvQueueHandle0;
  61. extern QueueHandle_t CanRecvQueueHandle1;
  62. extern QueueHandle_t CanRecvQueueHandle2;
  63. extern TaskHandle_t Uart_Hal_RecvTask_Handle,Uart_Hal_SendTask_Handle,CanTask_Handle,GpsTask_Handle,Uart_4G_Task_Handle;
  64. extern SemaphoreHandle_t sleep_mutex;
  65. /*Fota*/
  66. typedef struct _Fota_Type
  67. {
  68. bool Fota_update_error;
  69. uint32 Fota_All_Data_Len;
  70. uint32 Fota_Current_Addres;
  71. uint8 Fota_Recv_Data_Len;
  72. uint8 *Fota_Recv_DataPtr;
  73. uint32 Fota_Flash_Addres;
  74. uint8 Fota_CRC;
  75. } Fota_Type;
  76. /*���±�����ΪTCP��ر���*/
  77. extern uint8 CSQValue;
  78. extern sint8 SocketId;
  79. extern sint8 RegChkRet;
  80. extern char WebSiteIp[20];
  81. extern const char WebSiteName[];
  82. extern uint16 WebSitePort;
  83. extern char ImeiNum[15];
  84. extern char IccidNum[20];
  85. extern uint8 TcpWorkState;
  86. typedef struct _AppEppType
  87. {
  88. uint32 battDischrgAccCap;
  89. uint32 battDischrgAccEnrg;
  90. uint16 battCycleTimes;
  91. }AppEppBody;
  92. typedef struct _AppConfigType
  93. {
  94. bool appSaveFlg;
  95. bool eolFlg;
  96. uint8 deviceSn[17];
  97. AppEppBody AppDataInfo;
  98. uint8 re[20];
  99. } AppConfigBody;
  100. extern AppConfigBody AppConfigInfo;
  101. /*���±�����ΪApp_CAN��ر���*/
  102. #ifdef APP_CAN_ENABLE
  103. extern uint8 vehicleStatus;
  104. extern uint8 bmsHVOn;
  105. extern uint8 currentGearPosition;
  106. extern uint8 parkingBreakStatus;
  107. extern uint8 breakingStatus;
  108. extern uint32 ODO;
  109. extern uint8 dcdcWorkStatus;
  110. extern uint8 numOfChrgableSubsys;
  111. extern uint8 chrgableSubsysCode;
  112. extern uint16 vcuDCVol;
  113. // EBC
  114. extern uint8 ebcStatus;
  115. extern uint8 ebcAskHVOn;
  116. extern uint8 ebcAskHVOff;
  117. extern uint8 retainLockSignal;
  118. extern uint8 dischargeLockSignal;
  119. extern uint8 chargeLockSignal;
  120. extern uint8 chargeFlag;
  121. // BCU�������
  122. extern UINT32 BcuInTable[28];
  123. extern BOOL BcuRxShortError[28];
  124. extern BOOL BcuRxLongError[28];
  125. extern UINT8 BcuRxErrorCounter[28];
  126. extern UINT8 BcuRxFlag[28];
  127. extern UINT8 BMS_ReqVIN;
  128. extern UINT8 BMS_ReqHVOff;
  129. extern UINT8 BMS_ProtocolEditionH;
  130. extern UINT8 BMS_ProtocolEditionL;
  131. extern UINT8 BMS_CharDevNum;
  132. extern UINT8 BMS_FtPosRly;
  133. extern UINT8 BMS_FtNegRly;
  134. extern UINT8 BMS_FtPosCharRly1;
  135. extern UINT8 BMS_FtNegCharRly1;
  136. extern UINT8 BMS_FtPosCharRly2;
  137. extern UINT8 BMS_FtNegCharRly2;
  138. extern UINT8 BMS_FtHeatRly1;
  139. extern UINT8 BMS_FtHeatRly2;
  140. extern UINT8 BMS_StPosRly;
  141. extern UINT8 BMS_StNegRly;
  142. extern UINT8 BMS_StPreCharRly;
  143. extern UINT8 BMS_StPosCharRly1;
  144. extern UINT8 BMS_StNegCharRly1;
  145. extern UINT8 BMS_StPosCharRly2;
  146. extern UINT8 BMS_StNegCharRly2;
  147. extern UINT8 BMS_FtAuxRelayWeld;
  148. extern UINT8 BMS_BraOpenCirc;
  149. extern UINT8 BMS_FtBackCharCurrOutLim;
  150. extern UINT8 BMS_FtPosRlyOpen;
  151. extern UINT8 BMS_FtNegRlyOpen;
  152. extern UINT8 BMS_FtPosCharRly1Open;
  153. extern UINT8 BMS_FtPosCharRly2Open;
  154. extern UINT8 BMS_FtNegCharRly1Open;
  155. extern UINT8 BMS_FtNegCharRly2Open;
  156. extern UINT8 BMS_FtTMSContClose;
  157. extern UINT8 BMS_FtTMSContOpen;
  158. extern UINT8 BMS_FtTMS;
  159. extern UINT8 BMS_Ft24VSpy;
  160. extern UINT8 BMS_FtPACKSelfProt;
  161. extern UINT8 BMS_FtCharSockTempOver;
  162. extern UINT8 BMS_FtTempOutCtrl;
  163. extern UINT8 BMS_StPosHeatRly;
  164. extern UINT8 BMS_StNegHeatRly;
  165. extern UINT8 BMS_CharSysNum;
  166. extern UINT8 BMS_FtCode;
  167. extern UINT8 BMS_ST1CheckSum;
  168. extern UINT8 BMS_ST1Counter;
  169. extern UINT8 BMS_Mode;
  170. extern UINT8 BMS_AuxRlySt;
  171. extern UINT8 BMS_BattBalaSt;
  172. extern UINT8 BMS_CharGunSt;
  173. extern UINT8 BMS_CharMode;
  174. extern UINT8 BMS_CharSt;
  175. extern UINT8 BMS_FtLvl;
  176. extern UINT8 BMS_FtCellTempDiff;
  177. extern UINT8 BMS_FtCellTempHigh;
  178. extern UINT8 BMS_FtPACKOverVolt;
  179. extern UINT8 BMS_FtPACKUndeVolt;
  180. extern UINT8 BMS_FtSOCLow;
  181. extern UINT8 BMS_FtCellOverVolt;
  182. extern UINT8 BMS_FtCellUndeVolt;
  183. extern UINT8 BMS_FtIns;
  184. extern UINT8 BMS_FtCellOverVoltDiff;
  185. extern UINT8 BMS_FtCharCurrOver;
  186. extern UINT8 BMS_FtDisCharCurrOver;
  187. extern UINT8 BMS_FtCellTempLow;
  188. extern UINT8 BMS_FtBranVoltDifOver;
  189. extern UINT8 BMS_FtBMSHardWare;
  190. extern UINT8 BMS_FtSOCHigh;
  191. extern UINT8 BMS_FtSOCJump;
  192. extern UINT8 BMS_FtInCom;
  193. extern UINT8 BMS_FtSysMism;
  194. extern UINT8 BMS_FtHvIntLock;
  195. extern UINT8 BMS_FtSmoke;
  196. extern UINT8 BMS_FtFire;
  197. extern UINT8 BMS_FtNum;
  198. extern UINT8 BMS_PackSOC;
  199. extern UINT8 BMS_PackSOH;
  200. extern UINT8 BMS_MaxCellTemp;
  201. extern UINT8 BMS_MinCellTemp;
  202. extern UINT8 BMS_AverCellTemp;
  203. extern UINT8 BMS_MaxCellTempCSC;
  204. extern UINT8 BMS_MaxCellTempNum;
  205. extern UINT8 BMS_MinCellTempCSC;
  206. extern UINT8 BMS_MinCellTempNum;
  207. extern UINT8 BMS_MaxCellVoltCSC;
  208. extern UINT8 BMS_MaxCellVoltNum;
  209. extern UINT8 BMS_MinCellVoltCSC;
  210. extern UINT8 BMS_MinCellVoltNum;
  211. extern UINT8 BMS_InsDeteSt;
  212. extern UINT8 BMS_FtCharInsLow;
  213. extern UINT8 BMS_FtCurrSenr;
  214. extern UINT8 BMS_FtHeatingFilm;
  215. extern UINT8 BMS_FtMainLoopPreChar;
  216. extern UINT8 BMS_FtAuxLoopPreChar;
  217. extern UINT8 BMS_FtACANLost;
  218. extern UINT8 BMS_FtDCDC;
  219. extern UINT8 BMS_FtSOCDif;
  220. extern UINT8 BMS_FtCellOverDisChar;
  221. extern UINT8 BMS_FtCharOver;
  222. extern UINT8 BMS_FtContDisCharCurrOverLoad;
  223. extern UINT8 BMS_FtContCharCurrOverLoad;
  224. extern UINT8 BMS_Gun1DCNegTemp;
  225. extern UINT8 BMS_Gun1DCPosTemp;
  226. extern UINT8 BMS_Gun2DCNegTemp;
  227. extern UINT8 BMS_Gun2DCPosTemp;
  228. extern UINT8 BMS_CurrHeatSt;
  229. extern UINT8 BMS_CurrCoolSt;
  230. extern UINT8 BMS_FtCharCnct;
  231. extern UINT8 BMS_FtOverDisCharCurrDuringChar;
  232. extern UINT8 BMS_FtCharNTC;
  233. extern UINT8 BMS_FtELock;
  234. extern UINT8 BMS_CellVoltFramNum;
  235. extern UINT8 BMS_CellTempFramNum;
  236. extern UINT8 BMS_CSC_Code;
  237. extern UINT8 BMS_CellTemp[BMS_TEMP_MAX_NUM];
  238. extern UINT8 BMS_Checksum;
  239. extern UINT8 BMS_PackComp;
  240. extern UINT8 BMS_BattCodeLeng;
  241. extern UINT8 BMS_SN[27];
  242. extern UINT8 BMS_BattType;
  243. extern UINT8 BMS_CoolType;
  244. extern UINT8 BMS_CSC_Total;
  245. extern UINT8 BMS_CellVoltLevel;
  246. extern UINT8 BMS_CellMinVolt;
  247. extern UINT8 BMS_CellMaxVolt;
  248. extern UINT8 BMS_HVBranNum;
  249. extern UINT8 BMS_SingleHVBranchCellNum;
  250. extern UINT8 BMS_ReqMode;
  251. extern UINT8 BMS_HVCmd;
  252. extern UINT8 BMS_ChgSts;
  253. extern UINT8 BMS_HVRelaySts;
  254. extern UINT8 BMS_SetTemp;
  255. extern UINT8 BMS_Life;
  256. extern UINT8 BMS_CRC;
  257. extern UINT8 TMS_WorkStatus;
  258. extern UINT8 TMS_HVRelayST;
  259. extern UINT8 TMS_OutletTemp;
  260. extern UINT8 TMS_InletTemp;
  261. extern UINT8 TMS_ErrCode;
  262. extern UINT8 TMS_FaultLevel;
  263. extern UINT16 BMS_SoftwareVersion;
  264. extern UINT16 BMS_HardwareVersion;
  265. extern UINT16 BMS_PackCurr;
  266. extern UINT16 BMS_MaxCharCurr;
  267. extern UINT16 BMS_MaxDisCharCurr;
  268. extern UINT16 BMS_PosIns;
  269. extern UINT16 BMS_NegIns;
  270. extern UINT16 BMS_BattVolt;
  271. extern UINT16 BMS_LinkVolt;
  272. extern UINT16 BMS_MaxCellVolt;
  273. extern UINT16 BMS_AverCellVolt;
  274. extern UINT16 BMS_MinCellVolt;
  275. extern UINT16 BMS_ContChrgCurr;
  276. extern UINT16 BMS_ContDisCharCurr;
  277. extern UINT16 BMS_CharReqVolt;
  278. extern UINT16 BMS_CharReqCurr;
  279. extern UINT16 BMS_SysInsRes;
  280. extern UINT16 BMS_MaxDisCharPwr;
  281. extern UINT16 BMS_MaxCharPwr;
  282. extern UINT16 BMS_ContDisCharPwr;
  283. extern UINT16 BMS_ContCharPwr;
  284. extern UINT16 BMS_InstEngyCons;
  285. extern UINT16 BMS_TotalEngyCons;
  286. extern UINT16 BMS_SOE;
  287. extern UINT16 BMS_RmanCharTime;
  288. extern UINT16 BMS_CharNum;
  289. extern UINT16 BMS_CellVolt[BMS_CELL_MAX_NUM];
  290. extern UINT16 BMS_BattRateCap;
  291. extern UINT16 BMS_BattRateVolt;
  292. extern UINT16 BMS_BattRateEngy;
  293. extern UINT16 BMS_CellTotal;
  294. extern UINT16 BMS_TempTotal;
  295. extern UINT16 BMS_SingleCharEngy;
  296. extern UINT16 BMS_SingleCharCapy;
  297. extern UINT16 BMS_HVVolt;
  298. extern UINT16 TMS_ReqPow;
  299. extern UINT32 BMS_TotalCharEngy;
  300. extern UINT32 BMS_TotalDisCharEngy;
  301. extern UINT32 BMS_TotalBackCharEngy;
  302. extern UINT32 BMS_TotalStaCharEngy;
  303. extern UINT32 BMS_TotalGunCharEngy;
  304. extern UINT32 BMS_TotalGunCharCapy;
  305. extern UINT32 BMS_TotalCharCapy;
  306. extern UINT32 BMS_TotalDisCharCapy;
  307. extern UINT32 BMS_TotalBackCharCapy;
  308. extern UINT32 BMS_TotalStaCharCapy;
  309. #endif
  310. #endif /* APPGLOBALVAR_H_ */