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 CUER_DS1820 LTC2943 LTC6804 mbed PowerControl
LTC2943_Read.h@54:f18d3af300ba, 2017-08-19 (annotated)
- Committer:
- DasSidG
- Date:
- Sat Aug 19 18:57:18 2017 +0000
- Revision:
- 54:f18d3af300ba
- Parent:
- 49:419985e0b2b1
Removed all LTC2943 functionality as no longer working. Replaced it with the equivalent functionality from the IVT-A. Preliminary tests seem to suggests that it all works fine, including robustmess to weird power conditions
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| DasSidG | 4:9050c5d6925e | 1 | #ifndef LTC2943_READ_H |
| DasSidG | 4:9050c5d6925e | 2 | #define LTC2943_READ_H |
| DasSidG | 4:9050c5d6925e | 3 | |
| DasSidG | 4:9050c5d6925e | 4 | #include "mbed.h" |
| DasSidG | 4:9050c5d6925e | 5 | #include "LTC2943.h" |
| DasSidG | 4:9050c5d6925e | 6 | |
| DasSidG | 4:9050c5d6925e | 7 | #define i2c_sda p9 |
| DasSidG | 4:9050c5d6925e | 8 | #define i2c_scl p10 |
| DasSidG | 49:419985e0b2b1 | 9 | #define alcc_pin p18 //ALERT:CHANGE THIS VALUE ALERT:CHANGE THIS VALUE ALERT:CHANGE THIS VALUE ALERT:CHANGE THIS VALUE ALERT:CHANGE THIS VALUE ALERT:CHANGE THIS VALUE ALERT:CHANGE THIS VALUE |
| maxv008 | 31:888b2602aab2 | 10 | #define BATTERY_CAPACITY 1 //in Ah //TODO: change this to the right value |
| DasSidG | 54:f18d3af300ba | 11 | #define R_SENSE 0.001 //in Ohms |
| DasSidG | 4:9050c5d6925e | 12 | |
| DasSidG | 4:9050c5d6925e | 13 | /*@ALCC_MODES |
| DasSidG | 4:9050c5d6925e | 14 | * |
| DasSidG | 4:9050c5d6925e | 15 | LTC2943_ALERT_MODE 0x04 |
| DasSidG | 4:9050c5d6925e | 16 | LTC2943_CHARGE_COMPLETE_MODE 0x02 |
| DasSidG | 4:9050c5d6925e | 17 | LTC2943_DISABLE_ALCC_PIN 0x00 |
| DasSidG | 4:9050c5d6925e | 18 | */ |
| DasSidG | 4:9050c5d6925e | 19 | #define ALCCMODE 0x00 |
| DasSidG | 4:9050c5d6925e | 20 | |
| DasSidG | 4:9050c5d6925e | 21 | /*@ADC_MODES |
| DasSidG | 4:9050c5d6925e | 22 | * |
| DasSidG | 4:9050c5d6925e | 23 | LTC2943_AUTOMATIC_MODE 0xC0 |
| DasSidG | 4:9050c5d6925e | 24 | LTC2943_SCAN_MODE 0x80 |
| DasSidG | 4:9050c5d6925e | 25 | LTC2943_MANUAL_MODE 0x40 |
| DasSidG | 4:9050c5d6925e | 26 | LTC2943_SLEEP_MODE 0x00 |
| DasSidG | 4:9050c5d6925e | 27 | */ |
| DasSidG | 4:9050c5d6925e | 28 | #define ADCMODE 0xC0 //In this mode the LTC2943 will continuously carry out voltage, current and temperature measurements |
| DasSidG | 4:9050c5d6925e | 29 | |
| DasSidG | 4:9050c5d6925e | 30 | //VALUES BELOW TO BE CHANGED |
| DasSidG | 4:9050c5d6925e | 31 | #define chargeLow 0.1 |
| DasSidG | 49:419985e0b2b1 | 32 | #define chargeHigh 100 |
| DasSidG | 4:9050c5d6925e | 33 | |
| DasSidG | 4:9050c5d6925e | 34 | #define currentLow -1.1 |
| DasSidG | 4:9050c5d6925e | 35 | #define currentHigh 1.1 |
| DasSidG | 4:9050c5d6925e | 36 | |
| DasSidG | 4:9050c5d6925e | 37 | #define voltageLow 0.1 |
| DasSidG | 49:419985e0b2b1 | 38 | #define voltageHigh 15 |
| DasSidG | 4:9050c5d6925e | 39 | |
| DasSidG | 4:9050c5d6925e | 40 | #define temperatureLow 1.1 |
| DasSidG | 4:9050c5d6925e | 41 | #define temperatureHigh 50.1 |
| DasSidG | 4:9050c5d6925e | 42 | |
| DasSidG | 4:9050c5d6925e | 43 | //function prototypes |
| DasSidG | 4:9050c5d6925e | 44 | void dummyfunction(void); |
| DasSidG | 4:9050c5d6925e | 45 | void LTC2943_initialise(); |
| DasSidG | 4:9050c5d6925e | 46 | |
| DasSidG | 4:9050c5d6925e | 47 | extern LTC2943 ltc2943; //defined in LTC2943_Read.cpp |
| DasSidG | 4:9050c5d6925e | 48 | |
| DasSidG | 4:9050c5d6925e | 49 | #endif |