| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

Functions
LTC2642.cpp File Reference
Digital-to-Analog Converters (DAC) » LTC2642: 16-/14-/12-Bit VOUT DAC with SPI Interface

Library for LTC2642 16-/14-/12-Bit VOUT DAC with SPI Interface. More...

## Detailed Description

Library for LTC2642 16-/14-/12-Bit VOUT DAC with SPI Interface.

Definition in file LTC2642.cpp.

Go to the source code of this file.

## Functions
void | LTC2642_write (uint8_t cs, uint16_t data)
| Writes the 16-bit data into the DAC. More...
uint16_t | LTC2642_voltage_to_code (float voltage, float reference_voltage, uint8_t range)
| Calculates the 16 bit data code from voltage. More...
float | LTC2642_code_to_voltage (uint16_t code, float reference_voltage, uint8_t range)
| Calculates the output voltage from the given digital code and reference voltage. More...

## Function Documentation

## ◆ LTC2642_code_to_voltage()

float LTC2642_code_to_voltage | ( | uint16_t | data,
|  | float | reference_voltage,
|  | uint8_t | range
| ) |  |

Calculates the output voltage from the given digital code and reference voltage.

Returns
  Floating point voltage

Parameters

  code | 16-bit digital input data
  reference_voltage | Reference voltage
  range | Unipolar/Bipolar

Definition at line 107 of file LTC2642.cpp.

## ◆ LTC2642_voltage_to_code()

uint16_t LTC2642_voltage_to_code | ( | float | voltage,
|  | float | reference_voltage,
|  | uint8_t | range
| ) |  |

Calculates the 16 bit data code from voltage.

Returns
  16-bit code

Parameters

  voltage | Analog voltage to be converted into code
  reference_voltage | Reference Voltage
  range | Unipolar/Bipolar

Definition at line 92 of file LTC2642.cpp.

## ◆ LTC2642_write()

void LTC2642_write | ( | uint8_t | cs,
|  | uint16_t | data
| ) |  |

Writes the 16-bit data into the DAC.

Returns
  void

Parameters

  cs | Chip Select Pin
  data | 16-bit digital input data

Definition at line 85 of file LTC2642.cpp.