131 #define LTC4151_I2C_ADDRESS 0x6F // Low Low 155 #define LTC4151_SENSE_MSB_REG 0x00 // ADC Current Sense Voltage Data (8 MSB) 156 #define LTC4151_SENSE_LSB_REG 0x01 // ADC Current Sense Voltage Data (4 LSB) 157 #define LTC4151_VIN_MSB_REG 0x02 // ADC V_IN Voltage Data (8 MSB) 158 #define LTC4151_VIN_LSB_REG 0x03 // ADC V_IN Voltage Data (4 LSB) 159 #define LTC4151_ADIN_MSB_REG 0x04 // ADC ADIN Voltage Data (8 MSB) 160 #define LTC4151_ADIN_LSB_REG 0x05 // ADC ADIN Voltage Data (4 LSB) 161 #define LTC4151_CONTROL_REG 0x06 // Controls ADC Operation Mode and Test Mode 178 #define LTC4151_SENSE_CHANNEL_REG 0x00 // ADC Sense Channel For Snapshot Mode 179 #define LTC4151_VIN_CHANNEL_REG 0x20 // ADC V_IN Channel For Snapshot Mode 180 #define LTC4151_ADIN_CHANNEL_REG 0x40 // ADC ADIN Channel For Snapshot Mode 182 #define LTC4151_CONTINUOUS_MODE 0x00 183 #define LTC4151_SNAPSHOT_MODE 0x80
int8_t LTC4151_write(uint8_t i2c_address, uint8_t adc_command, uint8_t code)
Write one byte to an LTC4151 register.
static uint8_t adc_command
const float LTC4151_adin_lsb
Typical ADIN lsb weight in mV.
const float resistor
resistor value on demo board
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...
const float LTC4151_sense_lsb
Typical sense lsb weight in volts.
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_read_12_bits(uint8_t i2c_address, uint8_t adc_command, uint16_t *adc_code)
Reads a 12-bit value from LTC4151.
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.