AppFunc.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /****************************************************************************
  2. *
  3. * Copy right: RL.Chen J and Zhen C
  4. * File name: AppFunc.h
  5. * Description: 应用层函数调用文件
  6. * History: 2021-07-15
  7. * Version: V3.0
  8. ****************************************************************************/
  9. #include "flash_ec616_rt.h"
  10. #include "commontypedef.h"
  11. #include "flash_ec616_rt.h"
  12. #include "mem_map.h"
  13. #include "AppConfig.h"
  14. #include "ec_tcpip_api.h"
  15. #include "AppSignal.h"
  16. #define FLASH_BMS_FOTA_START_ADDR 0x2E6000 //BMS升级文件存储起始地址
  17. #define FLASH_BMS_FOTA_LEN 0x32000 //BMS升级文件存储长度 = =200k
  18. #define FLASH_BMS_FOTA_END_ADDR 0x318000 //BMS升级文件存储结束地址
  19. typedef struct _Fota_Type
  20. {
  21. BOOL Fota_update_error ;
  22. UINT32 Fota_All_Data_Len ;
  23. UINT32 Fota_Current_Addres ;
  24. UINT8 Fota_Recv_Data_Len ;
  25. UINT8 Fota_Recv_Data[100] ;
  26. UINT32 Fota_Flash_Addres;
  27. UINT8 Fota_CRC ;
  28. }Fota_Type;
  29. UINT8 bcc_chk(UINT8* data, UINT8 length);
  30. void LEDDisplay(void);
  31. BOOL uartBattInfoDecode(UINT8* dataPtr);
  32. static UINT8 BmsErrorDecode(UINT32 battWarningState);
  33. UINT16 GetErrorNum(UINT16 *ErrorArray,UINT8 Errorlen);
  34. UINT8 PutErrorNum(UINT16 *ErrorArray,UINT8 Errorlen,UINT16 ErrorNum);
  35. UINT8 LookUpRTtable(UINT32 R_value);
  36. void SaveAppData(void);
  37. void LoadAppData(void);
  38. void SaveAppConfig(void);
  39. void LoadAppConfig(void);
  40. static void setDefaultAppConfigData(void);
  41. static void setDefaultAppDataInfo(void);
  42. UINT16 encryptionAlgorithm (UINT16 plainText);
  43. void Fota_Func(UINT8 *DataPtr,INT32 connectId);
  44. static UINT8 bcc_chk_fota(UINT8* data, UINT8 length);
  45. static UINT8 Fota_crc_chk(UINT8* data,UINT8 length);