![]() |
Linduino
1.3.0
Linear Technology Arduino-Compatible Demonstration Board
|
Library for LTC2640: Single 12-/10-/8-Bit Rail-to-Rail DACs with 10ppm/C Reference. More...
Library for LTC2640: Single 12-/10-/8-Bit Rail-to-Rail DACs with 10ppm/C Reference.
Definition in file LTC2640.cpp.
Go to the source code of this file.
Functions | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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 codes. More... | |
| 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 codes.
| dac_code1 | First DAC code |
| dac_code2 | Second DAC code |
| voltage1 | First voltage |
| voltage2 | Second voltage |
| LTC2640_lsb | Returns resulting LSB (volts) |
| LTC2640_offset | Returns resulting Offset (volts) |
Definition at line 123 of file LTC2640.cpp.
| 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.
| dac_code | DAC code |
| LTC2640_lsb | LSB value (volts) |
| LTC2640_offset | Offset (volts) |
Definition at line 115 of file LTC2640.cpp.
| 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.
| dac_voltage | Voltage to send to DAC |
| LTC2640_lsb | LSB value (volts) |
| LTC2640_offset | Offset (volts) |
Definition at line 101 of file LTC2640.cpp.
| 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.
The dac_code must be left aligned before calling this function.
| cs | Chip Select Pin |
| dac_command | Command code nibble |
| dac_code | 12-bit DAC code, left justified |
Definition at line 87 of file LTC2640.cpp.