CAC_smartcushion / Mbed OS AdiSense1000_V21_Smartcushion

Fork of Sean_AdiSense1000_V21 by Rohan Gurav

Committer:
kevin1990
Date:
Fri Dec 15 22:41:56 2017 +0000
Revision:
18:fa3a317ebeaa
v1.0_RC3 Release

Who changed what in which revision?

UserRevisionLine numberNew contents of line
kevin1990 18:fa3a317ebeaa 1 /*!
kevin1990 18:fa3a317ebeaa 2 ******************************************************************************
kevin1990 18:fa3a317ebeaa 3 * @file: adi_sense_1000_config.h
kevin1990 18:fa3a317ebeaa 4 * @brief: Configuration type definitions for ADI Sense 1000.
kevin1990 18:fa3a317ebeaa 5 *-----------------------------------------------------------------------------
kevin1990 18:fa3a317ebeaa 6 */
kevin1990 18:fa3a317ebeaa 7
kevin1990 18:fa3a317ebeaa 8 /*
kevin1990 18:fa3a317ebeaa 9 Copyright (c) 2017 Analog Devices, Inc.
kevin1990 18:fa3a317ebeaa 10
kevin1990 18:fa3a317ebeaa 11 All rights reserved.
kevin1990 18:fa3a317ebeaa 12
kevin1990 18:fa3a317ebeaa 13 Redistribution and use in source and binary forms, with or without modification,
kevin1990 18:fa3a317ebeaa 14 are permitted provided that the following conditions are met:
kevin1990 18:fa3a317ebeaa 15 - Redistributions of source code must retain the above copyright notice,
kevin1990 18:fa3a317ebeaa 16 this list of conditions and the following disclaimer.
kevin1990 18:fa3a317ebeaa 17 - Redistributions in binary form must reproduce the above copyright notice,
kevin1990 18:fa3a317ebeaa 18 this list of conditions and the following disclaimer in the documentation
kevin1990 18:fa3a317ebeaa 19 and/or other materials provided with the distribution.
kevin1990 18:fa3a317ebeaa 20 - Modified versions of the software must be conspicuously marked as such.
kevin1990 18:fa3a317ebeaa 21 - This software is licensed solely and exclusively for use with processors
kevin1990 18:fa3a317ebeaa 22 manufactured by or for Analog Devices, Inc.
kevin1990 18:fa3a317ebeaa 23 - This software may not be combined or merged with other code in any manner
kevin1990 18:fa3a317ebeaa 24 that would cause the software to become subject to terms and conditions
kevin1990 18:fa3a317ebeaa 25 which differ from those listed here.
kevin1990 18:fa3a317ebeaa 26 - Neither the name of Analog Devices, Inc. nor the names of its
kevin1990 18:fa3a317ebeaa 27 contributors may be used to endorse or promote products derived
kevin1990 18:fa3a317ebeaa 28 from this software without specific prior written permission.
kevin1990 18:fa3a317ebeaa 29 - The use of this software may or may not infringe the patent rights of one
kevin1990 18:fa3a317ebeaa 30 or more patent holders. This license does not release you from the
kevin1990 18:fa3a317ebeaa 31 requirement that you obtain separate licenses from these patent holders
kevin1990 18:fa3a317ebeaa 32 to use this software.
kevin1990 18:fa3a317ebeaa 33
kevin1990 18:fa3a317ebeaa 34 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS" AND ANY
kevin1990 18:fa3a317ebeaa 35 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
kevin1990 18:fa3a317ebeaa 36 TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
kevin1990 18:fa3a317ebeaa 37 NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
kevin1990 18:fa3a317ebeaa 38 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR CONSEQUENTIAL DAMAGES
kevin1990 18:fa3a317ebeaa 39 (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF CLAIMS OF INTELLECTUAL
kevin1990 18:fa3a317ebeaa 40 PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
kevin1990 18:fa3a317ebeaa 41 OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
kevin1990 18:fa3a317ebeaa 42 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
kevin1990 18:fa3a317ebeaa 43 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
kevin1990 18:fa3a317ebeaa 44 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
kevin1990 18:fa3a317ebeaa 45 */
kevin1990 18:fa3a317ebeaa 46
kevin1990 18:fa3a317ebeaa 47 #ifndef __ADI_SENSE_1000_CONFIG_H__
kevin1990 18:fa3a317ebeaa 48 #define __ADI_SENSE_1000_CONFIG_H__
kevin1990 18:fa3a317ebeaa 49
kevin1990 18:fa3a317ebeaa 50 #include "adi_sense_platform.h"
kevin1990 18:fa3a317ebeaa 51 #include "adi_sense_1000_sensor_types.h"
kevin1990 18:fa3a317ebeaa 52
kevin1990 18:fa3a317ebeaa 53 /*! @addtogroup ADI_Sense_1000_Api ADI Sense 1000 Host Library API
kevin1990 18:fa3a317ebeaa 54 * @{
kevin1990 18:fa3a317ebeaa 55 */
kevin1990 18:fa3a317ebeaa 56
kevin1990 18:fa3a317ebeaa 57 #ifdef __cplusplus
kevin1990 18:fa3a317ebeaa 58 extern "C" {
kevin1990 18:fa3a317ebeaa 59 #endif
kevin1990 18:fa3a317ebeaa 60
kevin1990 18:fa3a317ebeaa 61 /*! Maximum length allowed for a digital sensor command */
kevin1990 18:fa3a317ebeaa 62 #define ADI_SENSE_1000_SENSOR_COMMAND_MAX_LENGTH 7
kevin1990 18:fa3a317ebeaa 63
kevin1990 18:fa3a317ebeaa 64 /*! ADI Sense 1000 operating mode options */
kevin1990 18:fa3a317ebeaa 65 typedef enum {
kevin1990 18:fa3a317ebeaa 66 ADI_SENSE_1000_OPERATING_MODE_SINGLECYCLE = 1,
kevin1990 18:fa3a317ebeaa 67 /*!< Executes a single measurement cycle and stops */
kevin1990 18:fa3a317ebeaa 68 ADI_SENSE_1000_OPERATING_MODE_CONTINUOUS,
kevin1990 18:fa3a317ebeaa 69 /*!< Continuously executes measurement cycles */
kevin1990 18:fa3a317ebeaa 70 ADI_SENSE_1000_OPERATING_MODE_MULTICYCLE,
kevin1990 18:fa3a317ebeaa 71 /*!< Executes a burst of measurement cycles, repeated at defined intervals */
kevin1990 18:fa3a317ebeaa 72 } ADI_SENSE_1000_OPERATING_MODE;
kevin1990 18:fa3a317ebeaa 73
kevin1990 18:fa3a317ebeaa 74 /*! ADI Sense 1000 data read mode options */
kevin1990 18:fa3a317ebeaa 75 typedef enum {
kevin1990 18:fa3a317ebeaa 76 ADI_SENSE_1000_DATAREADY_PER_CONVERSION = 1,
kevin1990 18:fa3a317ebeaa 77 /*!< The DATAREADY signal is asserted after completion of each conversion
kevin1990 18:fa3a317ebeaa 78 * - a single data sample only from the latest completed conversion is
kevin1990 18:fa3a317ebeaa 79 * stored in this mode
kevin1990 18:fa3a317ebeaa 80 */
kevin1990 18:fa3a317ebeaa 81 ADI_SENSE_1000_DATAREADY_PER_CYCLE,
kevin1990 18:fa3a317ebeaa 82 /*!< The DATAREADY signal is asserted after completion of each measurement
kevin1990 18:fa3a317ebeaa 83 * cycle
kevin1990 18:fa3a317ebeaa 84 * - data samples only from the lastest completed measurement cycle are
kevin1990 18:fa3a317ebeaa 85 * stored in this mode
kevin1990 18:fa3a317ebeaa 86 */
kevin1990 18:fa3a317ebeaa 87 ADI_SENSE_1000_DATAREADY_PER_MULTICYCLE_BURST,
kevin1990 18:fa3a317ebeaa 88 /*!< The DATAREADY signal is asserted after completion of each burst of
kevin1990 18:fa3a317ebeaa 89 * measurement cycles
kevin1990 18:fa3a317ebeaa 90 * - applicable only when @ref ADI_SENSE_1000_OPERATING_MODE_MULTICYCLE
kevin1990 18:fa3a317ebeaa 91 * is also selected
kevin1990 18:fa3a317ebeaa 92 * - data samples only from the lastest completed burst of measurement
kevin1990 18:fa3a317ebeaa 93 * cycles are stored in this mode
kevin1990 18:fa3a317ebeaa 94 */
kevin1990 18:fa3a317ebeaa 95 } ADI_SENSE_1000_DATAREADY_MODE;
kevin1990 18:fa3a317ebeaa 96
kevin1990 18:fa3a317ebeaa 97 /*! ADI Sense 1000 data power mode options */
kevin1990 18:fa3a317ebeaa 98 typedef enum {
kevin1990 18:fa3a317ebeaa 99 ADI_SENSE_1000_POWER_MODE_LOW = 1,
kevin1990 18:fa3a317ebeaa 100 /*!< Lowest ADC power consumption mode, with lowest conversion rate */
kevin1990 18:fa3a317ebeaa 101 ADI_SENSE_1000_POWER_MODE_MID,
kevin1990 18:fa3a317ebeaa 102 /*!< Medium ADC power consumption mode, with medium conversion rate */
kevin1990 18:fa3a317ebeaa 103 ADI_SENSE_1000_POWER_MODE_FULL,
kevin1990 18:fa3a317ebeaa 104 /*!< Highest ADC power consumption mode, with highest conversion rate */
kevin1990 18:fa3a317ebeaa 105 } ADI_SENSE_1000_POWER_MODE;
kevin1990 18:fa3a317ebeaa 106
kevin1990 18:fa3a317ebeaa 107 /*! ADI Sense 1000 measurement unit options
kevin1990 18:fa3a317ebeaa 108 *
kevin1990 18:fa3a317ebeaa 109 * Optionally select a measurement unit for final conversion results.
kevin1990 18:fa3a317ebeaa 110 * Currently applicable only to specific temperature sensor types.
kevin1990 18:fa3a317ebeaa 111 */
kevin1990 18:fa3a317ebeaa 112 typedef enum {
kevin1990 18:fa3a317ebeaa 113 ADI_SENSE_1000_MEASUREMENT_UNIT_DEFAULT = 0,
kevin1990 18:fa3a317ebeaa 114 /*!< No measurement unit specified - implied by sensor type selection */
kevin1990 18:fa3a317ebeaa 115 ADI_SENSE_1000_MEASUREMENT_UNIT_CELSIUS,
kevin1990 18:fa3a317ebeaa 116 /*!< Celsius temperature unit - applicable to temperature sensors only */
kevin1990 18:fa3a317ebeaa 117 ADI_SENSE_1000_MEASUREMENT_UNIT_FAHRENHEIT,
kevin1990 18:fa3a317ebeaa 118 /*!< Fahrenheit temperature unit - applicable to temperature sensors only */
kevin1990 18:fa3a317ebeaa 119 } ADI_SENSE_1000_MEASUREMENT_UNIT;
kevin1990 18:fa3a317ebeaa 120
kevin1990 18:fa3a317ebeaa 121 /*! ADI Sense 1000 Open-Sensor Diagnostics frequency
kevin1990 18:fa3a317ebeaa 122 *
kevin1990 18:fa3a317ebeaa 123 * Select the per-cycle frequency at which open-sensor diagnostic
kevin1990 18:fa3a317ebeaa 124 * checks should be performed. Open-sensor diagnostic checks typically require
kevin1990 18:fa3a317ebeaa 125 * specific or time-consuming processing which cannot be executed while a
kevin1990 18:fa3a317ebeaa 126 * measurement cycle is running.
kevin1990 18:fa3a317ebeaa 127 *
kevin1990 18:fa3a317ebeaa 128 * @note Open-sensor diagnostic checks, when performed, will add a delay to the
kevin1990 18:fa3a317ebeaa 129 * start of the next measurement cycle.
kevin1990 18:fa3a317ebeaa 130 */
kevin1990 18:fa3a317ebeaa 131 typedef enum {
kevin1990 18:fa3a317ebeaa 132 ADI_SENSE_1000_OPEN_SENSOR_DIAGNOSTICS_DISABLED = 0,
kevin1990 18:fa3a317ebeaa 133 /*!< No Open-Sensor Detection is performed */
kevin1990 18:fa3a317ebeaa 134 ADI_SENSE_1000_OPEN_SENSOR_DIAGNOSTICS_PER_CYCLE,
kevin1990 18:fa3a317ebeaa 135 /*!< No Open-Sensor Detection is performed prior to each cycle */
kevin1990 18:fa3a317ebeaa 136 ADI_SENSE_1000_OPEN_SENSOR_DIAGNOSTICS_PER_100_CYCLES,
kevin1990 18:fa3a317ebeaa 137 /*!< No Open-Sensor Detection is performed at intervals of 100 cycles */
kevin1990 18:fa3a317ebeaa 138 ADI_SENSE_1000_OPEN_SENSOR_DIAGNOSTICS_PER_1000_CYCLES,
kevin1990 18:fa3a317ebeaa 139 /*!< No Open-Sensor Detection is performed at intervals of 1000 cycles */
kevin1990 18:fa3a317ebeaa 140 } ADI_SENSE_1000_OPEN_SENSOR_DIAGNOSTICS;
kevin1990 18:fa3a317ebeaa 141
kevin1990 18:fa3a317ebeaa 142 /*! ADI Sense 1000 analog input signal amplification gain options
kevin1990 18:fa3a317ebeaa 143 *
kevin1990 18:fa3a317ebeaa 144 * @note applicable only to ADC analog sensor channels
kevin1990 18:fa3a317ebeaa 145 */
kevin1990 18:fa3a317ebeaa 146 typedef enum {
kevin1990 18:fa3a317ebeaa 147 ADI_SENSE_1000_ADC_GAIN_1X = 0,
kevin1990 18:fa3a317ebeaa 148 /*!< no amplification gain */
kevin1990 18:fa3a317ebeaa 149 ADI_SENSE_1000_ADC_GAIN_2X,
kevin1990 18:fa3a317ebeaa 150 /*!< x2 amplification gain */
kevin1990 18:fa3a317ebeaa 151 ADI_SENSE_1000_ADC_GAIN_4X,
kevin1990 18:fa3a317ebeaa 152 /*!< x4 amplification gain */
kevin1990 18:fa3a317ebeaa 153 ADI_SENSE_1000_ADC_GAIN_8X,
kevin1990 18:fa3a317ebeaa 154 /*!< x8 amplification gain */
kevin1990 18:fa3a317ebeaa 155 ADI_SENSE_1000_ADC_GAIN_16X,
kevin1990 18:fa3a317ebeaa 156 /*!< x16 amplification gain */
kevin1990 18:fa3a317ebeaa 157 ADI_SENSE_1000_ADC_GAIN_32X,
kevin1990 18:fa3a317ebeaa 158 /*!< x32 amplification gain */
kevin1990 18:fa3a317ebeaa 159 ADI_SENSE_1000_ADC_GAIN_64X,
kevin1990 18:fa3a317ebeaa 160 /*!< x64 amplification gain */
kevin1990 18:fa3a317ebeaa 161 ADI_SENSE_1000_ADC_GAIN_128X,
kevin1990 18:fa3a317ebeaa 162 /*!< x128 amplification gain */
kevin1990 18:fa3a317ebeaa 163 } ADI_SENSE_1000_ADC_GAIN;
kevin1990 18:fa3a317ebeaa 164
kevin1990 18:fa3a317ebeaa 165 /*! ADI Sense 1000 analog sensor excitation current output level options
kevin1990 18:fa3a317ebeaa 166 *
kevin1990 18:fa3a317ebeaa 167 * @note applicable only to ADC analog sensor channels, and
kevin1990 18:fa3a317ebeaa 168 * specific sensor types
kevin1990 18:fa3a317ebeaa 169 */
kevin1990 18:fa3a317ebeaa 170 typedef enum {
kevin1990 18:fa3a317ebeaa 171 ADI_SENSE_1000_ADC_EXC_CURRENT_NONE = 0,
kevin1990 18:fa3a317ebeaa 172 /*!< Excitation current disabled */
kevin1990 18:fa3a317ebeaa 173 ADI_SENSE_1000_ADC_EXC_CURRENT_50uA,
kevin1990 18:fa3a317ebeaa 174 /*!< 50uA excitation current enabled */
kevin1990 18:fa3a317ebeaa 175 ADI_SENSE_1000_ADC_EXC_CURRENT_100uA,
kevin1990 18:fa3a317ebeaa 176 /*!< 100uA excitation current */
kevin1990 18:fa3a317ebeaa 177 ADI_SENSE_1000_ADC_EXC_CURRENT_250uA,
kevin1990 18:fa3a317ebeaa 178 /*!< 250uA excitation current enabled */
kevin1990 18:fa3a317ebeaa 179 ADI_SENSE_1000_ADC_EXC_CURRENT_500uA,
kevin1990 18:fa3a317ebeaa 180 /*!< 500uA excitation current enabled */
kevin1990 18:fa3a317ebeaa 181 ADI_SENSE_1000_ADC_EXC_CURRENT_750uA,
kevin1990 18:fa3a317ebeaa 182 /*!< 750uA excitation current enabled */
kevin1990 18:fa3a317ebeaa 183 ADI_SENSE_1000_ADC_EXC_CURRENT_1000uA,
kevin1990 18:fa3a317ebeaa 184 /*!< 1mA excitation current enabled */
kevin1990 18:fa3a317ebeaa 185 } ADI_SENSE_1000_ADC_EXC_CURRENT;
kevin1990 18:fa3a317ebeaa 186
kevin1990 18:fa3a317ebeaa 187 /*! ADI Sense 1000 analog sensor excitation current swap options
kevin1990 18:fa3a317ebeaa 188 *
kevin1990 18:fa3a317ebeaa 189 * @note applicable only to ADC analog sensor types where 2 excitation current
kevin1990 18:fa3a317ebeaa 190 * sources may be enabled (e.g. 3-wire RTD sensors)
kevin1990 18:fa3a317ebeaa 191 */
kevin1990 18:fa3a317ebeaa 192 typedef enum {
kevin1990 18:fa3a317ebeaa 193 ADI_SENSE_1000_ADC_EXC_CURRENT_SWAP_DYNAMIC = 0,
kevin1990 18:fa3a317ebeaa 194 /*!< 2 measurements are performed, one with excitation currents output on
kevin1990 18:fa3a317ebeaa 195 * default output pins, then another with the current outputs swapped,
kevin1990 18:fa3a317ebeaa 196 * and these measurements are averaged to provide a single result.
kevin1990 18:fa3a317ebeaa 197 */
kevin1990 18:fa3a317ebeaa 198 ADI_SENSE_1000_ADC_EXC_CURRENT_SWAP_STATIC,
kevin1990 18:fa3a317ebeaa 199 /*!< Excitation current output pin assignments are swapped from defaults */
kevin1990 18:fa3a317ebeaa 200 ADI_SENSE_1000_ADC_EXC_CURRENT_SWAP_NONE,
kevin1990 18:fa3a317ebeaa 201 /*!< Excitation current output on default pins (IOUT0->AIN0, IOUT1->AIN3) */
kevin1990 18:fa3a317ebeaa 202 } ADI_SENSE_1000_ADC_EXC_CURRENT_SWAP;
kevin1990 18:fa3a317ebeaa 203
kevin1990 18:fa3a317ebeaa 204 /*! ADI Sense 1000 analog reference selection options
kevin1990 18:fa3a317ebeaa 205 *
kevin1990 18:fa3a317ebeaa 206 * @note applicable only to ADC analog sensor channels, and
kevin1990 18:fa3a317ebeaa 207 * specific sensor types
kevin1990 18:fa3a317ebeaa 208 */
kevin1990 18:fa3a317ebeaa 209 typedef enum {
kevin1990 18:fa3a317ebeaa 210 ADI_SENSE_1000_ADC_REFERENCE_NONE = 0,
kevin1990 18:fa3a317ebeaa 211 /*!< No reference is selected */
kevin1990 18:fa3a317ebeaa 212
kevin1990 18:fa3a317ebeaa 213 ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_INTERNAL_1,
kevin1990 18:fa3a317ebeaa 214 /*!< Internal reference resistor #1 (4320 ohms) is selected */
kevin1990 18:fa3a317ebeaa 215 ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_INTERNAL_2,
kevin1990 18:fa3a317ebeaa 216 /*!< Internal reference resistor #2 (10000 ohms) is selected */
kevin1990 18:fa3a317ebeaa 217 ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_INTERNAL,
kevin1990 18:fa3a317ebeaa 218 /*!< Internal ADC voltage reference (2.5V) is selected */
kevin1990 18:fa3a317ebeaa 219 ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_AVDD,
kevin1990 18:fa3a317ebeaa 220 /*!< Analag Supply Voltage AVDD reference (typically 3.3V) is selected */
kevin1990 18:fa3a317ebeaa 221
kevin1990 18:fa3a317ebeaa 222 ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_EXTERNAL_1,
kevin1990 18:fa3a317ebeaa 223 /*!< External user-supplied reference resistor #1 is selected
kevin1990 18:fa3a317ebeaa 224 *
kevin1990 18:fa3a317ebeaa 225 * @note reference resistor value @ref externalRef1Value must be specified
kevin1990 18:fa3a317ebeaa 226 * (see @ref ADI_SENSE_1000_MEASUREMENT_CONFIG) */
kevin1990 18:fa3a317ebeaa 227 ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_EXTERNAL_2,
kevin1990 18:fa3a317ebeaa 228 /*!< External user-supplied reference resistor #2 is selected
kevin1990 18:fa3a317ebeaa 229 *
kevin1990 18:fa3a317ebeaa 230 * @note reference resistor value @ref externalRef2Value must be specified
kevin1990 18:fa3a317ebeaa 231 * (see @ref ADI_SENSE_1000_MEASUREMENT_CONFIG) */
kevin1990 18:fa3a317ebeaa 232 ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_EXTERNAL_1,
kevin1990 18:fa3a317ebeaa 233 /*!< External user-supplied reference voltage #1 is selected
kevin1990 18:fa3a317ebeaa 234 *
kevin1990 18:fa3a317ebeaa 235 * @note reference voltage value @ref externalRef1Value must be specified
kevin1990 18:fa3a317ebeaa 236 * (see @ref ADI_SENSE_1000_MEASUREMENT_CONFIG) */
kevin1990 18:fa3a317ebeaa 237 ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_EXTERNAL_2,
kevin1990 18:fa3a317ebeaa 238 /*!< External user-supplied reference voltage #2 is selected
kevin1990 18:fa3a317ebeaa 239 *
kevin1990 18:fa3a317ebeaa 240 * @note reference voltage value @ref externalRef2Value must be specified
kevin1990 18:fa3a317ebeaa 241 * (see @ref ADI_SENSE_1000_MEASUREMENT_CONFIG) */
kevin1990 18:fa3a317ebeaa 242 ADI_SENSE_1000_ADC_REFERENCE_BRIDGE_EXCITATION,
kevin1990 18:fa3a317ebeaa 243 /*!< Bridge Excition Voltage is selected as reference
kevin1990 18:fa3a317ebeaa 244 *
kevin1990 18:fa3a317ebeaa 245 * @note this reference MUST be selected for 4/6-wire bridge sensor types
kevin1990 18:fa3a317ebeaa 246 * (see @ref ADI_SENSE_1000_ADC_SENSOR_TYPE) */
kevin1990 18:fa3a317ebeaa 247 } ADI_SENSE_1000_ADC_REFERENCE_TYPE;
kevin1990 18:fa3a317ebeaa 248
kevin1990 18:fa3a317ebeaa 249 /*! ADI Sense 1000 analog filter selection options
kevin1990 18:fa3a317ebeaa 250 *
kevin1990 18:fa3a317ebeaa 251 * @note applicable only to ADC analog sensor channels
kevin1990 18:fa3a317ebeaa 252 */
kevin1990 18:fa3a317ebeaa 253 typedef enum {
kevin1990 18:fa3a317ebeaa 254 ADI_SENSE_1000_ADC_FILTER_SINC4 = 1,
kevin1990 18:fa3a317ebeaa 255 /*!< SINC4 filter
kevin1990 18:fa3a317ebeaa 256 *
kevin1990 18:fa3a317ebeaa 257 * @note The number of input samples to be averaged by the filter
kevin1990 18:fa3a317ebeaa 258 * must be specified by @ref fs (see @ref ADI_SENSE_1000_ADC_FILTER_CONFIG)
kevin1990 18:fa3a317ebeaa 259 * The fs value affects the output sample rate and settling times
kevin1990 18:fa3a317ebeaa 260 * of the ADC */
kevin1990 18:fa3a317ebeaa 261 ADI_SENSE_1000_ADC_FILTER_FIR_20SPS,
kevin1990 18:fa3a317ebeaa 262 /*!< FIR post filter, producing a 20sps output sample rate */
kevin1990 18:fa3a317ebeaa 263 ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
kevin1990 18:fa3a317ebeaa 264 /*!< FIR post filter, producing a 25sps output sample rate */
kevin1990 18:fa3a317ebeaa 265 } ADI_SENSE_1000_ADC_FILTER_TYPE;
kevin1990 18:fa3a317ebeaa 266
kevin1990 18:fa3a317ebeaa 267 /*! ADI Sense 1000 Power Configuration options */
kevin1990 18:fa3a317ebeaa 268 typedef struct {
kevin1990 18:fa3a317ebeaa 269 ADI_SENSE_1000_POWER_MODE powerMode;
kevin1990 18:fa3a317ebeaa 270 /*!< Power mode selection */
kevin1990 18:fa3a317ebeaa 271 float32_t supplyVoltage;
kevin1990 18:fa3a317ebeaa 272 /*!< AVDD analog supply voltage (e.g. 3.3V)*/
kevin1990 18:fa3a317ebeaa 273 } ADI_SENSE_1000_POWER_CONFIG;
kevin1990 18:fa3a317ebeaa 274
kevin1990 18:fa3a317ebeaa 275 /*! ADI Sense 1000 Multi-Cycle Configuration options
kevin1990 18:fa3a317ebeaa 276 *
kevin1990 18:fa3a317ebeaa 277 * @note required only when ADI_SENSE_1000_OPERATING_MODE_MULTICYCLE is selected
kevin1990 18:fa3a317ebeaa 278 * as the operatingMode (@ref ADI_SENSE_1000_MEASUREMENT_CONFIG)
kevin1990 18:fa3a317ebeaa 279 */
kevin1990 18:fa3a317ebeaa 280 typedef struct {
kevin1990 18:fa3a317ebeaa 281 uint32_t cyclesPerBurst;
kevin1990 18:fa3a317ebeaa 282 /*!< Number of cycles to complete for a single burst */
kevin1990 18:fa3a317ebeaa 283 uint32_t burstInterval;
kevin1990 18:fa3a317ebeaa 284 /*!< Interval, in seconds, between each successive burst of cycles */
kevin1990 18:fa3a317ebeaa 285 } ADI_SENSE_1000_MULTICYCLE_CONFIG;
kevin1990 18:fa3a317ebeaa 286
kevin1990 18:fa3a317ebeaa 287 /*! ADI Sense 1000 Measurement Configuration options */
kevin1990 18:fa3a317ebeaa 288 typedef struct {
kevin1990 18:fa3a317ebeaa 289 ADI_SENSE_1000_OPERATING_MODE operatingMode;
kevin1990 18:fa3a317ebeaa 290 /*!< Operating mode - specifies how measurement cycles are scheduled */
kevin1990 18:fa3a317ebeaa 291 ADI_SENSE_1000_DATAREADY_MODE dataReadyMode;
kevin1990 18:fa3a317ebeaa 292 /*!< Data read mode - specifies how output samples are stored for reading */
kevin1990 18:fa3a317ebeaa 293 ADI_SENSE_1000_MULTICYCLE_CONFIG multiCycleConfig;
kevin1990 18:fa3a317ebeaa 294 /*!< Multi-Cycle configuration - specifies how bursts of measurement cycles
kevin1990 18:fa3a317ebeaa 295 * are scheduled. Applicable only when operatingMode is
kevin1990 18:fa3a317ebeaa 296 * ADI_SENSE_1000_OPERATING_MODE_MULTICYCLE
kevin1990 18:fa3a317ebeaa 297 */
kevin1990 18:fa3a317ebeaa 298 uint32_t cycleInterval;
kevin1990 18:fa3a317ebeaa 299 /*!< Cycle interval - specifies the time interval between the start of each
kevin1990 18:fa3a317ebeaa 300 * successive measurement cycle. Applicable only when operatingMode is
kevin1990 18:fa3a317ebeaa 301 * not ADI_SENSE_1000_OPERATING_MODE_SINGLECYCLE
kevin1990 18:fa3a317ebeaa 302 */
kevin1990 18:fa3a317ebeaa 303 float32_t externalRef1Value;
kevin1990 18:fa3a317ebeaa 304 /*!< Resistance/voltage value connected to external reference input #1.
kevin1990 18:fa3a317ebeaa 305 * Applicable only if the selected reference type is
kevin1990 18:fa3a317ebeaa 306 * ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_EXTERNAL_1 or
kevin1990 18:fa3a317ebeaa 307 * ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_EXTERNAL_1
kevin1990 18:fa3a317ebeaa 308 * (see @ref ADI_SENSE_1000_ADC_REFERENCE_TYPE)
kevin1990 18:fa3a317ebeaa 309 */
kevin1990 18:fa3a317ebeaa 310 float32_t externalRef2Value;
kevin1990 18:fa3a317ebeaa 311 /*!< Resistance/voltage value connected to external reference input #2.
kevin1990 18:fa3a317ebeaa 312 * Applicable only if the selected reference type is
kevin1990 18:fa3a317ebeaa 313 * ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_EXTERNAL_2 or
kevin1990 18:fa3a317ebeaa 314 * ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_EXTERNAL_2
kevin1990 18:fa3a317ebeaa 315 * (see @ref ADI_SENSE_1000_ADC_REFERENCE_TYPE)
kevin1990 18:fa3a317ebeaa 316 */
kevin1990 18:fa3a317ebeaa 317 } ADI_SENSE_1000_MEASUREMENT_CONFIG;
kevin1990 18:fa3a317ebeaa 318
kevin1990 18:fa3a317ebeaa 319 /*! ADI Sense 1000 ADC Excitation Current output configuration
kevin1990 18:fa3a317ebeaa 320 *
kevin1990 18:fa3a317ebeaa 321 * @note applicable only to ADC analog sensor channels, and
kevin1990 18:fa3a317ebeaa 322 * specific sensor types
kevin1990 18:fa3a317ebeaa 323 */
kevin1990 18:fa3a317ebeaa 324 typedef struct {
kevin1990 18:fa3a317ebeaa 325 ADI_SENSE_1000_ADC_EXC_CURRENT outputLevel;
kevin1990 18:fa3a317ebeaa 326 /*!< Excitation current output level */
kevin1990 18:fa3a317ebeaa 327 ADI_SENSE_1000_ADC_EXC_CURRENT_SWAP swapOption;
kevin1990 18:fa3a317ebeaa 328 /*!< Excitation current output source options */
kevin1990 18:fa3a317ebeaa 329 } ADI_SENSE_1000_ADC_EXC_CURRENT_CONFIG;
kevin1990 18:fa3a317ebeaa 330
kevin1990 18:fa3a317ebeaa 331 /*! ADI Sense 1000 ADC Filter configuration
kevin1990 18:fa3a317ebeaa 332 *
kevin1990 18:fa3a317ebeaa 333 * @note applicable only to ADC analog sensor channels
kevin1990 18:fa3a317ebeaa 334 */
kevin1990 18:fa3a317ebeaa 335 typedef struct {
kevin1990 18:fa3a317ebeaa 336 ADI_SENSE_1000_ADC_FILTER_TYPE type;
kevin1990 18:fa3a317ebeaa 337 /*!< Filter type selection */
kevin1990 18:fa3a317ebeaa 338 uint32_t fs;
kevin1990 18:fa3a317ebeaa 339 /*!< Number of input samples to accumulate and average in the filter.
kevin1990 18:fa3a317ebeaa 340 * Applicable only when type is ADI_SENSE_1000_ADC_FILTER_SINC4 */
kevin1990 18:fa3a317ebeaa 341 } ADI_SENSE_1000_ADC_FILTER_CONFIG;
kevin1990 18:fa3a317ebeaa 342
kevin1990 18:fa3a317ebeaa 343 /*! ADI Sense 1000 ADC Referemce configuration
kevin1990 18:fa3a317ebeaa 344 *
kevin1990 18:fa3a317ebeaa 345 * @note applicable only to ADC analog sensor channels
kevin1990 18:fa3a317ebeaa 346 */
kevin1990 18:fa3a317ebeaa 347 typedef struct {
kevin1990 18:fa3a317ebeaa 348 ADI_SENSE_1000_ADC_REFERENCE_TYPE type;
kevin1990 18:fa3a317ebeaa 349 /*!< Filter type selection */
kevin1990 18:fa3a317ebeaa 350 bool_t disableBuffer;
kevin1990 18:fa3a317ebeaa 351 /*!< Option to disable internal ADC reference buffer */
kevin1990 18:fa3a317ebeaa 352 } ADI_SENSE_1000_ADC_REFERENCE_CONFIG;
kevin1990 18:fa3a317ebeaa 353
kevin1990 18:fa3a317ebeaa 354 /*! ADI Sense 1000 ADC analog channel configuration details
kevin1990 18:fa3a317ebeaa 355 *
kevin1990 18:fa3a317ebeaa 356 * @note applicable only to ADC analog sensor channels
kevin1990 18:fa3a317ebeaa 357 */
kevin1990 18:fa3a317ebeaa 358 typedef struct {
kevin1990 18:fa3a317ebeaa 359 ADI_SENSE_1000_ADC_SENSOR_TYPE sensor;
kevin1990 18:fa3a317ebeaa 360 /*!< Sensor type selection */
kevin1990 18:fa3a317ebeaa 361 ADI_SENSE_1000_ADC_GAIN gain;
kevin1990 18:fa3a317ebeaa 362 /*!< ADC Gain selection */
kevin1990 18:fa3a317ebeaa 363 ADI_SENSE_1000_ADC_EXC_CURRENT_CONFIG current;
kevin1990 18:fa3a317ebeaa 364 /*!< ADC Excitation Current configuration */
kevin1990 18:fa3a317ebeaa 365 ADI_SENSE_1000_ADC_FILTER_CONFIG filter;
kevin1990 18:fa3a317ebeaa 366 /*!< ADC Filter configuration */
kevin1990 18:fa3a317ebeaa 367 ADI_SENSE_1000_ADC_REFERENCE_CONFIG reference;
kevin1990 18:fa3a317ebeaa 368 /*!< ADC Reference configuration */
kevin1990 18:fa3a317ebeaa 369 bool_t enableVbias;
kevin1990 18:fa3a317ebeaa 370 /*!< Option to enable internal ADC voltage bias */
kevin1990 18:fa3a317ebeaa 371 } ADI_SENSE_1000_ADC_CHANNEL_CONFIG;
kevin1990 18:fa3a317ebeaa 372
kevin1990 18:fa3a317ebeaa 373 /*! ADI Sense 1000 digital sensor data encoding
kevin1990 18:fa3a317ebeaa 374 *
kevin1990 18:fa3a317ebeaa 375 * @note applicable only to SPI and I2C digital sensor channels
kevin1990 18:fa3a317ebeaa 376 */
kevin1990 18:fa3a317ebeaa 377 typedef enum
kevin1990 18:fa3a317ebeaa 378 {
kevin1990 18:fa3a317ebeaa 379 ADI_SENSE_1000_DIGITAL_SENSOR_DATA_CODING_NONE,
kevin1990 18:fa3a317ebeaa 380 /**< None/Invalid - data format is ignored if coding is set to this value */
kevin1990 18:fa3a317ebeaa 381 ADI_SENSE_1000_DIGITAL_SENSOR_DATA_CODING_UNIPOLAR,
kevin1990 18:fa3a317ebeaa 382 /**< Unipolar - unsigned integer values */
kevin1990 18:fa3a317ebeaa 383 ADI_SENSE_1000_DIGITAL_SENSOR_DATA_CODING_TWOS_COMPLEMENT,
kevin1990 18:fa3a317ebeaa 384 /**< Twos-complement - signed integer values */
kevin1990 18:fa3a317ebeaa 385 ADI_SENSE_1000_DIGITAL_SENSOR_DATA_CODING_OFFSET_BINARY,
kevin1990 18:fa3a317ebeaa 386 /**< Offset Binary - used to represent signed values with unsigned integers,
kevin1990 18:fa3a317ebeaa 387 * with the mid-range value representing 0 */
kevin1990 18:fa3a317ebeaa 388 } ADI_SENSE_1000_DIGITAL_SENSOR_DATA_CODING;
kevin1990 18:fa3a317ebeaa 389
kevin1990 18:fa3a317ebeaa 390 /*! ADI Sense 1000 digital sensor data format configuration
kevin1990 18:fa3a317ebeaa 391 *
kevin1990 18:fa3a317ebeaa 392 * @note applicable only to SPI and I2C digital sensor channels
kevin1990 18:fa3a317ebeaa 393 */
kevin1990 18:fa3a317ebeaa 394 typedef struct {
kevin1990 18:fa3a317ebeaa 395 ADI_SENSE_1000_DIGITAL_SENSOR_DATA_CODING coding;
kevin1990 18:fa3a317ebeaa 396 /**< Data Encoding of Sensor Result */
kevin1990 18:fa3a317ebeaa 397 bool_t littleEndian;
kevin1990 18:fa3a317ebeaa 398 /**< Set as true if data format is little-endian, false otherwise */
kevin1990 18:fa3a317ebeaa 399 bool_t leftJustified;
kevin1990 18:fa3a317ebeaa 400 /**< Set as true if data is left-justified in the data frame, false otherwise */
kevin1990 18:fa3a317ebeaa 401 uint8_t frameLength;
kevin1990 18:fa3a317ebeaa 402 /**< Data frame length (number of bytes to read from the sensor) */
kevin1990 18:fa3a317ebeaa 403 uint8_t numDataBits;
kevin1990 18:fa3a317ebeaa 404 /**< Number of relevant data bits to extract from the data frame */
kevin1990 18:fa3a317ebeaa 405 uint8_t bitOffset;
kevin1990 18:fa3a317ebeaa 406 /**< Data bit offset, relative to data alignment within the data frame */
kevin1990 18:fa3a317ebeaa 407 } ADI_SENSE_1000_DIGITAL_SENSOR_DATA_FORMAT;
kevin1990 18:fa3a317ebeaa 408
kevin1990 18:fa3a317ebeaa 409 /*! ADI Sense 1000 digital sensor command
kevin1990 18:fa3a317ebeaa 410 *
kevin1990 18:fa3a317ebeaa 411 * @note applicable only to SPI and I2C digital sensor channels
kevin1990 18:fa3a317ebeaa 412 */
kevin1990 18:fa3a317ebeaa 413 typedef struct {
kevin1990 18:fa3a317ebeaa 414 uint8_t command[ADI_SENSE_1000_SENSOR_COMMAND_MAX_LENGTH];
kevin1990 18:fa3a317ebeaa 415 /*!< Optional command bytes to send to the device */
kevin1990 18:fa3a317ebeaa 416 uint8_t commandLength;
kevin1990 18:fa3a317ebeaa 417 /*!< Number of valid command bytes. Set to 0 if unused */
kevin1990 18:fa3a317ebeaa 418 } ADI_SENSE_1000_DIGITAL_SENSOR_COMMAND;
kevin1990 18:fa3a317ebeaa 419
kevin1990 18:fa3a317ebeaa 420 /*! ADI Sense 1000 I2C digital channel configuration details
kevin1990 18:fa3a317ebeaa 421 *
kevin1990 18:fa3a317ebeaa 422 * @note applicable only to I2C digital sensor channels
kevin1990 18:fa3a317ebeaa 423 */
kevin1990 18:fa3a317ebeaa 424 typedef struct {
kevin1990 18:fa3a317ebeaa 425 ADI_SENSE_1000_I2C_SENSOR_TYPE sensor;
kevin1990 18:fa3a317ebeaa 426 /*!< Sensor type selection */
kevin1990 18:fa3a317ebeaa 427 uint32_t deviceAddress;
kevin1990 18:fa3a317ebeaa 428 /*!< I2C device address (7-bit) */
kevin1990 18:fa3a317ebeaa 429 ADI_SENSE_1000_DIGITAL_SENSOR_COMMAND configurationCommand;
kevin1990 18:fa3a317ebeaa 430 /*!< Optional configuration command to send to the device at start-up.
kevin1990 18:fa3a317ebeaa 431 * A default configuration command will be used if this is not specified.
kevin1990 18:fa3a317ebeaa 432 * Applicable only to specific I2C sensor types.
kevin1990 18:fa3a317ebeaa 433 */
kevin1990 18:fa3a317ebeaa 434 ADI_SENSE_1000_DIGITAL_SENSOR_COMMAND dataRequestCommand;
kevin1990 18:fa3a317ebeaa 435 /*!< Optional data request command to send to the device for each sample.
kevin1990 18:fa3a317ebeaa 436 * A default data request command will be used if this is not specified.
kevin1990 18:fa3a317ebeaa 437 * Applicable only to specific I2C sensor types.
kevin1990 18:fa3a317ebeaa 438 */
kevin1990 18:fa3a317ebeaa 439 ADI_SENSE_1000_DIGITAL_SENSOR_DATA_FORMAT dataFormat;
kevin1990 18:fa3a317ebeaa 440 /*!< Optional data format configuration to parse/extract data from the device.
kevin1990 18:fa3a317ebeaa 441 * A default data format will be used if this is not specified.
kevin1990 18:fa3a317ebeaa 442 * Applicable only to specific I2C sensor types
kevin1990 18:fa3a317ebeaa 443 */
kevin1990 18:fa3a317ebeaa 444 } ADI_SENSE_1000_I2C_CHANNEL_CONFIG;
kevin1990 18:fa3a317ebeaa 445
kevin1990 18:fa3a317ebeaa 446 /*! ADI Sense 1000 SPI digital channel configuration details
kevin1990 18:fa3a317ebeaa 447 *
kevin1990 18:fa3a317ebeaa 448 * @note applicable only to SPI digital sensor channels
kevin1990 18:fa3a317ebeaa 449 */
kevin1990 18:fa3a317ebeaa 450 typedef struct {
kevin1990 18:fa3a317ebeaa 451 ADI_SENSE_1000_SPI_SENSOR_TYPE sensor;
kevin1990 18:fa3a317ebeaa 452 /*!< Sensor type selection */
kevin1990 18:fa3a317ebeaa 453 ADI_SENSE_1000_DIGITAL_SENSOR_COMMAND configurationCommand;
kevin1990 18:fa3a317ebeaa 454 /*!< Optional configuration command to send to the device at start-up.
kevin1990 18:fa3a317ebeaa 455 * A default configuration command will be used if this is not specified.
kevin1990 18:fa3a317ebeaa 456 * Applicable only to specific SPI sensor types.
kevin1990 18:fa3a317ebeaa 457 */
kevin1990 18:fa3a317ebeaa 458 ADI_SENSE_1000_DIGITAL_SENSOR_COMMAND dataRequestCommand;
kevin1990 18:fa3a317ebeaa 459 /*!< Optional data request command to send to the device for each sample.
kevin1990 18:fa3a317ebeaa 460 * A default data request command will be used if this is not specified.
kevin1990 18:fa3a317ebeaa 461 * Applicable only to specific SPI sensor types.
kevin1990 18:fa3a317ebeaa 462 */
kevin1990 18:fa3a317ebeaa 463 ADI_SENSE_1000_DIGITAL_SENSOR_DATA_FORMAT dataFormat;
kevin1990 18:fa3a317ebeaa 464 /*!< Optional data format configuration to parse/extract data from the device.
kevin1990 18:fa3a317ebeaa 465 * A default data format will be used if this is not specified.
kevin1990 18:fa3a317ebeaa 466 * Applicable only to specific SPI sensor types
kevin1990 18:fa3a317ebeaa 467 */
kevin1990 18:fa3a317ebeaa 468 } ADI_SENSE_1000_SPI_CHANNEL_CONFIG;
kevin1990 18:fa3a317ebeaa 469
kevin1990 18:fa3a317ebeaa 470 /*! ADI Sense 1000 Measurement Channel configuration details */
kevin1990 18:fa3a317ebeaa 471 typedef struct {
kevin1990 18:fa3a317ebeaa 472 bool_t enableChannel;
kevin1990 18:fa3a317ebeaa 473 /*!< Option to enable this channel. If set to false, all other fields
kevin1990 18:fa3a317ebeaa 474 * are ignored and this channel will be omitted from measurement cycles
kevin1990 18:fa3a317ebeaa 475 */
kevin1990 18:fa3a317ebeaa 476 bool_t disablePublishing;
kevin1990 18:fa3a317ebeaa 477 /*!< Option to disable publishing of data samples from this channel. The
kevin1990 18:fa3a317ebeaa 478 * channel may still be included in measurement cycles, but data samples
kevin1990 18:fa3a317ebeaa 479 * obtained from this channel will not be published. This is typically
kevin1990 18:fa3a317ebeaa 480 * used for channels which are required only as a compensation reference
kevin1990 18:fa3a317ebeaa 481 * for another channel (e.g. Cold-Junction Compensation channels).
kevin1990 18:fa3a317ebeaa 482 */
kevin1990 18:fa3a317ebeaa 483 ADI_SENSE_1000_CHANNEL_ID compensationChannel;
kevin1990 18:fa3a317ebeaa 484 /*!< Optional compensation channel. Set to ADI_SENSE_1000_CHANNEL_ID_NONE if not
kevin1990 18:fa3a317ebeaa 485 * required. Typically used for thermocouple sensors that require a
kevin1990 18:fa3a317ebeaa 486 * separate measurement of the "cold-junction" temperature, which can be
kevin1990 18:fa3a317ebeaa 487 * be provided by an RTD temperature sensor connected on a separate
kevin1990 18:fa3a317ebeaa 488 * "compensation channel" */
kevin1990 18:fa3a317ebeaa 489 ADI_SENSE_1000_MEASUREMENT_UNIT measurementUnit;
kevin1990 18:fa3a317ebeaa 490 /*!< Optional measurement unit selection for conversion results. Applicable
kevin1990 18:fa3a317ebeaa 491 * only for certain sensor types. Set to
kevin1990 18:fa3a317ebeaa 492 * ADI_SENSE_1000_MEASUREMENT_UNIT_DEFAULT if not applicable.
kevin1990 18:fa3a317ebeaa 493 */
kevin1990 18:fa3a317ebeaa 494 float32_t lowThreshold;
kevin1990 18:fa3a317ebeaa 495 /*!< Optional minimum threshold value for each processed sample, to be
kevin1990 18:fa3a317ebeaa 496 * checked prior to publishing. A channel ALERT condition is raised
kevin1990 18:fa3a317ebeaa 497 * if the processed value is lower than this threshold. Set to NaN
kevin1990 18:fa3a317ebeaa 498 * if not required.
kevin1990 18:fa3a317ebeaa 499 */
kevin1990 18:fa3a317ebeaa 500 float32_t highThreshold;
kevin1990 18:fa3a317ebeaa 501 /*!< Optional maximum threshold value for each processed sample, to be
kevin1990 18:fa3a317ebeaa 502 * checked prior to publishing. A channel ALERT condition is raised
kevin1990 18:fa3a317ebeaa 503 * if the processed value is higher than this threshold. Set to NaN
kevin1990 18:fa3a317ebeaa 504 * if not required.
kevin1990 18:fa3a317ebeaa 505 */
kevin1990 18:fa3a317ebeaa 506 float32_t offsetAdjustment;
kevin1990 18:fa3a317ebeaa 507 /*!< Optional offset adjustment value applied to each processed sample.
kevin1990 18:fa3a317ebeaa 508 * Set to NaN or 0.0 if not required.
kevin1990 18:fa3a317ebeaa 509 */
kevin1990 18:fa3a317ebeaa 510 float32_t gainAdjustment;
kevin1990 18:fa3a317ebeaa 511 /*!< Optional gain adjustment value applied to each processed sample.
kevin1990 18:fa3a317ebeaa 512 * Set to NaN or 1.0 if not required.
kevin1990 18:fa3a317ebeaa 513 */
kevin1990 18:fa3a317ebeaa 514 uint32_t measurementsPerCycle;
kevin1990 18:fa3a317ebeaa 515 /*!< The number of measurements to obtain from this channel within each
kevin1990 18:fa3a317ebeaa 516 * cycle. Each enabled channel is measured in turn, until the number of
kevin1990 18:fa3a317ebeaa 517 * measurements requested for the channel has been reached. A different
kevin1990 18:fa3a317ebeaa 518 * number of measurements-per-cycle may be specified for each channel.
kevin1990 18:fa3a317ebeaa 519 */
kevin1990 18:fa3a317ebeaa 520 uint32_t extraSettlingTime;
kevin1990 18:fa3a317ebeaa 521 /*!< A minimum settling time is applied internally for each channel, based
kevin1990 18:fa3a317ebeaa 522 * on the sensor type. However, additional settling time (microseconds)
kevin1990 18:fa3a317ebeaa 523 * can optionally be specified. Set to 0 if not required.
kevin1990 18:fa3a317ebeaa 524 */
kevin1990 18:fa3a317ebeaa 525 union {
kevin1990 18:fa3a317ebeaa 526 ADI_SENSE_1000_ADC_CHANNEL_CONFIG adcChannelConfig;
kevin1990 18:fa3a317ebeaa 527 /*!< ADC channel configuration - applicable only to ADC channels */
kevin1990 18:fa3a317ebeaa 528 ADI_SENSE_1000_I2C_CHANNEL_CONFIG i2cChannelConfig;
kevin1990 18:fa3a317ebeaa 529 /*!< I2C channel configuration - applicable only to I2C channels */
kevin1990 18:fa3a317ebeaa 530 ADI_SENSE_1000_SPI_CHANNEL_CONFIG spiChannelConfig;
kevin1990 18:fa3a317ebeaa 531 /*!< SPI channel configuration - applicable only to SPI channels */
kevin1990 18:fa3a317ebeaa 532 };
kevin1990 18:fa3a317ebeaa 533 /*!< Only one of adcChannelConfig, i2cChannelConfig, or spiChannelConfig is
kevin1990 18:fa3a317ebeaa 534 * required, depending on the channel designation (analog, I2C or SPI)
kevin1990 18:fa3a317ebeaa 535 */
kevin1990 18:fa3a317ebeaa 536 } ADI_SENSE_1000_CHANNEL_CONFIG;
kevin1990 18:fa3a317ebeaa 537
kevin1990 18:fa3a317ebeaa 538 /*! ADI Sense 1000 Diagnostics configuration details */
kevin1990 18:fa3a317ebeaa 539 typedef struct {
kevin1990 18:fa3a317ebeaa 540 bool_t disableGlobalDiag;
kevin1990 18:fa3a317ebeaa 541 /*!< Option to disable the following diagnostic checks on the ADC:
kevin1990 18:fa3a317ebeaa 542 * - Reference Detection errors
kevin1990 18:fa3a317ebeaa 543 * - Input under-/over-voltage errors
kevin1990 18:fa3a317ebeaa 544 * - Calibration, Conversion and Saturation errors
kevin1990 18:fa3a317ebeaa 545 */
kevin1990 18:fa3a317ebeaa 546 bool_t disableMeasurementDiag;
kevin1990 18:fa3a317ebeaa 547 /*!< Option to disable additional checks per measurement channel:
kevin1990 18:fa3a317ebeaa 548 * - High/low threshold limit violation
kevin1990 18:fa3a317ebeaa 549 */
kevin1990 18:fa3a317ebeaa 550 ADI_SENSE_1000_OPEN_SENSOR_DIAGNOSTICS osdFrequency;
kevin1990 18:fa3a317ebeaa 551 /*!< Option to enable Open-Circuit Detection at a selected cycle interval */
kevin1990 18:fa3a317ebeaa 552 } ADI_SENSE_1000_DIAGNOSTICS_CONFIG;
kevin1990 18:fa3a317ebeaa 553
kevin1990 18:fa3a317ebeaa 554 /*! ADI Sense 1000 Device configuration details */
kevin1990 18:fa3a317ebeaa 555 typedef struct {
kevin1990 18:fa3a317ebeaa 556 ADI_SENSE_1000_POWER_CONFIG power;
kevin1990 18:fa3a317ebeaa 557 /*!< Power configuration details */
kevin1990 18:fa3a317ebeaa 558 ADI_SENSE_1000_MEASUREMENT_CONFIG measurement;
kevin1990 18:fa3a317ebeaa 559 /*!< Measurement configuration details */
kevin1990 18:fa3a317ebeaa 560 ADI_SENSE_1000_DIAGNOSTICS_CONFIG diagnostics;
kevin1990 18:fa3a317ebeaa 561 /*!< Diagnostics configuration details */
kevin1990 18:fa3a317ebeaa 562 ADI_SENSE_1000_CHANNEL_CONFIG channels[ADI_SENSE_1000_MAX_CHANNELS];
kevin1990 18:fa3a317ebeaa 563 /*!< Channel-specific configuration details */
kevin1990 18:fa3a317ebeaa 564 } ADI_SENSE_1000_CONFIG;
kevin1990 18:fa3a317ebeaa 565
kevin1990 18:fa3a317ebeaa 566 #ifdef __cplusplus
kevin1990 18:fa3a317ebeaa 567 }
kevin1990 18:fa3a317ebeaa 568 #endif
kevin1990 18:fa3a317ebeaa 569
kevin1990 18:fa3a317ebeaa 570 /*!
kevin1990 18:fa3a317ebeaa 571 * @}
kevin1990 18:fa3a317ebeaa 572 */
kevin1990 18:fa3a317ebeaa 573
kevin1990 18:fa3a317ebeaa 574 #endif /* __ADI_SENSE_1000_CONFIG_H__ */
kevin1990 18:fa3a317ebeaa 575