![]() |
Linduino
1.3.0
Linear Technology Arduino-Compatible Demonstration Board
|
Library for LTC2607: 16-Bit, Dual Rail-to-Rail DACs with I2C Interface. More...
Library for LTC2607: 16-Bit, Dual Rail-to-Rail DACs with I2C Interface.
Definition in file LTC2607.cpp.
Go to the source code of this file.
Functions | |
int8_t | LTC2607_write (uint8_t i2c_address, uint8_t dac_command, uint8_t dac_address, uint16_t dac_code) |
Writes command, DAC address, and DAC code to the LTC2607. More... | |
uint16_t | LTC2607_voltage_to_code (float dac_voltage, float LTC2607_lsb, int32_t LTC2607_offset) |
Calculates an LTC2607 DAC code for the desired output voltage. More... | |
void | LTC2607_calibrate (uint16_t dac_code1, uint16_t dac_code2, float voltage1, float voltage2, float *LTC2607_lsb, int32_t *LTC2607_offset) |
Calculates the LTC2607 offset and lsb voltage given two measured voltages and their corresponding DAC codes. More... | |
void LTC2607_calibrate | ( | uint16_t | dac_code1, |
uint16_t | dac_code2, | ||
float | voltage1, | ||
float | voltage2, | ||
float * | LTC2607_lsb, | ||
int32_t * | LTC2607_offset | ||
) |
Calculates the LTC2607 offset and lsb voltage given two measured voltages and their corresponding DAC codes.
Prior to calling this function, write two DAC codes to the LTC2607, and measure the output voltage for each DAC code. When passed the DAC codes and measured voltages as parameters, this function calculates the calibrated lsb and offset values.
dac_code1 | DAC Code 1. |
dac_code2 | DAC Code 2. |
voltage1 | Measured output voltage corresponding to DAC Code 1. |
voltage2 | Measured output voltage corresponding to DAC Code 2. |
LTC2607_lsb | Overwritten with new calculated lsb voltage. |
LTC2607_offset | Overwritten with new calculated offset voltage. |
Definition at line 127 of file LTC2607.cpp.
uint16_t LTC2607_voltage_to_code | ( | float | dac_voltage, |
float | LTC2607_lsb, | ||
int32_t | LTC2607_offset | ||
) |
Calculates an LTC2607 DAC code for the desired output voltage.
Based on the desired output voltage, the offset, and lsb parameters, return the corresponding DAC code that should be written to the LTC2607.
dac_voltage | Desired DAC output voltage. |
LTC2607_lsb | The LSB weight. Use calibrated value for best results, otherwise use typical value from datasheet. |
LTC2607_offset | The offset voltage. Use calibrated value for best results, otherwise use typical value from datasheet. |
Definition at line 110 of file LTC2607.cpp.
int8_t LTC2607_write | ( | uint8_t | i2c_address, |
uint8_t | dac_command, | ||
uint8_t | dac_address, | ||
uint16_t | dac_code | ||
) |
Writes command, DAC address, and DAC code to the LTC2607.
Configures command (write, update, power down, etc.), address (DAC A, DAC B, or BOTH), and 16-bit dac_code for output voltage.
i2c_address | I2C address of the LTC2607. Configured by CA0, CA1, and CA2 pins. See Table 1 of datasheet. |
dac_command | DAC command (4-bits) that will be written to LTC2607. (Write, update, power down, etc.) |
dac_address | DAC address (4-bits) that will be written to LTC2607. Configures DAC A, DAC B, or both. |
dac_code | DAC code that will be written to LTC2607. This configures the output voltage. |
Definition at line 100 of file LTC2607.cpp.