105 #define LTC2640_CS QUIKEVAL_CS 110 #define LTC2640_CMD_WRITE 0x00 // Write to input register 111 #define LTC2640_CMD_UPDATE 0x10 // Update (power up) DAC register 112 #define LTC2640_CMD_WRITE_UPDATE 0x30 // Write to and update (power up) the DAC register 113 #define LTC2640_CMD_POWER_DOWN 0x40 // Power down 114 #define LTC2640_CMD_INTERNAL_REFERENCE 0x60 // Select internal reference (default at power up) 115 #define LTC2640_CMD_EXTERNAL_REFERENCE 0x70 // Select the supply as the reference void LTC2640_calibrate(uint16_t dac_code1, uint16_t dac_code2, float voltage1, float voltage2, float *LTC2640_lsb, int16_t *LTC2640_offset)
Calculate the LTC2640 offset and LSB voltages given two measured voltages and their corresponding cod...
float LTC2640_code_to_voltage(uint16_t dac_code, float LTC2640_lsb, int16_t LTC2640_offset)
Calculate the LTC2640 DAC output voltage given the DAC code, offset, and LSB value.
uint16_t LTC2640_voltage_to_code(float dac_voltage, float LTC2640_lsb, int16_t LTC2640_offset)
Calculate the LTC2640 DAC code given the desired output voltage.
static float LTC2640_lsb
DAC lsb.
static int16_t LTC2640_offset
DAC offset.
void LTC2640_write(uint8_t cs, uint8_t dac_command, uint16_t dac_code)
Write the dac_command and 16-bit dac_code to the LTC2640.