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
- Committer:
- DasSidG
- Date:
- 2017-08-19
- Revision:
- 54:f18d3af300ba
- Parent:
- 49:419985e0b2b1
File content as of revision 54:f18d3af300ba:
#ifndef LTC2943_READ_H
#define LTC2943_READ_H
#include "mbed.h"
#include "LTC2943.h"
#define i2c_sda p9
#define i2c_scl p10
#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
#define BATTERY_CAPACITY 1 //in Ah //TODO: change this to the right value
#define R_SENSE 0.001 //in Ohms
/*@ALCC_MODES
*
LTC2943_ALERT_MODE 0x04
LTC2943_CHARGE_COMPLETE_MODE 0x02
LTC2943_DISABLE_ALCC_PIN 0x00
*/
#define ALCCMODE 0x00
/*@ADC_MODES
*
LTC2943_AUTOMATIC_MODE 0xC0
LTC2943_SCAN_MODE 0x80
LTC2943_MANUAL_MODE 0x40
LTC2943_SLEEP_MODE 0x00
*/
#define ADCMODE 0xC0 //In this mode the LTC2943 will continuously carry out voltage, current and temperature measurements
//VALUES BELOW TO BE CHANGED
#define chargeLow 0.1
#define chargeHigh 100
#define currentLow -1.1
#define currentHigh 1.1
#define voltageLow 0.1
#define voltageHigh 15
#define temperatureLow 1.1
#define temperatureHigh 50.1
//function prototypes
void dummyfunction(void);
void LTC2943_initialise();
extern LTC2943 ltc2943; //defined in LTC2943_Read.cpp
#endif