Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board

Library for LTC2944 Multicell Battery Gas Gauge with Temperature, Voltage and Current Measurement. More...

Detailed Description

Library for LTC2944 Multicell Battery Gas Gauge with Temperature, Voltage and Current Measurement.

Definition in file LTC2944.cpp.

Go to the source code of this file.

Functions

int8_t LTC2944_write (uint8_t i2c_address, uint8_t adc_command, uint8_t code)
 Write an 8-bit code to the LTC2944. More...
 
int8_t LTC2944_write_16_bits (uint8_t i2c_address, uint8_t adc_command, uint16_t code)
 Write a 16-bit code to the LTC2944. More...
 
int8_t LTC2944_read (uint8_t i2c_address, uint8_t adc_command, uint8_t *adc_code)
 Reads an 8-bit adc_code from LTC2944. More...
 
int8_t LTC2944_read_16_bits (uint8_t i2c_address, uint8_t adc_command, uint16_t *adc_code)
 Reads a 16-bit adc_code from LTC2944. More...
 
float LTC2944_code_to_coulombs (uint16_t adc_code, float resistor, uint16_t prescalar)
 Calculate the LTC2944 charge in Coulombs. More...
 
float LTC2944_code_to_mAh (uint16_t adc_code, float resistor, uint16_t prescalar)
 Calculate the LTC2944 charge in mAh. More...
 
float LTC2944_code_to_voltage (uint16_t adc_code)
 Calculate the LTC2944 SENSE+ voltage. More...
 
float LTC2944_code_to_current (uint16_t adc_code, float resistor)
 Calculate the LTC2944 current with a sense resistor. More...
 
float LTC2944_code_to_kelvin_temperature (uint16_t adc_code)
 Calculate the LTC2944 temperature. More...
 
float LTC2944_code_to_celcius_temperature (uint16_t adc_code)
 Calculate the LTC2944 temperature. More...
 
int8_t LTC2944_register_set_clear_bits (uint8_t i2c_address, uint8_t register_address, uint8_t bits_to_set, uint8_t bits_to_clear)
 

Function Documentation

◆ LTC2944_code_to_celcius_temperature()

float LTC2944_code_to_celcius_temperature ( uint16_t  adc_code)

Calculate the LTC2944 temperature.

Returns
Returns the temperature in Celcius
Parameters
adc_codeThe RAW ADC value

Definition at line 161 of file LTC2944.cpp.

◆ LTC2944_code_to_coulombs()

float LTC2944_code_to_coulombs ( uint16_t  adc_code,
float  resistor,
uint16_t  prescalar 
)

Calculate the LTC2944 charge in Coulombs.

Returns
Returns the Coulombs of charge in the ACR register.
Parameters
adc_codeThe RAW ADC value
resistorThe sense resistor value
prescalarThe prescalar value

Definition at line 120 of file LTC2944.cpp.

◆ LTC2944_code_to_current()

float LTC2944_code_to_current ( uint16_t  adc_code,
float  resistor 
)

Calculate the LTC2944 current with a sense resistor.

Returns
Returns the current through the sense resisor
Parameters
adc_codeThe RAW ADC value
resistorThe sense resistor value

Definition at line 145 of file LTC2944.cpp.

◆ LTC2944_code_to_kelvin_temperature()

float LTC2944_code_to_kelvin_temperature ( uint16_t  adc_code)

Calculate the LTC2944 temperature.

Returns
Returns the temperature in Kelvin
Parameters
adc_codeThe RAW ADC value

Definition at line 153 of file LTC2944.cpp.

◆ LTC2944_code_to_mAh()

float LTC2944_code_to_mAh ( uint16_t  adc_code,
float  resistor,
uint16_t  prescalar 
)

Calculate the LTC2944 charge in mAh.

Returns
Returns the Coulombs of charge in the ACR register.
Parameters
adc_codeThe RAW ADC value
resistorThe sense resistor value
prescalarThe prescalar value

Definition at line 129 of file LTC2944.cpp.

◆ LTC2944_code_to_voltage()

float LTC2944_code_to_voltage ( uint16_t  adc_code)

Calculate the LTC2944 SENSE+ voltage.

Returns
Returns the SENSE+ Voltage in Volts
Parameters
adc_codeThe RAW ADC value

Definition at line 137 of file LTC2944.cpp.

◆ LTC2944_read()

int8_t LTC2944_read ( uint8_t  i2c_address,
uint8_t  adc_command,
uint8_t *  adc_code 
)

Reads an 8-bit adc_code from LTC2944.

Returns
The function returns the state of the acknowledge bit after the I2C address write. 0=acknowledge, 1=no acknowledge.
Parameters
i2c_addressRegister address for the LTC2944
adc_commandThe "command byte" for the LTC2944
adc_codeValue that will be read from the register.

Definition at line 98 of file LTC2944.cpp.

◆ LTC2944_read_16_bits()

int8_t LTC2944_read_16_bits ( uint8_t  i2c_address,
uint8_t  adc_command,
uint16_t *  adc_code 
)

Reads a 16-bit adc_code from LTC2944.

Returns
The function returns the state of the acknowledge bit after the I2C address write. 0=acknowledge, 1=no acknowledge.
Parameters
i2c_addressRegister address for the LTC2944
adc_commandThe "command byte" for the LTC2944
adc_codeValue that will be read from the register.

Definition at line 109 of file LTC2944.cpp.

◆ LTC2944_register_set_clear_bits()

int8_t LTC2944_register_set_clear_bits ( uint8_t  i2c_address,
uint8_t  register_address,
uint8_t  bits_to_set,
uint8_t  bits_to_clear 
)

Definition at line 171 of file LTC2944.cpp.

◆ LTC2944_write()

int8_t LTC2944_write ( uint8_t  i2c_address,
uint8_t  adc_command,
uint8_t  code 
)

Write an 8-bit code to the LTC2944.

Returns
The function returns the state of the acknowledge bit after the I2C address write. 0=acknowledge, 1=no acknowledge.
Parameters
i2c_addressRegister address for the LTC2944
adc_commandThe "command byte" for the LTC2944
codeValue that will be written to the register.

Definition at line 77 of file LTC2944.cpp.

◆ LTC2944_write_16_bits()

int8_t LTC2944_write_16_bits ( uint8_t  i2c_address,
uint8_t  adc_command,
uint16_t  code 
)

Write a 16-bit code to the LTC2944.

Returns
The function returns the state of the acknowledge bit after the I2C address write. 0=acknowledge, 1=no acknowledge.
Parameters
i2c_addressRegister address for the LTC2944
adc_commandThe "command byte" for the LTC2944
codeValue that will be written to the register.

Definition at line 88 of file LTC2944.cpp.