104 #define LTC2654_CS QUIKEVAL_CS 110 #define LTC2654_CMD_WRITE 0x00 111 #define LTC2654_CMD_UPDATE 0x10
112 #define LTC2654_CMD_WRITE_UPDATE_ALL 0x20
113 #define LTC2654_CMD_WRITE_UPDATE 0x30
114 #define LTC2654_CMD_POWER_DOWN 0x40
115 #define LTC2654_CMD_POWER_DOWN_ALL 0x50
116 #define LTC2654_CMD_INTERNAL_REFERENCE 0x60
117 #define LTC2654_CMD_EXTERNAL_REFERENCE 0x70
118 #define LTC2654_CMD_NO_OPERATION 0xF0
124 #define LTC2654_DAC_A 0x00 125 #define LTC2654_DAC_B 0x01 126 #define LTC2654_DAC_C 0x02 127 #define LTC2654_DAC_D 0x03 128 #define LTC2654_DAC_ALL 0x0F void LTC2654_write(uint8_t cs, uint8_t dac_command, uint8_t dac_address, uint16_t dac_code)
Write the 16-bit dac_code to the LTC2654.
static int16_t LTC2654_offset[5]
DAC offset - index 4 for "all DACs".
uint16_t LTC2654_voltage_to_code(float dac_voltage, float LTC2654_lsb, int16_t LTC2654_offset)
Calculate a LTC2654 DAC code given the desired output voltage and DAC address (0-3) ...
float LTC2654_code_to_voltage(uint16_t dac_code, float LTC2654_lsb, int16_t LTC2654_offset)
Calculate the LTC2654 DAC output voltage given the DAC code, offset, and LSB value.
static float LTC2654_lsb[5]
The LTC2654 lsb - index 4 for "all DACs".
void LTC2654_calibrate(uint16_t dac_code1, uint16_t dac_code2, float voltage1, float voltage2, float *LTC2654_lsb, int16_t *LTC2654_offset)
Calculate the LTC2654 offset and LSB voltage given two measured voltages and their corresponding code...