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
Diff: LTC2943_Read.cpp
- Revision:
- 4:9050c5d6925e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LTC2943_Read.cpp Tue Jan 10 00:57:19 2017 +0000 @@ -0,0 +1,24 @@ +#include "LTC2943_Read.h" + +LTC2943 ltc2943(i2c_sda, i2c_scl, alcc_pin, &dummyfunction, R_SENSE, BATTERY_CAPACITY); + +void LTC2943_initialise() +{ + ltc2943.setADCMode(ADCMODE); + ltc2943.configALCC(ALCCMODE); + ltc2943.setChargeThresholdLow(chargeLow); + ltc2943.setChargeThresholdHigh(chargeHigh); + ltc2943.setCurrentThresholdLow(currentLow); + ltc2943.setCurrentThresholdHigh(currentHigh); + ltc2943.setVoltageThresholdLow(voltageLow); + ltc2943.setVoltageThresholdHigh(voltageHigh); + ltc2943.setTemperatureThresholdLow(temperatureLow); + ltc2943.setTemperatureThresholdHigh(temperatureHigh); + ltc2943.setPrescAndBattCap(BATTERY_CAPACITY); //TODO: Give this a correct value, this value was randomly picked for compilation +} + + +void dummyfunction(void) //this is a functiona attached to an interrupt triggered by ALCC falling low +{ + printf("ALCC DUMMY"); +} \ No newline at end of file