Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board
LTC24XX_general.h File Reference

LTC24XX General Library: Functions and defines for all SINC4 Delta Sigma ADCs. More...

Detailed Description

LTC24XX General Library: Functions and defines for all SINC4 Delta Sigma ADCs.

LTC2442 / LTC2444 / LTC2445 / LTC2448 / LTC2449 (Are there don't care bits in the low channel counts?
SPI DATA FORMAT (MSB First):

            Byte #1                            Byte #2

Data Out :  !EOC DMY SIG D28 D27 D26 D25 D24   D23  D22  D21  D20  D19 D18 D17 D16
Data In  :  1    0   EN  SGL OS  S2  S1  S0    OSR3 OSR2 OSR1 OSR1 SPD X   X   X

            Byte #3                            Byte #4
            D15  D14 D13 D12 D11 D10 D9  D8    D7  D6  D5  D4 *D3  *D2 *D1 *D0
            X    X   X   X   X   X   X   X     X   X   X   X   X   X   X   X

!EOC : End of Conversion Bit (Active Low)
DMY  : Dummy Bit (Always 0)
SIG  : Sign Bit (1-data positive, 0-data negative)
Dx   : Data Bits
*Dx  : Data Bits Below lsb
EN   : Enable Bit (0-keep previous mode, 1-change mode)
SGL  : Enable Single-Ended Bit (0-differential, 1-single-ended)
OS   : ODD/Sign Bit
Sx   : Address Select Bit
0SRX : Over Sampling Rate Bits
SPD  : Double Output Rate Select Bit (0-Normal rate, auto-calibration on, 2x rate, auto_calibration off)

Command Byte #1
1    0    EN   SGL  OS   S2   S1   S0   Comments
1    0    0    X    X    X    X    X    Keep Previous Mode
1    0    1    0    X    X    X    X    Differential Mode
1    0    1    1    X    X    X    X    Single-Ended Mode

|  Coversion Rate    |  RMS  | ENOB | OSR  | Latency
Command Byte #2          |Internal | External | Noise |      |      |
|  9MHz   | 10.24MHz |       |      |      |
OSR3 OSR2 OSR1 OSR1 SPD  | Clock   |  Clock   |       |      |      |
0    0    0    0    0      Keep Previous Speed/Resolution
0    0    0    1    0      3.52kHz   4kHz       23uV    17     64     none
0    0    1    0    0      1.76kHz   2kHz       3.5uV   20.1   128    none
0    0    1    1    0      880Hz     1kHz       2uV     21.3   256    none
0    1    0    0    0      440Hz     500Hz      1.4uV   21.8   512    none
0    1    0    1    0      220Hz     250Hz      1uV     22.4   1024   none
0    1    1    0    0      110Hz     125Hz      750nV   22.9   2048   none
0    1    1    1    0      55Hz      62.5Hz     510nV   23.4   4096   none
1    0    0    0    0      27.5Hz    31.25Hz    375nV   24     8192   none
1    0    0    1    0      13.75Hz   15.625Hz   250nV   24.4   16384  none
1    1    1    1    0      6.87kHz   7.8125Hz   200nV   24.6   32768  none
0    0    0    0    1      Keep Previous Speed/Resolution
OSR3 OSR2 OSR1 OSR1 1      2X Mode  *all clock speeds double

Example Code:

Read Channel 0 in Single-Ended with OSR of 65536

    uint16_t miso_timeout = 1000;
    adc_command = LTC2449_CH0 | LTC2449_OSR_32768 | LTC2449_SPEED_2X;   // Build ADC command for channel 0
                                                                        // OSR = 32768*2 = 65536

    if(LTC2449_EOC_timeout(LTC2449_CS, miso_timeout))    // Check for EOC
        return;                                          // Exit if timeout is reached
    LTC2449_read(LTC2449_CS, adc_command, &adc_code);    // Throws out last reading

    if(LTC2449_EOC_timeout(LTC2449_CS, miso_timeout))    // Check for EOC
        return;                                          // Exit if timeout is reached
    LTC2449_read(LTC2449_CS, adc_command, &adc_code);    // Obtains the current reading and stores to adc_code variable

    // Convert adc_code to voltage
    adc_voltage = LTC2449_code_to_voltage(adc_code, LTC2449_lsb, LTC2449_offset_code);

http://www.linear.com/product/LTC2449

http://www.linear.com/product/LTC2449#demoboards

Copyright 2018(c) Analog Devices, Inc.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
  • The use of this software may or may not infringe the patent rights of one or more patent holders. This license does not release you from the requirement that you obtain separate licenses from these patent holders to use this software.
  • Use of the software either in source or binary form, must be run on or directly connected to an Analog Devices Inc. component.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Header for LTC2449: 24-Bit, 16-Channel Delta Sigma ADCs with Selectable Speed/Resolution

Definition in file LTC24XX_general.h.

Go to the source code of this file.

Functions

int8_t LTC24XX_EOC_timeout (uint8_t cs, uint16_t miso_timeout)
 Checks for EOC with a specified timeout. More...
 
void LTC24XX_SPI_32bit_data (uint8_t cs, int32_t *adc_code)
 Reads from LTC24XX ADC that has no configuration word and returns a 32 bit result. More...
 
void LTC24XX_SPI_8bit_command_32bit_data (uint8_t cs, uint8_t adc_command, int32_t *adc_code)
 Reads from LTC24XX ADC that accepts an 8 bit configuration and returns a 32 bit result. More...
 
void LTC24XX_SPI_16bit_command_32bit_data (uint8_t cs, uint8_t adc_command_high, uint8_t adc_command_low, int32_t *adc_code)
 Reads from LTC24XX ADC that accepts a 16 bit configuration and returns a 32 bit result. More...
 
void LTC24XX_SPI_2ch_ping_pong_32bit_data (uint8_t cs, uint8_t *adc_channel, int32_t *code)
 Reads from LTC24XX two channel "Ping-Pong" ADC, placing the channel information in the adc_channel parameter and returning the 32 bit result with the channel bit cleared so the data format matches the rest of the family. More...
 
void LTC24XX_SPI_24bit_data (uint8_t cs, int32_t *adc_code)
 Reads from LTC24XX ADC that has no configuration word and returns a 32 bit result. More...
 
void LTC24XX_SPI_8bit_command_24bit_data (uint8_t cs, uint8_t adc_command, int32_t *adc_code)
 Reads from LTC24XX ADC that accepts an 8 bit configuration and returns a 32 bit result. More...
 
void LTC24XX_SPI_16bit_command_24bit_data (uint8_t cs, uint8_t adc_command_high, uint8_t adc_command_low, int32_t *adc_code)
 Reads from LTC24XX ADC that accepts a 16 bit configuration and returns a 32 bit result. More...
 
void LTC24XX_SPI_8bit_command_16bit_data (uint8_t cs, uint8_t adc_command, int32_t *adc_code)
 Reads from LTC24XX ADC that accepts a 8 bit configuration and returns a 16 bit result. More...
 
void LTC24XX_SPI_2ch_ping_pong_24bit_data (uint8_t cs, uint8_t *adc_channel, int32_t *code)
 Reads from LTC24XX two channel "Ping-Pong" ADC, placing the channel information in the adc_channel parameter and returning the 32 bit result with the channel bit cleared so the data format matches the rest of the family. More...
 
int8_t LTC24XX_I2C_32bit_data (uint8_t i2c_address, int32_t *adc_code, uint16_t eoc_timeout)
 Reads from LTC24XX ADC that has no configuration word and returns a 32 bit result. More...
 
int8_t LTC24XX_I2C_8bit_command_32bit_data (uint8_t i2c_address, uint8_t adc_command, int32_t *adc_code, uint16_t eoc_timeout)
 Reads from LTC24XX ADC that accepts an 8 bit configuration and returns a 32 bit result. More...
 
int8_t LTC24XX_I2C_16bit_command_32bit_data (uint8_t i2c_address, uint8_t adc_command_high, uint8_t adc_command_low, int32_t *adc_code, uint16_t eoc_timeout)
 Reads from LTC24XX ADC that accepts a 16 bit configuration and returns a 32 bit result. More...
 
int8_t LTC24XX_I2C_24bit_data (uint8_t i2c_address, int32_t *adc_code, uint16_t eoc_timeout)
 Reads from LTC24XX ADC that has no configuration word and returns a 32 bit result. More...
 
int8_t LTC24XX_I2C_8bit_command_24bit_data (uint8_t i2c_address, uint8_t adc_command, int32_t *adc_code, uint16_t eoc_timeout)
 Reads from LTC24XX ADC that accepts an 8 bit configuration and returns a 32 bit result. More...
 
int8_t LTC24XX_I2C_16bit_command_24bit_data (uint8_t i2c_address, uint8_t adc_command_high, uint8_t adc_command_low, int32_t *adc_code, uint16_t eoc_timeout)
 Reads from LTC24XX ADC that accepts a 16 bit configuration and returns a 32 bit result. More...
 
float LTC24XX_SE_code_to_voltage (int32_t adc_code, float vref)
 Calculates the voltage corresponding to an ADC code, given the reference voltage. More...
 
float LTC24XX_diff_code_to_voltage (int32_t adc_code, float vref)
 Calculates the voltage corresponding to an ADC code, given the reference voltage. More...
 
float LTC24XX_diff_code_to_calibrated_voltage (int32_t adc_code, float LTC24XX_lsb, int32_t LTC24XX_offset_code)
 Calculates the voltage corresponding to an ADC code, given lsb weight (in volts) and the calibrated ADC offset code (zero code that is subtracted from adc_code). More...
 
void LTC24XX_calibrate_voltage (int32_t zero_code, int32_t fs_code, float zero_voltage, float fs_voltage, float *LTC24XX_lsb, int32_t *LTC24XX_offset_code)
 Calculate the lsb weight and offset code given a full-scale code and a measured zero-code. More...
 

Macros

#define LTC24XX_CS   QUIKEVAL_CS
 Define the SPI CS pin. More...
 
Mode Configuration for High Speed Family

In 2X Mode, A non offset binary 0 can be produced.

This is corrected in the differential code to voltage functions. To disable this correction, uncomment The following #define.

#define LTC24XX_HS_MULTI_KEEP_PREVIOUS_MODE   0x80
 
#define LTC24XX_HS_MULTI_KEEP_PREVIOUS_SPEED_RESOLUTION   0x00
 
#define LTC24XX_HS_MULTI_SPEED_1X   0x00
 
#define LTC24XX_HS_MULTI_SPEED_2X   0x08
 
Mode Configuration for EasyDrive Family
#define LTC24XX_EZ_MULTI_VIN   0b10000000
 
#define LTC24XX_EZ_MULTI_PTAT   0b11000000
 
#define LTC24XX_EZ_MULTI_R50   0b10010000
 
#define LTC24XX_EZ_MULTI_R55   0b10000000
 
#define LTC24XX_EZ_MULTI_R60   0b10100000
 
#define LTC24XX_EZ_MULTI_SLOW   0b10000000
 
#define LTC24XX_EZ_MULTI_FAST   0b10001000
 
Single-Ended Channel Configuration
Channel selection for all multi-channel, differential input ADCs, even those that only require
8 bits of configuration (no further options.) Most devices in this category require a second
byte of configuration for speed mode, temperature sensor selection, etc., but for the sake
of simplicity a single function will be used to read all devices, sending zeros in the second
configuration byte if only the channel is specified.

Applicable devices:
Easy Drive:
LTC2486, LTC2487, LTC2488, LTC2489, LTC2492, LTC2493,
LTC2494, LTC2495, LTC2496, LTC2497, LTC2498, LTC2499
First Generation Differential:
LTC2414, LTC2418, LTC2439
High Speed:
LTC2442, LTC2444, LTC2445, LTC2448, LTC2449
#define LTC24XX_MULTI_CH_CH0   0xB0
 
#define LTC24XX_MULTI_CH_CH1   0xB8
 
#define LTC24XX_MULTI_CH_CH2   0xB1
 
#define LTC24XX_MULTI_CH_CH3   0xB9
 
#define LTC24XX_MULTI_CH_CH4   0xB2
 
#define LTC24XX_MULTI_CH_CH5   0xBA
 
#define LTC24XX_MULTI_CH_CH6   0xB3
 
#define LTC24XX_MULTI_CH_CH7   0xBB
 
#define LTC24XX_MULTI_CH_CH8   0xB4
 
#define LTC24XX_MULTI_CH_CH9   0xBC
 
#define LTC24XX_MULTI_CH_CH10   0xB5
 
#define LTC24XX_MULTI_CH_CH11   0xBD
 
#define LTC24XX_MULTI_CH_CH12   0xB6
 
#define LTC24XX_MULTI_CH_CH13   0xBE
 
#define LTC24XX_MULTI_CH_CH14   0xB7
 
#define LTC24XX_MULTI_CH_CH15   0xBF
 
Differential Channel Configuration
See note for single-ended configuration above.
#define LTC24XX_MULTI_CH_P0_N1   0xA0
 
#define LTC24XX_MULTI_CH_P1_N0   0xA8
 
#define LTC24XX_MULTI_CH_P2_N3   0xA1
 
#define LTC24XX_MULTI_CH_P3_N2   0xA9
 
#define LTC24XX_MULTI_CH_P4_N5   0xA2
 
#define LTC24XX_MULTI_CH_P5_N4   0xAA
 
#define LTC24XX_MULTI_CH_P6_N7   0xA3
 
#define LTC24XX_MULTI_CH_P7_N6   0xAB
 
#define LTC24XX_MULTI_CH_P8_N9   0xA4
 
#define LTC24XX_MULTI_CH_P9_N8   0xAC
 
#define LTC24XX_MULTI_CH_P10_N11   0xA5
 
#define LTC24XX_MULTI_CH_P11_N10   0xAD
 
#define LTC24XX_MULTI_CH_P12_N13   0xA6
 
#define LTC24XX_MULTI_CH_P13_N12   0xAE
 
#define LTC24XX_MULTI_CH_P14_N15   0xA7
 
#define LTC24XX_MULTI_CH_P15_N14   0xAF
 
Oversample Ratio (OSR) Commands
#define LTC24XX_MULTI_CH_OSR_64   0x10
 
#define LTC24XX_MULTI_CH_OSR_128   0x20
 
#define LTC24XX_MULTI_CH_OSR_256   0x30
 
#define LTC24XX_MULTI_CH_OSR_512   0x40
 
#define LTC24XX_MULTI_CH_OSR_1024   0x50
 
#define LTC24XX_MULTI_CH_OSR_2048   0x60
 
#define LTC24XX_MULTI_CH_OSR_4096   0x70
 
#define LTC24XX_MULTI_CH_OSR_8192   0x80
 
#define LTC24XX_MULTI_CH_OSR_16384   0x90
 
#define LTC24XX_MULTI_CH_OSR_32768   0xF0
 

Function Documentation

◆ LTC24XX_calibrate_voltage()

void LTC24XX_calibrate_voltage ( int32_t  zero_code,
int32_t  fs_code,
float  zero_voltage,
float  fs_voltage,
float *  LTC24XX_lsb,
int32_t *  LTC24XX_offset_code 
)

Calculate the lsb weight and offset code given a full-scale code and a measured zero-code.

Returns
Void
Parameters
zero_codeMeasured code with the inputs shorted to ground
fs_codeMeasured code at nearly full-scale
zero_voltageMeasured zero voltage
fs_voltageVoltage measured at input (with voltmeter) when fs_code was read from ADC
LTC24XX_lsbOverwritten with lsb weight (in volts)
LTC24XX_offset_codeOverwritten with offset code (zero code)

Definition at line 427 of file LTC24XX_general.cpp.

◆ LTC24XX_diff_code_to_calibrated_voltage()

float LTC24XX_diff_code_to_calibrated_voltage ( int32_t  adc_code,
float  LTC24XX_lsb,
int32_t  LTC24XX_offset_code 
)

Calculates the voltage corresponding to an ADC code, given lsb weight (in volts) and the calibrated ADC offset code (zero code that is subtracted from adc_code).

Applies to differential input, SPI interface parts.

Returns
Returns voltage calculated from ADC code.
Parameters
adc_codeCode read from ADC
LTC24XX_lsbLSB weight (in volts)
LTC24XX_offset_codeThe calibrated offset code (This is the ADC code zero code that will be subtracted from adc_code)

Definition at line 409 of file LTC24XX_general.cpp.

◆ LTC24XX_diff_code_to_voltage()

float LTC24XX_diff_code_to_voltage ( int32_t  adc_code,
float  vref 
)

Calculates the voltage corresponding to an ADC code, given the reference voltage.

Applies to differential input parts (LTC2410 type input)

Returns
Returns voltage calculated from ADC code.
Parameters
adc_codeCode read from ADC
vrefReference voltage

Definition at line 389 of file LTC24XX_general.cpp.

◆ LTC24XX_EOC_timeout()

int8_t LTC24XX_EOC_timeout ( uint8_t  cs,
uint16_t  miso_timeout 
)

Checks for EOC with a specified timeout.

Applies to all SPI interface delta sigma ADCs that have SINC4 rejection, does NOT apply to LTC2450/60/70 family.

Returns
Returns 0=successful, 1=unsuccessful (exceeded timeout)
Parameters
csChip Select pin
miso_timeoutTimeout (in milliseconds)

Definition at line 82 of file LTC24XX_general.cpp.

◆ LTC24XX_I2C_16bit_command_24bit_data()

int8_t LTC24XX_I2C_16bit_command_24bit_data ( uint8_t  i2c_address,
uint8_t  adc_command_high,
uint8_t  adc_command_low,
int32_t *  adc_code,
uint16_t  eoc_timeout 
)

Reads from LTC24XX ADC that accepts a 16 bit configuration and returns a 32 bit result.

Returns
Returns the state of the acknowledge bit after the I2C address write. 0=acknowledge, 1=no acknowledge.
Parameters
i2c_addressI2C address of device
adc_command_highFirst command byte written to LTC24XX
adc_command_lowSecond command written to LTC24XX
adc_code4 byte conversion code read from LTC24XX
eoc_timeoutTimeout (in milliseconds)

◆ LTC24XX_I2C_16bit_command_32bit_data()

int8_t LTC24XX_I2C_16bit_command_32bit_data ( uint8_t  i2c_address,
uint8_t  adc_command_high,
uint8_t  adc_command_low,
int32_t *  adc_code,
uint16_t  eoc_timeout 
)

Reads from LTC24XX ADC that accepts a 16 bit configuration and returns a 32 bit result.

Returns
Returns the state of the acknowledge bit after the I2C address write. 0=acknowledge, 1=no acknowledge.
Parameters
i2c_addressI2C address of device
adc_command_highFirst command byte written to LTC24XX
adc_command_lowSecond command written to LTC24XX
adc_code4 byte conversion code read from LTC24XX
eoc_timeoutTimeout (in milliseconds)

Definition at line 350 of file LTC24XX_general.cpp.

◆ LTC24XX_I2C_24bit_data()

int8_t LTC24XX_I2C_24bit_data ( uint8_t  i2c_address,
int32_t *  adc_code,
uint16_t  eoc_timeout 
)

Reads from LTC24XX ADC that has no configuration word and returns a 32 bit result.

Applies to: LTC2483 (only this lonely one!)

Returns
Returns the state of the acknowledge bit after the I2C address write. 0=acknowledge, 1=no acknowledge.
Parameters
i2c_addressI2C address of device
adc_code4 byte conversion code read from LTC24XX
eoc_timeoutTimeout (in milliseconds)

◆ LTC24XX_I2C_32bit_data()

int8_t LTC24XX_I2C_32bit_data ( uint8_t  i2c_address,
int32_t *  adc_code,
uint16_t  eoc_timeout 
)

Reads from LTC24XX ADC that has no configuration word and returns a 32 bit result.

Returns
Returns the state of the acknowledge bit after the I2C address write. 0=acknowledge, 1=no acknowledge.

Data is formatted to match the SPI devices, with the MSB in the bit 28 position.

Returns
Returns the state of the acknowledge bit after the I2C address write. 0=acknowledge, 1=no acknowledge.
Parameters
i2c_addressI2C address of device
adc_code4 byte conversion code read from LTC24XX
eoc_timeoutTimeout (in milliseconds)

Definition at line 298 of file LTC24XX_general.cpp.

◆ LTC24XX_I2C_8bit_command_24bit_data()

int8_t LTC24XX_I2C_8bit_command_24bit_data ( uint8_t  i2c_address,
uint8_t  adc_command,
int32_t *  adc_code,
uint16_t  eoc_timeout 
)

Reads from LTC24XX ADC that accepts an 8 bit configuration and returns a 32 bit result.

Returns
Returns the state of the acknowledge bit after the I2C address write. 0=acknowledge, 1=no acknowledge.

Reads from LTC24XX ADC that accepts an 8 bit configuration and returns a 32 bit result.

Returns
Returns the state of the acknowledge bit after the I2C address write. 0=acknowledge, 1=no acknowledge.
Parameters
i2c_addressI2C address of device
adc_command1 byte command written to LTC24XX
adc_code4 byte conversion code read from LTC24XX
eoc_timeoutTimeout (in milliseconds)

Definition at line 268 of file LTC24XX_general.cpp.

◆ LTC24XX_I2C_8bit_command_32bit_data()

int8_t LTC24XX_I2C_8bit_command_32bit_data ( uint8_t  i2c_address,
uint8_t  adc_command,
int32_t *  adc_code,
uint16_t  eoc_timeout 
)

Reads from LTC24XX ADC that accepts an 8 bit configuration and returns a 32 bit result.

Returns
Returns the state of the acknowledge bit after the I2C address write. 0=acknowledge, 1=no acknowledge.
Parameters
i2c_addressI2C address of device
adc_command1 byte command written to LTC24XX
adc_code4 byte conversion code read from LTC24XX
eoc_timeoutTimeout (in milliseconds)

Definition at line 326 of file LTC24XX_general.cpp.

◆ LTC24XX_SE_code_to_voltage()

float LTC24XX_SE_code_to_voltage ( int32_t  adc_code,
float  vref 
)

Calculates the voltage corresponding to an ADC code, given the reference voltage.

Applies to Single-Ended input parts (LTC2400-type input)

Returns
Returns voltage calculated from ADC code.
Parameters
adc_codeCode read from ADC
vrefReference voltage

Definition at line 375 of file LTC24XX_general.cpp.

◆ LTC24XX_SPI_16bit_command_24bit_data()

void LTC24XX_SPI_16bit_command_24bit_data ( uint8_t  cs,
uint8_t  adc_command_high,
uint8_t  adc_command_low,
int32_t *  adc_code 
)

Reads from LTC24XX ADC that accepts a 16 bit configuration and returns a 32 bit result.

Returns
void

Reads from LTC24XX ADC that accepts a 16 bit configuration and returns a 32 bit result.

Returns
void
Parameters
csChip Select pin
adc_command_highFirst command byte written to LTC24XX
adc_command_lowSecond command written to LTC24XX
adc_code4 byte conversion code read from LTC24XX

Definition at line 216 of file LTC24XX_general.cpp.

◆ LTC24XX_SPI_16bit_command_32bit_data()

void LTC24XX_SPI_16bit_command_32bit_data ( uint8_t  cs,
uint8_t  adc_command_high,
uint8_t  adc_command_low,
int32_t *  adc_code 
)

Reads from LTC24XX ADC that accepts a 16 bit configuration and returns a 32 bit result.

Returns
void
Parameters
csChip Select pin
adc_command_highFirst command byte written to LTC24XX
adc_command_lowSecond command written to LTC24XX
adc_code4 byte conversion code read from LTC24XX

Definition at line 136 of file LTC24XX_general.cpp.

◆ LTC24XX_SPI_24bit_data()

void LTC24XX_SPI_24bit_data ( uint8_t  cs,
int32_t *  adc_code 
)

Reads from LTC24XX ADC that has no configuration word and returns a 32 bit result.

Returns
void
Parameters
csChip Select pin
adc_code4 byte conversion code read from LTC24XX

Definition at line 176 of file LTC24XX_general.cpp.

◆ LTC24XX_SPI_2ch_ping_pong_24bit_data()

void LTC24XX_SPI_2ch_ping_pong_24bit_data ( uint8_t  cs,
uint8_t *  adc_channel,
int32_t *  code 
)

Reads from LTC24XX two channel "Ping-Pong" ADC, placing the channel information in the adc_channel parameter and returning the 32 bit result with the channel bit cleared so the data format matches the rest of the family.

Returns
void

Reads from LTC24XX two channel "Ping-Pong" ADC, placing the channel information in the adc_channel parameter and returning the 32 bit result with the channel bit cleared so the data format matches the rest of the family.

Returns
void
Parameters
csChip Select pin
adc_channelReturns channel number read.
code4 byte conversion code read from LTC24XX

Definition at line 239 of file LTC24XX_general.cpp.

◆ LTC24XX_SPI_2ch_ping_pong_32bit_data()

void LTC24XX_SPI_2ch_ping_pong_32bit_data ( uint8_t  cs,
uint8_t *  adc_channel,
int32_t *  code 
)

Reads from LTC24XX two channel "Ping-Pong" ADC, placing the channel information in the adc_channel parameter and returning the 32 bit result with the channel bit cleared so the data format matches the rest of the family.

Returns
void
Parameters
csChip Select pin
adc_channelReturns channel number read.
code4 byte conversion code read from LTC24XX

Definition at line 155 of file LTC24XX_general.cpp.

◆ LTC24XX_SPI_32bit_data()

void LTC24XX_SPI_32bit_data ( uint8_t  cs,
int32_t *  adc_code 
)

Reads from LTC24XX ADC that has no configuration word and returns a 32 bit result.

Returns
void
Parameters
csChip Select pin
adc_code4 byte conversion code read from LTC24XX

Definition at line 103 of file LTC24XX_general.cpp.

◆ LTC24XX_SPI_8bit_command_16bit_data()

void LTC24XX_SPI_8bit_command_16bit_data ( uint8_t  cs,
uint8_t  adc_command,
int32_t *  adc_code 
)

Reads from LTC24XX ADC that accepts a 8 bit configuration and returns a 16 bit result.

Returns
void
Parameters
csChip Select pin
adc_commandFirst command byte written to LTC24XX
adc_code4 byte conversion code read from LTC24XX

◆ LTC24XX_SPI_8bit_command_24bit_data()

void LTC24XX_SPI_8bit_command_24bit_data ( uint8_t  cs,
uint8_t  adc_command,
int32_t *  adc_code 
)

Reads from LTC24XX ADC that accepts an 8 bit configuration and returns a 32 bit result.

Returns
void

Reads from LTC24XX ADC that accepts an 8 bit configuration and returns a 32 bit result.

Returns
void
Parameters
csChip Select pin
adc_command1 byte command written to LTC24XX
adc_code4 byte conversion code read from LTC24XX

Definition at line 195 of file LTC24XX_general.cpp.

◆ LTC24XX_SPI_8bit_command_32bit_data()

void LTC24XX_SPI_8bit_command_32bit_data ( uint8_t  cs,
uint8_t  adc_command,
int32_t *  adc_code 
)

Reads from LTC24XX ADC that accepts an 8 bit configuration and returns a 32 bit result.

Returns
void
Parameters
csChip Select pin
adc_command1 byte command written to LTC24XX
adc_code4 byte conversion code read from LTC24XX

Definition at line 118 of file LTC24XX_general.cpp.

Macro Definition Documentation

◆ LTC24XX_CS

#define LTC24XX_CS   QUIKEVAL_CS

Define the SPI CS pin.

Definition at line 125 of file LTC24XX_general.h.

◆ LTC24XX_EZ_MULTI_FAST

#define LTC24XX_EZ_MULTI_FAST   0b10001000

Definition at line 158 of file LTC24XX_general.h.

◆ LTC24XX_EZ_MULTI_PTAT

#define LTC24XX_EZ_MULTI_PTAT   0b11000000

Definition at line 149 of file LTC24XX_general.h.

◆ LTC24XX_EZ_MULTI_R50

#define LTC24XX_EZ_MULTI_R50   0b10010000

Definition at line 152 of file LTC24XX_general.h.

◆ LTC24XX_EZ_MULTI_R55

#define LTC24XX_EZ_MULTI_R55   0b10000000

Definition at line 153 of file LTC24XX_general.h.

◆ LTC24XX_EZ_MULTI_R60

#define LTC24XX_EZ_MULTI_R60   0b10100000

Definition at line 154 of file LTC24XX_general.h.

◆ LTC24XX_EZ_MULTI_SLOW

#define LTC24XX_EZ_MULTI_SLOW   0b10000000

Definition at line 157 of file LTC24XX_general.h.

◆ LTC24XX_EZ_MULTI_VIN

#define LTC24XX_EZ_MULTI_VIN   0b10000000

Definition at line 148 of file LTC24XX_general.h.

◆ LTC24XX_HS_MULTI_KEEP_PREVIOUS_MODE

#define LTC24XX_HS_MULTI_KEEP_PREVIOUS_MODE   0x80

Definition at line 136 of file LTC24XX_general.h.

◆ LTC24XX_HS_MULTI_KEEP_PREVIOUS_SPEED_RESOLUTION

#define LTC24XX_HS_MULTI_KEEP_PREVIOUS_SPEED_RESOLUTION   0x00

Definition at line 137 of file LTC24XX_general.h.

◆ LTC24XX_HS_MULTI_SPEED_1X

#define LTC24XX_HS_MULTI_SPEED_1X   0x00

Definition at line 138 of file LTC24XX_general.h.

◆ LTC24XX_HS_MULTI_SPEED_2X

#define LTC24XX_HS_MULTI_SPEED_2X   0x08

Definition at line 139 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_CH0

#define LTC24XX_MULTI_CH_CH0   0xB0

Definition at line 182 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_CH1

#define LTC24XX_MULTI_CH_CH1   0xB8

Definition at line 183 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_CH10

#define LTC24XX_MULTI_CH_CH10   0xB5

Definition at line 192 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_CH11

#define LTC24XX_MULTI_CH_CH11   0xBD

Definition at line 193 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_CH12

#define LTC24XX_MULTI_CH_CH12   0xB6

Definition at line 194 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_CH13

#define LTC24XX_MULTI_CH_CH13   0xBE

Definition at line 195 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_CH14

#define LTC24XX_MULTI_CH_CH14   0xB7

Definition at line 196 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_CH15

#define LTC24XX_MULTI_CH_CH15   0xBF

Definition at line 197 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_CH2

#define LTC24XX_MULTI_CH_CH2   0xB1

Definition at line 184 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_CH3

#define LTC24XX_MULTI_CH_CH3   0xB9

Definition at line 185 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_CH4

#define LTC24XX_MULTI_CH_CH4   0xB2

Definition at line 186 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_CH5

#define LTC24XX_MULTI_CH_CH5   0xBA

Definition at line 187 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_CH6

#define LTC24XX_MULTI_CH_CH6   0xB3

Definition at line 188 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_CH7

#define LTC24XX_MULTI_CH_CH7   0xBB

Definition at line 189 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_CH8

#define LTC24XX_MULTI_CH_CH8   0xB4

Definition at line 190 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_CH9

#define LTC24XX_MULTI_CH_CH9   0xBC

Definition at line 191 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_OSR_1024

#define LTC24XX_MULTI_CH_OSR_1024   0x50

Definition at line 246 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_OSR_128

#define LTC24XX_MULTI_CH_OSR_128   0x20

Definition at line 243 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_OSR_16384

#define LTC24XX_MULTI_CH_OSR_16384   0x90

Definition at line 250 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_OSR_2048

#define LTC24XX_MULTI_CH_OSR_2048   0x60

Definition at line 247 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_OSR_256

#define LTC24XX_MULTI_CH_OSR_256   0x30

Definition at line 244 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_OSR_32768

#define LTC24XX_MULTI_CH_OSR_32768   0xF0

Definition at line 251 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_OSR_4096

#define LTC24XX_MULTI_CH_OSR_4096   0x70

Definition at line 248 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_OSR_512

#define LTC24XX_MULTI_CH_OSR_512   0x40

Definition at line 245 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_OSR_64

#define LTC24XX_MULTI_CH_OSR_64   0x10

Definition at line 242 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_OSR_8192

#define LTC24XX_MULTI_CH_OSR_8192   0x80

Definition at line 249 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_P0_N1

#define LTC24XX_MULTI_CH_P0_N1   0xA0

Definition at line 206 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_P10_N11

#define LTC24XX_MULTI_CH_P10_N11   0xA5

Definition at line 221 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_P11_N10

#define LTC24XX_MULTI_CH_P11_N10   0xAD

Definition at line 222 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_P12_N13

#define LTC24XX_MULTI_CH_P12_N13   0xA6

Definition at line 224 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_P13_N12

#define LTC24XX_MULTI_CH_P13_N12   0xAE

Definition at line 225 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_P14_N15

#define LTC24XX_MULTI_CH_P14_N15   0xA7

Definition at line 227 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_P15_N14

#define LTC24XX_MULTI_CH_P15_N14   0xAF

Definition at line 228 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_P1_N0

#define LTC24XX_MULTI_CH_P1_N0   0xA8

Definition at line 207 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_P2_N3

#define LTC24XX_MULTI_CH_P2_N3   0xA1

Definition at line 209 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_P3_N2

#define LTC24XX_MULTI_CH_P3_N2   0xA9

Definition at line 210 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_P4_N5

#define LTC24XX_MULTI_CH_P4_N5   0xA2

Definition at line 212 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_P5_N4

#define LTC24XX_MULTI_CH_P5_N4   0xAA

Definition at line 213 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_P6_N7

#define LTC24XX_MULTI_CH_P6_N7   0xA3

Definition at line 215 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_P7_N6

#define LTC24XX_MULTI_CH_P7_N6   0xAB

Definition at line 216 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_P8_N9

#define LTC24XX_MULTI_CH_P8_N9   0xA4

Definition at line 218 of file LTC24XX_general.h.

◆ LTC24XX_MULTI_CH_P9_N8

#define LTC24XX_MULTI_CH_P9_N8   0xAC

Definition at line 219 of file LTC24XX_general.h.