97 *adc_code = (uint16_t)(values[0]) <<2 | values[1]>>6;
114 adc_voltage = (float)adc_code*LTC4261_ADIN_lsb;
115 return(adc_voltage*resistor_divider_ratio);
123 voltage = (float)adc_code*LTC4261_DELTA_SENSE_lsb;
static uint8_t adc_command
int8_t i2c_read_block_data(uint8_t address, uint8_t command, uint8_t length, uint8_t *values)
Read a block of data, starting at register specified by "command" and ending at (command + length - 1...
int8_t i2c_read_byte_data(uint8_t address, uint8_t command, uint8_t *value)
Read a byte of data at register specified by "command", store in "value".
int8_t LTC4261_write(uint8_t i2c_address, uint8_t command, uint8_t code)
Write an 8-bit code to the LTC4261.
const float resistor
resistor value on demo board
Header File for Linduino Libraries and Demo Code.
LTC4261: Negative Voltage Hot Swap Controller with ADC and I2C Monitoring.
int8_t LTC4261_read_10_bits(uint8_t i2c_address, uint8_t adc_command, uint16_t *adc_code)
Reads a 10-bit adc_code from LTC4261.
int8_t LTC4261_ARA(uint8_t alert_response_address, uint8_t *i2c_address)
SMBus Alert Response Protocol: Sends an alert response command and releases /ALERT pin...
int8_t LTC4261_read(uint8_t i2c_address, uint8_t command, uint8_t *code)
Reads an 8-bit adc_code from LTC4261.
int8_t i2c_write_byte_data(uint8_t address, uint8_t command, uint8_t value)
Write a byte of data to register specified by "command".
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
float LTC4261_code_to_current(uint16_t adc_code, float resistor, float LTC4261_DELTA_SENSE_lsb)
Calculate the LTC4261 current with a sense resistor.
static uint16_t current
the current measurement from the LTC3335's counter test mode.
float LTC4261_ADIN_code_to_voltage(uint16_t adc_code, float LTC4261_ADIN_lsb, float resistor_divider_ratio)
Calculate the LTC4261 ADIN voltage.
int8_t i2c_read_byte(uint8_t address, uint8_t *value)
Read a byte, store in "value".