Code clean up and handling FIFO errors

Committer:
Vkadaba
Date:
Tue Apr 14 06:43:47 2020 +0000
Revision:
63:2655a04c00f5
Parent:
62:a5b88f433406
Code clean up - part 1 working; ADMW1001_config.h; ADMW1001_lut_data; ADMW1001_sensors_types.h;

Who changed what in which revision?

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