Cell voltages fork (SoC)
Dependencies: CUER_CAN CUER_DS1820 LTC2943 LTC6804 mbed PowerControl
CANParserBMU.h@14:e0e88a009f4c, 2017-07-02 (annotated)
- Committer:
- maxv008
- Date:
- Sun Jul 02 01:45:39 2017 +0000
- Revision:
- 14:e0e88a009f4c
- Parent:
- 13:7b42af989cd1
- Child:
- 18:521ffdd724f3
Added a proper unique identification to the temperature CAN. Implemented an interrupt based CAN read setup, currently configured with Dummy data and test code that will be cleaned up in a future commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lcockerton62 | 0:0a5f554d2a16 | 1 | #include "CAN_Data.h" |
lcockerton62 | 0:0a5f554d2a16 | 2 | #include "CAN_IDs.h" |
lcockerton62 | 1:51477fe4851b | 3 | #include "Data_Types_BMU.h" |
lcockerton62 | 0:0a5f554d2a16 | 4 | |
lcockerton62 | 0:0a5f554d2a16 | 5 | #ifndef CANParserBMU_H |
lcockerton62 | 0:0a5f554d2a16 | 6 | #define CANParserBMU_H |
lcockerton62 | 0:0a5f554d2a16 | 7 | |
lcockerton62 | 0:0a5f554d2a16 | 8 | //@TODO Move these definitions elsewhere ideally into CAN_IDS.h |
lcockerton62 | 0:0a5f554d2a16 | 9 | #define BATTERY_SOC_BASE_ID 0xF5 |
lcockerton62 | 0:0a5f554d2a16 | 10 | #define MAX_MIN_VOLTAGE 0xF8 |
lcockerton62 | 0:0a5f554d2a16 | 11 | #define BLANK_DATA 0x00 |
lcockerton62 | 0:0a5f554d2a16 | 12 | #define MAX_MIN_TEMPERATURE 0xF9 |
lcockerton62 | 0:0a5f554d2a16 | 13 | #define BATTERY_PACK_STATUS_ID 0xFA |
lcockerton62 | 0:0a5f554d2a16 | 14 | |
lcockerton62 | 0:0a5f554d2a16 | 15 | //@TODO add some comments |
maxv008 | 14:e0e88a009f4c | 16 | CANMessage createTemperatureTelemetry(uint8_t offset, char * ROMID, float Temperature); |
maxv008 | 13:7b42af989cd1 | 17 | |
maxv008 | 13:7b42af989cd1 | 18 | individual_temperature decodeTemperatureTelemetry(CANMessage msg); |
lcockerton62 | 0:0a5f554d2a16 | 19 | |
lcockerton62 | 0:0a5f554d2a16 | 20 | CANMessage createVoltageTelemetry(int ID, uint16_t voltage[]); |
lcockerton62 | 0:0a5f554d2a16 | 21 | |
lcockerton62 | 0:0a5f554d2a16 | 22 | CANMessage createPackSOC(float SOC, float percentageCharge); |
lcockerton62 | 0:0a5f554d2a16 | 23 | |
lcockerton62 | 0:0a5f554d2a16 | 24 | CANMessage createPackBalanceSOC(float SOC, float percentageCharge); |
lcockerton62 | 0:0a5f554d2a16 | 25 | |
lcockerton62 | 1:51477fe4851b | 26 | CANMessage createCellVoltageMAXMIN(pack_voltage_extremes max_voltage, pack_voltage_extremes min_voltage); |
lcockerton62 | 0:0a5f554d2a16 | 27 | |
lcockerton62 | 1:51477fe4851b | 28 | CANMessage createCellTemperatureMAXMIN(pack_temperature_extremes min_temperature, pack_temperature_extremes max_temperature); |
lcockerton62 | 0:0a5f554d2a16 | 29 | |
lcockerton62 | 0:0a5f554d2a16 | 30 | CANMessage createBatteryVI(uint32_t batteryVoltage,uint32_t batteryCurrent); |
lcockerton62 | 0:0a5f554d2a16 | 31 | |
lcockerton62 | 0:0a5f554d2a16 | 32 | CANMessage createBatteryPackStatus(uint16_t voltageThreshold[], uint8_t statusFlag,uint8_t BMS_CMU_Count,uint16_t BMS_Firmware_Build); |
lcockerton62 | 0:0a5f554d2a16 | 33 | |
lcockerton62 | 1:51477fe4851b | 34 | CANMessage createExtendedBatteryPackStatus(uint32_t status); |
lcockerton62 | 0:0a5f554d2a16 | 35 | |
lcockerton62 | 0:0a5f554d2a16 | 36 | |
lcockerton62 | 0:0a5f554d2a16 | 37 | union float2byte { |
lcockerton62 | 1:51477fe4851b | 38 | float f; |
lcockerton62 | 1:51477fe4851b | 39 | char b[sizeof(float)]; |
lcockerton62 | 0:0a5f554d2a16 | 40 | }; |
lcockerton62 | 0:0a5f554d2a16 | 41 | |
lcockerton62 | 0:0a5f554d2a16 | 42 | #endif |