Module_LcmControl.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. #ifndef MODULE_LCM_CTRL_H_
  2. #define MODULE_LCM_CTRL_H_
  3. #include <stdint.h>
  4. #include <stdbool.h>
  5. #include "../Define/define.h"
  6. //------------------------------------------------------------------------------
  7. #define RETURNIDLE_Timeout 30
  8. #define DEFAULT_AC_INDEX (2)
  9. #define TIME_MAX_SEC (2592000) // 一個月,秒數
  10. #define POWER_MAX_KW (5000)
  11. #define ENERGY_MAX_KWH (5000)
  12. #define CMD_TITLE_1 (0x5A)
  13. #define CMD_TITLE_2 (0xA5)
  14. #define CMD_READ (0x80)
  15. #define CMD_WRITE (0x81)
  16. #define CMD_MULTI_WRITE (0x82)
  17. #define CMD_MULTI_READ (0x83)
  18. #define CMD_BACKLIGHT (0x01)
  19. #define CMD_REGISTER (0x03)
  20. #define CMD_HEADER_1 0x5A
  21. #define CMD_HEADER_2 0xA5
  22. #define CMD_REG_WRITE 0x80
  23. #define CMD_REG_READ 0x81
  24. #define CMD_REG_WRITE_DATA 0x82
  25. #define CMD_REG_READ_DATA 0x83
  26. #define REG_ADDRESS_READ_VERSION 0x0F
  27. #define REG_ADDRESS_READ_RTC 0x10
  28. #define REG_ADDRESS_READ_PAGE_ID 0x14
  29. #define REG_ADDRESS_READ_BRIGHTNESS 0x31
  30. #define REG_ADDRESS_WRITE_BRIGHTNESS 0X82
  31. #define REG_ADDRESS_SET_PAGE_ID 0x84
  32. #define REG_ADDRESS_SET_RTC 0x9C
  33. #define REG_TYPE_CONTROL 0x00
  34. #define REG_TYPE_RAM 0x01
  35. #define REG_TYPE_SPECIAL_CONTROL 0x02
  36. #define _CHANGE_REMOTESTART 0x01
  37. #define _CHANGE_REFUNDING 0x02
  38. #define _CHANGE_REFUNDAMOUNT 0x03
  39. #define _CHANGE_NOREFUND 0x04
  40. #define _CHANGE_PREPAYMENTINFO 0x05
  41. #define _CHANGE_PAYMENT_OK 0x06
  42. #define _CHANGE_PAYMENT_FAIL 0x07
  43. //#define NOODOE_QR_CODE_URL "https://ev-alpha-test.noodoe.com/station?id=" ////For Audi
  44. #define _StatuIcon 0x1000
  45. #define _TccareIcon 0x1004
  46. #define _StartTouchIcon 0x1006
  47. #define _FurthureIcon 0x1010
  48. #define _WeatherIcon 0x1012
  49. #define _WelcomeIcon 0x1014
  50. #define _QRCodeIcon 0x1016
  51. #define _ExclamIcon 0x1018
  52. #define _PluginIcon 0x101A
  53. #define _PlugoutIcon 0x101C
  54. #define _ReturnIcon 0x101E
  55. #define _PrechargeIcon 0x1020
  56. #define _MinuteIcon 0x1026
  57. #define _Rate13Icon 0x1028
  58. #define _CompleteIcon 0x102A
  59. #define _KgIcon 0x102C
  60. #define _Rate14Icon 0x102E
  61. #define _ExitIcon 0x1030
  62. #define _FarewellIcon 0x1032
  63. #define _ChargingIcon 0x1034
  64. // Circle Battery Setting Icon
  65. #define _Battery_Circle 0x1036
  66. // Energy Bar
  67. #define _EnergyBar 0x1038
  68. // Prepare Bar
  69. #define _PrepareBar 0x103A
  70. // QRCode
  71. #define _QRCode_Authorize 0x1040
  72. #define _QRCode_Replug 0x1050
  73. #define _QRCode_Complete 0x1060
  74. #define _LeftGun_status 0x1070
  75. #define _RightGun_status 0x1072
  76. // Touch
  77. #define _Touch_LeftGun 0x1080
  78. #define _Touch_RightGun 0x1082
  79. #define _Touch_Return 0x1084
  80. #define _Touch_IDLE 0x1086
  81. // Text String
  82. #define _Text_Power 0x1090
  83. #define _Text_Time 0x10A0
  84. #define _Text_Energy 0x10B0
  85. #define _Text_Money 0x10C0
  86. #define _Text_BatterySoc 0x10D0
  87. #define _Text_Carbon 0x10E0
  88. // ICON Map Address
  89. enum _LCM_TCC_INDEX {
  90. _LCM_NONE = 0x00,
  91. _LCM_INIT,
  92. _LCM_AUTHORIZE_LEFT,
  93. _LCM_PLUGIN_LEFT,
  94. _LCM_PRECHARGE_LEFT,
  95. _LCM_CHARGING_LEFT,
  96. _LCM_COMPLETE_LEFT,
  97. _LCM_FUNCTION_SELECT_LEFT,
  98. _LCM_REFUND_SENSEING_LEFT,
  99. _LCM_REFUNDING_LEFT,
  100. _LCM_REFUND_COMPLETE_LEFT,
  101. _LCM_REFUND_NONE_LEFT,
  102. _LCM_MEMBER_SELECT_LEFT,
  103. _LCM_MEMBER_QR_LFET,
  104. _LCM_DONATE_LEFT,
  105. _LCM_DONATE_SELECT_LEFT,
  106. _LCM_PAY_SENSING_LEFT,
  107. _LCM_PAY_ETICKET_SUCCESS_LEFT,
  108. _LCM_PAY_MPAY_SUCCESS_LEFT,
  109. _LCM_PAY_FAIL_LEFT,
  110. _LCM_AUTHORIZE_RIGHT = 32,
  111. _LCM_PLUGIN_RIGHT,
  112. _LCM_PRECHARGE_RIGHT,
  113. _LCM_CHARGING_RIGHT,
  114. _LCM_COMPLETE_RIGHT,
  115. _LCM_FUNCTION_SELECT_RIGHT,
  116. _LCM_REFUND_SENSEING_RIGHT,
  117. _LCM_REFUNDING_RIGHT,
  118. _LCM_REFUND_COMPLETE_RIGHT,
  119. _LCM_REFUND_NONE_RIGHT,
  120. _LCM_MEMBER_SELECT_RIGHT,
  121. _LCM_MEMBER_QR_RIGHT,
  122. _LCM_DONATE_RIGHT,
  123. _LCM_DONATE_SELECT_RIGHT,
  124. _LCM_PAY_SENSING_RIGHT,
  125. _LCM_PAY_ETICKET_SUCCESS_RIGHT,
  126. _LCM_PAY_MPAY_SUCCESS_RIGHT,
  127. _LCM_PAY_FAIL_RIGHT,
  128. };
  129. enum _ICON_LIST_ {
  130. _ICON_Empty = 0,
  131. _ICON_StatusInit,
  132. _ICON_StatusAuthorize,
  133. _ICON_StatusCharge,
  134. _ICON_StatusComplete,
  135. _ICON_AllIdle,
  136. _ICON_LeftGunSelect,
  137. _ICON_RightGunSelect,
  138. _ICON_AllSelect,
  139. _ICON_TCCare,
  140. _ICON_StartTouch,
  141. _ICON_Furthure = 15,
  142. _ICON_Weather,
  143. _ICON_Welcome,
  144. _ICON_QRCode,
  145. _ICON_exclamation,
  146. _ICON_plugin,
  147. _ICON_Plugout,
  148. _ICON_Return,
  149. _ICON_PrepareCharge,
  150. _ICON_min = 26,
  151. _ICON_Rate_13,
  152. _ICON_Complete,
  153. _ICON_kg,
  154. _ICON_Rate_14,
  155. _ICON_Exit,
  156. _ICON_HaveANiceDay,
  157. _ICON_HaveANiceTrip,
  158. _ICON_SaftDrive,
  159. _ICON_Charging,
  160. _ICON_Battery_0 = 40,
  161. _ICON_Battery_1,
  162. _ICON_Battery_2,
  163. _ICON_Battery_3,
  164. _ICON_Battery_4,
  165. _ICON_Battery_5,
  166. _ICON_Battery_6,
  167. _ICON_Battery_7,
  168. _ICON_Battery_8,
  169. _ICON_Battery_9,
  170. _ICON_Battery_10,
  171. _ICON_Battery_11,
  172. _ICON_Battery_12,
  173. _ICON_Battery_13,
  174. _ICON_Battery_14,
  175. _ICON_Battery_15,
  176. _ICON_Battery_16,
  177. _ICON_Battery_17,
  178. _ICON_Battery_18,
  179. _ICON_Battery_19,
  180. _ICON_Battery_20,
  181. _ICON_Battery_21,
  182. _ICON_Battery_22,
  183. _ICON_Battery_23,
  184. _ICON_Battery_24,
  185. _ICON_Battery_25,
  186. _ICON_Battery_26,
  187. _ICON_Battery_27,
  188. _ICON_Battery_28,
  189. _ICON_Battery_29,
  190. _ICON_Battery_30,
  191. _ICON_Battery_31,
  192. _ICON_Battery_32,
  193. _ICON_Battery_33,
  194. _ICON_Battery_34,
  195. _ICON_Battery_35,
  196. _ICON_Bar_1,
  197. _ICON_Bar_2,
  198. _ICON_Bar_3,
  199. _ICON_Bar_4,
  200. _ICON_Bar_5,
  201. _ICON_Bar_6,
  202. _ICON_Bar_7,
  203. _ICON_Bar_8,
  204. _ICON_Bar_9,
  205. _ICON_Bar_10,
  206. _ICON_PrePare_1,
  207. _ICON_PrePare_2,
  208. _ICON_PrePare_3,
  209. _ICON_PrePare_4,
  210. _ICON_PrePare_5,
  211. _ICON_PrePare_6,
  212. _ICON_PrePare_7,
  213. _ICON_PrePare_8,
  214. _ICON_PrePare_9,
  215. _ICON_PrePare_10,
  216. _ICON_PrePare_11,
  217. _ICON_PrePare_12,
  218. _ICON_PrePare_13,
  219. _ICON_PrePare_14,
  220. _ICON_Left_CCS1_Off,
  221. _ICON_Left_CCS2_Off,
  222. _ICON_Left_CHAdeMO_Off,
  223. _ICON_Left_CCS1_ON,
  224. _ICON_Left_CCS2_ON,
  225. _ICON_Left_CHAdeMO_ON,
  226. _ICON_Right_CCS1_Off,
  227. _ICON_Right_CCS2_Off,
  228. _ICON_Right_CHAdeMo_Off,
  229. _ICON_Right_CCS1_ON,
  230. _ICON_Right_CCS2_ON,
  231. _ICON_Right_CHAdeMO_ON,
  232. };
  233. /* Show Version */
  234. #define _Version_Cabient_Name_Text 0x0500
  235. #define _Version_Cabient_BootLoader_Text 0x0510
  236. #define _Version_Cabient_Kernel_Text 0x0520
  237. #define _Version_Cabient_CSU_Text 0x0530
  238. #define _Version_Cabient_Priamry_Text 0x0540
  239. #define _Version_Cabient_Relay0_Text 0x0550
  240. #define _Version_Cabient_Relay1_Text 0x0560
  241. #define _Version_Cabient_Fan_Text 0x0570
  242. #define _Version_Cabient_IPAddr_Text 0x0580
  243. #define _Version_Cabient_PSU1_Text 0x0590
  244. #define _Version_Cabient_PSU2_Text 0x05A0
  245. #define _Version_Cabient_PSU3_Text 0x05B0
  246. #define _Version_Cabient_PSU4_Text 0x05C0
  247. #define _Version_Cabient_PSU5_Text 0x05D0
  248. #define _Version_Cabient_PSU6_Text 0x05E0
  249. #define _Version_Cabient_PSU7_Text 0x05F0
  250. #define _Version_Cabient_PSU8_Text 0x0600
  251. #define _Version_Cabient_PSU9_Text 0x0610
  252. #define _Version_Cabient_PSU10_Text 0x0620
  253. #define _Version_Cabient_PSU11_Text 0x0630
  254. #define _Version_Cabient_PSU12_Text 0x0640
  255. #define _Version_Cabient_Primary_Text 0x0920
  256. #define _Version_Cabient_Secondary_Text 0x0930
  257. #define _Version_Cabient_Model_value 0x0650
  258. #define _Version_Cabient_BootLoader_value 0x0660
  259. #define _Version_Cabient_Kernel_value 0x0670
  260. #define _Version_Cabient_CSU_value 0x0680
  261. #define _Version_Cabient_Priamry_value 0x0690
  262. #define _Version_Cabient_Relay0_value 0x06A0
  263. #define _Version_Cabient_Relay1_value 0x06B0
  264. #define _Version_Cabient_Fan_value 0x06C0
  265. #define _Version_Cabient_IPAddr_value 0x06D0
  266. #define _Version_Cabient_PSU_Prim1_value 0x06E0
  267. #define _Version_Cabient_PSU_Prim2_value 0x06F0
  268. #define _Version_Cabient_PSU_Prim3_value 0x0700
  269. #define _Version_Cabient_PSU_Prim4_value 0x0710
  270. #define _Version_Cabient_PSU_Prim5_value 0x0720
  271. #define _Version_Cabient_PSU_Prim6_value 0x0730
  272. #define _Version_Cabient_PSU_Sec1_value 0x0740
  273. #define _Version_Cabient_PSU_Sec2_value 0x0750
  274. #define _Version_Cabient_PSU_Sec3_value 0x0760
  275. #define _Version_Cabient_PSU_Sec4_value 0x0770
  276. #define _Version_Cabient_PSU_Sec5_value 0x0780
  277. #define _Version_Cabient_PSU_Sec6_value 0x0790
  278. #define _Version_Cabient_PSU_Prim7_value 0x09E0
  279. #define _Version_Cabient_PSU_Prim8_value 0x09F0
  280. #define _Version_Cabient_PSU_Prim9_value 0x1000
  281. #define _Version_Cabient_PSU_Prim10_value 0x1010
  282. #define _Version_Cabient_PSU_Prim11_value 0x1020
  283. #define _Version_Cabient_PSU_Prim12_value 0x1030
  284. #define _Version_Cabient_PSU_Sec7_value 0x1040
  285. #define _Version_Cabient_PSU_Sec8_value 0x1050
  286. #define _Version_Cabient_PSU_Sec9_value 0x1060
  287. #define _Version_Cabient_PSU_Sec10_value 0x1070
  288. #define _Version_Cabient_PSU_Sec11_value 0x1080
  289. #define _Version_Cabient_PSU_Sec12_value 0x1090
  290. #define _Version_Dispenser_Name_Text 0x07A0
  291. #define _Version_Dispenser_BootLoader_Text 0x07B0
  292. #define _Version_Dispenser_Kernel_Text 0x07C0
  293. #define _Version_Dispenser_CSU_Text 0x07D0
  294. #define _Version_Dispenser_Relay_Text 0x07E0
  295. #define _Version_Dispenser_Fan_Text 0x07F0
  296. #define _Version_Dispenser_Priamry_Text 0x0800
  297. #define _Version_Dispenser_LCM_Text 0x0810
  298. #define _Version_Dispenser_LED_Text 0x0820
  299. #define _Version_Dispenser_Connector0_Text 0x0830
  300. #define _Version_Dispenser_Connector1_Text 0x0840
  301. #define _Version_Dispenser_IPAddr_Text 0x0850
  302. #define _Version_Dispenser_Model_value 0x0860
  303. #define _Version_Dispenser_BootLoader_value 0x0870
  304. #define _Version_Dispenser_Kernel_value 0x0880
  305. #define _Version_Dispenser_CSU_value 0x0890
  306. #define _Version_Dispenser_Relay_value 0x08A0
  307. #define _Version_Dispenser_Fan_value 0x08B0
  308. #define _Version_Dispenser_Priamry_value 0x08C0
  309. #define _Version_Dispenser_LCM_value 0x08D0
  310. #define _Version_Dispenser_LED_value 0x08E0
  311. #define _Version_Dispenser_Connector0_value 0x08F0
  312. #define _Version_Dispenser_Connector1_value 0x0900
  313. #define _Version_Dispenser_IPAddr_value 0x0910
  314. #endif //MODULE_LCM_CTRL_H_