Has base BMU code but sends dummy temperature and voltage readings to test CAN
Dependencies: CUER_CAN DS1820 LTC2943 LTC6804 mbed
Fork of BMS_BMUCore_Max by
CANParserBMU.h@0:0a5f554d2a16, 2016-12-22 (annotated)
- Committer:
- lcockerton62
- Date:
- Thu Dec 22 15:11:29 2016 +0000
- Revision:
- 0:0a5f554d2a16
- Child:
- 1:51477fe4851b
Initial commit: Added a basic overview of the code in main, added CANParserBMU and defined some data structures
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 | 0:0a5f554d2a16 | 3 | |
lcockerton62 | 0:0a5f554d2a16 | 4 | #ifndef CANParserBMU_H |
lcockerton62 | 0:0a5f554d2a16 | 5 | #define CANParserBMU_H |
lcockerton62 | 0:0a5f554d2a16 | 6 | |
lcockerton62 | 0:0a5f554d2a16 | 7 | //@TODO Move these definitions elsewhere ideally into CAN_IDS.h |
lcockerton62 | 0:0a5f554d2a16 | 8 | #define BATTERY_SOC_BASE_ID 0xF5 |
lcockerton62 | 0:0a5f554d2a16 | 9 | #define MAX_MIN_VOLTAGE 0xF8 |
lcockerton62 | 0:0a5f554d2a16 | 10 | #define BLANK_DATA 0x00 |
lcockerton62 | 0:0a5f554d2a16 | 11 | #define MAX_MIN_TEMPERATURE 0xF9 |
lcockerton62 | 0:0a5f554d2a16 | 12 | #define BATTERY_PACK_STATUS_ID 0xFA |
lcockerton62 | 0:0a5f554d2a16 | 13 | |
lcockerton62 | 0:0a5f554d2a16 | 14 | //@TODO add some comments |
lcockerton62 | 0:0a5f554d2a16 | 15 | CANMessage createTemperatureTelemetry(int ID, uint32_t CMUSerialNumber, uint16_t PCBTemperature, uint16_t cellTemperature); |
lcockerton62 | 0:0a5f554d2a16 | 16 | |
lcockerton62 | 0:0a5f554d2a16 | 17 | CANMessage createVoltageTelemetry(int ID, uint16_t voltage[]); |
lcockerton62 | 0:0a5f554d2a16 | 18 | |
lcockerton62 | 0:0a5f554d2a16 | 19 | CANMessage createPackSOC(float SOC, float percentageCharge); |
lcockerton62 | 0:0a5f554d2a16 | 20 | |
lcockerton62 | 0:0a5f554d2a16 | 21 | CANMessage createPackBalanceSOC(float SOC, float percentageCharge); |
lcockerton62 | 0:0a5f554d2a16 | 22 | |
lcockerton62 | 0:0a5f554d2a16 | 23 | CANMessage createCellVoltageMAXMIN(uint16_t MAXMINVoltage[], uint8_t cellVoltageInformation[]); |
lcockerton62 | 0:0a5f554d2a16 | 24 | |
lcockerton62 | 0:0a5f554d2a16 | 25 | CANMessage createCellTemperatureMAXMIN(uint16_t MAXMINTemperature[], uint8_t cellTemperatureInformation[]); |
lcockerton62 | 0:0a5f554d2a16 | 26 | |
lcockerton62 | 0:0a5f554d2a16 | 27 | CANMessage createBatteryVI(uint32_t batteryVoltage,uint32_t batteryCurrent); |
lcockerton62 | 0:0a5f554d2a16 | 28 | |
lcockerton62 | 0:0a5f554d2a16 | 29 | CANMessage createBatteryPackStatus(uint16_t voltageThreshold[], uint8_t statusFlag,uint8_t BMS_CMU_Count,uint16_t BMS_Firmware_Build); |
lcockerton62 | 0:0a5f554d2a16 | 30 | |
lcockerton62 | 0:0a5f554d2a16 | 31 | CANMessage createExtendedBatteryPackStatus(uint32_t status[]); |
lcockerton62 | 0:0a5f554d2a16 | 32 | |
lcockerton62 | 0:0a5f554d2a16 | 33 | |
lcockerton62 | 0:0a5f554d2a16 | 34 | union float2byte { |
lcockerton62 | 0:0a5f554d2a16 | 35 | float f; |
lcockerton62 | 0:0a5f554d2a16 | 36 | char b[sizeof(float)]; |
lcockerton62 | 0:0a5f554d2a16 | 37 | }; |
lcockerton62 | 0:0a5f554d2a16 | 38 | |
lcockerton62 | 0:0a5f554d2a16 | 39 | #endif |