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 CUER

Revision:
0:0a5f554d2a16
Child:
1:51477fe4851b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Data_Types_BMU.h	Thu Dec 22 15:11:29 2016 +0000
@@ -0,0 +1,59 @@
+#ifndef Data_Types_BMU_H
+#define Data_Types_BMU_H
+
+#include "CAN_Data.h"
+#include "CAN_IDs.h"
+#include "mbed.h"
+
+#define NO_OF_CELLS 1
+#define NO_TEMPERATURE_SENSORS 1
+
+// CAN pins
+#define CAN_WRITE_PIN p29
+#define CAN_READ_PIN p30
+
+struct BMU_data{
+    // Data for the CAN bus see Tritium Communications Protocol
+    // Cell voltage
+    uint16_t cell_voltages[NO_OF_CELLS]; // Store all voltage measurements in here
+    uint16_t max_cell_voltage;
+    uint16_t min_cell_voltage;
+    uint8_t CMU_cell_voltage_minimum[2]; //Order: [0]CMU with minimum [1]cell with minimum
+    uint8_t CMU_cell_voltage_maximum[2]; //Order: [0]CMU with maximum [1]cell with maximum
+    
+    // SOC 
+    float SOC;
+    float percentage_SOC;
+    
+    //Cell Temperature
+    uint16_t temperature_measurements[NO_TEMPERATURE_SENSORS]; // Store all of the temperature measurements in here
+    uint16_t max_cell_temp;
+    uint16_t min_cell_temp;
+    uint8_t CMU_number_min_temp;
+    uint8_t CMU_number_max_temp;
+};
+
+// @TODO are both the battery status and extended status used or just one of them
+enum BMU_CAN_flags{
+    // Think this is used for legacy software
+};
+
+enum BMU_extended_CAN_flags{
+    // BMU wont send all of these errors 
+    NONE = 0x00,
+    CELL_OVER_VOLTAGE = 0x00000001,
+    CELL_UNDER_VOLTAGE = 0x00000002,
+    CELL_OVER_TEMPERATURE = 0x00000004,
+    MEASUREMENT_UNTRUSTED = 0x00000008,
+    CMU_COMMUNICATION_TIMEOUT = 0x00000010,
+    VEHICLE_COMMUNICATIONS_TIMEOUT = 0x00000020,
+    BMU_SETUP_MODE = 0x00000040,
+    CMU_CAN_POWER_STATUS = 0x00000080,
+    PACK_ISOLATION_TEST_FAILURE = 0x00000100,
+    SOC_MEASUREMENT_NOT_VALID = 0x00000200,
+    CAN_12V_LOW = 0x00000400,
+    CONTACTOR_NOT_ENGAGED = 0x00000800,
+    CMU_EXTRA_CELL = 0x00001000,
+};
+
+#endif
\ No newline at end of file