Host API Example for the ADMW1001

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers multichannel_continuous_config.c Source File

multichannel_continuous_config.c

00001 /*!
00002  ******************************************************************************
00003  * @file:   config.c
00004  * @brief:
00005  *-----------------------------------------------------------------------------
00006  *
00007 Copyright 2019 (c) Analog Devices, Inc.
00008 
00009 All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without
00012 modification, are permitted provided that the following conditions are met:
00013   - Redistributions of source code must retain the above copyright
00014     notice, this list of conditions and the following disclaimer.
00015   - Redistributions in binary form must reproduce the above copyright
00016     notice, this list of conditions and the following disclaimer in
00017     the documentation and/or other materials provided with the
00018     distribution.
00019   - Neither the name of Analog Devices, Inc. nor the names of its
00020     contributors may be used to endorse or promote products derived
00021     from this software without specific prior written permission.
00022   - The use of this software may or may not infringe the patent rights
00023     of one or more patent holders. This license does not release you
00024     from the requirement that you obtain separate licenses from these
00025     patent holders to use this software.
00026   - Use of the software either in source or binary form, must be run
00027     on or directly connected to an Analog Devices Inc. component.
00028 
00029 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
00030 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
00031 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00032 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
00033 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00034 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
00035 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00036 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00037 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00038 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00039  *
00040  *****************************************************************************/
00041 
00042 #include "admw_config_types.h"
00043 
00044 ADMW_CONFIG  multichannel_continuous_config = {
00045     .versionId  = { .major  = 2, .minor = 0 },
00046     .productId = ADMW_PRODUCT_ID_ADMW1001 ,
00047     .admw1001 = {
00048         .power = {
00049             .powerMode = ADMW1001_POWER_MODE_ACTIVE ,
00050         },
00051         .measurement = {
00052             .operatingMode = ADMW1001_OPERATING_MODE_CONTINUOUS ,
00053             .dataReadyMode = ADMW1001_DATAREADY_PER_CYCLE , // FIX: Temporarily all values from json are hardcoded to this one in the Contracts.FileGenerator - > file translations!!
00054             .cycleInterval = 0,
00055             .vBiasEnable = true,
00056         },
00057         .diagnostics = {
00058             .disableGlobalDiag = true,
00059             .disableMeasurementDiag = true,
00060             .osdFrequency = ADMW1001_OPEN_SENSOR_DIAGNOSTICS_DISABLED ,
00061         },
00062         .channels = {
00063             [ADMW1001_CH_ID_ANLG_1_UNIVERSAL ] = {
00064                 .enableChannel = true,
00065                 .disablePublishing = false,
00066                 .compensationChannel = ADMW1001_CH_ID_NONE ,
00067                 .lutSelect = ADMW1001_LUT_DEFAULT ,
00068                 .measurementUnit = ADMW1001_MEASUREMENT_UNIT_FAHRENHEIT ,
00069                 .lowThreshold = -58,
00070                 .highThreshold = 482,
00071                 .offsetAdjustment = 0.0,
00072                 .gainAdjustment = 0.0,
00073                 .sensorParameter = 0.0,
00074                 .measurementsPerCycle = 10,
00075                 .cycleSkipCount = 0,
00076                 .extraSettlingTime = 0,
00077                 .priority = 0,
00078                 .adcChannelConfig = {
00079                     .sensor = ADMW1001_ADC_SENSOR_RTD_2WIRE_PT100 ,
00080                     .rtdCurve = ADMW1001_ADC_RTD_CURVE_EUROPEAN ,
00081                     .gain = ADMW1001_ADC_GAIN_1X ,
00082                     .current = {
00083                         .excitationState= ADMW1001_ADC_EXC_STATE_ALWAYS_ON ,
00084                         .outputLevel = ADMW1001_ADC_EXC_CURRENT_250uA ,
00085                         .diodeRatio = 0,
00086                     },
00087                     .filter = {
00088                         .type = ADMW1001_ADC_FILTER_SINC3 ,
00089                         .sf = ADMW1001_SF_8P24HZ ,
00090                         .chopMode = ADMW1001_CHOP_MD_SW ,
00091                         .notch1p2 = false,
00092                         .groundSwitch = ADMW1001_ADC_GND_SW_OPEN 
00093                     },
00094                     .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL ,
00095                 },
00096             },
00097             [ADMW1001_CH_ID_ANLG_1_DIFFERENTIAL ] = {
00098                 .enableChannel = true,
00099                 .disablePublishing = false,
00100                 .compensationChannel = ADMW1001_CH_ID_ANLG_1_UNIVERSAL ,
00101                 .lutSelect = ADMW1001_LUT_DEFAULT ,
00102                 .measurementUnit = ADMW1001_MEASUREMENT_UNIT_FAHRENHEIT ,
00103                 .lowThreshold = -58,
00104                 .highThreshold = 482,
00105                 .offsetAdjustment = 0.0,
00106                 .gainAdjustment = 0.0,
00107                 .sensorParameter = 0.0,
00108                 .measurementsPerCycle = 10,
00109                 .cycleSkipCount = 0,
00110                 .extraSettlingTime = 4499.99986449257,
00111                 .priority = 0,
00112                 .adcChannelConfig = {
00113                     .sensor = ADMW1001_ADC_SENSOR_THERMOCOUPLE_K ,
00114                     .rtdCurve = ADMW1001_ADC_RTD_CURVE_EUROPEAN ,
00115                     .gain = ADMW1001_ADC_GAIN_8X ,
00116                     .current = {
00117                         .excitationState= ADMW1001_ADC_EXC_STATE_CYCLE_POWER ,
00118                         .outputLevel = ADMW1001_ADC_EXC_CURRENT_EXTERNAL ,
00119                         .diodeRatio = 0,
00120                     },
00121                     .filter = {
00122                         .type = ADMW1001_ADC_FILTER_SINC3 ,
00123                         .sf = ADMW1001_SF_8P24HZ ,
00124                         .chopMode = ADMW1001_CHOP_MD_SW ,
00125                         .notch1p2 = false,
00126                         .groundSwitch = ADMW1001_ADC_GND_SW_OPEN 
00127                     },
00128                     .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL ,
00129                 },
00130             },
00131             [ADMW1001_CH_ID_DIG_I2C_0 ] = {
00132                 .enableChannel = true,
00133                 .disablePublishing = false,
00134                 .compensationChannel = ADMW1001_CH_ID_NONE ,
00135                 .measurementsPerCycle = 10,
00136                 .extraSettlingTime = 15000,
00137                 .i2cChannelConfig = {
00138                     .sensor = ADMW1001_I2C_SENSOR_HUMIDITY_B ,
00139                     .deviceAddress = 0x44,
00140                 },
00141             },
00142         },
00143     },
00144 };