CUER
/
charger_code
Code to run on the charger board (used to charge the car from the mains).
Diff: CANParserCharger.h
- Revision:
- 1:0c77e20b4d4c
- Child:
- 3:a7626dffb64a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CANParserCharger.h Thu Jul 06 21:27:26 2017 +0000 @@ -0,0 +1,18 @@ +#include "CAN_Data.h" +#include "CAN_IDs.h" + +#ifndef CANParserCharger_H +#define CANParserCharger_H + +#define CHARGER_CAN_BIT_RATE 250000 //note this is different to the car CAN bit rate + +//@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); +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); + +#endif \ No newline at end of file