Cell voltages fork (SoC)

Dependencies:   CUER_CAN CUER_DS1820 LTC2943 LTC6804 mbed PowerControl

Committer:
maxv008
Date:
Sun Jul 02 15:06:51 2017 +0000
Revision:
18:521ffdd724f3
Parent:
14:e0e88a009f4c
Child:
23:a1af4439c1fc
Set up voltage and temperature sending and reading with live data and a near final setup for it;

Who changed what in which revision?

UserRevisionLine numberNew 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
maxv008 18:521ffdd724f3 22 bool decodeVoltageTelemetry(CANMessage msg, CMU_voltage readings[NO_CMUS]);
maxv008 18:521ffdd724f3 23
lcockerton62 0:0a5f554d2a16 24 CANMessage createPackSOC(float SOC, float percentageCharge);
lcockerton62 0:0a5f554d2a16 25
lcockerton62 0:0a5f554d2a16 26 CANMessage createPackBalanceSOC(float SOC, float percentageCharge);
lcockerton62 0:0a5f554d2a16 27
lcockerton62 1:51477fe4851b 28 CANMessage createCellVoltageMAXMIN(pack_voltage_extremes max_voltage, pack_voltage_extremes min_voltage);
lcockerton62 0:0a5f554d2a16 29
lcockerton62 1:51477fe4851b 30 CANMessage createCellTemperatureMAXMIN(pack_temperature_extremes min_temperature, pack_temperature_extremes max_temperature);
lcockerton62 0:0a5f554d2a16 31
lcockerton62 0:0a5f554d2a16 32 CANMessage createBatteryVI(uint32_t batteryVoltage,uint32_t batteryCurrent);
lcockerton62 0:0a5f554d2a16 33
lcockerton62 0:0a5f554d2a16 34 CANMessage createBatteryPackStatus(uint16_t voltageThreshold[], uint8_t statusFlag,uint8_t BMS_CMU_Count,uint16_t BMS_Firmware_Build);
lcockerton62 0:0a5f554d2a16 35
lcockerton62 1:51477fe4851b 36 CANMessage createExtendedBatteryPackStatus(uint32_t status);
lcockerton62 0:0a5f554d2a16 37
lcockerton62 0:0a5f554d2a16 38
lcockerton62 0:0a5f554d2a16 39 union float2byte {
lcockerton62 1:51477fe4851b 40 float f;
lcockerton62 1:51477fe4851b 41 char b[sizeof(float)];
lcockerton62 0:0a5f554d2a16 42 };
lcockerton62 0:0a5f554d2a16 43
lcockerton62 0:0a5f554d2a16 44 #endif