Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board
support_functions_LTC2983.h
Go to the documentation of this file.
1 /*!
2 LTC2983: Multi-Sensor High Accuracy Digital Temperature Measurement System.
3 
4 @verbatim
5 
6 support_functions_LTC2983.h:
7 This file contains all the support function prototypes used in the main program.
8 @endverbatim
9 
10 http://www.linear.com/product/LTC2983
11 
12 http://www.linear.com/product/LTC2983#demoboards
13 
14 
15 Copyright 2018(c) Analog Devices, Inc.
16 
17 All rights reserved.
18 
19 Redistribution and use in source and binary forms, with or without
20 modification, are permitted provided that the following conditions are met:
21  - Redistributions of source code must retain the above copyright
22  notice, this list of conditions and the following disclaimer.
23  - Redistributions in binary form must reproduce the above copyright
24  notice, this list of conditions and the following disclaimer in
25  the documentation and/or other materials provided with the
26  distribution.
27  - Neither the name of Analog Devices, Inc. nor the names of its
28  contributors may be used to endorse or promote products derived
29  from this software without specific prior written permission.
30  - The use of this software may or may not infringe the patent rights
31  of one or more patent holders. This license does not release you
32  from the requirement that you obtain separate licenses from these
33  patent holders to use this software.
34  - Use of the software either in source or binary form, must be run
35  on or directly connected to an Analog Devices Inc. component.
36 
37 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
38 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
39 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
40 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
41 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
43 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
44 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
46 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47 */
48 
49 
50 
51 /*! @file
52  @ingroup LTC2983
53  Header for LTC2983: Multi-Sensor High Accuracy Digital Temperature Measurement System
54 */
55 
56 
57 
58 void print_title();
59 void assign_channel(uint8_t chip_select, uint8_t channel_number, uint32_t channel_assignment_data);
60 void write_custom_table(uint8_t chip_select, struct table_coeffs coefficients[64], uint16_t start_address, uint8_t table_length);
61 void write_custom_steinhart_hart(uint8_t chip_select, uint32_t steinhart_hart_coeffs[6], uint16_t start_address);
62 
63 void measure_channel(uint8_t chip_select, uint8_t channel_number, uint8_t channel_output);
64 void convert_channel(uint8_t chip_select, uint8_t channel_number);
65 void wait_for_process_to_finish(uint8_t chip_select);
66 
67 void get_result(uint8_t chip_select, uint8_t channel_number, uint8_t channel_output);
68 void print_conversion_result(uint32_t raw_conversion_result, uint8_t channel_output);
69 void read_voltage_or_resistance_results(uint8_t chip_select, uint8_t channel_number);
70 void print_fault_data(uint8_t fault_byte);
71 
72 
73 
74 uint32_t transfer_four_bytes(uint8_t chip_select, uint8_t read_or_write, uint16_t start_address, uint32_t input_data);
75 uint8_t transfer_byte(uint8_t chip_select, uint8_t read_or_write, uint16_t start_address, uint8_t input_data);
76 
77 uint16_t get_start_address(uint16_t base_address, uint8_t channel_number);
78 bool is_number_in_array(uint8_t number, uint8_t *array, uint8_t array_length);
void write_custom_table(uint8_t chip_select, struct table_coeffs coefficients[64], uint16_t start_address, uint8_t table_length)
void print_title()
Prints the title block when program first starts.
void assign_channel(uint8_t chip_select, uint8_t channel_number, uint32_t channel_assignment_data)
void convert_channel(uint8_t chip_select, uint8_t channel_number)
LTC2983: Multi-Sensor High Accuracy Digital Temperature Measurement System.
void print_fault_data(uint8_t fault_byte)
uint8_t transfer_byte(uint8_t chip_select, uint8_t read_or_write, uint16_t start_address, uint8_t input_data)
uint32_t transfer_four_bytes(uint8_t chip_select, uint8_t read_or_write, uint16_t start_address, uint32_t input_data)
void print_conversion_result(uint32_t raw_conversion_result, uint8_t channel_output)
void wait_for_process_to_finish(uint8_t chip_select)
bool is_number_in_array(uint8_t number, uint8_t *array, uint8_t array_length)
uint16_t get_start_address(uint16_t base_address, uint8_t channel_number)
void measure_channel(uint8_t chip_select, uint8_t channel_number, uint8_t channel_output)
void write_custom_steinhart_hart(uint8_t chip_select, uint32_t steinhart_hart_coeffs[6], uint16_t start_address)
void get_result(uint8_t chip_select, uint8_t channel_number, uint8_t channel_output)
void read_voltage_or_resistance_results(uint8_t chip_select, uint8_t channel_number)