AppGlobalVar.h 8.4 KB

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