AdiSense1000_V21 MBED API

Fork of AdiSense1000 by PoC_Team

Committer:
danodonovan
Date:
Mon Jan 22 17:40:21 2018 +0000
Revision:
23:2adb6216b001
Parent:
12:97457cf77bcb
Child:
25:c5bff546082f
Updating example to adisense1000 v1.0.1

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