Mbed FW update

Committer:
Vkadaba
Date:
Thu Nov 21 13:36:43 2019 +0000
Revision:
39:e255f52072fc
Parent:
37:6acfbb4405cd
Child:
43:e1789b7214cf
added continue in utils.c to fix the wrong measurement from being displayed

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ADIJake 0:85855ecd3257 1 /*!
ADIJake 0:85855ecd3257 2 ******************************************************************************
ADIJake 0:85855ecd3257 3 * @file: config.c
ADIJake 0:85855ecd3257 4 * @brief:
ADIJake 0:85855ecd3257 5 *-----------------------------------------------------------------------------
ADIJake 0:85855ecd3257 6 *
Vkadaba 15:b5d57daeb7c0 7 Copyright 2019 (c) Analog Devices, Inc.
ADIJake 0:85855ecd3257 8
ADIJake 0:85855ecd3257 9 All rights reserved.
ADIJake 0:85855ecd3257 10
ADIJake 0:85855ecd3257 11 Redistribution and use in source and binary forms, with or without
ADIJake 0:85855ecd3257 12 modification, are permitted provided that the following conditions are met:
ADIJake 0:85855ecd3257 13 - Redistributions of source code must retain the above copyright
ADIJake 0:85855ecd3257 14 notice, this list of conditions and the following disclaimer.
ADIJake 0:85855ecd3257 15 - Redistributions in binary form must reproduce the above copyright
ADIJake 0:85855ecd3257 16 notice, this list of conditions and the following disclaimer in
ADIJake 0:85855ecd3257 17 the documentation and/or other materials provided with the
ADIJake 0:85855ecd3257 18 distribution.
ADIJake 0:85855ecd3257 19 - Neither the name of Analog Devices, Inc. nor the names of its
ADIJake 0:85855ecd3257 20 contributors may be used to endorse or promote products derived
ADIJake 0:85855ecd3257 21 from this software without specific prior written permission.
ADIJake 0:85855ecd3257 22 - The use of this software may or may not infringe the patent rights
ADIJake 0:85855ecd3257 23 of one or more patent holders. This license does not release you
ADIJake 0:85855ecd3257 24 from the requirement that you obtain separate licenses from these
ADIJake 0:85855ecd3257 25 patent holders to use this software.
ADIJake 0:85855ecd3257 26 - Use of the software either in source or binary form, must be run
ADIJake 0:85855ecd3257 27 on or directly connected to an Analog Devices Inc. component.
ADIJake 0:85855ecd3257 28
ADIJake 0:85855ecd3257 29 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
ADIJake 0:85855ecd3257 30 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
ADIJake 0:85855ecd3257 31 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
ADIJake 0:85855ecd3257 32 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
ADIJake 0:85855ecd3257 33 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
ADIJake 0:85855ecd3257 34 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
ADIJake 0:85855ecd3257 35 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
ADIJake 0:85855ecd3257 36 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
ADIJake 0:85855ecd3257 37 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
ADIJake 0:85855ecd3257 38 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ADIJake 0:85855ecd3257 39 *
ADIJake 0:85855ecd3257 40 *****************************************************************************/
ADIJake 0:85855ecd3257 41
Vkadaba 5:0728bde67bdb 42 #include "admw_config_types.h"
ADIJake 0:85855ecd3257 43
Vkadaba 5:0728bde67bdb 44 ADMW_CONFIG multichannel_continuous_config = {
Vkadaba 13:97cb32670539 45 .versionId = { .major = 2, .minor = 0 },
Vkadaba 5:0728bde67bdb 46 .productId = ADMW_PRODUCT_ID_ADMW1001,
Vkadaba 5:0728bde67bdb 47 .admw1001 = {
Vkadaba 23:bb685f35b08b 48 .power = {
Vkadaba 23:bb685f35b08b 49 .powerMode = ADMW1001_POWER_MODE_ACTIVE,
Vkadaba 23:bb685f35b08b 50 },
Vkadaba 23:bb685f35b08b 51 .measurement = {
Vkadaba 37:6acfbb4405cd 52 .externalRefVoltage=0.0,
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 = true,
Vkadaba 37:6acfbb4405cd 57 .RSenseValue = 1000.0,
Vkadaba 23:bb685f35b08b 58 },
Vkadaba 23:bb685f35b08b 59 .diagnostics = {
Vkadaba 23:bb685f35b08b 60 .disableGlobalDiag = true,
Vkadaba 23:bb685f35b08b 61 .disableMeasurementDiag = true,
Vkadaba 23:bb685f35b08b 62 .osdFrequency = ADMW1001_OPEN_SENSOR_DIAGNOSTICS_DISABLED,
Vkadaba 23:bb685f35b08b 63 },
Vkadaba 23:bb685f35b08b 64 .channels = {
Vkadaba 23:bb685f35b08b 65 [ADMW1001_CH_ID_ANLG_1_UNIVERSAL] = {
Vkadaba 23:bb685f35b08b 66 .enableChannel = true,
Vkadaba 23:bb685f35b08b 67 .disablePublishing = false,
Vkadaba 23:bb685f35b08b 68 .compensationChannel = ADMW1001_CH_ID_NONE,
Vkadaba 23:bb685f35b08b 69 .lutSelect = ADMW1001_LUT_DEFAULT,
Vkadaba 37:6acfbb4405cd 70 .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS,
Vkadaba 37:6acfbb4405cd 71 .lowThreshold = -50,
Vkadaba 37:6acfbb4405cd 72 .highThreshold = 250,
Vkadaba 23:bb685f35b08b 73 .offsetAdjustment = 0.0,
Vkadaba 23:bb685f35b08b 74 .gainAdjustment = 0.0,
Vkadaba 23:bb685f35b08b 75 .sensorParameter = 0.0,
Vkadaba 34:b60ee1e0af2b 76 .measurementsPerCycle = 1,
Vkadaba 23:bb685f35b08b 77 .cycleSkipCount = 0,
Vkadaba 23:bb685f35b08b 78 .extraSettlingTime = 0,
Vkadaba 23:bb685f35b08b 79 .priority = 0,
Vkadaba 23:bb685f35b08b 80 .adcChannelConfig = {
Vkadaba 23:bb685f35b08b 81 .sensor = ADMW1001_ADC_SENSOR_RTD_2WIRE_PT100,
Vkadaba 23:bb685f35b08b 82 .rtdCurve = ADMW1001_ADC_RTD_CURVE_EUROPEAN,
Vkadaba 23:bb685f35b08b 83 .gain = ADMW1001_ADC_GAIN_1X,
Vkadaba 23:bb685f35b08b 84 .current = {
Vkadaba 23:bb685f35b08b 85 .excitationState= ADMW1001_ADC_EXC_STATE_ALWAYS_ON,
Vkadaba 23:bb685f35b08b 86 .outputLevel = ADMW1001_ADC_EXC_CURRENT_250uA,
Vkadaba 23:bb685f35b08b 87 .diodeRatio = 0,
Vkadaba 8:2f2775c34640 88 },
Vkadaba 23:bb685f35b08b 89 .filter = {
Vkadaba 23:bb685f35b08b 90 .type = ADMW1001_ADC_FILTER_SINC3,
Vkadaba 23:bb685f35b08b 91 .sf = ADMW1001_SF_8P24HZ,
Vkadaba 23:bb685f35b08b 92 .chopMode = ADMW1001_CHOP_MD_SW,
Vkadaba 23:bb685f35b08b 93 .notch1p2 = false,
Vkadaba 23:bb685f35b08b 94 .groundSwitch = ADMW1001_ADC_GND_SW_OPEN
ADIJake 0:85855ecd3257 95 },
Vkadaba 23:bb685f35b08b 96 .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL,
Vkadaba 37:6acfbb4405cd 97 .bufferBypass = ADMW1001_BUFFER_BYPASSS_DISABLED,
ADIJake 0:85855ecd3257 98 },
ADIJake 0:85855ecd3257 99 },
Vkadaba 23:bb685f35b08b 100 [ADMW1001_CH_ID_ANLG_1_DIFFERENTIAL] = {
Vkadaba 23:bb685f35b08b 101 .enableChannel = true,
Vkadaba 23:bb685f35b08b 102 .disablePublishing = false,
Vkadaba 23:bb685f35b08b 103 .compensationChannel = ADMW1001_CH_ID_ANLG_1_UNIVERSAL,
Vkadaba 23:bb685f35b08b 104 .lutSelect = ADMW1001_LUT_DEFAULT,
Vkadaba 37:6acfbb4405cd 105 .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS,
Vkadaba 37:6acfbb4405cd 106 .lowThreshold = -50,
Vkadaba 37:6acfbb4405cd 107 .highThreshold = 250,
Vkadaba 23:bb685f35b08b 108 .offsetAdjustment = 0.0,
Vkadaba 23:bb685f35b08b 109 .gainAdjustment = 0.0,
Vkadaba 23:bb685f35b08b 110 .sensorParameter = 0.0,
Vkadaba 34:b60ee1e0af2b 111 .measurementsPerCycle = 1,
Vkadaba 23:bb685f35b08b 112 .cycleSkipCount = 0,
Vkadaba 23:bb685f35b08b 113 .extraSettlingTime = 4499.99986449257,
Vkadaba 23:bb685f35b08b 114 .priority = 0,
Vkadaba 23:bb685f35b08b 115 .adcChannelConfig = {
Vkadaba 23:bb685f35b08b 116 .sensor = ADMW1001_ADC_SENSOR_THERMOCOUPLE_K,
Vkadaba 23:bb685f35b08b 117 .rtdCurve = ADMW1001_ADC_RTD_CURVE_EUROPEAN,
Vkadaba 23:bb685f35b08b 118 .gain = ADMW1001_ADC_GAIN_8X,
Vkadaba 23:bb685f35b08b 119 .current = {
Vkadaba 23:bb685f35b08b 120 .excitationState= ADMW1001_ADC_EXC_STATE_CYCLE_POWER,
Vkadaba 37:6acfbb4405cd 121 .outputLevel = ADMW1001_ADC_NO_EXTERNAL_EXC_CURRENT,
Vkadaba 23:bb685f35b08b 122 .diodeRatio = 0,
Vkadaba 23:bb685f35b08b 123 },
Vkadaba 23:bb685f35b08b 124 .filter = {
Vkadaba 23:bb685f35b08b 125 .type = ADMW1001_ADC_FILTER_SINC3,
Vkadaba 23:bb685f35b08b 126 .sf = ADMW1001_SF_8P24HZ,
Vkadaba 23:bb685f35b08b 127 .chopMode = ADMW1001_CHOP_MD_SW,
Vkadaba 23:bb685f35b08b 128 .notch1p2 = false,
Vkadaba 23:bb685f35b08b 129 .groundSwitch = ADMW1001_ADC_GND_SW_OPEN
Vkadaba 23:bb685f35b08b 130 },
Vkadaba 23:bb685f35b08b 131 .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL,
Vkadaba 37:6acfbb4405cd 132 .bufferBypass = ADMW1001_BUFFER_BYPASSS_DISABLED,
Vkadaba 23:bb685f35b08b 133 },
Vkadaba 23:bb685f35b08b 134 },
Vkadaba 23:bb685f35b08b 135 [ADMW1001_CH_ID_DIG_I2C_0] = {
Vkadaba 39:e255f52072fc 136 .enableChannel = false,
Vkadaba 23:bb685f35b08b 137 .disablePublishing = false,
Vkadaba 23:bb685f35b08b 138 .compensationChannel = ADMW1001_CH_ID_NONE,
Vkadaba 34:b60ee1e0af2b 139 .measurementsPerCycle = 1,
Vkadaba 23:bb685f35b08b 140 .extraSettlingTime = 15000,
Vkadaba 23:bb685f35b08b 141 .i2cChannelConfig = {
Vkadaba 23:bb685f35b08b 142 .sensor = ADMW1001_I2C_SENSOR_HUMIDITY_B,
Vkadaba 23:bb685f35b08b 143 .deviceAddress = 0x44,
Vkadaba 23:bb685f35b08b 144 },
Vkadaba 23:bb685f35b08b 145 },
Vkadaba 23:bb685f35b08b 146 },
Vkadaba 23:bb685f35b08b 147 },
Vkadaba 22:2835e9e9f59f 148 };