Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board

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
code16-bit digital input data
reference_voltageReference voltage
rangeUnipolar/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
voltageAnalog voltage to be converted into code
reference_voltageReference Voltage
rangeUnipolar/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
csChip Select Pin
data16-bit digital input data

Definition at line 85 of file LTC2642.cpp.