Module_EvComm.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef MODULE_EVCOMM_H_
  2. #define MODULE_EVCOMM_H_
  3. #include <stdbool.h>
  4. int CanFd;
  5. typedef unsigned char byte;
  6. extern struct Ev_Board_Cmd
  7. {
  8. int none;
  9. int address_assignment;
  10. int get_firmware_ver;
  11. int get_hardware_ver;
  12. int charging_permission;
  13. int present_output_power;
  14. int present_output_cap;
  15. int get_output_req;
  16. int get_battery_info;
  17. int evse_stop_charging;
  18. int get_miscellaneous_info;
  19. int download_req;
  20. int start_block_transfer;
  21. int data_transfer;
  22. int download_finish;
  23. int isolation_status;
  24. int evse_precharge_info;
  25. }Ev_Cmd;
  26. extern struct Ev_Cmd_Dir
  27. {
  28. unsigned short master_to_slave;
  29. unsigned short slave_to_master;
  30. }Ev_Dir;
  31. struct timeval _id_assign_time;
  32. // Send msg to can-bus
  33. void SetTargetAddr(byte *target_number, byte index);
  34. void GetFirmwareVersion(byte gun_index, byte toId);
  35. void GetHardwareVersion(byte gun_index, byte toId);
  36. void SetChargingPermission(byte gun_index, byte permissionStatus, short aOutputPw, short aOutputVol, short aOutputCur, byte toId);
  37. void SetPresentOutputPower(short outputVol_b1, short outputCur_b1, short outputVol_b2, short outputCur_b2);
  38. void SetPresentOutputCapacity(short aOutputPw_b1, short aOutputCur_b1, short aOutputPw_b2, short aOutputCur_b2);
  39. void GetOutputReq(byte gun_index, byte toId);
  40. void GetEvBatteryInfo(byte gun_index, byte toId);
  41. void GetMiscellaneousInfo(byte gun_index, byte toId);
  42. void SetIsolationStatus(byte gun_index, byte result, byte toId);
  43. void SetEvsePrechargeInfo(byte gun_index, byte result, byte toId);
  44. // 發送電樁主動停止充電結果及原因
  45. void EvseStopChargingEvent(byte stopResult, byte *stopReason, byte toId);
  46. // Receive msg From can-bus.
  47. enum Receieve_PSU_msgf
  48. {
  49. // 車端主動
  50. ADDRESS_REQ = 0x080001FF,
  51. NOTIFICATION_EV_STATUS = 0x08000300,
  52. NOTIFICATION_EV_STOP = 0x08000B00,
  53. // 車端回應
  54. ACK_EV_FW_VERSION = 0x08000400,
  55. ACK_EV_HW_VERSION = 0x08000500,
  56. ACK_GET_OUTPUT_REQ = 0x08000900,
  57. ACK_GET_EV_BATTERY_INFO = 0x08000A00,
  58. ACK_GET_MISCELLANEOUS_INFO = 0x08000D00,
  59. ACK_EVSE_ISOLATION_STATUS = 0x08001200,
  60. ACK_EVSE_PRECHAGE_INFO = 0x08001500,
  61. };
  62. #endif /* MODULE_EVCOMM_H_ */