Host API Example for the ADMW1001

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers multichannel_singlecycle_config.c Source File

multichannel_singlecycle_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_singlecycle_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_SINGLECYCLE ,
00053             .dataReadyMode = ADMW1001_DATAREADY_PER_CONVERSION ,
00054         },
00055         .channels = {
00056             [ADMW1001_CH_ID_ANLG_1_UNIVERSAL ] = {
00057                 .enableChannel = true,
00058                 .disablePublishing = false,
00059                 .compensationChannel = ADMW1001_CH_ID_NONE ,
00060                 .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS ,
00061                 .measurementsPerCycle = 10,
00062                 .extraSettlingTime = 0,
00063                 .adcChannelConfig = {
00064                     .sensor = ADMW1001_ADC_SENSOR_RTD_2WIRE_PT100 ,
00065                     .gain = ADMW1001_ADC_GAIN_8X ,
00066                     .current = {
00067                         .outputLevel = ADMW1001_ADC_EXC_CURRENT_500uA ,
00068                     },
00069                     .filter = {
00070                         .type = ADMW1001_ADC_FILTER_SINC3 ,
00071                     },
00072                     .reference = {
00073                         ADMW1001_ADC_REFERENCE_VOLTAGE_AVDD ,
00074                     },
00075                 },
00076             },
00077             [ADMW1001_CH_ID_ANLG_2_UNIVERSAL ] = {
00078                 .enableChannel = true,
00079                 .disablePublishing = false,
00080                 .compensationChannel = ADMW1001_CH_ID_NONE ,
00081                 .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS ,
00082                 .measurementsPerCycle = 10,
00083                 .extraSettlingTime = 0,
00084                 .adcChannelConfig = {
00085                     .sensor = ADMW1001_ADC_SENSOR_RTD_2WIRE_PT100 ,
00086                     .gain = ADMW1001_ADC_GAIN_8X ,
00087                     .current = {
00088                         .outputLevel = ADMW1001_ADC_EXC_CURRENT_500uA ,
00089                     },
00090                     .filter = {
00091                         .type = ADMW1001_ADC_FILTER_SINC3 ,
00092                     },
00093                     .reference = {
00094                         ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL ,
00095                     },
00096                 },
00097             },
00098             [ADMW1001_CH_ID_ANLG_1_DIFFERENTIAL ] = {
00099                 .enableChannel = true,
00100                 .disablePublishing = false,
00101                 .compensationChannel = ADMW1001_CH_ID_NONE ,
00102                 .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS ,
00103                 .measurementsPerCycle = 10,
00104                 .extraSettlingTime = 0,
00105                 .adcChannelConfig = {
00106                     .sensor = ADMW1001_ADC_SENSOR_RTD_2WIRE_PT100 ,
00107                     .gain = ADMW1001_ADC_GAIN_8X ,
00108                     .current = {
00109                         .outputLevel = ADMW1001_ADC_EXC_CURRENT_500uA ,
00110                     },
00111                     .filter = {
00112                         .type = ADMW1001_ADC_FILTER_SINC3 ,
00113                     },
00114                     .reference = {
00115                         ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL ,
00116                     },
00117                 },
00118             },
00119             [ADMW1001_CH_ID_ANLG_2_DIFFERENTIAL ] = {
00120                 .enableChannel = true,
00121                 .disablePublishing = false,
00122                 .compensationChannel = ADMW1001_CH_ID_ANLG_2_UNIVERSAL ,
00123                 .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS ,
00124                 .measurementsPerCycle = 10,
00125                 .extraSettlingTime = 0,
00126                 .adcChannelConfig = {
00127                     .sensor = ADMW1001_ADC_SENSOR_THERMOCOUPLE_K ,
00128                     .gain = ADMW1001_ADC_GAIN_32X ,
00129                     .filter = {
00130                         .type = ADMW1001_ADC_FILTER_SINC3 ,
00131                     },
00132                     .reference = {
00133                         ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL ,
00134                     },
00135                 },
00136             },
00137             [ADMW1001_CH_ID_DIG_I2C_0 ] = {
00138                 .enableChannel = true,
00139                 .disablePublishing = false,
00140                 .compensationChannel = ADMW1001_CH_ID_NONE ,
00141                 .measurementsPerCycle = 10,
00142                 .extraSettlingTime = 36500,
00143                 .i2cChannelConfig = {
00144                     .sensor = ADMW1001_I2C_SENSOR_HUMIDITY_A ,
00145                     .deviceAddress = 0x27,
00146                 },
00147             },
00148         },
00149     },
00150 };
00151