Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board

Library for LTC1867: 16-Bit 8-Channel 200ksps ADC. More...

Detailed Description

Library for LTC1867: 16-Bit 8-Channel 200ksps ADC.

Definition in file LTC1867.cpp.

Go to the source code of this file.

Functions

void LTC1867_read (uint8_t cs, uint8_t adc_command, uint16_t *adc_code)
 Reads the ADC and returns 16-bit data. More...
 
float LTC1867_unipolar_code_to_voltage (uint16_t adc_code, float LTC1867_lsb, int32_t LTC1867_offset_unipolar_code)
 Calculates the LTC1867 input's unipolar voltage given the binary data and lsb weight. More...
 
float LTC1867_bipolar_code_to_voltage (uint16_t adc_code, float LTC1867_lsb, int32_t LTC1867_offset_bipolar_code)
 Calculates the LTC1867 input's bipolar voltage given the two's compliment data and lsb weight. More...
 
void LTC1867_cal_voltage (uint16_t zero_unipolar_code, uint16_t zero_bipolar_code, uint16_t fs_code, float zero_voltage, float fs_voltage, float *LTC1867_lsb, int32_t *LTC1867_offset_unipolar_code, int32_t *LTC1867_offset_bipolar_code)
 Calibrate the offset and LSB voltage given two measured offset codes, and a full-scale voltage with the corresponding code. More...
 

Function Documentation

◆ LTC1867_bipolar_code_to_voltage()

float LTC1867_bipolar_code_to_voltage ( uint16_t  adc_code,
float  LTC1867_lsb,
int32_t  LTC1867_offset_bipolar_code 
)

Calculates the LTC1867 input's bipolar voltage given the two's compliment data and lsb weight.

Returns
Floating point voltage
Parameters
adc_codeRaw ADC code
LTC1867_lsbLSB value (volts)
LTC1867_offset_bipolar_codeOffset code

Definition at line 92 of file LTC1867.cpp.

◆ LTC1867_cal_voltage()

void LTC1867_cal_voltage ( uint16_t  zero_unipolar_code,
uint16_t  zero_bipolar_code,
uint16_t  fs_code,
float  zero_voltage,
float  fs_voltage,
float *  LTC1867_lsb,
int32_t *  LTC1867_offset_unipolar_code,
int32_t *  LTC1867_offset_bipolar_code 
)

Calibrate the offset and LSB voltage given two measured offset codes, and a full-scale voltage with the corresponding code.

Returns
Void
Parameters
zero_unipolar_codeCode from a unipolar zero reading
zero_bipolar_codeCode from a bipolar zero reading
fs_codefull-scale code
zero_voltageMeasured zero voltage
fs_voltageMeasured full-scale voltage
LTC1867_lsbReturn LSB value (volts)
LTC1867_offset_unipolar_codeReturn Unipolar Offset code, in floating point
LTC1867_offset_bipolar_codeReturn Bipolar Offset code, in floating point

Definition at line 105 of file LTC1867.cpp.

◆ LTC1867_read()

void LTC1867_read ( uint8_t  cs,
uint8_t  adc_command,
uint16_t *  adc_code 
)

Reads the ADC and returns 16-bit data.

Returns
void
Parameters
csChip Select Pin
adc_commandChannel address, config bits ORed together
adc_codeReturns code read from ADC (from previous conversion)

Definition at line 78 of file LTC1867.cpp.

◆ LTC1867_unipolar_code_to_voltage()

float LTC1867_unipolar_code_to_voltage ( uint16_t  adc_code,
float  LTC1867_lsb,
int32_t  LTC1867_offset_unipolar_code 
)

Calculates the LTC1867 input's unipolar voltage given the binary data and lsb weight.

Returns
Floating point voltage
Parameters
adc_codeRaw ADC code
LTC1867_lsbLSB value (volts)
LTC1867_offset_unipolar_codeOffset code

Definition at line 84 of file LTC1867.cpp.