99 #define LTC2943_I2C_ADDRESS 0x64 100 #define LTC2943_I2C_ALERT_RESPONSE 0x0C 136 #define LTC2943_STATUS_REG 0x00 137 #define LTC2943_CONTROL_REG 0x01 138 #define LTC2943_ACCUM_CHARGE_MSB_REG 0x02 139 #define LTC2943_ACCUM_CHARGE_LSB_REG 0x03 140 #define LTC2943_CHARGE_THRESH_HIGH_MSB_REG 0x04 141 #define LTC2943_CHARGE_THRESH_HIGH_LSB_REG 0x05 142 #define LTC2943_CHARGE_THRESH_LOW_MSB_REG 0x06 143 #define LTC2943_CHARGE_THRESH_LOW_LSB_REG 0x07 144 #define LTC2943_VOLTAGE_MSB_REG 0x08 145 #define LTC2943_VOLTAGE_LSB_REG 0x09 146 #define LTC2943_VOLTAGE_THRESH_HIGH_MSB_REG 0x0A 147 #define LTC2943_VOLTAGE_THRESH_HIGH_LSB_REG 0x0B 148 #define LTC2943_VOLTAGE_THRESH_LOW_MSB_REG 0x0C 149 #define LTC2943_VOLTAGE_THRESH_LOW_LSB_REG 0x0D 150 #define LTC2943_CURRENT_MSB_REG 0x0E 151 #define LTC2943_CURRENT_LSB_REG 0x0F 152 #define LTC2943_CURRENT_THRESH_HIGH_MSB_REG 0x10 153 #define LTC2943_CURRENT_THRESH_HIGH_LSB_REG 0x11 154 #define LTC2943_CURRENT_THRESH_LOW_MSB_REG 0x12 155 #define LTC2943_CURRENT_THRESH_LOW_LSB_REG 0x13 156 #define LTC2943_TEMPERATURE_MSB_REG 0x14 157 #define LTC2943_TEMPERATURE_LSB_REG 0x15 158 #define LTC2943_TEMPERATURE_THRESH_HIGH_REG 0x16 159 #define LTC2943_TEMPERATURE_THRESH_LOW_REG 0x17 186 #define LTC2943_AUTOMATIC_MODE 0xC0 187 #define LTC2943_SCAN_MODE 0x80 188 #define LTC2943_MANUAL_MODE 0x40 189 #define LTC2943_SLEEP_MODE 0x00 191 #define LTC2943_PRESCALAR_M_1 0x00 192 #define LTC2943_PRESCALAR_M_4 0x08 193 #define LTC2943_PRESCALAR_M_16 0x10 194 #define LTC2943_PRESCALAR_M_64 0x18 195 #define LTC2943_PRESCALAR_M_256 0x20 196 #define LTC2943_PRESCALAR_M_1024 0x28 197 #define LTC2943_PRESCALAR_M_4096 0x30 198 #define LTC2943_PRESCALAR_M_4096_2 0x31 200 #define LTC2943_ALERT_MODE 0x04 201 #define LTC2943_CHARGE_COMPLETE_MODE 0x02 203 #define LTC2943_DISABLE_ALCC_PIN 0x00 204 #define LTC2943_SHUTDOWN_MODE 0x01 const float LTC2943_VOLTAGE_lsb
static uint8_t adc_command
int8_t LTC2943_read(uint8_t i2c_address, uint8_t adc_command, uint8_t *adc_code)
Reads an 8-bit adc_code from LTC2943.
const float resistor
resistor value on demo board
float LTC2943_code_to_kelvin_temperature(uint16_t adc_code)
Calculate the LTC2943 temperature.
int8_t LTC2943_write(uint8_t i2c_address, uint8_t adc_command, uint8_t code)
Write an 8-bit code to the LTC2943.
int8_t LTC2943_write_16_bits(uint8_t i2c_address, uint8_t adc_command, uint16_t code)
Write a 16-bit code to the LTC2943.
float LTC2943_code_to_current(uint16_t adc_code, float resistor)
Calculate the LTC2943 current with a sense resistor.
const float LTC2943_FULLSCALE_CURRENT
float LTC2943_code_to_celcius_temperature(uint16_t adc_code)
Calculate the LTC2943 temperature.
float LTC2943_code_to_coulombs(uint16_t adc_code, float resistor, uint16_t prescalar)
Calculate the LTC2943 charge in Coulombs.
const float LTC2943_TEMPERATURE_lsb
float LTC2943_code_to_mAh(uint16_t adc_code, float resistor, uint16_t prescalar)
Calculate the LTC2943 charge in mAh.
float LTC2943_code_to_voltage(uint16_t adc_code)
Calculate the LTC2943 SENSE+ voltage.
const float LTC2943_CHARGE_lsb
const float LTC2943_FULLSCALE_TEMPERATURE
const float LTC2943_FULLSCALE_VOLTAGE
const float LTC2943_CURRENT_lsb
int8_t LTC2943_read_16_bits(uint8_t i2c_address, uint8_t adc_command, uint16_t *adc_code)
Reads a 16-bit adc_code from LTC2943.