157 #define LTC2990_I2C_ADDRESS 0x4C // Low Low 164 #define LTC2990_I2C_GLOBAL_ADDRESS 0x77 // Global Address 170 #define LTC2990_STATUS_REG 0x00 171 #define LTC2990_CONTROL_REG 0x01
172 #define LTC2990_TRIGGER_REG 0x02
173 #define LTC2990_TINT_MSB_REG 0x04
174 #define LTC2990_TINT_LSB_REG 0x05
175 #define LTC2990_V1_MSB_REG 0x06
176 #define LTC2990_V1_LSB_REG 0x07
177 #define LTC2990_V2_MSB_REG 0x08
178 #define LTC2990_V2_LSB_REG 0x09
179 #define LTC2990_V3_MSB_REG 0x0A
180 #define LTC2990_V3_LSB_REG 0x0B
181 #define LTC2990_V4_MSB_REG 0x0C
182 #define LTC2990_V4_LSB_REG 0x0D
183 #define LTC2990_VCC_MSB_REG 0x0E
184 #define LTC2990_VCC_LSB_REG 0x0F
192 #define LTC2990_KELVIN_ENABLE 0x80 193 #define LTC2990_CELSIUS_ENABLE 0x00
194 #define LTC2990_TEMP_FORMAT_MASK 0x80
196 #define LTC2990_SINGLE_ENABLE 0x40 197 #define LTC2990_REPEATED_ENABLE 0x00
198 #define LTC2990_ACQUISITION_MASK 0x40
207 #define LTC2990_ENABLE_INT_TEMPERATURE 0x00 208 #define LTC2990_ENABLE_V1 0x08
209 #define LTC2990_ENABLE_V2 0x10
210 #define LTC2990_ENABLE_ALL 0x18
211 #define LTC2990_TEMP_MEAS_MODE_MASK 0x18
219 #define LTC2990_V1_V2_TR2 0x00 220 #define LTC2990_V1V2_TR2 0x01
221 #define LTC2990_V1V2_V3_V4 0x02
222 #define LTC2990_TR1_V3_V4 0x03
223 #define LTC2990_TR1_V3V4 0x04
224 #define LTC2990_TR1_TR2 0x05
225 #define LTC2990_V1V2_V3V4 0x06
226 #define LTC2990_V1_V2_V3_V4 0x07
227 #define LTC2990_VOLTAGE_MODE_MASK 0x07
236 uint8_t msb_register_address,
248 uint8_t msb_register_address,
263 uint8_t msb_register_address,
274 uint8_t register_address,
275 uint8_t *register_data
282 uint8_t register_address,
283 uint8_t register_data
291 uint8_t register_address,
293 uint8_t bits_to_clear
300 float LTC2990_single_ended_lsb
306 float LTC2990_single_ended_lsb
312 float LTC2990_differential_lsb
318 float LTC2990_temperature_lsb,
325 float LTC2990_diode_voltage_lsb
float LTC2990_code_to_vcc_voltage(int16_t adc_code, float LTC2990_single_ended_lsb)
Calculates the LTC2990 Vcc voltage.
float LTC2990_code_to_differential_voltage(int16_t adc_code, float LTC2990_differential_lsb)
Calculates the LTC2990 differential input voltage.
int8_t LTC2990_register_read(uint8_t i2c_address, uint8_t register_address, uint8_t *register_data)
Reads an 8-bit register from the LTC2990 using the standard repeated start format.
float LTC2990_code_to_single_ended_voltage(int16_t adc_code, float LTC2990_single_ended_lsb)
Calculates the LTC2990 single-ended input voltages.
int8_t LTC2990_register_write(uint8_t i2c_address, uint8_t register_address, uint8_t register_data)
Write one byte to an LTC2990 register.
int8_t LTC2990_adc_read(uint8_t i2c_address, uint8_t msb_register_address, int16_t *adc_code, int8_t *data_valid)
Reads a 14-bit adc_code from LTC2990.
float LTC2990_code_to_diode_voltage(int16_t adc_code, float LTC2990_diode_voltage_lsb)
Calculates the LTC2990 diode voltage.
int8_t LTC2990_adc_read_new_data(uint8_t i2c_address, uint8_t msb_register_address, int16_t *adc_code, int8_t *data_valid, uint16_t timeout)
Reads new data (even after a mode change) by flushing old data and waiting for the data_valid bit to ...
int8_t LTC2990_register_set_clear_bits(uint8_t i2c_address, uint8_t register_address, uint8_t bits_to_set, uint8_t bits_to_clear)
Used to set and clear bits in a control register.
int8_t LTC2990_adc_read_timeout(uint8_t i2c_address, uint8_t msb_register_address, int16_t *adc_code, int8_t *data_valid, uint16_t timeout, uint8_t status_bit)
Reads a 14-bit adc_code from the LTC2990 but enforces a maximum timeout.
float LTC2990_temperature(int16_t adc_code, float LTC2990_temperature_lsb, boolean unit)
Calculates the LTC2990 temperature.