/* * lcmComm_dwin.h * * Created on : 2020-10-20 * Update on : XXXX-XX-XX * Author : Folus Wen, Eason Yang * Version : D0.01 * */ #ifndef LCMCOMM_DGUS_H_ #define LCMCOMM_DGUS_H_ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define DEBUG_INFO(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__), __LINE__, __FUNCTION__, ##args) #define DEBUG_WARN(format, args...) StoreLogMsg("[%s:%d][%s][Warn] "format, (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__), __LINE__, __FUNCTION__, ##args) #define DEBUG_ERROR(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__), __LINE__, __FUNCTION__, ##args) #define ARRAY_SIZE(A) (sizeof(A) / sizeof(A[0])) #define PASS 1 #define FAIL -1 #define YES 1 #define NO 0 #define ON 1 #define OFF 0 #define PAGE_DISPLAY_PERIOD 3 //======================================= // Register Control type //======================================= #define REG_TYPE_CONTROL 0x00 #define REG_TYPE_RAM 0x01 #define REG_TYPE_SPECIAL_CONTROL 0x02 //======================================= // Register content (Variable storage) //======================================= #define REG_ADDRESS_READ_VERSION 0x0F #define REG_ADDRESS_READ_RTC 0x10 #define REG_ADDRESS_READ_PAGE_ID 0x14 #define REG_ADDRESS_READ_BRIGHTNESS 0x31 #define REG_ADDRESS_SET_PAGE_ID 0x84 #define REG_ADDRESS_SET_RTC 0x9C //======================================= // LCD command constant //======================================= #define CMD_HEADER_1 0x5A #define CMD_HEADER_2 0xA5 #define CMD_REG_WRITE 0x80 #define CMD_REG_READ 0x81 #define CMD_REG_WRITE_DATA 0x82 #define CMD_REG_READ_DATA 0x83 //======================================= // LCD system screen //======================================= #define SYSTEM_SCREEN_BOOTING 0x00 #define SYSTEM_SCREEN_IDLE 0x01 #define SYSTEM_SCREEN_PREPARING 0x02 #define SYSTEM_SCREEN_PREPARE_FOR_EVSE 0x03 #define SYSTEM_SCREEN_CHARGING 0x04 #define SYSTEM_SCREEN_COMPLETE 0x05 #define SYSTEM_SCREEN_MAINTAIN 0x06 #define SYSTEM_SCREEN_AUTH_PASS 0x07 #define SYSTEM_SCREEN_AUTH_FAIL 0x08 #define SYSTEM_SCREEN_AUTH_UNKNOW 0x09 #define SYSTEM_SCREEN_TERMINATING 0X0A //======================================= // Parameter to change icon status //======================================= #define DISAPPEAR 0x00 #define APPEAR 0x01 #define BACKEND_OFFLINE 0x01 #define BACKEND_ONLINE 0x02 #define ETHERENT_OFFLINE 0x03 #define EHTERNET_ONLINE 0x04 #define WIFI_OFFLINE 0x05 #define WIFI_ONLINE 0x06 #define TELECOM_OFFLINE 0x07 #define TELECOM_ONLINE 0x08 #define PRICE_DISAPPEAR 0x00 #define PRICE_APPEAR 0x01 #define RFID_DISABLE 0x01 #define RFID_ENABLE 0x02 #define VISA_DISABLE 0x03 #define VISA_ENABLE 0x04 #define PLUGIN_ARROW_1 0x01 #define PLUGIN_ARROW_2 0x02 #define BATTERY_MAP 0x01 #define BATTERY_CAPACITY_EMPTY 0x02 #define BATTERY_CAPACITY_20 0x03 #define BATTERY_CAPACITY_40 0x04 #define BATTERY_CAPACITY_60 0x05 #define BATTERY_CAPACITY_80 0x06 #define BATTERY_CAPACITY_100 0x07 #define CONNECTION_QUESTION_MARK_1 0x01 #define CONNECTION_QUESTION_MARK_2 0x02 #define CONNECTION_ELECTRIC_MARK_1 0x03 #define CONNECTION_ELECTRIC_MARK_2 0x04 #define TIMER_DARK 0x01 #define TIMER_LIGHT 0x02 #define POWER_DARK 0x01 #define POWER_LIGHT 0x02 #define ENERGY_DARK 0x01 #define ENERGY_LIGHT 0x02 #define ELECTRICITY_DIRECTION_RIGHT 0x01 #define ELECTRICITY_DIRECTION_LEFT 0x02 #define WALLET_COMPELTE_DISAPPEAR 0x00 #define WALLET_COMPLETE_APPEAR 0x01 #define BATTERY_SOC_EMPTY 0x01 #define BATTERY_SOC_20 0x02 #define BATTERY_SOC_40 0x03 #define BATTERY_SOC_60 0x04 #define BATTERY_SOC_80 0x05 #define BATTERY_SOC_100 0x06 #define CONNECTION_COMPLETE_MARK 0x01 #define TIMER_COMPLETE_DISAPPEAR 0x00 #define TIMER_COMPLETE_APPEAR 0x01 #define COST_COMPLETE_DISAPPER 0x00 #define COST_COMPLETE_APPEAR 0x01 #define ENERGY_COMPLETE_DISAPPER 0x00 #define ENERGY_COMPLETE_APPEAR 0x01 #define VALID_WALLET_DISAPPER 0x00 #define VALID_WALLET_APPEAR 0x01 #define QRCODE_DISABLE 0x01 #define QRCODE_ENABLE 0x02 #define QRCODE_BANDED 0x03 //======================================= // Icon variable address start from 1000 //======================================= #define ICON_ALARM_1 0x1000 #define ICON_ALARM_2 0x1001 #define ICON_ALARM_3 0x1002 #define ICON_ALARM_4 0x1003 #define ICON_4G_CONNECTION 0x1004 #define ICON_WIFI_CONNECTION 0x1005 #define ICON_ETHERENT_CONNECTION 0x1006 #define ICON_BACKEND_CONNECTION 0x1007 #define ICON_PRICE 0x1008 #define ICON_RFID 0x1009 #define ICON_QRCODE 0x100A #define ICON_PLUGIN_ARROW 0x100B #define ICON_BATTERY_PRECHARGING 0x100C #define ICON_CONNECTION_PRECHARGING 0x100D #define ICON_TIMER_PRECHARGING 0x100E #define ICON_POWER_PRECHARGING 0x100F #define ICON_ENERGY_PRECHARGING 0x1010 #define ICON_BATTERY_CHARGING 0x1011 #define ICON_CONNECTION_CHARGING 0x1012 #define ICON_ELECTRICITY_DIRECTION 0x1013 #define ICON_TIMER_CHARGING 0x1014 #define ICON_POWER_CHARGING 0x1015 #define ICON_ENERGY_CHARGING 0x1016 #define ICON_WALLER_COMPLETE 0x1017 #define ICON_BATTERY_COMPLETE 0x1018 #define ICON_CONNECTION_COMPLETE 0x1019 #define ICON_TIMER_COMPLETE 0x101A #define ICON_COST_COMPLETE 0X101B #define ICON_ENERGY_COMPLETE 0X101C #define ICON_BALANCE_WALLET 0x101D #define ICON_LOGO 0x1500 #define ICON_LOGO_CHARGING 0x1501 //======================================= // Text content address start from 2000 //======================================= #define TEXT_ALARM_CODE_1 0x2000 // size 6 #define TEXT_ALARM_CODE_2 0x2006 // size 6 #define TEXT_ALARM_CODE_3 0x200C // size 6 #define TEXT_ALARM_CODE_4 0x2012 // size 6 #define TEXT_PRICE 0x2018 // size 16 #define TEXT_CURRENCY_UNIT 0x2028 // size 16 #define TEXT_TIMER_PRECHARGING 0x2038 // size 16 #define TEXT_POWER_PRECHARGING 0x2048 // size 16 #define TEXT_ENERGY_PRECHARGING 0x2058 // size 16 #define TEXT_TIMER_CHARGING 0x2068 // size 16 #define TEXT_POWER_CHARGING 0x2078 // size 16 #define TEXT_ENERGY_CHARGING 0x2088 // size 16 #define TEXT_COST_COMPLETE 0x2098 // size 16 #define TEXT_ACCOUNT_COMPLETE 0x20A8 // size 16 #define TEXT_BALANCE 0x20B8 // size 16 #define TEXT_PERCENTAGE 0x20C8 // size 6 #define TEXT_RTC 0X2500 // size 32 //======================================= // QR Code content address start from 5000 //======================================= #define TEXT_QRCODE_CONTENT 0x3000 //======================================= // 4G + WIFI connection flags (Header) //======================================= #define DISABLE_4G 0x00 #define ENABLE_4G 0x01 #define DISABLE_WIFI 0x00 #define WIFI_STATION 0x01 #define WIFI_ACCESS_POINT 0x02 //======================================= // Battery level status (Charging) //======================================= #define BATTERY_LEVEL_0 0x00 #define BATTERY_LEVEL_1 0x01 #define BATTERY_LEVEL_2 0x02 #define BATTERY_LEVEL_3 0x03 #define BATTERY_LEVEL_4 0x04 #define BATTERY_LEVEL_5 0x05 //======================================= // CConnection level status (Charging) //======================================= #define CONNECTION_LEVEL_0 0x00 #define CONNECTION_LEVEL_1 0x01 //======================================= // Gun plug-in level status (Preparing) //======================================= #define GUN_PLUGING_LEVEL_0 0x00 #define GUN_PLUGING_LEVEL_1 0x01 //======================================= // RFID authorization constant //======================================= #define VALIDATED_RFID 0x00 #define UNVALIDATED_RFID 0x01 #define UNKNOW_RFID 0x02 //======================================= // Normal mode or CCS mode constant //======================================= #define BASIC_MODE 0x00 #define CCS_MODE 0x01 extern int StoreLogMsg(const char *fmt, ...); extern int8_t lcdRegisterWrite(int32_t fd, uint8_t regType, uint16_t address, uint8_t *data, uint16_t dataLen); extern int8_t lcdRegisterRead(int32_t fd, uint8_t regType, uint16_t address, uint8_t *data, uint16_t dataLen); #endif /* LCMCOMM_DGUS_H_ */