Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board
LTC2380_24.h
Go to the documentation of this file.
1 /*!
2 LTC2380-24: Low Noise, High Speed, 24-Bit SAR ADC With Digital Filter
3 
4 @verbatim
5 
6 
7 
8 @endverbatim
9 
10 http://www.linear.com/product/LTC2380-24
11 
12 
13 Copyright 2018(c) Analog Devices, Inc.
14 
15 All rights reserved.
16 
17 Redistribution and use in source and binary forms, with or without
18 modification, are permitted provided that the following conditions are met:
19  - Redistributions of source code must retain the above copyright
20  notice, this list of conditions and the following disclaimer.
21  - Redistributions in binary form must reproduce the above copyright
22  notice, this list of conditions and the following disclaimer in
23  the documentation and/or other materials provided with the
24  distribution.
25  - Neither the name of Analog Devices, Inc. nor the names of its
26  contributors may be used to endorse or promote products derived
27  from this software without specific prior written permission.
28  - The use of this software may or may not infringe the patent rights
29  of one or more patent holders. This license does not release you
30  from the requirement that you obtain separate licenses from these
31  patent holders to use this software.
32  - Use of the software either in source or binary form, must be run
33  on or directly connected to an Analog Devices Inc. component.
34 
35 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
36 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
37 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
38 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
39 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
40 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
41 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
42 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
43 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
44 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45 */
46 
47 /*! @file
48  @ingroup LTC2380-24
49  Header for LTC2380-24: Low Noise, High Speed, 24-Bit SAR ADC With Digital Filter
50 */
51 
52 #ifndef LTC2380_H
53 #define LTC2380_H
54 
55 #include <SPI.h>
56 
57 //! Define the SPI CS pin
58 #ifndef LTC2380_CS
59 #define LTC2380_CS QUIKEVAL_CS
60 #endif
61 
62 //! @name LTC2380 Channel Address
63 //! @{
64 // Channel Address
65 #define LTC2380_ADDRESS 0x00
66 //!@}
67 
68 
69 //! Reads the LTC2380 and returns 32-bit data in 2's complement format
70 //! @return void
71 void LTC2380_read(int32_t *ptr_adc_code, //!< Returns code read from ADC (from previous conversion)
72  int16_t *ptr_cycles
73  );
74 
75 
76 //! Calculates the LTC2380 input voltage given the binary data and lsb weight.
77 //! @return Floating point voltage
78 float LTC2380_code_to_voltage(int32_t adc_code, //!< Raw ADC code
79  uint8_t gain_compression,
80  float vref //!< Reference voltage
81  );
82 
83 #endif // LTC2380_H
84 
85 
void LTC2380_read(int32_t *ptr_adc_code, int16_t *ptr_cycles)
Reads the LTC2380 and returns 32-bit data in 2&#39;s complement format.
Definition: LTC2380_24.cpp:65
float LTC2380_code_to_voltage(int32_t adc_code, uint8_t gain_compression, float vref)
Calculates the LTC2380 input voltage given the binary data and lsb weight.
Definition: LTC2380.cpp:136
static uint32_t adc_code
Definition: DC2071AA.ino:113