Analog Devices / Mbed OS ADISense1000_Example_FW

Fork of ADISense_ExampleFirmware by Sean Wilson

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ADISense1000_MBED.c Source File

ADISense1000_MBED.c

00001 /*!
00002  ******************************************************************************
00003  * @file:   config.c
00004  * @brief:
00005  *-----------------------------------------------------------------------------
00006  *
00007 Copyright (c) 2017 Emutex Ltd. / Analog Devices, Inc.
00008 
00009 All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without modification,
00012 are permitted provided that the following conditions are met:
00013   - Redistributions of source code must retain the above copyright notice,
00014     this list of conditions and the following disclaimer.
00015   - Redistributions in binary form must reproduce the above copyright notice,
00016     this list of conditions and the following disclaimer in the documentation
00017     and/or other materials provided with the distribution.
00018   - Modified versions of the software must be conspicuously marked as such.
00019   - This software is licensed solely and exclusively for use with processors
00020     manufactured by or for Analog Devices, Inc.
00021   - This software may not be combined or merged with other code in any manner
00022     that would cause the software to become subject to terms and conditions
00023     which differ from those listed here.
00024   - Neither the name of Analog Devices, Inc. nor the names of its
00025     contributors may be used to endorse or promote products derived
00026     from this software without specific prior written permission.
00027   - The use of this software may or may not infringe the patent rights of one
00028     or more patent holders.  This license does not release you from the
00029     requirement that you obtain separate licenses from these patent holders
00030     to use this software.
00031 
00032 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS" AND ANY
00033 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
00034 TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
00035 NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
00036 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR CONSEQUENTIAL DAMAGES
00037 (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF CLAIMS OF INTELLECTUAL
00038 PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00039 OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00040 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00041 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
00042 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00043  *
00044  *****************************************************************************/
00045 
00046 #include "inc/adi_sense_config_types.h"
00047 
00048 ADI_SENSE_CONFIG  config = {
00049     .versionId  = { .major  = 1, .minor = 4 },
00050     .adisense1000 = {
00051             .power = {
00052                 .powerMode = ADI_SENSE_1000_POWER_MODE_FULL ,
00053                 .supplyVoltage = 3.3,
00054             },
00055             .measurement = {
00056                 .operatingMode = ADI_SENSE_1000_OPERATING_MODE_CONTINUOUS ,
00057                 .dataReadyMode = ADI_SENSE_1000_DATAREADY_PER_CYCLE ,
00058                 .cycleInterval = 0,
00059             },
00060             .channels = {
00061                 [ADI_SENSE_1000_CHANNEL_ID_SENSOR_0 ] = {
00062                     .enableChannel = true,
00063                     .disablePublishing = false,
00064                     .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_CJC_0 ,
00065                     .measurementsPerCycle = 1,
00066                     .extraSettlingTime = 0.0000,
00067                     .measurementUnit = ADI_SENSE_1000_MEASUREMENT_UNIT_CELSIUS ,
00068                     .adcChannelConfig = {
00069                         .sensor = ADI_SENSE_1000_ADC_SENSOR_THERMOCOUPLE_T_DEF_L1 ,
00070                         .gain = ADI_SENSE_1000_ADC_GAIN_128X ,
00071                         .current = {
00072                             .outputLevel = ADI_SENSE_1000_ADC_EXC_CURRENT_NONE ,
00073                             .swapOption = ADI_SENSE_1000_ADC_EXC_CURRENT_SWAP_NONE ,
00074                         },
00075                         .filter = {
00076                             .type = ADI_SENSE_1000_ADC_FILTER_SINC4 ,
00077                             .fs = 1920,
00078                         },
00079                         .reference = {
00080                             .type = ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_INTERNAL ,
00081                             .disableBuffer = false,
00082                         },
00083                         .enableVbias = true,
00084                     },
00085                 },
00086                 [ADI_SENSE_1000_CHANNEL_ID_CJC_0 ] = {
00087                     .enableChannel = true,
00088                     .disablePublishing = false,
00089                     .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE ,
00090                     .measurementsPerCycle = 1,
00091                     .extraSettlingTime = 0.0000,
00092                     .measurementUnit = ADI_SENSE_1000_MEASUREMENT_UNIT_CELSIUS ,
00093                     .adcChannelConfig = {
00094                         .sensor = ADI_SENSE_1000_ADC_SENSOR_RTD_2WIRE_PT100_DEF_L1 ,
00095                         .gain = ADI_SENSE_1000_ADC_GAIN_128X ,
00096                         .current = {
00097                             .outputLevel = ADI_SENSE_1000_ADC_EXC_CURRENT_500uA ,
00098                             .swapOption = ADI_SENSE_1000_ADC_EXC_CURRENT_SWAP_NONE ,
00099                         },
00100                         .filter = {
00101                             .type = ADI_SENSE_1000_ADC_FILTER_SINC4 ,
00102                             .fs = 1920,
00103                         },
00104                         .reference = {
00105                             .type = ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_INTERNAL_1 ,
00106                             .disableBuffer = false,
00107                         },
00108                         .enableVbias = false,
00109                     },
00110                 },
00111             },
00112     },
00113 };
00114