Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: CUER_CAN DS1820 LTC2943 LTC6804 mbed
Fork of BMS_BMUCore_Max by
LTC2943_Read.cpp@4:9050c5d6925e, 2017-01-10 (annotated)
- Committer:
- DasSidG
- Date:
- Tue Jan 10 00:57:19 2017 +0000
- Revision:
- 4:9050c5d6925e
First attempt at adding SoC and battery current measurements to BMU code; ; Note some constants (e.g. battery capacity, threshold values) need to be modified in the future.; ; Code compiles.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| DasSidG | 4:9050c5d6925e | 1 | #include "LTC2943_Read.h" |
| DasSidG | 4:9050c5d6925e | 2 | |
| DasSidG | 4:9050c5d6925e | 3 | LTC2943 ltc2943(i2c_sda, i2c_scl, alcc_pin, &dummyfunction, R_SENSE, BATTERY_CAPACITY); |
| DasSidG | 4:9050c5d6925e | 4 | |
| DasSidG | 4:9050c5d6925e | 5 | void LTC2943_initialise() |
| DasSidG | 4:9050c5d6925e | 6 | { |
| DasSidG | 4:9050c5d6925e | 7 | ltc2943.setADCMode(ADCMODE); |
| DasSidG | 4:9050c5d6925e | 8 | ltc2943.configALCC(ALCCMODE); |
| DasSidG | 4:9050c5d6925e | 9 | ltc2943.setChargeThresholdLow(chargeLow); |
| DasSidG | 4:9050c5d6925e | 10 | ltc2943.setChargeThresholdHigh(chargeHigh); |
| DasSidG | 4:9050c5d6925e | 11 | ltc2943.setCurrentThresholdLow(currentLow); |
| DasSidG | 4:9050c5d6925e | 12 | ltc2943.setCurrentThresholdHigh(currentHigh); |
| DasSidG | 4:9050c5d6925e | 13 | ltc2943.setVoltageThresholdLow(voltageLow); |
| DasSidG | 4:9050c5d6925e | 14 | ltc2943.setVoltageThresholdHigh(voltageHigh); |
| DasSidG | 4:9050c5d6925e | 15 | ltc2943.setTemperatureThresholdLow(temperatureLow); |
| DasSidG | 4:9050c5d6925e | 16 | ltc2943.setTemperatureThresholdHigh(temperatureHigh); |
| DasSidG | 4:9050c5d6925e | 17 | ltc2943.setPrescAndBattCap(BATTERY_CAPACITY); //TODO: Give this a correct value, this value was randomly picked for compilation |
| DasSidG | 4:9050c5d6925e | 18 | } |
| DasSidG | 4:9050c5d6925e | 19 | |
| DasSidG | 4:9050c5d6925e | 20 | |
| DasSidG | 4:9050c5d6925e | 21 | void dummyfunction(void) //this is a functiona attached to an interrupt triggered by ALCC falling low |
| DasSidG | 4:9050c5d6925e | 22 | { |
| DasSidG | 4:9050c5d6925e | 23 | printf("ALCC DUMMY"); |
| DasSidG | 4:9050c5d6925e | 24 | } |
