| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

Functions
LTC1867.cpp File Reference
Analog-to-Digital Converters (ADC) » LTC1867: 16-Bit 8-Channel 200ksps ADC

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_code | Raw ADC code
  LTC1867_lsb | LSB value (volts)
  LTC1867_offset_bipolar_code | Offset 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_code | Code from a unipolar zero reading
  zero_bipolar_code | Code from a bipolar zero reading
  fs_code | full-scale code
  zero_voltage | Measured zero voltage
  fs_voltage | Measured full-scale voltage
  LTC1867_lsb | Return LSB value (volts)
  LTC1867_offset_unipolar_code | Return Unipolar Offset code, in floating point
  LTC1867_offset_bipolar_code | Return 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

  cs | Chip Select Pin
  adc_command | Channel address, config bits ORed together
  adc_code | Returns 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_code | Raw ADC code
  LTC1867_lsb | LSB value (volts)
  LTC1867_offset_unipolar_code | Offset code

Definition at line 84 of file LTC1867.cpp.