156 #define LTC2991_I2C_ADDRESS 0x48 // Low Low Low 166 #define LTC2991_I2C_GLOBAL_ADDRESS 0x77 // Global Address 172 #define LTC2991_STATUS_LOW_REG 0x00 173 #define LTC2991_STATUS_HIGH_REG 0x01
174 #define LTC2991_CHANNEL_ENABLE_REG 0x01
175 #define LTC2991_CONTROL_V1234_REG 0x06
176 #define LTC2991_CONTROL_V5678_REG 0x07
177 #define LTC2991_CONTROL_PWM_Tinternal_REG 0x08
178 #define LTC2991_PWM_THRESHOLD_MSB_REG 0x09
179 #define LTC2991_V1_MSB_REG 0x0A
180 #define LTC2991_V1_LSB_REG 0x0B
181 #define LTC2991_V2_MSB_REG 0x0C
182 #define LTC2991_V2_LSB_REG 0x0D
183 #define LTC2991_V3_MSB_REG 0x0E
184 #define LTC2991_V3_LSB_REG 0x0F
185 #define LTC2991_V4_MSB_REG 0x10
186 #define LTC2991_V4_LSB_REG 0x11
187 #define LTC2991_V5_MSB_REG 0x12
188 #define LTC2991_V5_LSB_REG 0x13
189 #define LTC2991_V6_MSB_REG 0x14
190 #define LTC2991_V6_LSB_REG 0x15
191 #define LTC2991_V7_MSB_REG 0x16
192 #define LTC2991_V7_LSB_REG 0x17
193 #define LTC2991_V8_MSB_REG 0x18
194 #define LTC2991_V8_LSB_REG 0x19
195 #define LTC2991_T_Internal_MSB_REG 0x1A
196 #define LTC2991_T_Internal_LSB_REG 0x1B
197 #define LTC2991_Vcc_MSB_REG 0x1C
198 #define LTC2991_Vcc_LSB_REG 0x1D
206 #define LTC2991_V7_V8_TR4_ENABLE 0x80 207 #define LTC2991_V5_V6_TR3_ENABLE 0x40
208 #define LTC2991_V3_V4_TR2_ENABLE 0x20
209 #define LTC2991_V1_V2_TR1_ENABLE 0x10
210 #define LTC2991_VCC_TINTERNAL_ENABLE 0x08
211 #define LTC2991_ENABLE_ALL_CHANNELS 0xF8
212 #define LTC2991_BUSY 0x04
220 #define LTC2991_V3_V4_FILTER_ENABLE 0x80 221 #define LTC2991_V3_V4_KELVIN_ENABLE 0x40
222 #define LTC2991_V3_V4_TEMP_ENABLE 0x20
223 #define LTC2991_V3_V4_DIFFERENTIAL_ENABLE 0x10
224 #define LTC2991_V1_V2_FILTER_ENABLE 0x08
225 #define LTC2991_V1_V2_KELVIN_ENABLE 0x04
226 #define LTC2991_V1_V2_TEMP_ENABLE 0x02
227 #define LTC2991_V1_V2_DIFFERENTIAL_ENABLE 0x01
235 #define LTC2991_V7_V8_FILTER_ENABLE 0x80 236 #define LTC2991_V7_V8_KELVIN_ENABLE 0x40
237 #define LTC2991_V7_V8_TEMP_ENABLE 0x20
238 #define LTC2991_V7_V8_DIFFERENTIAL_ENABLE 0x10
239 #define LTC2991_V5_V6_FILTER_ENABLE 0x08
240 #define LTC2991_V5_V6_KELVIN_ENABLE 0x04
241 #define LTC2991_V5_V6_TEMP_ENABLE 0x02
242 #define LTC2991_V5_V6_DIFFERENTIAL_ENABLE 0x01
250 #define LTC2991_PWM_0 0x80 251 #define LTC2991_PWM_INVERT 0x40
252 #define LTC2991_PWM_ENABLE 0x20
253 #define LTC2991_REPEAT_MODE 0x10
254 #define LTC2991_INT_FILTER_ENABLE 0x08
255 #define LTC2991_INT_KELVIN_ENABLE 0x04
261 uint8_t msb_register_address,
273 uint8_t msb_register_address,
288 uint8_t msb_register_address,
299 uint8_t register_address,
300 uint8_t *register_data
307 uint8_t register_address,
308 uint8_t register_data
316 uint8_t register_address,
318 uint8_t bits_to_clear
324 float LTC2991_single_ended_lsb
330 float LTC2991_single_ended_lsb
336 float LTC2991_differential_lsb
342 float LTC2991_temperature_lsb,
349 float LTC2991_diode_voltage_lsb
const float LTC2991_TEMPERATURE_lsb
Typical temperature LSB weight in degrees Celsius (and Kelvin).
int8_t LTC2991_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 LTC2991 but enforces a maximum timeout.
float LTC2991_temperature(int16_t adc_code, float LTC2991_temperature_lsb, boolean unit)
Calculates the LTC2991 temperature.
const float LTC2991_DIFFERENTIAL_lsb
Typical differential LSB weight in volts.
float LTC2991_code_to_vcc_voltage(int16_t adc_code, float LTC2991_single_ended_lsb)
Calculates the LTC2991 Vcc voltage.
int8_t LTC2991_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.
const float LTC2991_SINGLE_ENDED_lsb
Typical single-ended LSB weight in volts.
float LTC2991_code_to_differential_voltage(int16_t adc_code, float LTC2991_differential_lsb)
Calculates the LTC2991 differential input voltage.
int8_t LTC2991_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 LTC2991.
const float LTC2991_DIODE_VOLTAGE_lsb
Typical remote diode LSB weight in volts.
int8_t LTC2991_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 ...
float LTC2991_code_to_single_ended_voltage(int16_t adc_code, float LTC2991_single_ended_lsb)
Calculates the LTC2991 single-ended input voltages.
int8_t LTC2991_register_write(uint8_t i2c_address, uint8_t register_address, uint8_t register_data)
Write one byte to an LTC2991 register.
int8_t LTC2991_register_read(uint8_t i2c_address, uint8_t register_address, uint8_t *register_data)
Reads an 8-bit register from the LTC2991 using the standard repeated start format.
const float LTC2991_VCC_lsb
Typical VCC LSB weight in volts.
float LTC2991_code_to_diode_voltage(int16_t adc_code, float LTC2991_diode_voltage_lsb)
Calcultates the LTC2991 diode voltage.