Config.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. /*
  2. * Config.h
  3. *
  4. * Created on: 2019年4月23日
  5. * Author: foluswen
  6. */
  7. #ifndef CONFIG_H_
  8. #define CONFIG_H_
  9. typedef unsigned char byte;
  10. #define TOTAL_QUANTITY_GUN 4 //Max Count
  11. #ifdef DEBUG_OPTION
  12. #if (DEBUG_OPTION == 1)
  13. #define DEBUG 1
  14. #else
  15. #define DEBUG 0
  16. #endif
  17. #else
  18. #define DEBUG 0
  19. #endif
  20. #define MODE_BOOT 0
  21. #define MODE_IDLE 1
  22. #define MODE_AUTHORIZING 2
  23. #define MODE_REASSIGN_CHECK 3
  24. #define MODE_REASSIGN 4
  25. #define MODE_PRECHARGE 5
  26. #define MODE_PREPARE_FOR_EV 6
  27. #define MODE_PREPARE_FOR_EVSE 7
  28. #define MODE_CHARGING 8
  29. #define MODE_TERMINATING 9
  30. #define MODE_COMPLETE 10
  31. #define MODE_ALARM 11
  32. #define MODE_FAULT 12
  33. #define MODE_RESERVATION 13
  34. #define MODE_BOOKING 14
  35. #define MODE_MAINTAIN 15
  36. #define MODE_DEBUG 16
  37. #define MODE_CCS_PRECHARGE_STEP0 17 // ready for ccs precharge processing, For D+ relay to precharge relay
  38. #define MODE_CCS_PRECHARGE_STEP1 18 // waitting for ev board inform to enter to charging, For precharge relay to D+ relay
  39. #define MODE_SINGLE_RUN 19
  40. #define GFD_WAIT 0
  41. #define GFD_PASS 1
  42. #define GFD_FAIL 2
  43. #define GFD_WARNING 3
  44. #define PRECHARGE_WAIT 0
  45. #define PRECHARGE_READY 1
  46. #define PRECHARGE_PRERELAY_PASS 2
  47. #define PRECHARGE_CHARELAY_PASS 3
  48. #define BOOTTING 0
  49. #define BOOT_COMPLETE 1
  50. enum _SYSTEM_STATUS
  51. {
  52. S_BOOTING = 0,
  53. S_IDLE = 1,
  54. S_AUTHORIZING = 2,
  55. S_REASSIGN_CHECK = 3,
  56. S_REASSIGN = 4,
  57. S_PREPARNING = 5,
  58. S_PREPARING_FOR_EV = 6,
  59. S_PREPARING_FOR_EVSE = 7,
  60. S_CHARGING = 8,
  61. S_TERMINATING = 9,
  62. S_COMPLETE = 10,
  63. S_ALARM = 11,
  64. S_FAULT = 12,
  65. S_RESERVATION = 13,
  66. S_BOOKING = 14,
  67. S_MAINTAIN = 15,
  68. S_DEBUG = 16,
  69. S_CCS_PRECHARGE_ST0 = 17,
  70. S_CCS_PRECHARGE_ST1 = 18,
  71. S_SINGLE_RUN = 19,
  72. S_NONE = 20,
  73. };
  74. enum _GUN_TYPE
  75. {
  76. _Type_Chademo = 0,
  77. _Type_CCS_2 = 1,
  78. _Type_GB = 2,
  79. };
  80. enum _LCM_INDEX
  81. {
  82. _LCM_INIT = 0x00,
  83. _LCM_IDLE = 0x01,
  84. _LCM_AUTHORIZING = 0x04,
  85. _LCM_AUTHORIZ_COMP = 0x05,
  86. _LCM_AUTHORIZ_FAIL = 0x06,
  87. _LCM_WAIT_FOR_PLUG = 0x07,
  88. _LCM_PRE_CHARGE = 0x08,
  89. _LCM_CHARGING = 0x09,
  90. _LCM_COMPLETE = 0x0A,
  91. _LCM_FIX = 0x0B,
  92. _LCM_NONE = 0xFF,
  93. };
  94. enum _SELF_TEST_SEQ
  95. {
  96. _STEST_VERSION = 0x00,
  97. _STEST_AC_CONTACTOR = 0x01,
  98. _STEST_PSU_DETECT = 0x02,
  99. _STEST_PSU_CAP = 0x03,
  100. _STEST_FAIL = 0x04,
  101. _STEST_COMPLETE = 0xEE,
  102. };
  103. enum _MODULE_PSU_WORK_STEP
  104. {
  105. INITIAL_START = 0,
  106. GET_PSU_COUNT = 1,
  107. GET_SYS_CAP = 2,
  108. BOOTING_COMPLETE = 3,
  109. _WORK_CHARGING = 10,
  110. _NO_WORKING = 254,
  111. _INIT_PSU_STATUS = 255,
  112. };
  113. enum _OFFLINE_POLICY
  114. {
  115. _OFFLINE_POLICY_LOCAL_LIST = 0x00,
  116. _OFFLINE_POLICY_PHIHONG_RFID_TAG = 0x01,
  117. _OFFLINE_POLICY_FREE_CHARGING = 0x02,
  118. _OFFLINE_POLICY_NO_CHARGING = 0x03,
  119. };
  120. enum _REASSIGNED_RESOURCE_STEP
  121. {
  122. _REASSIGNED_NONE = 0, //
  123. _REASSIGNED_PREPARE_M_TO_A = 1, // 系統收到需要降載需求 (輸出總電流降低),PSU Task 收到將狀態切換至下個狀態
  124. _REASSIGNED_GET_NEW_CAP = 2, // 充電中的重新取得屬於自己火線上的總能量並透過小板通知車端 - 超過10秒直接跳下一步
  125. _REASSIGNED_ADJUST_M_TO_A = 3, // 模塊重新分配完成
  126. _REASSIGNED_RELAY_M_TO_A = 4, // 切斷橋接的 Relay
  127. _REASSIGNED_PREPARE_A_TO_M = 11,
  128. _REASSIGNED_ADJUST_A_TO_M = 12, // 模塊升壓
  129. _REASSIGNED_RELAY_A_TO_M = 13, // 搭接橋接的 Relay
  130. _REASSIGNED_WAITING = 14,
  131. _REASSIGNED_COMP = 15,
  132. };
  133. enum _MAIN_CHARGING_MODE
  134. {
  135. _MAIN_CHARGING_MODE_MAX = 0,
  136. _MAIN_CHARGING_MODE_AVER = 1,
  137. };
  138. enum _EXTRA_ERR_PROCESS
  139. {
  140. _EXTRA_ERR_PROCESS_NONE = 0,
  141. _EXTRA_ERR_PROCESS_INUVP = 1,
  142. };
  143. #endif /* CONFIG_H_ */