AdiSense1000_V21 MBED API

Fork of AdiSense1000 by PoC_Team

Committer:
kevin1990
Date:
Mon Nov 27 13:10:11 2017 +0000
Revision:
12:97457cf77bcb
Child:
23:2adb6216b001
v1.0 release

Who changed what in which revision?

UserRevisionLine numberNew contents of line
kevin1990 12:97457cf77bcb 1 /*!
kevin1990 12:97457cf77bcb 2 ******************************************************************************
kevin1990 12:97457cf77bcb 3 * @file: config.c
kevin1990 12:97457cf77bcb 4 * @brief:
kevin1990 12:97457cf77bcb 5 *-----------------------------------------------------------------------------
kevin1990 12:97457cf77bcb 6 *
kevin1990 12:97457cf77bcb 7 Copyright (c) 2017 Emutex Ltd. / Analog Devices, Inc.
kevin1990 12:97457cf77bcb 8
kevin1990 12:97457cf77bcb 9 All rights reserved.
kevin1990 12:97457cf77bcb 10
kevin1990 12:97457cf77bcb 11 Redistribution and use in source and binary forms, with or without modification,
kevin1990 12:97457cf77bcb 12 are permitted provided that the following conditions are met:
kevin1990 12:97457cf77bcb 13 - Redistributions of source code must retain the above copyright notice,
kevin1990 12:97457cf77bcb 14 this list of conditions and the following disclaimer.
kevin1990 12:97457cf77bcb 15 - Redistributions in binary form must reproduce the above copyright notice,
kevin1990 12:97457cf77bcb 16 this list of conditions and the following disclaimer in the documentation
kevin1990 12:97457cf77bcb 17 and/or other materials provided with the distribution.
kevin1990 12:97457cf77bcb 18 - Modified versions of the software must be conspicuously marked as such.
kevin1990 12:97457cf77bcb 19 - This software is licensed solely and exclusively for use with processors
kevin1990 12:97457cf77bcb 20 manufactured by or for Analog Devices, Inc.
kevin1990 12:97457cf77bcb 21 - This software may not be combined or merged with other code in any manner
kevin1990 12:97457cf77bcb 22 that would cause the software to become subject to terms and conditions
kevin1990 12:97457cf77bcb 23 which differ from those listed here.
kevin1990 12:97457cf77bcb 24 - Neither the name of Analog Devices, Inc. nor the names of its
kevin1990 12:97457cf77bcb 25 contributors may be used to endorse or promote products derived
kevin1990 12:97457cf77bcb 26 from this software without specific prior written permission.
kevin1990 12:97457cf77bcb 27 - The use of this software may or may not infringe the patent rights of one
kevin1990 12:97457cf77bcb 28 or more patent holders. This license does not release you from the
kevin1990 12:97457cf77bcb 29 requirement that you obtain separate licenses from these patent holders
kevin1990 12:97457cf77bcb 30 to use this software.
kevin1990 12:97457cf77bcb 31
kevin1990 12:97457cf77bcb 32 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS" AND ANY
kevin1990 12:97457cf77bcb 33 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
kevin1990 12:97457cf77bcb 34 TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
kevin1990 12:97457cf77bcb 35 NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
kevin1990 12:97457cf77bcb 36 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR CONSEQUENTIAL DAMAGES
kevin1990 12:97457cf77bcb 37 (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF CLAIMS OF INTELLECTUAL
kevin1990 12:97457cf77bcb 38 PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
kevin1990 12:97457cf77bcb 39 OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
kevin1990 12:97457cf77bcb 40 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
kevin1990 12:97457cf77bcb 41 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
kevin1990 12:97457cf77bcb 42 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
kevin1990 12:97457cf77bcb 43 *
kevin1990 12:97457cf77bcb 44 *****************************************************************************/
kevin1990 12:97457cf77bcb 45
kevin1990 12:97457cf77bcb 46 #include "inc/adi_sense_config_types.h"
kevin1990 12:97457cf77bcb 47
kevin1990 12:97457cf77bcb 48 ADI_SENSE_CONFIG multichannel_singlecycle_config = {
kevin1990 12:97457cf77bcb 49 .versionId = { .major = 1, .minor = 4 },
kevin1990 12:97457cf77bcb 50 .productId = ADI_SENSE_PRODUCT_ID_1000,
kevin1990 12:97457cf77bcb 51 .adisense1000 = {
kevin1990 12:97457cf77bcb 52 .power = {
kevin1990 12:97457cf77bcb 53 .powerMode = ADI_SENSE_1000_POWER_MODE_FULL,
kevin1990 12:97457cf77bcb 54 .supplyVoltage = 3.3,
kevin1990 12:97457cf77bcb 55 },
kevin1990 12:97457cf77bcb 56 .measurement = {
kevin1990 12:97457cf77bcb 57 .operatingMode = ADI_SENSE_1000_OPERATING_MODE_SINGLECYCLE,
kevin1990 12:97457cf77bcb 58 .dataReadyMode = ADI_SENSE_1000_DATAREADY_PER_CONVERSION,
kevin1990 12:97457cf77bcb 59 },
kevin1990 12:97457cf77bcb 60 .channels = {
kevin1990 12:97457cf77bcb 61 [ADI_SENSE_1000_CHANNEL_ID_CJC_0] = {
kevin1990 12:97457cf77bcb 62 .enableChannel = true,
kevin1990 12:97457cf77bcb 63 .disablePublishing = false,
kevin1990 12:97457cf77bcb 64 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
kevin1990 12:97457cf77bcb 65 .measurementsPerCycle = 10,
kevin1990 12:97457cf77bcb 66 .extraSettlingTime = 0,
kevin1990 12:97457cf77bcb 67 .adcChannelConfig = {
kevin1990 12:97457cf77bcb 68 .sensor = ADI_SENSE_1000_ADC_SENSOR_RTD_2WIRE_PT100_DEF_L1,
kevin1990 12:97457cf77bcb 69 .gain = ADI_SENSE_1000_ADC_GAIN_8X,
kevin1990 12:97457cf77bcb 70 .current = {
kevin1990 12:97457cf77bcb 71 .outputLevel = ADI_SENSE_1000_ADC_EXC_CURRENT_500uA,
kevin1990 12:97457cf77bcb 72 .swapOption = ADI_SENSE_1000_ADC_EXC_CURRENT_SWAP_NONE,
kevin1990 12:97457cf77bcb 73 },
kevin1990 12:97457cf77bcb 74 .filter = {
kevin1990 12:97457cf77bcb 75 .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
kevin1990 12:97457cf77bcb 76 },
kevin1990 12:97457cf77bcb 77 .reference = {
kevin1990 12:97457cf77bcb 78 .type = ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_INTERNAL_1,
kevin1990 12:97457cf77bcb 79 .disableBuffer = false,
kevin1990 12:97457cf77bcb 80 },
kevin1990 12:97457cf77bcb 81 .enableVbias = false,
kevin1990 12:97457cf77bcb 82 },
kevin1990 12:97457cf77bcb 83 },
kevin1990 12:97457cf77bcb 84 [ADI_SENSE_1000_CHANNEL_ID_CJC_1] = {
kevin1990 12:97457cf77bcb 85 .enableChannel = true,
kevin1990 12:97457cf77bcb 86 .disablePublishing = false,
kevin1990 12:97457cf77bcb 87 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
kevin1990 12:97457cf77bcb 88 .measurementsPerCycle = 10,
kevin1990 12:97457cf77bcb 89 .extraSettlingTime = 0,
kevin1990 12:97457cf77bcb 90 .adcChannelConfig = {
kevin1990 12:97457cf77bcb 91 .sensor = ADI_SENSE_1000_ADC_SENSOR_RTD_2WIRE_PT100_DEF_L1,
kevin1990 12:97457cf77bcb 92 .gain = ADI_SENSE_1000_ADC_GAIN_8X,
kevin1990 12:97457cf77bcb 93 .current = {
kevin1990 12:97457cf77bcb 94 .outputLevel = ADI_SENSE_1000_ADC_EXC_CURRENT_500uA,
kevin1990 12:97457cf77bcb 95 .swapOption = ADI_SENSE_1000_ADC_EXC_CURRENT_SWAP_NONE,
kevin1990 12:97457cf77bcb 96 },
kevin1990 12:97457cf77bcb 97 .filter = {
kevin1990 12:97457cf77bcb 98 .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
kevin1990 12:97457cf77bcb 99 },
kevin1990 12:97457cf77bcb 100 .reference = {
kevin1990 12:97457cf77bcb 101 .type = ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_INTERNAL_1,
kevin1990 12:97457cf77bcb 102 .disableBuffer = false,
kevin1990 12:97457cf77bcb 103 },
kevin1990 12:97457cf77bcb 104 .enableVbias = false,
kevin1990 12:97457cf77bcb 105 },
kevin1990 12:97457cf77bcb 106 },
kevin1990 12:97457cf77bcb 107 [ADI_SENSE_1000_CHANNEL_ID_SENSOR_0] = {
kevin1990 12:97457cf77bcb 108 .enableChannel = true,
kevin1990 12:97457cf77bcb 109 .disablePublishing = false,
kevin1990 12:97457cf77bcb 110 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
kevin1990 12:97457cf77bcb 111 .measurementsPerCycle = 10,
kevin1990 12:97457cf77bcb 112 .extraSettlingTime = 0,
kevin1990 12:97457cf77bcb 113 .adcChannelConfig = {
kevin1990 12:97457cf77bcb 114 .sensor = ADI_SENSE_1000_ADC_SENSOR_RTD_2WIRE_PT100_DEF_L1,
kevin1990 12:97457cf77bcb 115 .gain = ADI_SENSE_1000_ADC_GAIN_8X,
kevin1990 12:97457cf77bcb 116 .current = {
kevin1990 12:97457cf77bcb 117 .outputLevel = ADI_SENSE_1000_ADC_EXC_CURRENT_500uA,
kevin1990 12:97457cf77bcb 118 .swapOption = ADI_SENSE_1000_ADC_EXC_CURRENT_SWAP_NONE,
kevin1990 12:97457cf77bcb 119 },
kevin1990 12:97457cf77bcb 120 .filter = {
kevin1990 12:97457cf77bcb 121 .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
kevin1990 12:97457cf77bcb 122 },
kevin1990 12:97457cf77bcb 123 .reference = {
kevin1990 12:97457cf77bcb 124 .type = ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_INTERNAL_1,
kevin1990 12:97457cf77bcb 125 .disableBuffer = false,
kevin1990 12:97457cf77bcb 126 },
kevin1990 12:97457cf77bcb 127 .enableVbias = false,
kevin1990 12:97457cf77bcb 128 },
kevin1990 12:97457cf77bcb 129 },
kevin1990 12:97457cf77bcb 130 [ADI_SENSE_1000_CHANNEL_ID_SENSOR_1] = {
kevin1990 12:97457cf77bcb 131 .enableChannel = true,
kevin1990 12:97457cf77bcb 132 .disablePublishing = false,
kevin1990 12:97457cf77bcb 133 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_CJC_1,
kevin1990 12:97457cf77bcb 134 .measurementsPerCycle = 10,
kevin1990 12:97457cf77bcb 135 .extraSettlingTime = 0,
kevin1990 12:97457cf77bcb 136 .adcChannelConfig = {
kevin1990 12:97457cf77bcb 137 .sensor = ADI_SENSE_1000_ADC_SENSOR_THERMOCOUPLE_K_DEF_L1,
kevin1990 12:97457cf77bcb 138 .gain = ADI_SENSE_1000_ADC_GAIN_32X,
kevin1990 12:97457cf77bcb 139 .filter = {
kevin1990 12:97457cf77bcb 140 .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
kevin1990 12:97457cf77bcb 141 },
kevin1990 12:97457cf77bcb 142 .reference = {
kevin1990 12:97457cf77bcb 143 .type = ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_INTERNAL,
kevin1990 12:97457cf77bcb 144 .disableBuffer = true,
kevin1990 12:97457cf77bcb 145 },
kevin1990 12:97457cf77bcb 146 .enableVbias = true,
kevin1990 12:97457cf77bcb 147 },
kevin1990 12:97457cf77bcb 148 },
kevin1990 12:97457cf77bcb 149 [ADI_SENSE_1000_CHANNEL_ID_SENSOR_2] = {
kevin1990 12:97457cf77bcb 150 .enableChannel = true,
kevin1990 12:97457cf77bcb 151 .disablePublishing = false,
kevin1990 12:97457cf77bcb 152 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_CJC_0,
kevin1990 12:97457cf77bcb 153 .measurementsPerCycle = 10,
kevin1990 12:97457cf77bcb 154 .extraSettlingTime = 0,
kevin1990 12:97457cf77bcb 155 .adcChannelConfig = {
kevin1990 12:97457cf77bcb 156 .sensor = ADI_SENSE_1000_ADC_SENSOR_THERMOCOUPLE_T_DEF_L1,
kevin1990 12:97457cf77bcb 157 .gain = ADI_SENSE_1000_ADC_GAIN_32X,
kevin1990 12:97457cf77bcb 158 .filter = {
kevin1990 12:97457cf77bcb 159 .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
kevin1990 12:97457cf77bcb 160 },
kevin1990 12:97457cf77bcb 161 .reference = {
kevin1990 12:97457cf77bcb 162 .type = ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_INTERNAL,
kevin1990 12:97457cf77bcb 163 .disableBuffer = true,
kevin1990 12:97457cf77bcb 164 },
kevin1990 12:97457cf77bcb 165 .enableVbias = true,
kevin1990 12:97457cf77bcb 166 },
kevin1990 12:97457cf77bcb 167 },
kevin1990 12:97457cf77bcb 168 [ADI_SENSE_1000_CHANNEL_ID_SENSOR_3] = {
kevin1990 12:97457cf77bcb 169 .enableChannel = true,
kevin1990 12:97457cf77bcb 170 .disablePublishing = false,
kevin1990 12:97457cf77bcb 171 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_CJC_0,
kevin1990 12:97457cf77bcb 172 .measurementsPerCycle = 10,
kevin1990 12:97457cf77bcb 173 .extraSettlingTime = 0,
kevin1990 12:97457cf77bcb 174 .adcChannelConfig = {
kevin1990 12:97457cf77bcb 175 .sensor = ADI_SENSE_1000_ADC_SENSOR_THERMOCOUPLE_J_DEF_L1,
kevin1990 12:97457cf77bcb 176 .gain = ADI_SENSE_1000_ADC_GAIN_32X,
kevin1990 12:97457cf77bcb 177 .filter = {
kevin1990 12:97457cf77bcb 178 .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
kevin1990 12:97457cf77bcb 179 },
kevin1990 12:97457cf77bcb 180 .reference = {
kevin1990 12:97457cf77bcb 181 .type = ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_INTERNAL,
kevin1990 12:97457cf77bcb 182 .disableBuffer = true,
kevin1990 12:97457cf77bcb 183 },
kevin1990 12:97457cf77bcb 184 .enableVbias = true,
kevin1990 12:97457cf77bcb 185 },
kevin1990 12:97457cf77bcb 186 },
kevin1990 12:97457cf77bcb 187 [ADI_SENSE_1000_CHANNEL_ID_VOLTAGE_0] = {
kevin1990 12:97457cf77bcb 188 .enableChannel = true,
kevin1990 12:97457cf77bcb 189 .disablePublishing = false,
kevin1990 12:97457cf77bcb 190 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
kevin1990 12:97457cf77bcb 191 .measurementsPerCycle = 10,
kevin1990 12:97457cf77bcb 192 .extraSettlingTime = 0,
kevin1990 12:97457cf77bcb 193 .adcChannelConfig = {
kevin1990 12:97457cf77bcb 194 .sensor = ADI_SENSE_1000_ADC_SENSOR_VOLTAGE_PRESSURE_HONEYWELL_TRUSTABILITY,
kevin1990 12:97457cf77bcb 195 .gain = ADI_SENSE_1000_ADC_GAIN_2X,
kevin1990 12:97457cf77bcb 196 .filter = {
kevin1990 12:97457cf77bcb 197 .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
kevin1990 12:97457cf77bcb 198 },
kevin1990 12:97457cf77bcb 199 .reference = {
kevin1990 12:97457cf77bcb 200 .type = ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_INTERNAL,
kevin1990 12:97457cf77bcb 201 .disableBuffer = true,
kevin1990 12:97457cf77bcb 202 },
kevin1990 12:97457cf77bcb 203 .enableVbias = false,
kevin1990 12:97457cf77bcb 204 },
kevin1990 12:97457cf77bcb 205 },
kevin1990 12:97457cf77bcb 206 [ADI_SENSE_1000_CHANNEL_ID_CURRENT_0] = {
kevin1990 12:97457cf77bcb 207 .enableChannel = true,
kevin1990 12:97457cf77bcb 208 .disablePublishing = false,
kevin1990 12:97457cf77bcb 209 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
kevin1990 12:97457cf77bcb 210 .measurementsPerCycle = 10,
kevin1990 12:97457cf77bcb 211 .extraSettlingTime = 0,
kevin1990 12:97457cf77bcb 212 .adcChannelConfig = {
kevin1990 12:97457cf77bcb 213 .sensor = ADI_SENSE_1000_ADC_SENSOR_CURRENT_PRESSURE_HONEYWELL_PX2,
kevin1990 12:97457cf77bcb 214 .gain = ADI_SENSE_1000_ADC_GAIN_2X,
kevin1990 12:97457cf77bcb 215 .filter = {
kevin1990 12:97457cf77bcb 216 .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
kevin1990 12:97457cf77bcb 217 },
kevin1990 12:97457cf77bcb 218 .reference = {
kevin1990 12:97457cf77bcb 219 .type = ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_INTERNAL,
kevin1990 12:97457cf77bcb 220 .disableBuffer = true,
kevin1990 12:97457cf77bcb 221 },
kevin1990 12:97457cf77bcb 222 .enableVbias = false,
kevin1990 12:97457cf77bcb 223 },
kevin1990 12:97457cf77bcb 224 },
kevin1990 12:97457cf77bcb 225 [ADI_SENSE_1000_CHANNEL_ID_I2C_0] = {
kevin1990 12:97457cf77bcb 226 .enableChannel = true,
kevin1990 12:97457cf77bcb 227 .disablePublishing = false,
kevin1990 12:97457cf77bcb 228 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
kevin1990 12:97457cf77bcb 229 .measurementsPerCycle = 10,
kevin1990 12:97457cf77bcb 230 .extraSettlingTime = 0,
kevin1990 12:97457cf77bcb 231 .i2cChannelConfig = {
kevin1990 12:97457cf77bcb 232 .sensor = ADI_SENSE_1000_I2C_SENSOR_HUMIDITY_HONEYWELL_HUMIDICON,
kevin1990 12:97457cf77bcb 233 .deviceAddress = 0x27,
kevin1990 12:97457cf77bcb 234 },
kevin1990 12:97457cf77bcb 235 },
kevin1990 12:97457cf77bcb 236 [ADI_SENSE_1000_CHANNEL_ID_I2C_1] = {
kevin1990 12:97457cf77bcb 237 .enableChannel = false,
kevin1990 12:97457cf77bcb 238 },
kevin1990 12:97457cf77bcb 239 [ADI_SENSE_1000_CHANNEL_ID_SPI_0] = {
kevin1990 12:97457cf77bcb 240 .enableChannel = false,
kevin1990 12:97457cf77bcb 241 },
kevin1990 12:97457cf77bcb 242 [ADI_SENSE_1000_CHANNEL_ID_SPI_1] = {
kevin1990 12:97457cf77bcb 243 .enableChannel = false,
kevin1990 12:97457cf77bcb 244 },
kevin1990 12:97457cf77bcb 245 [ADI_SENSE_1000_CHANNEL_ID_SPI_2] = {
kevin1990 12:97457cf77bcb 246 .enableChannel = false,
kevin1990 12:97457cf77bcb 247 },
kevin1990 12:97457cf77bcb 248 },
kevin1990 12:97457cf77bcb 249 },
kevin1990 12:97457cf77bcb 250 };
kevin1990 12:97457cf77bcb 251