Module_LcmControl.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  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 PREAUTHMONEY 2000
  8. #define RETURNIDLE_Timeout 60
  9. #define DEFAULT_AC_INDEX (2)
  10. #define TIME_MAX_SEC (2592000) // 一個月,秒數
  11. #define POWER_MAX_KW (5000)
  12. #define ENERGY_MAX_KWH (5000)
  13. #define CMD_TITLE_1 (0x5A)
  14. #define CMD_TITLE_2 (0xA5)
  15. #define CMD_READ (0x80)
  16. #define CMD_WRITE (0x81)
  17. #define CMD_MULTI_WRITE (0x82)
  18. #define CMD_MULTI_READ (0x83)
  19. #define CMD_BACKLIGHT (0x01)
  20. #define CMD_REGISTER (0x03)
  21. #define CMD_HEADER_1 0x5A
  22. #define CMD_HEADER_2 0xA5
  23. #define CMD_REG_WRITE 0x80
  24. #define CMD_REG_READ 0x81
  25. #define CMD_REG_WRITE_DATA 0x82
  26. #define CMD_REG_READ_DATA 0x83
  27. #define REG_ADDRESS_READ_VERSION 0x0F
  28. #define REG_ADDRESS_READ_RTC 0x10
  29. #define REG_ADDRESS_READ_PAGE_ID 0x14
  30. #define REG_ADDRESS_READ_BRIGHTNESS 0x31
  31. #define REG_ADDRESS_WRITE_BRIGHTNESS 0X82
  32. #define REG_ADDRESS_SET_PAGE_ID 0x84
  33. #define REG_ADDRESS_SET_RTC 0x9C
  34. #define REG_TYPE_CONTROL 0x00
  35. #define REG_TYPE_RAM 0x01
  36. #define REG_TYPE_SPECIAL_CONTROL 0x02
  37. #define _CHANGE_REMOTESTART 0x01
  38. #define _CHANGE_REFUNDING 0x02
  39. #define _CHANGE_REFUNDAMOUNT 0x03
  40. #define _CHANGE_NOREFUND 0x04
  41. #define _CHANGE_PREPAYMENTINFO 0x05
  42. #define _CHANGE_PAYMENT_OK 0x06
  43. #define _CHANGE_PAYMENT_FAIL 0x07
  44. //#define NOODOE_QR_CODE_URL "https://ev-alpha-test.noodoe.com/station?id=" ////For Audi
  45. #define _StatuIcon 0x1000
  46. #define _ConfirmStopIcon 0x1002
  47. #define _TccareIcon 0x1004
  48. #define _StartTouchIcon 0x1006
  49. #define _FurthureIcon 0x1010
  50. #define _WeatherIcon 0x1012
  51. #define _WelcomeIcon 0x1014
  52. #define _QRCodeIcon 0x1016
  53. #define _ExclamIcon 0x1018
  54. #define _PluginIcon 0x101A
  55. #define _PlugoutIcon 0x101C
  56. #define _ReturnIcon 0x101E
  57. #define _PrechargeIcon 0x1020
  58. #define _MinuteIcon 0x1026
  59. #define _Rate13Icon 0x1028
  60. #define _CompleteIcon 0x102A
  61. #define _KgIcon 0x102C
  62. #define _Rate14Icon 0x102E
  63. #define _ExitIcon 0x1030
  64. #define _FarewellIcon 0x1032
  65. #define _ChargingIcon 0x1034
  66. // Circle Battery Setting Icon
  67. #define _Battery_Circle 0x1036
  68. // Energy Bar
  69. #define _EnergyBar 0x1038
  70. // Prepare Bar
  71. #define _PrepareBar 0x103A
  72. // QRCode
  73. #define _QRCode_Authorize 0x1040
  74. #define _QRCode_Replug 0x1050
  75. #define _QRCode_Complete 0x1060
  76. #define _LeftGun_status 0x1070
  77. #define _RightGun_status 0x1072
  78. // Warm
  79. #define _Icon_Warming_0 0x1074
  80. #define _Icon_Warming_1 0x1076
  81. #define _Icon_Warming_2 0x1078
  82. #define _Icon_Warming_3 0x107A
  83. #define _Icon_Warming_4 0x107C
  84. // Touch
  85. #define _Touch_LeftGun 0x1080
  86. #define _Touch_RightGun 0x1082
  87. #define _Touch_Return 0x1084
  88. #define _Touch_IDLE 0x1086
  89. #define _Touch_Stop 0x1088
  90. #define _Touch_Stop_Confirm 0x108A
  91. #define _Touch_Stop_Cancel 0x108C
  92. #define _Touch_ConfirmLeft 0x1208
  93. #define _Touch_ConfirmRight 0x120A
  94. // Text String
  95. #define _Text_Power 0x1090
  96. #define _Text_Time 0x10A0
  97. #define _Text_Energy 0x10B0
  98. #define _Text_Money 0x10C0
  99. #define _Text_BatterySoc 0x10D0
  100. #define _Text_Carbon 0x10E0
  101. // Warming Code
  102. #define _Text_Warming_0 0x10F0
  103. #define _Text_Warming_1 0x1100
  104. #define _Text_Warming_2 0x1110
  105. #define _Text_Warming_3 0x1120
  106. #define _Text_Warming_4 0x1130
  107. #define _Text_Date 0x1140
  108. #define _Text_Tempture 0x1150
  109. #define _WeekIcon 0x1200
  110. #define _WeatherIcon 0x1202
  111. #define _LocationIcon 0x1204
  112. #define _StopChargeBtn 0x1206
  113. #define _ErrorIcon 0x120C
  114. #define _PayIcon 0x120E
  115. #define _ProgreePayIcon 0x1210
  116. #define _ConfirmLeftIcon 0x1212
  117. #define _ConfirmRightIcon 0x1214
  118. #define _PayFailLeftIcon 0x1216
  119. #define _PayFailRightIcon 0x1218
  120. // ICON Map Address
  121. enum _LCM_TCC_INDEX {
  122. _LCM_NONE = 0x00,
  123. _LCM_INIT,
  124. _LCM_AUTHORIZE_LEFT,
  125. _LCM_PLUGIN_LEFT,
  126. _LCM_PRECHARGE_LEFT,
  127. _LCM_CHARGING_LEFT,
  128. _LCM_COMPLETE_LEFT,
  129. _LCM_FUNCTION_SELECT_LEFT,
  130. _LCM_REFUND_SENSEING_LEFT,
  131. _LCM_REFUNDING_LEFT,
  132. _LCM_REFUND_COMPLETE_LEFT,
  133. _LCM_REFUND_NONE_LEFT,
  134. _LCM_MEMBER_SELECT_LEFT,
  135. _LCM_MEMBER_QR_LFET,
  136. _LCM_DONATE_LEFT,
  137. _LCM_DONATE_SELECT_LEFT,
  138. _LCM_PAY_SENSING_LEFT,
  139. _LCM_PAY_ETICKET_SUCCESS_LEFT,
  140. _LCM_PAY_MPAY_SUCCESS_LEFT,
  141. _LCM_PAY_FAIL_LEFT,
  142. _LCM_AUTHORIZE_RIGHT = 32,
  143. _LCM_PLUGIN_RIGHT,
  144. _LCM_PRECHARGE_RIGHT,
  145. _LCM_CHARGING_RIGHT,
  146. _LCM_COMPLETE_RIGHT,
  147. _LCM_FUNCTION_SELECT_RIGHT,
  148. _LCM_REFUND_SENSEING_RIGHT,
  149. _LCM_REFUNDING_RIGHT,
  150. _LCM_REFUND_COMPLETE_RIGHT,
  151. _LCM_REFUND_NONE_RIGHT,
  152. _LCM_MEMBER_SELECT_RIGHT,
  153. _LCM_MEMBER_QR_RIGHT,
  154. _LCM_DONATE_RIGHT,
  155. _LCM_DONATE_SELECT_RIGHT,
  156. _LCM_PAY_SENSING_RIGHT,
  157. _LCM_PAY_ETICKET_SUCCESS_RIGHT,
  158. _LCM_PAY_MPAY_SUCCESS_RIGHT,
  159. _LCM_PAY_FAIL_RIGHT,
  160. };
  161. enum _ICON_LIST_ {
  162. _ICON_Empty = 0,
  163. _ICON_StatusInit,
  164. _ICON_StatusAuthorize,
  165. _ICON_StatusCharge,
  166. _ICON_StatusComplete,
  167. _ICON_AllIdle,
  168. _ICON_LeftGunSelect,
  169. _ICON_RightGunSelect,
  170. _ICON_AllSelect,
  171. _ICON_TCCare,
  172. _ICON_StartTouch,
  173. _ICON_Furthure = 15,
  174. _ICON_Weather,
  175. _ICON_Welcome,
  176. _ICON_QRCode,
  177. _ICON_exclamation,
  178. _ICON_plugin,
  179. _ICON_Plugout,
  180. _ICON_Return,
  181. _ICON_PrepareCharge,
  182. _ICON_min = 26,
  183. _ICON_Rate_13,
  184. _ICON_Complete,
  185. _ICON_kg,
  186. _ICON_Rate_14,
  187. _ICON_Exit,
  188. _ICON_HaveANiceDay,
  189. _ICON_HaveANiceTrip,
  190. _ICON_SaftDrive,
  191. _ICON_Charging,
  192. _ICON_Battery_0 = 40,
  193. _ICON_Battery_1,
  194. _ICON_Battery_2,
  195. _ICON_Battery_3,
  196. _ICON_Battery_4,
  197. _ICON_Battery_5,
  198. _ICON_Battery_6,
  199. _ICON_Battery_7,
  200. _ICON_Battery_8,
  201. _ICON_Battery_9,
  202. _ICON_Battery_10,
  203. _ICON_Battery_11,
  204. _ICON_Battery_12,
  205. _ICON_Battery_13,
  206. _ICON_Battery_14,
  207. _ICON_Battery_15,
  208. _ICON_Battery_16,
  209. _ICON_Battery_17,
  210. _ICON_Battery_18,
  211. _ICON_Battery_19,
  212. _ICON_Battery_20,
  213. _ICON_Battery_21,
  214. _ICON_Battery_22,
  215. _ICON_Battery_23,
  216. _ICON_Battery_24,
  217. _ICON_Battery_25,
  218. _ICON_Battery_26,
  219. _ICON_Battery_27,
  220. _ICON_Battery_28,
  221. _ICON_Battery_29,
  222. _ICON_Battery_30,
  223. _ICON_Battery_31,
  224. _ICON_Battery_32,
  225. _ICON_Battery_33,
  226. _ICON_Battery_34,
  227. _ICON_Battery_35,
  228. _ICON_Battery_36,
  229. _ICON_Weather_Sun,
  230. _ICON_Weather_Cloudy,
  231. _ICON_Weather_Rain,
  232. _ICON_Weather_Thunder,
  233. _ICON_Weather_Snow,
  234. _ICON_Weather_Fog,
  235. /*
  236. _ICON_Bar_1,
  237. _ICON_Bar_2,
  238. _ICON_Bar_3,
  239. _ICON_Bar_4,
  240. _ICON_Bar_5,
  241. _ICON_Bar_6,
  242. _ICON_Bar_7,
  243. _ICON_Bar_8,
  244. _ICON_Bar_9,
  245. _ICON_Bar_10,
  246. */
  247. _ICON_PrePare_1 = 86,
  248. _ICON_PrePare_2,
  249. _ICON_PrePare_3,
  250. _ICON_PrePare_4,
  251. _ICON_PrePare_5,
  252. _ICON_PrePare_6,
  253. _ICON_PrePare_7,
  254. _ICON_PrePare_8,
  255. _ICON_PrePare_9,
  256. _ICON_PrePare_10,
  257. _ICON_PrePare_11,
  258. _ICON_PrePare_12,
  259. _ICON_PrePare_13,
  260. _ICON_PrePare_14,
  261. _ICON_Left_CCS1_Off,
  262. _ICON_Left_CCS2_Off,
  263. _ICON_Left_CHAdeMO_Off,
  264. _ICON_Left_CCS1_ON,
  265. _ICON_Left_CCS2_ON,
  266. _ICON_Left_CHAdeMO_ON,
  267. _ICON_Right_CCS1_Off,
  268. _ICON_Right_CCS2_Off,
  269. _ICON_Right_CHAdeMo_Off,
  270. _ICON_Right_CCS1_ON,
  271. _ICON_Right_CCS2_ON,
  272. _ICON_Right_CHAdeMO_ON,
  273. _ICON_WARMING,
  274. _ICON_SELECT_TEXT,
  275. _ICON_MONDAY,
  276. _ICON_TUESDAY,
  277. _ICON_WENSDAY,
  278. _ICON_THRUDAY,
  279. _ICON_FRIDAY,
  280. _ICON_SATURDAY,
  281. _ICON_SUNDAY,
  282. _ICON_LOCATION_TAIPEI,
  283. _ICON_PAYFAIL = 126,
  284. _ICON_PROGREEPAY_1,
  285. _ICON_PROGREEPAY_2,
  286. _ICON_PROGREEPAY_3,
  287. _ICON_PROGREEPAY_4,
  288. _ICON_PROGREEPAY_5,
  289. _ICON_PROGREEPAY_6,
  290. _ICON_PROGREEPAY_7,
  291. _ICON_PROGREEPAY_8,
  292. _ICON_PROGREEPAY_9,
  293. _ICON_PROGREEPAY_10,
  294. _ICON_PROGREEPAY_11,
  295. _ICON_PROGREEPAY_12,
  296. _ICON_PROGREEPAY_13,
  297. _ICON_PROGREEPAY_14,
  298. _ICON_PROGREEPAY_15,
  299. _ICON_STOPSERVICE,
  300. _ICON_WELCOMELEFTCCS1,
  301. _ICON_WELCOMELEFTCCS2,
  302. _ICON_WELCOMELEFTCHADEMO,
  303. _ICON_WELCOMERIGHTCCS1,
  304. _ICON_WELCOMERIGHTCCS2,
  305. _ICON_WELCOMERIGHTCHADEMO,
  306. _ICON_PAYFAILLEFTCCS1,
  307. _ICON_PAYFAILLEFTCCS2,
  308. _ICON_PAYFAILLETCHADEMO,
  309. _ICON_PAYFAILRIGHTCCS1,
  310. _ICON_PAYFAILRIGHTCCS2,
  311. _ICON_PAYFAILRIGHTCHADEMO,
  312. };
  313. /* Show Version */
  314. #define _Version_Cabient_Name_Text 0x0500
  315. #define _Version_Cabient_BootLoader_Text 0x0510
  316. #define _Version_Cabient_Kernel_Text 0x0520
  317. #define _Version_Cabient_CSU_Text 0x0530
  318. #define _Version_Cabient_Priamry_Text 0x0540
  319. #define _Version_Cabient_Relay0_Text 0x0550
  320. #define _Version_Cabient_Relay1_Text 0x0560
  321. #define _Version_Cabient_Fan_Text 0x0570
  322. #define _Version_Cabient_IPAddr_Text 0x0580
  323. #define _Version_Cabient_PSU1_Text 0x0590
  324. #define _Version_Cabient_PSU2_Text 0x05A0
  325. #define _Version_Cabient_PSU3_Text 0x05B0
  326. #define _Version_Cabient_PSU4_Text 0x05C0
  327. #define _Version_Cabient_PSU5_Text 0x05D0
  328. #define _Version_Cabient_PSU6_Text 0x05E0
  329. #define _Version_Cabient_PSU7_Text 0x05F0
  330. #define _Version_Cabient_PSU8_Text 0x0600
  331. #define _Version_Cabient_PSU9_Text 0x0610
  332. #define _Version_Cabient_PSU10_Text 0x0620
  333. #define _Version_Cabient_PSU11_Text 0x0630
  334. #define _Version_Cabient_PSU12_Text 0x0640
  335. #define _Version_Cabient_Primary_Text 0x0920
  336. #define _Version_Cabient_Secondary_Text 0x0930
  337. #define _Version_Cabient_Model_value 0x0650
  338. #define _Version_Cabient_BootLoader_value 0x0660
  339. #define _Version_Cabient_Kernel_value 0x0670
  340. #define _Version_Cabient_CSU_value 0x0680
  341. #define _Version_Cabient_Priamry_value 0x0690
  342. #define _Version_Cabient_Relay0_value 0x06A0
  343. #define _Version_Cabient_Relay1_value 0x06B0
  344. #define _Version_Cabient_Fan_value 0x06C0
  345. #define _Version_Cabient_IPAddr_value 0x06D0
  346. #define _Version_Cabient_PSU_Prim1_value 0x06E0
  347. #define _Version_Cabient_PSU_Prim2_value 0x06F0
  348. #define _Version_Cabient_PSU_Prim3_value 0x0700
  349. #define _Version_Cabient_PSU_Prim4_value 0x0710
  350. #define _Version_Cabient_PSU_Prim5_value 0x0720
  351. #define _Version_Cabient_PSU_Prim6_value 0x0730
  352. #define _Version_Cabient_PSU_Sec1_value 0x0740
  353. #define _Version_Cabient_PSU_Sec2_value 0x0750
  354. #define _Version_Cabient_PSU_Sec3_value 0x0760
  355. #define _Version_Cabient_PSU_Sec4_value 0x0770
  356. #define _Version_Cabient_PSU_Sec5_value 0x0780
  357. #define _Version_Cabient_PSU_Sec6_value 0x0790
  358. #define _Version_Cabient_PSU_Prim7_value 0x09E0
  359. #define _Version_Cabient_PSU_Prim8_value 0x09F0
  360. #define _Version_Cabient_PSU_Prim9_value 0x1000
  361. #define _Version_Cabient_PSU_Prim10_value 0x1010
  362. #define _Version_Cabient_PSU_Prim11_value 0x1020
  363. #define _Version_Cabient_PSU_Prim12_value 0x1030
  364. #define _Version_Cabient_PSU_Sec7_value 0x1040
  365. #define _Version_Cabient_PSU_Sec8_value 0x1050
  366. #define _Version_Cabient_PSU_Sec9_value 0x1060
  367. #define _Version_Cabient_PSU_Sec10_value 0x1070
  368. #define _Version_Cabient_PSU_Sec11_value 0x1080
  369. #define _Version_Cabient_PSU_Sec12_value 0x1090
  370. #define _Version_Dispenser_Name_Text 0x07A0
  371. #define _Version_Dispenser_BootLoader_Text 0x07B0
  372. #define _Version_Dispenser_Kernel_Text 0x07C0
  373. #define _Version_Dispenser_CSU_Text 0x07D0
  374. #define _Version_Dispenser_Relay_Text 0x07E0
  375. #define _Version_Dispenser_Fan_Text 0x07F0
  376. #define _Version_Dispenser_Priamry_Text 0x0800
  377. #define _Version_Dispenser_LCM_Text 0x0810
  378. #define _Version_Dispenser_LED_Text 0x0820
  379. #define _Version_Dispenser_Connector0_Text 0x0830
  380. #define _Version_Dispenser_Connector1_Text 0x0840
  381. #define _Version_Dispenser_IPAddr_Text 0x0850
  382. #define _Version_Dispenser_Model_value 0x0860
  383. #define _Version_Dispenser_BootLoader_value 0x0870
  384. #define _Version_Dispenser_Kernel_value 0x0880
  385. #define _Version_Dispenser_CSU_value 0x0890
  386. #define _Version_Dispenser_Relay_value 0x08A0
  387. #define _Version_Dispenser_Fan_value 0x08B0
  388. #define _Version_Dispenser_Priamry_value 0x08C0
  389. #define _Version_Dispenser_LCM_value 0x08D0
  390. #define _Version_Dispenser_LED_value 0x08E0
  391. #define _Version_Dispenser_Connector0_value 0x08F0
  392. #define _Version_Dispenser_Connector1_value 0x0900
  393. #define _Version_Dispenser_IPAddr_value 0x0910
  394. #endif //MODULE_LCM_CTRL_H_