main.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #ifndef _MAIN_H_
  2. #define _MAIN_H_
  3. //------------------------------------------------------------------------------
  4. #include <stdint.h>
  5. //------------------------------------------------------------------------------
  6. #define MODELNAME_FAIL (0)
  7. #define BUFFER_SIZE (128)
  8. #define BTN_RELEASE (0)
  9. #define BTN_PRESS (1)
  10. #define MAX_BUF (64)
  11. #define SYSFS_GPIO_DIR "/sys/class/gpio"
  12. #define UPGRADE_FAN (0x02)
  13. #if defined DD360 || defined DD360Audi || defined DD360ComBox
  14. #define UPGRADE_RB (0x09) //0x09 for DD360 dispenser
  15. #else
  16. #define UPGRADE_RB (0x03) //other module use
  17. #endif //defined DD360 ||defined DD360Audi || defined DD360ComBox
  18. #define UPGRADE_PRI (0x04)
  19. #define UPGRADE_AC (0x05)
  20. #define UPGRADE_LED (0x06)
  21. #define SYSTEM_MIN_VOL (80) //150
  22. #define MIN_OUTPUT_CUR (0)
  23. #define AC_OUTPUT_VOL (220)
  24. #define DEFAULT_AC_INDEX (2)
  25. #define PSU_MIN_CUR (100)
  26. //#define DB_FILE "/Storage/ChargeLog/localCgargingRecord.db"
  27. #define uSEC_VAL (1000000)
  28. #define SELFTEST_TIMEOUT (60)//45
  29. #define AUTHORIZE_TIMEOUT (30)//30
  30. #define BALANCE_TIMEOUT (15)//15
  31. #define AUTHORIZE_COMP_TIMEOUT (3)
  32. #define AUTHORIZE_FAIL_TIMEOUT (3)
  33. #define AUTHORIZE_STOP_TIMEOUT (30)
  34. #define RETURN_TO_CHARGING_PAGE (30)
  35. #define GUN_PREPARE_TIMEOUT (30)
  36. #define GUN_EV_WAIT_TIMEOUT (120)
  37. #define GUN_EVSE_WAIT_TIMEOUT (60)
  38. #define GUN_COMP_WAIT_TIMEOUT (10)
  39. #define GUN_PRECHARGING_TIMEOUT (60)
  40. #define EVCCID_LINK_TIMEOUT (120)
  41. #define PRECHARGING_TTIMEOUT (60)
  42. #define SHOW_STOP_TIMEOUT (30)
  43. #define HELP_PAGE_TIMEOUT (30)
  44. #define SETTING_PAGE_TIMEOUT (30)
  45. #define CONN_PLUG_TIMEOUT (40)
  46. #define SHOW_PLUG_FAIL_TIMEOUT (10)
  47. #define EXIT_COMPLETE_TIMEOUT (10)
  48. #define WHILE_LOOP_TIME (10000)
  49. //#define log_info(format, args...) StoreLogMsg_1("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  50. //#define log_warn(format, args...) StoreLogMsg_1("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  51. //#define log_error(format, args...) StoreLogMsg_1("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  52. //------------------------------------------------------------------------------
  53. //typedef struct StLedConfig {
  54. // //OutputDrvValue[0]
  55. // uint8_t LeftButtonLed: 1; //bit 0, H: ON, L:OFF
  56. // uint8_t RightButtonLed: 1; //bit 1, H: ON, L:OFF
  57. // uint8_t GreenLED: 1; //bit 2, H: ON, L:OFF
  58. // uint8_t YellowLED: 1; //bit 3, H: ON, L:OFF
  59. // uint8_t RedLED: 1; //bit 4, H: ON, L:OFF
  60. // uint8_t SystemLed4: 1; //bit 5, H: ON, L:OFF
  61. // uint8_t AcContactor: 1; //bit 6, H: ON, L:OFF
  62. // uint8_t Reserved: 1; //bit 7 reserved
  63. //} LedConfig;
  64. //------------------------------------------------------------------------------
  65. bool isDetectPlugin(int gunIndex);
  66. void _DetectPlugInTimeout(int gunIndex);
  67. void _evccidlinktimeout(uint8_t gunIndex);
  68. void StartSystemTimeoutDet(uint8_t flag);
  69. void StopSystemTimeoutDet(void);
  70. void StartGunInfoTimeoutDet(uint8_t gunIndex, uint8_t flag);
  71. void StopGunInfoTimeoutDet(uint8_t gunIndex);
  72. void AuthorizingStart(void);
  73. bool IsAuthorizingMode(void);
  74. bool isAuthorizedComplete(void);
  75. void ClearAuthorizedFlag(void);
  76. void ChargingAlarmProcess(uint8_t gunIndex);
  77. void StopChargingProcessByString(uint8_t level);
  78. void EmcOccureByString(char *code);
  79. void ReleaseEmsOccureByString(uint8_t index, char *code);
  80. void confirmSelGun(uint8_t selGun);
  81. void destroySelGun(uint8_t curGun);
  82. int getConfirmSelectedGun(uint8_t curSel);
  83. void setSelGunWaitToAuthor(uint8_t curSel);
  84. void ChargingTerminalProcess(uint8_t gunIndex);
  85. void AcChargingTerminalProcess(void);
  86. void ChangeGunSelectByIndex(uint8_t sel);
  87. void setChargerMode(uint8_t gun_index, uint8_t mode);
  88. void KillAllTask(void);
  89. void KillTask(void);
  90. void ClearDetectPluginFlag(int gunIndex);
  91. #endif /* _MAIN_H_ */