| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

Functions
LTC2637.cpp File Reference
Digital-to-Analog Converters (DAC) » LTC2637: Octal 12-/10-/8-Bit I2C VOUT DACs with 10ppm/°C Reference

Library for LTC2637 Octal 12-/10-/8-Bit I2C VOUT DACs with 10ppm/°C Reference. More...

## Detailed Description

Library for LTC2637 Octal 12-/10-/8-Bit I2C VOUT DACs with 10ppm/°C Reference.

Definition in file LTC2637.cpp.

Go to the source code of this file.

## Functions
int8_t | LTC2637_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 LTC2637. More...
uint16_t | LTC2637_voltage_to_code (float dac_voltage, float LTC2637_lsb, int16_t LTC2637_offset)
| Calculate a LTC2637 DAC code given the desired output voltage and DAC address (0-3) More...
float | LTC2637_code_to_voltage (uint16_t dac_code, float LTC2637_lsb, int16_t LTC2637_offset)
| Calculate the LTC2637 DAC output voltage given the DAC code, offset, and LSB value. More...
void | LTC2637_calibrate (uint16_t dac_code1, uint16_t dac_code2, float voltage1, float voltage2, float *LTC2637_lsb, int16_t *LTC2637_offset)
| Calculate the LTC2637 offset and LSB voltages given two measured voltages and their corresponding codes. More...

## Function Documentation

## ◆ LTC2637_calibrate()

void LTC2637_calibrate | ( | uint16_t | dac_code1,
|  | uint16_t | dac_code2,
|  | float | voltage1,
|  | float | voltage2,
|  | float * | LTC2637_lsb,
|  | int16_t * | LTC2637_offset
| ) |  |

Calculate the LTC2637 offset and LSB voltages given two measured voltages and their corresponding codes.

Returns
  Void

Parameters

  dac_code1 | First DAC code
  dac_code2 | Second DAC code
  voltage1 | First voltage
  voltage2 | Second voltage
  LTC2637_lsb | Returns resulting LSB (volts)
  LTC2637_offset | Returns resulting Offset (volts)

Definition at line 117 of file LTC2637.cpp.

## ◆ LTC2637_code_to_voltage()

float LTC2637_code_to_voltage | ( | uint16_t | dac_code,
|  | float | LTC2637_lsb,
|  | int16_t | LTC2637_offset
| ) |  |

Calculate the LTC2637 DAC output voltage given the DAC code, offset, and LSB value.

Returns
  Calculated voltage

Parameters

  dac_code | DAC code
  LTC2637_lsb | LSB value (volts)
  LTC2637_offset | Offset (volts)

Definition at line 109 of file LTC2637.cpp.

## ◆ LTC2637_voltage_to_code()

uint16_t LTC2637_voltage_to_code | ( | float | dac_voltage,
|  | float | LTC2637_lsb,
|  | int16_t | LTC2637_offset
| ) |  |

Calculate a LTC2637 DAC code given the desired output voltage and DAC address (0-3)

Returns
  The 16-bit code to send to the DAC

Parameters

  dac_voltage | Voltage to send to DAC
  LTC2637_lsb | LSB value (volts)
  LTC2637_offset | Offset (volts)

Definition at line 96 of file LTC2637.cpp.

## ◆ LTC2637_write()

int8_t LTC2637_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 LTC2637.

Returns
  ACK bit (0=acknowledge, 1=no acknowledge)

Parameters

  i2c_address | I2C address of DAC
  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 87 of file LTC2637.cpp.