This is a simple program to read temp reading using 2 wire RTD sensor with the measureware kit.
Fork of ADISense1000_Example_FW by
ADISense1000_MBED.c@0:76fed7dd9235, 2018-01-25 (annotated)
- Committer:
- seanwilson10
- Date:
- Thu Jan 25 16:00:23 2018 +0000
- Revision:
- 0:76fed7dd9235
initial;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
seanwilson10 | 0:76fed7dd9235 | 1 | /*! |
seanwilson10 | 0:76fed7dd9235 | 2 | ****************************************************************************** |
seanwilson10 | 0:76fed7dd9235 | 3 | * @file: config.c |
seanwilson10 | 0:76fed7dd9235 | 4 | * @brief: |
seanwilson10 | 0:76fed7dd9235 | 5 | *----------------------------------------------------------------------------- |
seanwilson10 | 0:76fed7dd9235 | 6 | * |
seanwilson10 | 0:76fed7dd9235 | 7 | Copyright (c) 2017 Emutex Ltd. / Analog Devices, Inc. |
seanwilson10 | 0:76fed7dd9235 | 8 | |
seanwilson10 | 0:76fed7dd9235 | 9 | All rights reserved. |
seanwilson10 | 0:76fed7dd9235 | 10 | |
seanwilson10 | 0:76fed7dd9235 | 11 | Redistribution and use in source and binary forms, with or without modification, |
seanwilson10 | 0:76fed7dd9235 | 12 | are permitted provided that the following conditions are met: |
seanwilson10 | 0:76fed7dd9235 | 13 | - Redistributions of source code must retain the above copyright notice, |
seanwilson10 | 0:76fed7dd9235 | 14 | this list of conditions and the following disclaimer. |
seanwilson10 | 0:76fed7dd9235 | 15 | - Redistributions in binary form must reproduce the above copyright notice, |
seanwilson10 | 0:76fed7dd9235 | 16 | this list of conditions and the following disclaimer in the documentation |
seanwilson10 | 0:76fed7dd9235 | 17 | and/or other materials provided with the distribution. |
seanwilson10 | 0:76fed7dd9235 | 18 | - Modified versions of the software must be conspicuously marked as such. |
seanwilson10 | 0:76fed7dd9235 | 19 | - This software is licensed solely and exclusively for use with processors |
seanwilson10 | 0:76fed7dd9235 | 20 | manufactured by or for Analog Devices, Inc. |
seanwilson10 | 0:76fed7dd9235 | 21 | - This software may not be combined or merged with other code in any manner |
seanwilson10 | 0:76fed7dd9235 | 22 | that would cause the software to become subject to terms and conditions |
seanwilson10 | 0:76fed7dd9235 | 23 | which differ from those listed here. |
seanwilson10 | 0:76fed7dd9235 | 24 | - Neither the name of Analog Devices, Inc. nor the names of its |
seanwilson10 | 0:76fed7dd9235 | 25 | contributors may be used to endorse or promote products derived |
seanwilson10 | 0:76fed7dd9235 | 26 | from this software without specific prior written permission. |
seanwilson10 | 0:76fed7dd9235 | 27 | - The use of this software may or may not infringe the patent rights of one |
seanwilson10 | 0:76fed7dd9235 | 28 | or more patent holders. This license does not release you from the |
seanwilson10 | 0:76fed7dd9235 | 29 | requirement that you obtain separate licenses from these patent holders |
seanwilson10 | 0:76fed7dd9235 | 30 | to use this software. |
seanwilson10 | 0:76fed7dd9235 | 31 | |
seanwilson10 | 0:76fed7dd9235 | 32 | THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS" AND ANY |
seanwilson10 | 0:76fed7dd9235 | 33 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, |
seanwilson10 | 0:76fed7dd9235 | 34 | TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN |
seanwilson10 | 0:76fed7dd9235 | 35 | NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, |
seanwilson10 | 0:76fed7dd9235 | 36 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR CONSEQUENTIAL DAMAGES |
seanwilson10 | 0:76fed7dd9235 | 37 | (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF CLAIMS OF INTELLECTUAL |
seanwilson10 | 0:76fed7dd9235 | 38 | PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS |
seanwilson10 | 0:76fed7dd9235 | 39 | OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
seanwilson10 | 0:76fed7dd9235 | 40 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
seanwilson10 | 0:76fed7dd9235 | 41 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
seanwilson10 | 0:76fed7dd9235 | 42 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
seanwilson10 | 0:76fed7dd9235 | 43 | * |
seanwilson10 | 0:76fed7dd9235 | 44 | *****************************************************************************/ |
seanwilson10 | 0:76fed7dd9235 | 45 | |
seanwilson10 | 0:76fed7dd9235 | 46 | #include "inc/adi_sense_config_types.h" |
seanwilson10 | 0:76fed7dd9235 | 47 | |
seanwilson10 | 0:76fed7dd9235 | 48 | ADI_SENSE_CONFIG config = { |
seanwilson10 | 0:76fed7dd9235 | 49 | .versionId = { .major = 1, .minor = 4 }, |
seanwilson10 | 0:76fed7dd9235 | 50 | .adisense1000 = { |
seanwilson10 | 0:76fed7dd9235 | 51 | .power = { |
seanwilson10 | 0:76fed7dd9235 | 52 | .powerMode = ADI_SENSE_1000_POWER_MODE_FULL, |
seanwilson10 | 0:76fed7dd9235 | 53 | .supplyVoltage = 3.3, |
seanwilson10 | 0:76fed7dd9235 | 54 | }, |
seanwilson10 | 0:76fed7dd9235 | 55 | .measurement = { |
seanwilson10 | 0:76fed7dd9235 | 56 | .operatingMode = ADI_SENSE_1000_OPERATING_MODE_CONTINUOUS, |
seanwilson10 | 0:76fed7dd9235 | 57 | .dataReadyMode = ADI_SENSE_1000_DATAREADY_PER_CYCLE, |
seanwilson10 | 0:76fed7dd9235 | 58 | .cycleInterval = 0, |
seanwilson10 | 0:76fed7dd9235 | 59 | }, |
seanwilson10 | 0:76fed7dd9235 | 60 | .channels = { |
seanwilson10 | 0:76fed7dd9235 | 61 | [ADI_SENSE_1000_CHANNEL_ID_SENSOR_0] = { |
seanwilson10 | 0:76fed7dd9235 | 62 | .enableChannel = true, |
seanwilson10 | 0:76fed7dd9235 | 63 | .disablePublishing = false, |
seanwilson10 | 0:76fed7dd9235 | 64 | .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_CJC_0, |
seanwilson10 | 0:76fed7dd9235 | 65 | .measurementsPerCycle = 1, |
seanwilson10 | 0:76fed7dd9235 | 66 | .extraSettlingTime = 0.0000, |
seanwilson10 | 0:76fed7dd9235 | 67 | .measurementUnit = ADI_SENSE_1000_MEASUREMENT_UNIT_CELSIUS, |
seanwilson10 | 0:76fed7dd9235 | 68 | .adcChannelConfig = { |
seanwilson10 | 0:76fed7dd9235 | 69 | .sensor = ADI_SENSE_1000_ADC_SENSOR_THERMOCOUPLE_T_DEF_L1, |
seanwilson10 | 0:76fed7dd9235 | 70 | .gain = ADI_SENSE_1000_ADC_GAIN_128X, |
seanwilson10 | 0:76fed7dd9235 | 71 | .current = { |
seanwilson10 | 0:76fed7dd9235 | 72 | .outputLevel = ADI_SENSE_1000_ADC_EXC_CURRENT_NONE, |
seanwilson10 | 0:76fed7dd9235 | 73 | .swapOption = ADI_SENSE_1000_ADC_EXC_CURRENT_SWAP_NONE, |
seanwilson10 | 0:76fed7dd9235 | 74 | }, |
seanwilson10 | 0:76fed7dd9235 | 75 | .filter = { |
seanwilson10 | 0:76fed7dd9235 | 76 | .type = ADI_SENSE_1000_ADC_FILTER_SINC4, |
seanwilson10 | 0:76fed7dd9235 | 77 | .fs = 1920, |
seanwilson10 | 0:76fed7dd9235 | 78 | }, |
seanwilson10 | 0:76fed7dd9235 | 79 | .reference = { |
seanwilson10 | 0:76fed7dd9235 | 80 | .type = ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_INTERNAL, |
seanwilson10 | 0:76fed7dd9235 | 81 | .disableBuffer = false, |
seanwilson10 | 0:76fed7dd9235 | 82 | }, |
seanwilson10 | 0:76fed7dd9235 | 83 | .enableVbias = true, |
seanwilson10 | 0:76fed7dd9235 | 84 | }, |
seanwilson10 | 0:76fed7dd9235 | 85 | }, |
seanwilson10 | 0:76fed7dd9235 | 86 | [ADI_SENSE_1000_CHANNEL_ID_CJC_0] = { |
seanwilson10 | 0:76fed7dd9235 | 87 | .enableChannel = true, |
seanwilson10 | 0:76fed7dd9235 | 88 | .disablePublishing = false, |
seanwilson10 | 0:76fed7dd9235 | 89 | .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE, |
seanwilson10 | 0:76fed7dd9235 | 90 | .measurementsPerCycle = 1, |
seanwilson10 | 0:76fed7dd9235 | 91 | .extraSettlingTime = 0.0000, |
seanwilson10 | 0:76fed7dd9235 | 92 | .measurementUnit = ADI_SENSE_1000_MEASUREMENT_UNIT_CELSIUS, |
seanwilson10 | 0:76fed7dd9235 | 93 | .adcChannelConfig = { |
seanwilson10 | 0:76fed7dd9235 | 94 | .sensor = ADI_SENSE_1000_ADC_SENSOR_RTD_2WIRE_PT100_DEF_L1, |
seanwilson10 | 0:76fed7dd9235 | 95 | .gain = ADI_SENSE_1000_ADC_GAIN_128X, |
seanwilson10 | 0:76fed7dd9235 | 96 | .current = { |
seanwilson10 | 0:76fed7dd9235 | 97 | .outputLevel = ADI_SENSE_1000_ADC_EXC_CURRENT_500uA, |
seanwilson10 | 0:76fed7dd9235 | 98 | .swapOption = ADI_SENSE_1000_ADC_EXC_CURRENT_SWAP_NONE, |
seanwilson10 | 0:76fed7dd9235 | 99 | }, |
seanwilson10 | 0:76fed7dd9235 | 100 | .filter = { |
seanwilson10 | 0:76fed7dd9235 | 101 | .type = ADI_SENSE_1000_ADC_FILTER_SINC4, |
seanwilson10 | 0:76fed7dd9235 | 102 | .fs = 1920, |
seanwilson10 | 0:76fed7dd9235 | 103 | }, |
seanwilson10 | 0:76fed7dd9235 | 104 | .reference = { |
seanwilson10 | 0:76fed7dd9235 | 105 | .type = ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_INTERNAL_1, |
seanwilson10 | 0:76fed7dd9235 | 106 | .disableBuffer = false, |
seanwilson10 | 0:76fed7dd9235 | 107 | }, |
seanwilson10 | 0:76fed7dd9235 | 108 | .enableVbias = false, |
seanwilson10 | 0:76fed7dd9235 | 109 | }, |
seanwilson10 | 0:76fed7dd9235 | 110 | }, |
seanwilson10 | 0:76fed7dd9235 | 111 | }, |
seanwilson10 | 0:76fed7dd9235 | 112 | }, |
seanwilson10 | 0:76fed7dd9235 | 113 | }; |
seanwilson10 | 0:76fed7dd9235 | 114 |