main.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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 RETURN_VIEWPAGE_TIMEOUT (30)
  43. #define HELP_PAGE_TIMEOUT (30)
  44. #define LANGUAGE_PAGE_TIMEOUT (30)
  45. #define CONN_PLUG_TIMEOUT (40)
  46. #define WHILE_LOOP_TIME (10000)
  47. //#define log_info(format, args...) StoreLogMsg_1("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  48. //#define log_warn(format, args...) StoreLogMsg_1("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  49. //#define log_error(format, args...) StoreLogMsg_1("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  50. //------------------------------------------------------------------------------
  51. //typedef struct StLedConfig {
  52. // //OutputDrvValue[0]
  53. // uint8_t LeftButtonLed: 1; //bit 0, H: ON, L:OFF
  54. // uint8_t RightButtonLed: 1; //bit 1, H: ON, L:OFF
  55. // uint8_t GreenLED: 1; //bit 2, H: ON, L:OFF
  56. // uint8_t YellowLED: 1; //bit 3, H: ON, L:OFF
  57. // uint8_t RedLED: 1; //bit 4, H: ON, L:OFF
  58. // uint8_t SystemLed4: 1; //bit 5, H: ON, L:OFF
  59. // uint8_t AcContactor: 1; //bit 6, H: ON, L:OFF
  60. // uint8_t Reserved: 1; //bit 7 reserved
  61. //} LedConfig;
  62. //------------------------------------------------------------------------------
  63. bool isDetectPlugin(int gunIndex);
  64. void _DetectPlugInTimeout(int gunIndex);
  65. void _evccidlinktimeout(uint8_t gunIndex);
  66. void StartSystemTimeoutDet(uint8_t flag);
  67. void StopSystemTimeoutDet(void);
  68. void StartGunInfoTimeoutDet(uint8_t gunIndex, uint8_t flag);
  69. void StopGunInfoTimeoutDet(uint8_t gunIndex);
  70. void AuthorizingStart(void);
  71. bool IsAuthorizingMode(void);
  72. bool isAuthorizedComplete(void);
  73. void ClearAuthorizedFlag(void);
  74. void ChargingAlarmProcess(uint8_t gunIndex);
  75. void StopChargingProcessByString(uint8_t level);
  76. void EmcOccureByString(char *code);
  77. void ReleaseEmsOccureByString(uint8_t index, char *code);
  78. void confirmSelGun(uint8_t selGun);
  79. void destroySelGun(uint8_t curGun);
  80. int getConfirmSelectedGun(uint8_t curSel);
  81. void setSelGunWaitToAuthor(uint8_t curSel);
  82. void ChargingTerminalProcess(uint8_t gunIndex);
  83. void AcChargingTerminalProcess(void);
  84. void ChangeGunSelectByIndex(uint8_t sel);
  85. void setChargerMode(uint8_t gun_index, uint8_t mode);
  86. void KillAllTask(void);
  87. void KillTask(void);
  88. #endif /* _MAIN_H_ */