![]() |
Linduino
1.3.0
Linear Technology Arduino-Compatible Demonstration Board
|
Library for LTC2654 Quad SPI 16-/12-Bit Rail-to-Rail DACs with 10ppm/C Max Reference. More...
Library for LTC2654 Quad SPI 16-/12-Bit Rail-to-Rail DACs with 10ppm/C Max Reference.
Definition in file LTC2654.cpp.
Go to the source code of this file.
Functions | |
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. More... | |
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) More... | |
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. More... | |
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 codes. More... | |
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 codes.
dac_code1 | First DAC code |
dac_code2 | Second DAC code |
voltage1 | First voltage |
voltage2 | Second voltage |
LTC2654_lsb | Returns resulting LSB (volts) |
LTC2654_offset | Returns resulting Offset (volts) |
Definition at line 115 of file LTC2654.cpp.
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.
dac_code | DAC code |
LTC2654_lsb | LSB value (volts) |
LTC2654_offset | Offset (volts) |
Definition at line 107 of file LTC2654.cpp.
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)
dac_voltage | Voltage to send to DAC |
LTC2654_lsb | LSB value (volts) |
LTC2654_offset | Offset (volts) |
Definition at line 94 of file LTC2654.cpp.
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.
cs | Chip Select Pin |
dac_command | Command Nibble, left-justified, lower nibble set to zero |
dac_address | DAC Address Nibble, right justified, upper nibble set to zero |
dac_code | 16-bit DAC code |
Definition at line 79 of file LTC2654.cpp.