Code clean up and handling FIFO errors

Committer:
Vkadaba
Date:
Tue Nov 19 11:17:35 2019 +0000
Revision:
34:b60ee1e0af2b
Parent:
sensor1_rtd-3w-pt100_config.c@23:bb685f35b08b
Child:
37:6acfbb4405cd
External Voltage Reference support

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ADIJake 0:85855ecd3257 1 /*
Vkadaba 15:b5d57daeb7c0 2 Copyright 2019 (c) Analog Devices, Inc.
ADIJake 0:85855ecd3257 3
ADIJake 0:85855ecd3257 4 All rights reserved.
ADIJake 0:85855ecd3257 5
ADIJake 0:85855ecd3257 6 Redistribution and use in source and binary forms, with or without
ADIJake 0:85855ecd3257 7 modification, are permitted provided that the following conditions are met:
ADIJake 0:85855ecd3257 8 - Redistributions of source code must retain the above copyright
ADIJake 0:85855ecd3257 9 notice, this list of conditions and the following disclaimer.
ADIJake 0:85855ecd3257 10 - Redistributions in binary form must reproduce the above copyright
ADIJake 0:85855ecd3257 11 notice, this list of conditions and the following disclaimer in
ADIJake 0:85855ecd3257 12 the documentation and/or other materials provided with the
ADIJake 0:85855ecd3257 13 distribution.
ADIJake 0:85855ecd3257 14 - Neither the name of Analog Devices, Inc. nor the names of its
ADIJake 0:85855ecd3257 15 contributors may be used to endorse or promote products derived
ADIJake 0:85855ecd3257 16 from this software without specific prior written permission.
ADIJake 0:85855ecd3257 17 - The use of this software may or may not infringe the patent rights
ADIJake 0:85855ecd3257 18 of one or more patent holders. This license does not release you
ADIJake 0:85855ecd3257 19 from the requirement that you obtain separate licenses from these
ADIJake 0:85855ecd3257 20 patent holders to use this software.
ADIJake 0:85855ecd3257 21 - Use of the software either in source or binary form, must be run
ADIJake 0:85855ecd3257 22 on or directly connected to an Analog Devices Inc. component.
ADIJake 0:85855ecd3257 23
ADIJake 0:85855ecd3257 24 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
ADIJake 0:85855ecd3257 25 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
ADIJake 0:85855ecd3257 26 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
ADIJake 0:85855ecd3257 27 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
ADIJake 0:85855ecd3257 28 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
ADIJake 0:85855ecd3257 29 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
ADIJake 0:85855ecd3257 30 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
ADIJake 0:85855ecd3257 31 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
ADIJake 0:85855ecd3257 32 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
ADIJake 0:85855ecd3257 33 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ADIJake 0:85855ecd3257 34 *
ADIJake 0:85855ecd3257 35 *****************************************************************************/
ADIJake 0:85855ecd3257 36
ADIJake 0:85855ecd3257 37 /*!
ADIJake 0:85855ecd3257 38 ******************************************************************************
ADIJake 0:85855ecd3257 39 * @file:
ADIJake 0:85855ecd3257 40 * @brief:
ADIJake 0:85855ecd3257 41 *-----------------------------------------------------------------------------
ADIJake 0:85855ecd3257 42 */
Vkadaba 5:0728bde67bdb 43 #include "admw_config_types.h"
ADIJake 0:85855ecd3257 44
Vkadaba 34:b60ee1e0af2b 45 ADMW_CONFIG rtd_3w_pt100_config = {
Vkadaba 23:bb685f35b08b 46 .versionId = { .major = 2, .minor = 0 },
Vkadaba 5:0728bde67bdb 47 .productId = ADMW_PRODUCT_ID_ADMW1001,
Vkadaba 5:0728bde67bdb 48 .admw1001 = {
Vkadaba 23:bb685f35b08b 49 .power = {
Vkadaba 23:bb685f35b08b 50 .powerMode = ADMW1001_POWER_MODE_ACTIVE,
Vkadaba 23:bb685f35b08b 51 },
Vkadaba 23:bb685f35b08b 52 .measurement = {
Vkadaba 23:bb685f35b08b 53 .operatingMode = ADMW1001_OPERATING_MODE_CONTINUOUS,
Vkadaba 23:bb685f35b08b 54 .dataReadyMode = ADMW1001_DATAREADY_PER_CYCLE, // FIX: Temporarily all values from json are hardcoded to this one in the Contracts.FileGenerator - > file translations!!
Vkadaba 23:bb685f35b08b 55 .cycleInterval = 0,
Vkadaba 23:bb685f35b08b 56 .vBiasEnable = false,
Vkadaba 23:bb685f35b08b 57 },
Vkadaba 23:bb685f35b08b 58 .diagnostics = {
Vkadaba 23:bb685f35b08b 59 .disableGlobalDiag = true,
Vkadaba 23:bb685f35b08b 60 .disableMeasurementDiag = true,
Vkadaba 23:bb685f35b08b 61 .osdFrequency = ADMW1001_OPEN_SENSOR_DIAGNOSTICS_DISABLED,
Vkadaba 23:bb685f35b08b 62 },
Vkadaba 23:bb685f35b08b 63 .channels = {
Vkadaba 23:bb685f35b08b 64 [ADMW1001_CH_ID_ANLG_1_UNIVERSAL] = {
Vkadaba 23:bb685f35b08b 65 .enableChannel = true,
Vkadaba 23:bb685f35b08b 66 .disablePublishing = false,
Vkadaba 23:bb685f35b08b 67 .compensationChannel = ADMW1001_CH_ID_NONE,
Vkadaba 23:bb685f35b08b 68 .lutSelect = ADMW1001_LUT_DEFAULT,
Vkadaba 23:bb685f35b08b 69 .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS,
Vkadaba 23:bb685f35b08b 70 .lowThreshold = -50,
Vkadaba 23:bb685f35b08b 71 .highThreshold = 250,
Vkadaba 23:bb685f35b08b 72 .offsetAdjustment = 0.0,
Vkadaba 23:bb685f35b08b 73 .gainAdjustment = 0.0,
Vkadaba 23:bb685f35b08b 74 .sensorParameter = 0.0,
Vkadaba 23:bb685f35b08b 75 .measurementsPerCycle = 1,
Vkadaba 23:bb685f35b08b 76 .cycleSkipCount = 0,
Vkadaba 23:bb685f35b08b 77 .extraSettlingTime = 4499.99986449257,
Vkadaba 23:bb685f35b08b 78 .priority = 0,
Vkadaba 23:bb685f35b08b 79 .adcChannelConfig = {
Vkadaba 23:bb685f35b08b 80 .sensor = ADMW1001_ADC_SENSOR_RTD_3WIRE_PT100,
Vkadaba 23:bb685f35b08b 81 .rtdCurve = ADMW1001_ADC_RTD_CURVE_EUROPEAN,
Vkadaba 23:bb685f35b08b 82 .gain = ADMW1001_ADC_GAIN_1X,
Vkadaba 23:bb685f35b08b 83 .current = {
Vkadaba 23:bb685f35b08b 84 .excitationState= ADMW1001_ADC_EXC_STATE_ALWAYS_ON,
Vkadaba 23:bb685f35b08b 85 .outputLevel = ADMW1001_ADC_EXC_CURRENT_250uA,
Vkadaba 23:bb685f35b08b 86 .diodeRatio = 0,
ADIJake 0:85855ecd3257 87 },
Vkadaba 23:bb685f35b08b 88 .filter = {
Vkadaba 23:bb685f35b08b 89 .type = ADMW1001_ADC_FILTER_SINC3,
Vkadaba 23:bb685f35b08b 90 .sf = ADMW1001_SF_8P24HZ,
Vkadaba 23:bb685f35b08b 91 .chopMode = ADMW1001_CHOP_MD_SW,
Vkadaba 23:bb685f35b08b 92 .notch1p2 = false,
Vkadaba 23:bb685f35b08b 93 .groundSwitch = ADMW1001_ADC_GND_SW_OPEN
Vkadaba 23:bb685f35b08b 94 },
Vkadaba 23:bb685f35b08b 95 .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL,
ADIJake 0:85855ecd3257 96 },
ADIJake 0:85855ecd3257 97 },
Vkadaba 23:bb685f35b08b 98 },
ADIJake 0:85855ecd3257 99 },
ADIJake 0:85855ecd3257 100 };