118 #define LTC2637_I2C_ADDRESS 0x10 // GND GND GND 146 #define LTC2637_I2C_GLOBAL_ADDRESS 0x73 152 #define LTC2637_CMD_WRITE 0x00 // Write to input register n 153 #define LTC2637_CMD_UPDATE 0x10 // Update (power up) DAC register n 154 #define LTC2637_CMD_WRITE_UPDATE 0x30 // Write to input register n, update (power up) all 155 #define LTC2637_CMD_POWER_DOWN 0x40 // Power down n 156 #define LTC2637_CMD_POWER_DOWN_ALL 0x50 // Power down chip (all DACs and reference) 157 #define LTC2637_CMD_INTERNAL_REFERENCE 0x60 // Select internal reference (power up reference) 158 #define LTC2637_CMD_EXTERNAL_REFERENCE 0x70 // Select external reference (power down internal reference) 159 #define LTC2637_CMD_NO_OPERATION 0xF0 // No operation 165 #define LTC2637_DAC_A 0x00 166 #define LTC2637_DAC_B 0x01 167 #define LTC2637_DAC_C 0x02 168 #define LTC2637_DAC_D 0x03 169 #define LTC2637_DAC_E 0x04 170 #define LTC2637_DAC_F 0x05 171 #define LTC2637_DAC_G 0x06 172 #define LTC2637_DAC_H 0x07 173 #define LTC2637_DAC_ALL 0x0F static int16_t LTC2637_offset[9]
DAC offset - index 8 for "all DACs".
static float LTC2637_lsb[9]
The LTC2637 lsb - index 8 for "all DACs".
float LTC2637_code_to_voltage(uint16_t dac_code, float LTC2637_lsb, int16_t LTC2637_offset)
Calculate the LTC2637 DAC output voltage given the DAC code, offset, and LSB value.
void LTC2637_calibrate(uint16_t dac_code1, uint16_t dac_code2, float voltage1, float voltage2, float *LTC2637_lsb, int16_t *LTC2637_offset)
Calculate the LTC2637 offset and LSB voltages given two measured voltages and their corresponding cod...
int8_t LTC2637_write(uint8_t i2c_address, uint8_t dac_command, uint8_t dac_address, uint16_t dac_code)
Write a 16-bit dac_code to the LTC2637.
uint16_t LTC2637_voltage_to_code(float dac_voltage, float LTC2637_lsb, int16_t LTC2637_offset)
Calculate a LTC2637 DAC code given the desired output voltage and DAC address (0-3) ...