90 float_code = (float_code > (floor(float_code) + 0.5)) ? ceil(float_code) : floor(float_code);
91 dac_code = (int32_t)float_code - LTC2605_offset;
94 return ((uint16_t)dac_code);
101 dac_voltage = ((float)(dac_code + LTC2605_offset)*
LTC2605_lsb);
102 return (dac_voltage);
static int16_t LTC2605_offset
DAC offset.
Header File for Linduino Libraries and Demo Code.
uint16_t LTC2605_voltage_to_code(float dac_voltage, float LTC2605_lsb, int16_t LTC2605_offset)
Calculate a LTC2605 DAC code given the desired output voltage.
int8_t i2c_write_word_data(uint8_t address, uint8_t command, uint16_t value)
Write a 16-bit word of data to register specified by "command".
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
int8_t LTC2605_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 LTC2605.
float LTC2605_code_to_voltage(uint16_t dac_code, float LTC2605_lsb, int16_t LTC2605_offset)
Calculate the LTC2605 DAC output voltage given the DAC code, offset, and LSB value.
LTC2605: Octal 16-/14-/12-Bit Rail-to Rail DACs in 16-Lead SSOP.