Module_EvComm.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #ifndef MODULE_EVCOMM_H_
  2. #define MODULE_EVCOMM_H_
  3. #include <stdbool.h>
  4. int CanFd;
  5. int CanFd2;
  6. typedef unsigned char byte;
  7. extern struct Ev_Board_Cmd
  8. {
  9. int none;
  10. int address_assignment;
  11. int get_firmware_ver;
  12. int get_hardware_ver;
  13. int charging_permission;
  14. int present_input_power;
  15. int present_input_requirement;
  16. int get_evse_output_status;
  17. int get_evse_capacity_info;
  18. int evse_stop_charging;
  19. int get_miscellaneous_info;
  20. int download_req;
  21. int start_block_transfer;
  22. int data_transfer;
  23. int download_finish;
  24. int isolation_status;
  25. int evse_precharge_info;
  26. }Ev_Cmd;
  27. extern struct Ev_Cmd_Dir
  28. {
  29. unsigned short master_to_slave;
  30. unsigned short slave_to_master;
  31. }Ev_Dir;
  32. struct timeval _id_assign_time;
  33. // Send msg to can-bus
  34. void SetTargetAddr(byte *target_number, byte index);
  35. void GetFirmwareVersion(byte gun_index, byte toId);
  36. void GetHardwareVersion(byte gun_index, byte toId);
  37. void SetChargingPermission(byte gun_index, byte permissionStatus, short aOutputPw, short aOutputVol, short aOutputCur, byte toId);
  38. void SetPresentOutputPower(short outputVol_b1, short outputCur_b1, short outputVol_b2, short outputCur_b2);
  39. void SetPresentOutputCapacity(short aOutputPw_b1, short aOutputCur_b1, short aOutputPw_b2, short aOutputCur_b2);
  40. void GetOutputReq(byte gun_index, byte toId);
  41. void GetEvBatteryInfo(byte gun_index, byte toId);
  42. void GetMiscellaneousInfo(byte gun_index, byte toId, short K1K2Status, short soc);
  43. void SetIsolationStatus(byte gun_index, byte result, byte toId);
  44. void SetEvsePrechargeInfo(byte gun_index, byte result, byte toId);
  45. // 發送電樁主動停止充電結果及原因
  46. void EvseStopChargingEvent(byte stopResult, byte *stopReason, byte toId);
  47. void setBootNotification1();
  48. void setVCCU_Requests(byte *data, byte dataLen);
  49. void setVCCU_ChargeFromVehicle(byte *data, byte dataLen);
  50. void setVCCU_V2G_EVMaximumVoltageLimit(byte *data, byte dataLen);
  51. void setVCCU_V2G_EVMaximumCurrentLimit(byte *data, byte dataLen);
  52. void setVCCU_V2G_EVTargetVoltage(byte *data, byte dataLen);
  53. void setVCCU_V2G_EVTargetCurrent(byte *data, byte dataLen);
  54. void setVCCU_V2G_VehicleStatus(byte *data, byte dataLen);
  55. void setVCCU_V2G_RemainingTimeToFullSO(byte *data, byte dataLen);
  56. void setEVStatus1(byte evstatus);
  57. void setEVStatus2(byte evstatus);
  58. void setMisc(byte toId, float K1K2Status, float soc);
  59. void VCCU_TD();
  60. void SetPresentInputPower(short outputVol_b1, short outputCur_b1, byte toId);
  61. void SetPresentInputRequirement(short aOutputPw_b1, short aOutputCur_b1, short aOutputPw_b2, short aOutputCur_b2, byte toId);
  62. // Receive msg From can-bus.
  63. enum Receieve_PSU_msgf
  64. {
  65. // 車端主動
  66. ADDRESS_REQ = 0x080001FF,
  67. EV_BOARD_STATUS_NOTIFICATION = 0x08000300,//03
  68. NOTIFICATION_EV_STOP = 0x08000B00,
  69. // 車端回應
  70. ACK_EV_FW_VERSION = 0x08000400,//04
  71. ACK_EV_HW_VERSION = 0x08000500,//05
  72. ACK__GET_EVSE_OUTPUT_STATUS = 0x08000900,//
  73. ACK_GET_EVSE_Capacity_INFO = 0x08000A00,
  74. ACK_GET_MISCELLANEOUS_INFO = 0x08000D00,
  75. ACK_EVSE_ISOLATION_STATUS = 0x08001200,
  76. ACK_EVSE_PRECHAGE_INFO = 0x08001500,
  77. };
  78. #endif /* MODULE_EVCOMM_H_ */