103 voltage = (float)adc_code * LTC4151_sense_lsb;
112 voltage = (float)adc_code * LTC4151_vin_lsb;
120 voltage = (float)adc_code * LTC4151_adin_lsb;
static uint8_t adc_command
const float LTC4151_adin_lsb
Typical ADIN lsb weight in mV.
const float resistor
resistor value on demo board
Header File for Linduino Libraries and Demo Code.
float LTC4151_code_to_ADIN_voltage(uint16_t adc_code, float LTC4151_adin_lsb)
Calculates the LTC4151 ADIN voltage in mV given "LTC4151_adin_lsb" LSB weight in mV.
int8_t LTC4151_write(uint8_t i2c_address, uint8_t adc_command, uint8_t code)
Write one byte to an LTC4151 register.
const float LTC4151_sense_lsb
Typical sense lsb weight in volts.
LTC4151: High Voltage I2C Current and Voltage Monitor.
int8_t LTC4151_read_12_bits(uint8_t i2c_address, uint8_t adc_command, uint16_t *adc_code)
Reads a 12-bit value from LTC4151.
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".
float LTC4151_code_to_vin_voltage(uint16_t adc_code, float LTC4151_vin_lsb)
Calculates the LTC4151 V_IN voltage given "LTC_vin_lsb" LSB weight in volts.
const float LTC4151_vin_lsb
Typical Vin lsb weight in volts.
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".
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
float LTC4151_code_to_sense_current(uint16_t adc_code, float resistor, float LTC4151_sense_lsb)
Calculates the LTC4151 sense current in Amps given "resistor" value in ohms and "LTC4151_sense_lsb" L...
static uint16_t current
the current measurement from the LTC3335's counter test mode.