1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- #ifndef _MAIN_H_
- #define _MAIN_H_
- //------------------------------------------------------------------------------
- #include <stdint.h>
- //------------------------------------------------------------------------------
- #define MODELNAME_FAIL 0
- #define BUFFER_SIZE 128
- #define BTN_RELEASE 0
- #define BTN_PRESS 1
- #define MAX_BUF 64
- #define MtdBlockSize 0x600000
- #define SYSFS_GPIO_DIR "/sys/class/gpio"
- #define UPGRADE_FAN 0x02
- #if defined DD360 ||defined DD360Audi || defined DD360ComBox
- #define UPGRADE_RB 0x09 //0x09 for DD360 dispenser
- #else
- #define UPGRADE_RB 0x03 //other module use
- #endif //defined DD360 || defined DD360Audi
- #define UPGRADE_PRI 0x04
- #define UPGRADE_AC 0x05
- #define UPGRADE_LED 0x06
- #define SYSTEM_MIN_VOL 80 //150
- #define MIN_OUTPUT_CUR 0
- #define AC_OUTPUT_VOL 220
- #define DEFAULT_AC_INDEX 2
- #define PSU_MIN_CUR 100
- //#define DB_FILE "/Storage/ChargeLog/localCgargingRecord.db"
- #define uSEC_VAL 1000000
- #define SELFTEST_TIMEOUT 60//45
- #define AUTHORIZE_TIMEOUT 15//30
- #define AUTHORIZE_COMP_TIMEOUT 3
- #define AUTHORIZE_FAIL_TIMEOUT 3
- #define AUTHORIZE_STOP_TIMEOUT 30
- #define RETURN_TO_CHARGING_PAGE 30
- #define GUN_PREPARE_TIMEOUT 30
- #define GUN_EV_WAIT_TIMEOUT 120
- #define GUN_EVSE_WAIT_TIMEOUT 60
- #define GUN_COMP_WAIT_TIMEOUT 10
- #define GUN_PRECHARGING_TIMEOUT 60
- //#define log_info(format, args...) StoreLogMsg_1("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
- //#define log_warn(format, args...) StoreLogMsg_1("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
- //#define log_error(format, args...) StoreLogMsg_1("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
- //------------------------------------------------------------------------------
- typedef struct StLedConfig {
- //OutputDrvValue[0]
- uint8_t LeftButtonLed: 1; //bit 0, H: ON, L:OFF
- uint8_t RightButtonLed: 1; //bit 1, H: ON, L:OFF
- uint8_t GreenLED: 1; //bit 2, H: ON, L:OFF
- uint8_t YellowLED: 1; //bit 3, H: ON, L:OFF
- uint8_t RedLED: 1; //bit 4, H: ON, L:OFF
- uint8_t SystemLed4: 1; //bit 5, H: ON, L:OFF
- uint8_t AcContactor: 1; //bit 6, H: ON, L:OFF
- uint8_t Reserved: 1; //bit 7 reserved
- } LedConfig;
- //------------------------------------------------------------------------------
- bool isDetectPlugin(void);
- void _DetectPlugInTimeout(void);
- void StartSystemTimeoutDet(uint8_t flag);
- void StopSystemTimeoutDet(void);
- void StartGunInfoTimeoutDet(uint8_t gunIndex, uint8_t flag);
- void StopGunInfoTimeoutDet(uint8_t gunIndex);
- void AuthorizingStart(void);
- bool IsAuthorizingMode(void);
- bool isAuthorizedComplete(void);
- void ClearAuthorizedFlag(void);
- void ChargingAlarmProcess(uint8_t gunIndex);
- void StopChargingProcessByString(uint8_t level);
- void EmcOccureByString(char *code);
- void ReleaseEmsOccureByString(uint8_t index, char *code);
- void confirmSelGun(uint8_t selGun);
- void destroySelGun(uint8_t curGun);
- int getConfirmSelectedGun(uint8_t curSel);
- void setSelGunWaitToAuthor(uint8_t curSel);
- void ChargingTerminalProcess(uint8_t gunIndex);
- void AcChargingTerminalProcess(void);
- void ChangeGunSelectByIndex(uint8_t sel);
- void setChargerMode(uint8_t gun_index, uint8_t mode);
- void KillAllTask(void);
- void KillTask(void);
- #endif /* _MAIN_H_ */
|