115 *LTC2461_lsb = (fs_voltage-zero_voltage)/((
float)(fs_code - zero_code));
117 temp_offset = (zero_voltage/ *
LTC2461_lsb) - zero_code;
118 temp_offset = (temp_offset > (floor(temp_offset) + 0.5)) ? ceil(temp_offset) : floor(temp_offset);
119 *LTC2461_offset_code = (int32_t)temp_offset;
static uint8_t adc_command
int8_t i2c_write_byte(uint8_t address, uint8_t value)
Write "value" byte to device at "address".
int8_t LTC2461_read(uint8_t i2c_address, uint8_t adc_command, uint16_t *adc_code)
Reads the ADC and returns 16-bit data.
static float LTC2461_lsb
Ideal LSB voltage for a perfect part (Vref/(2^16))
Header File for Linduino Libraries and Demo Code.
void LTC2461_cal_voltage(uint16_t zero_code, uint16_t fs_code, float zero_voltage, float fs_voltage, float *LTC2461_lsb, int32_t *LTC2461_offset_code)
Calibrate the lsb.
int8_t LTC2461_command(uint8_t i2c_address, uint8_t adc_command)
Write a 16-bit command to the ADC.
int8_t i2c_read_word_data(uint8_t address, uint8_t command, uint16_t *value)
Read a 16-bit word of data from register specified by "command".
static int32_t LTC2461_offset_code
Ideal offset for a perfect part.
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
LTC2461: 16-Bit I2C Delta Sigma ADCs with 10ppm/C Max Precision Reference.
float LTC2461_code_to_voltage(uint16_t adc_code, float LTC2461_lsb, int32_t LTC2461_offset_code)
Calculates the LTC2309 input unipolar voltage.