| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

LTC2370.h
Go to the documentation of this file.
1 /*!
2 LTC2364-16: 16-Bit, 250Ksps ADC.
3 LTC2364-18: 18-Bit, 250Ksps ADC.
4 LTC2367-16: 16-Bit, 500Ksps ADC
5 LTC2367-18: 18-Bit, 500Ksps ADC
6 LTC2368-16: 16-Bit, 1Msps ADC
7 LTC2368-18: 18-Bit, 1Msps ADC
8 LTC2369-18: 18-Bit, 1.6Msps ADC
9 LTC2370-16: 16-Bit, 2Msps ADC
10
11 @verbatim
12
13 The following parts (DUT) are pin-compatible, 16/18-bit A/D converters with serial I/O, and an internal reference:
14 LTC2364-16: 16-Bit, 250Ksps ADC
15 LTC2364-18: 18-Bit, 250Ksps ADC
16 LTC2367-16: 16-Bit, 500Ksps ADC
17 LTC2367-18: 18-Bit, 500Ksps ADC
18 LTC2368-16: 16-Bit, 1Msps ADC
19 LTC23678-18: 18-Bit, 1Msps ADC
20 LTC2369-18: 18-Bit, 1.6Msps ADC
21 LTC2370-16: 16-Bit, 2Msps ADC
22
23 Example Code:
24
25 Read ADC input.
26
27 LTC2370_read(LTC2370_CS, &adc_code); // Throws out last reading
28 LTC2370_read(LTC2370_CS, &adc_code); // Obtains the current reading and stores to adc_code variable
29
30 // Convert adc_code to voltage
31 adc_voltage = LTC2370_code_to_voltage(adc_code, vref);
32
33 @endverbatim
34
35 http://www.linear.com/product/LTC2364-16
36 http://www.linear.com/product/LTC2364-18
37 http://www.linear.com/product/LTC2367-16
38 http://www.linear.com/product/LTC2367-18
39 http://www.linear.com/product/LTC2368-16
40 http://www.linear.com/product/LTC2368-18
41 http://www.linear.com/product/LTC2369-18
42 http://www.linear.com/product/LTC2370-16
43
44 http://www.linear.com/product/LTC2364-16#demoboards
45 http://www.linear.com/product/LTC2364-18#demoboards
46 http://www.linear.com/product/LTC2367-16#demoboards
47 http://www.linear.com/product/LTC2367-18#demoboards
48 http://www.linear.com/product/LTC2368-16#demoboards
49 http://www.linear.com/product/LTC2368-18#demoboards
50 http://www.linear.com/product/LTC2369-18#demoboards
51 http://www.linear.com/product/LTC2370-16#demoboards
52
53
54 Copyright 2018(c) Analog Devices, Inc.
55
56 All rights reserved.
57
58 Redistribution and use in source and binary forms, with or without
59 modification, are permitted provided that the following conditions are met:
60 - Redistributions of source code must retain the above copyright
61 notice, this list of conditions and the following disclaimer.
62 - Redistributions in binary form must reproduce the above copyright
63 notice, this list of conditions and the following disclaimer in
64 the documentation and/or other materials provided with the
65 distribution.
66 - Neither the name of Analog Devices, Inc. nor the names of its
67 contributors may be used to endorse or promote products derived
68 from this software without specific prior written permission.
69 - The use of this software may or may not infringe the patent rights
70 of one or more patent holders. This license does not release you
71 from the requirement that you obtain separate licenses from these
72 patent holders to use this software.
73 - Use of the software either in source or binary form, must be run
74 on or directly connected to an Analog Devices Inc. component.
75
76 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
77 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
78 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
79 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
80 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
81 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
82 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
83 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
84 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
85 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
86 */
87
88 /*! @file
89 @ingroup LTC2370
90 Header for LTC2370: 16/18-bit 1Msps ADC
91 */
92
93 #ifndef LTC2370_H
94 #define LTC2370_H
95
96 #include <SPI.h>
97
98 //! Define the SPI CS pin
99 #ifndef LTC2370_CS
100 #define LTC2370_CS QUIKEVAL_CS
101 #endif
102
103 //! @name LTC2370 Channel Address
104 //! @{
105 // Channel Address
106 #define LTC2370_ADDRESS 0x00
107 //!@}
108
109
110 //! Reads the LTC2370 and returns 32-bit data in offset binary format
111 //! @return void
112 void LTC2370_read(uint8_t cs, //!< Chip Select Pin
113 uint32_t *ptr_adc_code //!< Returns code read from ADC (from previous conversion)
114 );
115
116
117 //! Calculates the LTC2370 input voltage given the binary data and lsb weight.
118 //! @return Floating point voltage
119 float LTC2370_code_to_voltage(uint32_t adc_code, //!< Raw ADC code
120 float vref //!< Reference voltage
121 );
122
123 #endif // LTC2370_H
124
125
LTC2370_code_to_voltage
float LTC2370_code_to_voltage(uint32_t adc_code, float vref)
Calculates the LTC2370 input voltage given the binary data and lsb weight.
Definition: LTC2370.cpp:119
LTC2370_read
void LTC2370_read(uint8_t cs, uint32_t *ptr_adc_code)
Reads the LTC2370 and returns 32-bit data in offset binary format.
Definition: LTC2370.cpp:97
vref
float vref
Definition: LTC2492_Thermocouple_Meter.ino:129
adc_code
static uint32_t adc_code
Definition: DC2071AA.ino:113