CUER
/
charger_code
Code to run on the charger board (used to charge the car from the mains).
CANParserCharger.h@1:0c77e20b4d4c, 2017-07-06 (annotated)
- Committer:
- DasSidG
- Date:
- Thu Jul 06 21:27:26 2017 +0000
- Revision:
- 1:0c77e20b4d4c
- Child:
- 3:a7626dffb64a
Code majorly changed:; ; Structure changed significantly; All of the CAN-related functions, structures etc. added (but not yet tested); Still need to add some of the main program logic in terms of deciding when/when not to charge etc
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
DasSidG | 1:0c77e20b4d4c | 1 | #include "CAN_Data.h" |
DasSidG | 1:0c77e20b4d4c | 2 | #include "CAN_IDs.h" |
DasSidG | 1:0c77e20b4d4c | 3 | |
DasSidG | 1:0c77e20b4d4c | 4 | #ifndef CANParserCharger_H |
DasSidG | 1:0c77e20b4d4c | 5 | #define CANParserCharger_H |
DasSidG | 1:0c77e20b4d4c | 6 | |
DasSidG | 1:0c77e20b4d4c | 7 | #define CHARGER_CAN_BIT_RATE 250000 //note this is different to the car CAN bit rate |
DasSidG | 1:0c77e20b4d4c | 8 | |
DasSidG | 1:0c77e20b4d4c | 9 | //@TODO add some comments |
DasSidG | 1:0c77e20b4d4c | 10 | |
DasSidG | 1:0c77e20b4d4c | 11 | void get_charger_control_info(CANMessage msg, float &_voltage_error, float &_temp_margin, float &_discharge_error, float &_pack_capacity); |
DasSidG | 1:0c77e20b4d4c | 12 | void get_max_min_voltage(CANMessage msg, float &_min_cell_voltage, float &_max_cell_voltage); |
DasSidG | 1:0c77e20b4d4c | 13 | void get_battery_status(CANMessage msg, bool &error); |
DasSidG | 1:0c77e20b4d4c | 14 | void get_charger_VI_info(CANMessage msg, float &_charger_voltage, float &_charger_current, uint8_t &_charger_status); |
DasSidG | 1:0c77e20b4d4c | 15 | CANMessage generate_charger_control_msg(float _desired_voltage, float _desired_current, uint8_t _charger_control); |
DasSidG | 1:0c77e20b4d4c | 16 | CANMessage generate_charger_info_msg(float _charger_voltage, float _charger_current, uint8_t _charger_status); |
DasSidG | 1:0c77e20b4d4c | 17 | |
DasSidG | 1:0c77e20b4d4c | 18 | #endif |