Ross O'Halloran / Mbed OS Babyseat_NewFirmware_copy_sean

Fork of AdiSense1000 by PoC_Team

Committer:
danodonovan
Date:
Mon Mar 26 14:50:05 2018 +0000
Revision:
26:12d0204be712
Child:
27:567abf893938
Child:
28:4eb837cd71df
Adding files missed in previous commit for v1.0.2

Who changed what in which revision?

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