#ifndef MODULE_EVCOMM_H_ #define MODULE_EVCOMM_H_ #include int CanFd; int CanFd2; typedef unsigned char byte; extern struct Ev_Board_Cmd { int none; int address_assignment; int get_firmware_ver; int get_hardware_ver; int charging_permission; int present_input_power; int present_input_requirement; int get_evse_output_status; int get_evse_capacity_info; int evse_stop_charging; int get_miscellaneous_info; int download_req; int start_block_transfer; int data_transfer; int download_finish; int isolation_status; int evse_precharge_info; }Ev_Cmd; extern struct Ev_Cmd_Dir { unsigned short master_to_slave; unsigned short slave_to_master; }Ev_Dir; struct timeval _id_assign_time; // Send msg to can-bus void SetTargetAddr(byte *target_number, byte index); void GetFirmwareVersion(byte gun_index, byte toId); void GetHardwareVersion(byte gun_index, byte toId); void SetChargingPermission(byte gun_index, byte permissionStatus, short aOutputPw, short aOutputVol, short aOutputCur, byte toId); void SetPresentOutputPower(short outputVol_b1, short outputCur_b1, short outputVol_b2, short outputCur_b2); void SetPresentOutputCapacity(short aOutputPw_b1, short aOutputCur_b1, short aOutputPw_b2, short aOutputCur_b2); void GetOutputReq(byte gun_index, byte toId); void GetEvBatteryInfo(byte gun_index, byte toId); void GetMiscellaneousInfo(byte gun_index, byte toId, short K1K2Status, short soc); void SetIsolationStatus(byte gun_index, byte result, byte toId); void SetEvsePrechargeInfo(byte gun_index, byte result, byte toId); // 發送電樁主動停止充電結果及原因 void EvseStopChargingEvent(byte stopResult, byte *stopReason, byte toId); void setBootNotification1(); void setVCCU_Requests(byte *data, byte dataLen); void setVCCU_ChargeFromVehicle(byte *data, byte dataLen); void setVCCU_V2G_EVMaximumVoltageLimit(byte *data, byte dataLen); void setVCCU_V2G_EVMaximumCurrentLimit(byte *data, byte dataLen); void setVCCU_V2G_EVTargetVoltage(byte *data, byte dataLen); void setVCCU_V2G_EVTargetCurrent(byte *data, byte dataLen); void setVCCU_V2G_VehicleStatus(byte *data, byte dataLen); void setVCCU_V2G_RemainingTimeToFullSO(byte *data, byte dataLen); void setEVStatus1(byte evstatus); void setEVStatus2(byte evstatus); void setMisc(byte toId, float K1K2Status, float soc); void VCCU_TD(); void SetPresentInputPower(short outputVol_b1, short outputCur_b1, byte toId); void SetPresentInputRequirement(short aOutputPw_b1, short aOutputCur_b1, short aOutputPw_b2, short aOutputCur_b2, byte toId); // Receive msg From can-bus. enum Receieve_PSU_msgf { // 車端主動 ADDRESS_REQ = 0x080001FF, EV_BOARD_STATUS_NOTIFICATION = 0x08000300,//03 NOTIFICATION_EV_STOP = 0x08000B00, // 車端回應 ACK_EV_FW_VERSION = 0x08000400,//04 ACK_EV_HW_VERSION = 0x08000500,//05 ACK__GET_EVSE_OUTPUT_STATUS = 0x08000900,// ACK_GET_EVSE_Capacity_INFO = 0x08000A00, ACK_GET_MISCELLANEOUS_INFO = 0x08000D00, ACK_EVSE_ISOLATION_STATUS = 0x08001200, ACK_EVSE_PRECHAGE_INFO = 0x08001500, }; #endif /* MODULE_EVCOMM_H_ */