CUER
/
charger_code
Code to run on the charger board (used to charge the car from the mains).
Diff: CANParserCharger.h
- Revision:
- 5:756fae795d37
- Parent:
- 4:f6459580c312
- Child:
- 7:70cf5bff23f9
diff -r f6459580c312 -r 756fae795d37 CANParserCharger.h --- a/CANParserCharger.h Thu Jul 27 21:21:32 2017 +0000 +++ b/CANParserCharger.h Sun Jul 30 22:59:37 2017 +0000 @@ -3,10 +3,11 @@ #include "CAN_Data.h" #include "CAN_IDs.h" +#include "charger.h" -#define CHARGER_CAN_BIT_RATE 250000 //note this is different to the car CAN bit rate +#define CHARGER_CAN_BIT_RATE 250000 //note this is different to the car CAN bit rate, this is fixed by the charger #define CHARGER_VI_CONTROL_ID 0x1806E5F4 #define CHARGER_VI_INFO_ID 0x18FF50E5 @@ -16,10 +17,11 @@ //@TODO add some comments -void get_charger_control_info(CANMessage msg, float &_voltage_error, float &_temp_margin, float &_discharge_error, float &_pack_capacity); void get_max_min_voltage(CANMessage msg, float &_min_cell_voltage, float &_max_cell_voltage); void get_battery_status(CANMessage msg, bool &error); void get_charger_VI_info(CANMessage msg, float &_charger_voltage, float &_charger_current, uint8_t &_charger_status); +void check_precharge_status (CANMessage msg, bool &_precharge_ready); + CANMessage generate_charger_control_msg(float _desired_voltage, float _desired_current, uint8_t _charger_control); CANMessage generate_charger_info_msg(float _charger_voltage, float _charger_current, uint8_t _charger_status); CANMessage generate_charging_finished_msg(); //When this packet is received by the BMU, it causes the BMU to reset its SoC value to 100%