Cell voltages fork (SoC)

Dependencies:   CUER_CAN CUER_DS1820 LTC2943 LTC6804 mbed PowerControl

Revision:
45:c288d7cbdb4a
Parent:
31:888b2602aab2
Child:
48:5c3f42c44036
--- a/CANParserBMU.cpp	Sat Jul 22 13:08:26 2017 +0000
+++ b/CANParserBMU.cpp	Sat Jul 22 17:47:14 2017 +0000
@@ -258,8 +258,33 @@
     decode.importCANData(msg);
     result = decode.getUpperFloat();
     return result;
+}
+
+CANMessage createIVTACurrent(int32_t current)
+{
+    CANMessage msg;
+    msg.len = 8;
+    msg.id = BMS_BASE_ID + IVTA_ID;
+
+    CAN_Data data;
+    data.setLower_Long(current);
+    data.setHigher_Long(0);
+    
+    for(int i=0; i<8; i++) {
+        msg.data[i] = data.get_u8(i);
+    }
+    return msg;
 } 
 
+int32_t decodeIVTACurrent(CANMessage msg)
+{
+    int32_t result = 0;
+    CAN_Data decode;
+    decode.importCANData(msg);
+    result = decode.getLower_Long();
+    return result;
+}
+
 CANMessage createBatteryPackStatus(uint16_t voltageThreshold[], uint8_t statusFlag,uint8_t BMS_CMU_Count,uint16_t BMS_Firmware_Build)
 {
     CANMessage msg;