Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board

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

Detailed Description

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

Definition in file LTC2636.cpp.

Go to the source code of this file.

Functions

void LTC2636_write (uint8_t cs, uint8_t dac_command, uint8_t dac_address, uint16_t dac_code)
 Write the 16-bit dac_code to the LTC2636. More...
 
uint16_t LTC2636_voltage_to_code (float dac_voltage, float LTC2636_lsb, int16_t LTC2636_offset)
 Calculate a LTC2636 DAC code given the desired output voltage, offset, and LSB value. More...
 
float LTC2636_code_to_voltage (uint16_t dac_code, float LTC2636_lsb, int16_t LTC2636_offset)
 Calculate the LTC2636 DAC output voltage given the DAC code, offset, and LSB value. More...
 
void LTC2636_calibrate (uint16_t dac_code1, uint16_t dac_code2, float voltage1, float voltage2, float *LTC2636_lsb, int16_t *LTC2636_offset)
 Calculate the LTC2636 offset and LSB voltages given two measured voltages and their corresponding codes. More...
 

Function Documentation

◆ LTC2636_calibrate()

void LTC2636_calibrate ( uint16_t  dac_code1,
uint16_t  dac_code2,
float  voltage1,
float  voltage2,
float *  LTC2636_lsb,
int16_t *  LTC2636_offset 
)

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

Returns
Void
Parameters
dac_code1First DAC code
dac_code2Second DAC code
voltage1First voltage
voltage2Second voltage
LTC2636_lsbReturns resulting LSB (volts)
LTC2636_offsetReturns resulting Offset (volts)

Definition at line 120 of file LTC2636.cpp.

◆ LTC2636_code_to_voltage()

float LTC2636_code_to_voltage ( uint16_t  dac_code,
float  LTC2636_lsb,
int16_t  LTC2636_offset 
)

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

Returns
Calculated voltage
Parameters
dac_codeDAC code
LTC2636_lsbLSB value (volts)
LTC2636_offsetOffset (volts)

Definition at line 112 of file LTC2636.cpp.

◆ LTC2636_voltage_to_code()

uint16_t LTC2636_voltage_to_code ( float  dac_voltage,
float  LTC2636_lsb,
int16_t  LTC2636_offset 
)

Calculate a LTC2636 DAC code given the desired output voltage, offset, and LSB value.

Returns
The 16-bit code to send to the DAC
Parameters
dac_voltageVoltage to send to DAC
LTC2636_lsbLSB value (volts)
LTC2636_offsetOffset (volts)

Definition at line 99 of file LTC2636.cpp.

◆ LTC2636_write()

void LTC2636_write ( uint8_t  cs,
uint8_t  dac_command,
uint8_t  dac_address,
uint16_t  dac_code 
)

Write the 16-bit dac_code to the LTC2636.

Returns
Void
Parameters
csChip Select Pin
dac_commandCommand Nibble, left-justified, lower nibble set to zero
dac_addressDAC Address Nibble, right justified, upper nibble set to zero
dac_code16-bit DAC code

Definition at line 84 of file LTC2636.cpp.