Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of ADISense_ExampleFirmware by
adi_sense_1000_config.h
00001 /*! 00002 ****************************************************************************** 00003 * @file: adi_sense_1000_config.h 00004 * @brief: Configuration type definitions for ADI Sense 1000. 00005 *----------------------------------------------------------------------------- 00006 */ 00007 00008 /* 00009 Copyright (c) 2017 Analog Devices, Inc. 00010 00011 All rights reserved. 00012 00013 Redistribution and use in source and binary forms, with or without modification, 00014 are permitted provided that the following conditions are met: 00015 - Redistributions of source code must retain the above copyright notice, 00016 this list of conditions and the following disclaimer. 00017 - Redistributions in binary form must reproduce the above copyright notice, 00018 this list of conditions and the following disclaimer in the documentation 00019 and/or other materials provided with the distribution. 00020 - Modified versions of the software must be conspicuously marked as such. 00021 - This software is licensed solely and exclusively for use with processors 00022 manufactured by or for Analog Devices, Inc. 00023 - This software may not be combined or merged with other code in any manner 00024 that would cause the software to become subject to terms and conditions 00025 which differ from those listed here. 00026 - Neither the name of Analog Devices, Inc. nor the names of its 00027 contributors may be used to endorse or promote products derived 00028 from this software without specific prior written permission. 00029 - The use of this software may or may not infringe the patent rights of one 00030 or more patent holders. This license does not release you from the 00031 requirement that you obtain separate licenses from these patent holders 00032 to use this software. 00033 00034 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS" AND ANY 00035 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, 00036 TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 00037 NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 00038 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR CONSEQUENTIAL DAMAGES 00039 (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF CLAIMS OF INTELLECTUAL 00040 PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 00041 OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00042 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00043 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00044 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00045 */ 00046 00047 #ifndef __ADI_SENSE_1000_CONFIG_H__ 00048 #define __ADI_SENSE_1000_CONFIG_H__ 00049 00050 #include "adi_sense_platform.h" 00051 #include "adi_sense_1000_sensor_types.h" 00052 00053 /*! @addtogroup ADI_Sense_1000_Api ADI Sense 1000 Host Library API 00054 * @{ 00055 */ 00056 00057 #ifdef __cplusplus 00058 extern "C" { 00059 #endif 00060 00061 /*! Maximum length allowed for a digital sensor command */ 00062 #define ADI_SENSE_1000_SENSOR_COMMAND_MAX_LENGTH 7 00063 00064 /*! ADI Sense 1000 operating mode options */ 00065 typedef enum { 00066 ADI_SENSE_1000_OPERATING_MODE_SINGLECYCLE = 1, 00067 /*!< Executes a single measurement cycle and stops */ 00068 ADI_SENSE_1000_OPERATING_MODE_CONTINUOUS , 00069 /*!< Continuously executes measurement cycles */ 00070 ADI_SENSE_1000_OPERATING_MODE_MULTICYCLE , 00071 /*!< Executes a burst of measurement cycles, repeated at defined intervals */ 00072 } ADI_SENSE_1000_OPERATING_MODE ; 00073 00074 /*! ADI Sense 1000 data ready mode options */ 00075 typedef enum { 00076 ADI_SENSE_1000_DATAREADY_PER_CONVERSION = 1, 00077 /*!< The DATAREADY signal is asserted after completion of each conversion 00078 * - a single data sample only from the latest completed conversion is 00079 * stored in this mode 00080 */ 00081 ADI_SENSE_1000_DATAREADY_PER_CYCLE , 00082 /*!< The DATAREADY signal is asserted after completion of each measurement 00083 * cycle 00084 * - data samples only from the lastest completed measurement cycle are 00085 * stored in this mode 00086 */ 00087 ADI_SENSE_1000_DATAREADY_PER_MULTICYCLE_BURST , 00088 /*!< The DATAREADY signal is asserted after completion of each burst of 00089 * measurement cycles 00090 * - applicable only when @ref ADI_SENSE_1000_OPERATING_MODE_MULTICYCLE 00091 * is also selected 00092 * - data samples only from the lastest completed burst of measurement 00093 * cycles are stored in this mode 00094 */ 00095 } ADI_SENSE_1000_DATAREADY_MODE ; 00096 00097 /*! ADI Sense 1000 data power mode options */ 00098 typedef enum { 00099 ADI_SENSE_1000_POWER_MODE_LOW = 1, 00100 /*!< Lowest ADC power consumption mode, with lowest conversion rate */ 00101 ADI_SENSE_1000_POWER_MODE_MID , 00102 /*!< Medium ADC power consumption mode, with medium conversion rate */ 00103 ADI_SENSE_1000_POWER_MODE_FULL , 00104 /*!< Highest ADC power consumption mode, with highest conversion rate */ 00105 } ADI_SENSE_1000_POWER_MODE ; 00106 00107 /*! ADI Sense 1000 measurement unit options 00108 * 00109 * Optionally select a measurement unit for final conversion results. 00110 * Currently applicable only to specific temperature sensor types. 00111 */ 00112 typedef enum { 00113 ADI_SENSE_1000_MEASUREMENT_UNIT_DEFAULT = 0, 00114 /*!< No measurement unit specified - implied by sensor type selection */ 00115 ADI_SENSE_1000_MEASUREMENT_UNIT_CELSIUS , 00116 /*!< Celsius temperature unit - applicable to temperature sensors only */ 00117 ADI_SENSE_1000_MEASUREMENT_UNIT_FAHRENHEIT , 00118 /*!< Fahrenheit temperature unit - applicable to temperature sensors only */ 00119 } ADI_SENSE_1000_MEASUREMENT_UNIT ; 00120 00121 /*! ADI Sense 1000 Open-Sensor Diagnostics frequency 00122 * 00123 * Select the per-cycle frequency at which open-sensor diagnostic 00124 * checks should be performed. Open-sensor diagnostic checks typically require 00125 * specific or time-consuming processing which cannot be executed while a 00126 * measurement cycle is running. 00127 * 00128 * @note Open-sensor diagnostic checks, when performed, will add a delay to the 00129 * start of the next measurement cycle. 00130 */ 00131 typedef enum { 00132 ADI_SENSE_1000_OPEN_SENSOR_DIAGNOSTICS_DISABLED = 0, 00133 /*!< No Open-Sensor Detection is performed */ 00134 ADI_SENSE_1000_OPEN_SENSOR_DIAGNOSTICS_PER_CYCLE , 00135 /*!< No Open-Sensor Detection is performed prior to each cycle */ 00136 ADI_SENSE_1000_OPEN_SENSOR_DIAGNOSTICS_PER_100_CYCLES , 00137 /*!< No Open-Sensor Detection is performed at intervals of 100 cycles */ 00138 ADI_SENSE_1000_OPEN_SENSOR_DIAGNOSTICS_PER_1000_CYCLES , 00139 /*!< No Open-Sensor Detection is performed at intervals of 1000 cycles */ 00140 } ADI_SENSE_1000_OPEN_SENSOR_DIAGNOSTICS ; 00141 00142 /*! ADI Sense 1000 analog input signal amplification gain options 00143 * 00144 * @note applicable only to ADC analog sensor channels 00145 */ 00146 typedef enum { 00147 ADI_SENSE_1000_ADC_GAIN_1X = 0, 00148 /*!< no amplification gain */ 00149 ADI_SENSE_1000_ADC_GAIN_2X , 00150 /*!< x2 amplification gain */ 00151 ADI_SENSE_1000_ADC_GAIN_4X , 00152 /*!< x4 amplification gain */ 00153 ADI_SENSE_1000_ADC_GAIN_8X , 00154 /*!< x8 amplification gain */ 00155 ADI_SENSE_1000_ADC_GAIN_16X , 00156 /*!< x16 amplification gain */ 00157 ADI_SENSE_1000_ADC_GAIN_32X , 00158 /*!< x32 amplification gain */ 00159 ADI_SENSE_1000_ADC_GAIN_64X , 00160 /*!< x64 amplification gain */ 00161 ADI_SENSE_1000_ADC_GAIN_128X , 00162 /*!< x128 amplification gain */ 00163 } ADI_SENSE_1000_ADC_GAIN ; 00164 00165 /*! ADI Sense 1000 analog sensor excitation current output level options 00166 * 00167 * @note applicable only to ADC analog sensor channels, and 00168 * specific sensor types 00169 */ 00170 typedef enum { 00171 ADI_SENSE_1000_ADC_EXC_CURRENT_NONE = 0, 00172 /*!< Excitation current disabled */ 00173 ADI_SENSE_1000_ADC_EXC_CURRENT_50uA , 00174 /*!< 50uA excitation current enabled */ 00175 ADI_SENSE_1000_ADC_EXC_CURRENT_100uA , 00176 /*!< 100uA excitation current */ 00177 ADI_SENSE_1000_ADC_EXC_CURRENT_250uA , 00178 /*!< 250uA excitation current enabled */ 00179 ADI_SENSE_1000_ADC_EXC_CURRENT_500uA , 00180 /*!< 500uA excitation current enabled */ 00181 ADI_SENSE_1000_ADC_EXC_CURRENT_750uA , 00182 /*!< 750uA excitation current enabled */ 00183 ADI_SENSE_1000_ADC_EXC_CURRENT_1000uA , 00184 /*!< 1mA excitation current enabled */ 00185 } ADI_SENSE_1000_ADC_EXC_CURRENT ; 00186 00187 /*! ADI Sense 1000 analog sensor excitation current swap options 00188 * 00189 * @note applicable only to ADC analog sensor types where 2 excitation current 00190 * sources may be enabled (e.g. 3-wire RTD sensors) 00191 */ 00192 typedef enum { 00193 ADI_SENSE_1000_ADC_EXC_CURRENT_SWAP_DYNAMIC = 0, 00194 /*!< 2 measurements are performed, one with excitation currents output on 00195 * default output pins, then another with the current outputs swapped, 00196 * and these measurements are averaged to provide a single result. 00197 */ 00198 ADI_SENSE_1000_ADC_EXC_CURRENT_SWAP_STATIC , 00199 /*!< Excitation current output pin assignments are swapped from defaults */ 00200 ADI_SENSE_1000_ADC_EXC_CURRENT_SWAP_NONE , 00201 /*!< Excitation current output on default pins (IOUT0->AIN0, IOUT1->AIN3) */ 00202 } ADI_SENSE_1000_ADC_EXC_CURRENT_SWAP ; 00203 00204 /*! ADI Sense 1000 analog reference selection options 00205 * 00206 * @note applicable only to ADC analog sensor channels, and 00207 * specific sensor types 00208 */ 00209 typedef enum { 00210 ADI_SENSE_1000_ADC_REFERENCE_NONE = 0, 00211 /*!< No reference is selected */ 00212 00213 ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_INTERNAL_1 , 00214 /*!< Internal reference resistor #1 (4320 ohms) is selected */ 00215 ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_INTERNAL_2 , 00216 /*!< Internal reference resistor #2 (10000 ohms) is selected */ 00217 ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_INTERNAL , 00218 /*!< Internal ADC voltage reference (2.5V) is selected */ 00219 ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_AVDD , 00220 /*!< Analag Supply Voltage AVDD reference (typically 3.3V) is selected */ 00221 00222 ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_EXTERNAL_1 , 00223 /*!< External user-supplied reference resistor #1 is selected 00224 * 00225 * @note reference resistor value @ref externalRef1Value must be specified 00226 * (see @ref ADI_SENSE_1000_MEASUREMENT_CONFIG) */ 00227 ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_EXTERNAL_2 , 00228 /*!< External user-supplied reference resistor #2 is selected 00229 * 00230 * @note reference resistor value @ref externalRef2Value must be specified 00231 * (see @ref ADI_SENSE_1000_MEASUREMENT_CONFIG) */ 00232 ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_EXTERNAL_1 , 00233 /*!< External user-supplied reference voltage #1 is selected 00234 * 00235 * @note reference voltage value @ref externalRef1Value must be specified 00236 * (see @ref ADI_SENSE_1000_MEASUREMENT_CONFIG) */ 00237 ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_EXTERNAL_2 , 00238 /*!< External user-supplied reference voltage #2 is selected 00239 * 00240 * @note reference voltage value @ref externalRef2Value must be specified 00241 * (see @ref ADI_SENSE_1000_MEASUREMENT_CONFIG) */ 00242 ADI_SENSE_1000_ADC_REFERENCE_BRIDGE_EXCITATION , 00243 /*!< Bridge Excition Voltage is selected as reference 00244 * 00245 * @note this reference MUST be selected for 4/6-wire bridge sensor types 00246 * (see @ref ADI_SENSE_1000_ADC_SENSOR_TYPE) */ 00247 } ADI_SENSE_1000_ADC_REFERENCE_TYPE ; 00248 00249 /*! ADI Sense 1000 analog filter selection options 00250 * 00251 * @note applicable only to ADC analog sensor channels 00252 */ 00253 typedef enum { 00254 ADI_SENSE_1000_ADC_FILTER_SINC4 = 1, 00255 /*!< SINC4 filter 00256 * 00257 * @note The number of input samples to be averaged by the filter 00258 * must be specified by @ref fs (see @ref ADI_SENSE_1000_ADC_FILTER_CONFIG) 00259 * The fs value affects the output sample rate and settling times 00260 * of the ADC */ 00261 ADI_SENSE_1000_ADC_FILTER_FIR_20SPS , 00262 /*!< FIR post filter, producing a 20sps output sample rate */ 00263 ADI_SENSE_1000_ADC_FILTER_FIR_25SPS , 00264 /*!< FIR post filter, producing a 25sps output sample rate */ 00265 } ADI_SENSE_1000_ADC_FILTER_TYPE ; 00266 00267 /*! ADI Sense 1000 Power Configuration options */ 00268 typedef struct { 00269 ADI_SENSE_1000_POWER_MODE powerMode; 00270 /*!< Power mode selection */ 00271 float32_t supplyVoltage; 00272 /*!< AVDD analog supply voltage (e.g. 3.3V)*/ 00273 } ADI_SENSE_1000_POWER_CONFIG ; 00274 00275 /*! ADI Sense 1000 Multi-Cycle Configuration options 00276 * 00277 * @note required only when ADI_SENSE_1000_OPERATING_MODE_MULTICYCLE is selected 00278 * as the operatingMode (@ref ADI_SENSE_1000_MEASUREMENT_CONFIG) 00279 */ 00280 typedef struct { 00281 uint32_t cyclesPerBurst; 00282 /*!< Number of cycles to complete for a single burst */ 00283 uint32_t burstInterval; 00284 /*!< Interval, in seconds, between each successive burst of cycles */ 00285 } ADI_SENSE_1000_MULTICYCLE_CONFIG ; 00286 00287 /*! ADI Sense 1000 Measurement Configuration options */ 00288 typedef struct { 00289 ADI_SENSE_1000_OPERATING_MODE operatingMode; 00290 /*!< Operating mode - specifies how measurement cycles are scheduled */ 00291 ADI_SENSE_1000_DATAREADY_MODE dataReadyMode; 00292 /*!< Data read mode - specifies how output samples are stored for reading */ 00293 ADI_SENSE_1000_MULTICYCLE_CONFIG multiCycleConfig; 00294 /*!< Multi-Cycle configuration - specifies how bursts of measurement cycles 00295 * are scheduled. Applicable only when operatingMode is 00296 * ADI_SENSE_1000_OPERATING_MODE_MULTICYCLE 00297 */ 00298 uint32_t cycleInterval; 00299 /*!< Cycle interval - specifies the time interval between the start of each 00300 * successive measurement cycle. Applicable only when operatingMode is 00301 * not ADI_SENSE_1000_OPERATING_MODE_SINGLECYCLE 00302 */ 00303 float32_t externalRef1Value; 00304 /*!< Resistance/voltage value connected to external reference input #1. 00305 * Applicable only if the selected reference type is 00306 * ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_EXTERNAL_1 or 00307 * ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_EXTERNAL_1 00308 * (see @ref ADI_SENSE_1000_ADC_REFERENCE_TYPE) 00309 */ 00310 float32_t externalRef2Value; 00311 /*!< Resistance/voltage value connected to external reference input #2. 00312 * Applicable only if the selected reference type is 00313 * ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_EXTERNAL_2 or 00314 * ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_EXTERNAL_2 00315 * (see @ref ADI_SENSE_1000_ADC_REFERENCE_TYPE) 00316 */ 00317 } ADI_SENSE_1000_MEASUREMENT_CONFIG ; 00318 00319 /*! ADI Sense 1000 ADC Excitation Current output configuration 00320 * 00321 * @note applicable only to ADC analog sensor channels, and 00322 * specific sensor types 00323 */ 00324 typedef struct { 00325 ADI_SENSE_1000_ADC_EXC_CURRENT outputLevel; 00326 /*!< Excitation current output level */ 00327 ADI_SENSE_1000_ADC_EXC_CURRENT_SWAP swapOption; 00328 /*!< Excitation current output source options */ 00329 } ADI_SENSE_1000_ADC_EXC_CURRENT_CONFIG ; 00330 00331 /*! ADI Sense 1000 ADC Filter configuration 00332 * 00333 * @note applicable only to ADC analog sensor channels 00334 */ 00335 typedef struct { 00336 ADI_SENSE_1000_ADC_FILTER_TYPE type; 00337 /*!< Filter type selection */ 00338 uint32_t fs; 00339 /*!< Number of input samples to accumulate and average in the filter. 00340 * Applicable only when type is ADI_SENSE_1000_ADC_FILTER_SINC4 */ 00341 } ADI_SENSE_1000_ADC_FILTER_CONFIG ; 00342 00343 /*! ADI Sense 1000 ADC Referemce configuration 00344 * 00345 * @note applicable only to ADC analog sensor channels 00346 */ 00347 typedef struct { 00348 ADI_SENSE_1000_ADC_REFERENCE_TYPE type; 00349 /*!< Filter type selection */ 00350 bool_t disableBuffer; 00351 /*!< Option to disable internal ADC reference buffer */ 00352 } ADI_SENSE_1000_ADC_REFERENCE_CONFIG ; 00353 00354 /*! ADI Sense 1000 ADC analog channel configuration details 00355 * 00356 * @note applicable only to ADC analog sensor channels 00357 */ 00358 typedef struct { 00359 ADI_SENSE_1000_ADC_SENSOR_TYPE sensor; 00360 /*!< Sensor type selection */ 00361 ADI_SENSE_1000_ADC_GAIN gain; 00362 /*!< ADC Gain selection */ 00363 ADI_SENSE_1000_ADC_EXC_CURRENT_CONFIG current; 00364 /*!< ADC Excitation Current configuration */ 00365 ADI_SENSE_1000_ADC_FILTER_CONFIG filter; 00366 /*!< ADC Filter configuration */ 00367 ADI_SENSE_1000_ADC_REFERENCE_CONFIG reference; 00368 /*!< ADC Reference configuration */ 00369 bool_t enableVbias; 00370 /*!< Option to enable internal ADC voltage bias */ 00371 } ADI_SENSE_1000_ADC_CHANNEL_CONFIG ; 00372 00373 /*! ADI Sense 1000 digital sensor data encoding 00374 * 00375 * @note applicable only to SPI and I2C digital sensor channels 00376 */ 00377 typedef enum 00378 { 00379 ADI_SENSE_1000_DIGITAL_SENSOR_DATA_CODING_NONE, 00380 /**< None/Invalid - data format is ignored if coding is set to this value */ 00381 ADI_SENSE_1000_DIGITAL_SENSOR_DATA_CODING_UNIPOLAR, 00382 /**< Unipolar - unsigned integer values */ 00383 ADI_SENSE_1000_DIGITAL_SENSOR_DATA_CODING_TWOS_COMPLEMENT, 00384 /**< Twos-complement - signed integer values */ 00385 ADI_SENSE_1000_DIGITAL_SENSOR_DATA_CODING_OFFSET_BINARY, 00386 /**< Offset Binary - used to represent signed values with unsigned integers, 00387 * with the mid-range value representing 0 */ 00388 } ADI_SENSE_1000_DIGITAL_SENSOR_DATA_CODING ; 00389 00390 /*! ADI Sense 1000 digital sensor data format configuration 00391 * 00392 * @note applicable only to SPI and I2C digital sensor channels 00393 */ 00394 typedef struct { 00395 ADI_SENSE_1000_DIGITAL_SENSOR_DATA_CODING coding; 00396 /**< Data Encoding of Sensor Result */ 00397 bool_t littleEndian; 00398 /**< Set as true if data format is little-endian, false otherwise */ 00399 bool_t leftJustified; 00400 /**< Set as true if data is left-justified in the data frame, false otherwise */ 00401 uint8_t frameLength; 00402 /**< Data frame length (number of bytes to read from the sensor) */ 00403 uint8_t numDataBits; 00404 /**< Number of relevant data bits to extract from the data frame */ 00405 uint8_t bitOffset; 00406 /**< Data bit offset, relative to data alignment within the data frame */ 00407 } ADI_SENSE_1000_DIGITAL_SENSOR_DATA_FORMAT ; 00408 00409 /*! ADI Sense 1000 digital sensor command 00410 * 00411 * @note applicable only to SPI and I2C digital sensor channels 00412 */ 00413 typedef struct { 00414 uint8_t command[ADI_SENSE_1000_SENSOR_COMMAND_MAX_LENGTH]; 00415 /*!< Optional command bytes to send to the device */ 00416 uint8_t commandLength; 00417 /*!< Number of valid command bytes. Set to 0 if unused */ 00418 } ADI_SENSE_1000_DIGITAL_SENSOR_COMMAND ; 00419 00420 /*! ADI Sense 1000 I2C digital channel configuration details 00421 * 00422 * @note applicable only to I2C digital sensor channels 00423 */ 00424 typedef struct { 00425 ADI_SENSE_1000_I2C_SENSOR_TYPE sensor; 00426 /*!< Sensor type selection */ 00427 uint32_t deviceAddress; 00428 /*!< I2C device address (7-bit) */ 00429 ADI_SENSE_1000_DIGITAL_SENSOR_COMMAND configurationCommand; 00430 /*!< Optional configuration command to send to the device at start-up. 00431 * A default configuration command will be used if this is not specified. 00432 * Applicable only to specific I2C sensor types. 00433 */ 00434 ADI_SENSE_1000_DIGITAL_SENSOR_COMMAND dataRequestCommand; 00435 /*!< Optional data request command to send to the device for each sample. 00436 * A default data request command will be used if this is not specified. 00437 * Applicable only to specific I2C sensor types. 00438 */ 00439 ADI_SENSE_1000_DIGITAL_SENSOR_DATA_FORMAT dataFormat; 00440 /*!< Optional data format configuration to parse/extract data from the device. 00441 * A default data format will be used if this is not specified. 00442 * Applicable only to specific I2C sensor types 00443 */ 00444 } ADI_SENSE_1000_I2C_CHANNEL_CONFIG ; 00445 00446 /*! ADI Sense 1000 SPI digital channel configuration details 00447 * 00448 * @note applicable only to SPI digital sensor channels 00449 */ 00450 typedef struct { 00451 ADI_SENSE_1000_SPI_SENSOR_TYPE sensor; 00452 /*!< Sensor type selection */ 00453 ADI_SENSE_1000_DIGITAL_SENSOR_COMMAND configurationCommand; 00454 /*!< Optional configuration command to send to the device at start-up. 00455 * A default configuration command will be used if this is not specified. 00456 * Applicable only to specific SPI sensor types. 00457 */ 00458 ADI_SENSE_1000_DIGITAL_SENSOR_COMMAND dataRequestCommand; 00459 /*!< Optional data request command to send to the device for each sample. 00460 * A default data request command will be used if this is not specified. 00461 * Applicable only to specific SPI sensor types. 00462 */ 00463 ADI_SENSE_1000_DIGITAL_SENSOR_DATA_FORMAT dataFormat; 00464 /*!< Optional data format configuration to parse/extract data from the device. 00465 * A default data format will be used if this is not specified. 00466 * Applicable only to specific SPI sensor types 00467 */ 00468 } ADI_SENSE_1000_SPI_CHANNEL_CONFIG ; 00469 00470 /*! ADI Sense 1000 Measurement Channel configuration details */ 00471 typedef struct { 00472 bool_t enableChannel; 00473 /*!< Option to enable this channel. If set to false, all other fields 00474 * are ignored and this channel will be omitted from measurement cycles 00475 */ 00476 bool_t disablePublishing; 00477 /*!< Option to disable publishing of data samples from this channel. The 00478 * channel may still be included in measurement cycles, but data samples 00479 * obtained from this channel will not be published. This is typically 00480 * used for channels which are required only as a compensation reference 00481 * for another channel (e.g. Cold-Junction Compensation channels). 00482 */ 00483 ADI_SENSE_1000_CHANNEL_ID compensationChannel; 00484 /*!< Optional compensation channel. Set to ADI_SENSE_1000_CHANNEL_ID_NONE if not 00485 * required. Typically used for thermocouple sensors that require a 00486 * separate measurement of the "cold-junction" temperature, which can be 00487 * be provided by an RTD temperature sensor connected on a separate 00488 * "compensation channel" */ 00489 ADI_SENSE_1000_MEASUREMENT_UNIT measurementUnit; 00490 /*!< Optional measurement unit selection for conversion results. Applicable 00491 * only for certain sensor types. Set to 00492 * ADI_SENSE_1000_MEASUREMENT_UNIT_DEFAULT if not applicable. 00493 */ 00494 float32_t lowThreshold; 00495 /*!< Optional minimum threshold value for each processed sample, to be 00496 * checked prior to publishing. A channel ALERT condition is raised 00497 * if the processed value is lower than this threshold. Set to NaN 00498 * if not required. 00499 */ 00500 float32_t highThreshold; 00501 /*!< Optional maximum threshold value for each processed sample, to be 00502 * checked prior to publishing. A channel ALERT condition is raised 00503 * if the processed value is higher than this threshold. Set to NaN 00504 * if not required. 00505 */ 00506 float32_t offsetAdjustment; 00507 /*!< Optional offset adjustment value applied to each processed sample. 00508 * Set to NaN or 0.0 if not required. 00509 */ 00510 float32_t gainAdjustment; 00511 /*!< Optional gain adjustment value applied to each processed sample. 00512 * Set to NaN or 1.0 if not required. 00513 */ 00514 uint32_t measurementsPerCycle; 00515 /*!< The number of measurements to obtain from this channel within each 00516 * cycle. Each enabled channel is measured in turn, until the number of 00517 * measurements requested for the channel has been reached. A different 00518 * number of measurements-per-cycle may be specified for each channel. 00519 */ 00520 uint32_t extraSettlingTime; 00521 /*!< A minimum settling time is applied internally for each channel, based 00522 * on the sensor type. However, additional settling time (microseconds) 00523 * can optionally be specified. Set to 0 if not required. 00524 */ 00525 union { 00526 ADI_SENSE_1000_ADC_CHANNEL_CONFIG adcChannelConfig; 00527 /*!< ADC channel configuration - applicable only to ADC channels */ 00528 ADI_SENSE_1000_I2C_CHANNEL_CONFIG i2cChannelConfig; 00529 /*!< I2C channel configuration - applicable only to I2C channels */ 00530 ADI_SENSE_1000_SPI_CHANNEL_CONFIG spiChannelConfig; 00531 /*!< SPI channel configuration - applicable only to SPI channels */ 00532 }; 00533 /*!< Only one of adcChannelConfig, i2cChannelConfig, or spiChannelConfig is 00534 * required, depending on the channel designation (analog, I2C or SPI) 00535 */ 00536 } ADI_SENSE_1000_CHANNEL_CONFIG ; 00537 00538 /*! ADI Sense 1000 Diagnostics configuration details */ 00539 typedef struct { 00540 bool_t disableGlobalDiag; 00541 /*!< Option to disable the following diagnostic checks on the ADC: 00542 * - Reference Detection errors 00543 * - Input under-/over-voltage errors 00544 * - Calibration, Conversion and Saturation errors 00545 */ 00546 bool_t disableMeasurementDiag; 00547 /*!< Option to disable additional checks per measurement channel: 00548 * - High/low threshold limit violation 00549 */ 00550 ADI_SENSE_1000_OPEN_SENSOR_DIAGNOSTICS osdFrequency; 00551 /*!< Option to enable Open-Circuit Detection at a selected cycle interval */ 00552 } ADI_SENSE_1000_DIAGNOSTICS_CONFIG ; 00553 00554 /*! ADI Sense 1000 Device configuration details */ 00555 typedef struct { 00556 ADI_SENSE_1000_POWER_CONFIG power; 00557 /*!< Power configuration details */ 00558 ADI_SENSE_1000_MEASUREMENT_CONFIG measurement; 00559 /*!< Measurement configuration details */ 00560 ADI_SENSE_1000_DIAGNOSTICS_CONFIG diagnostics; 00561 /*!< Diagnostics configuration details */ 00562 ADI_SENSE_1000_CHANNEL_CONFIG channels[ADI_SENSE_1000_MAX_CHANNELS ]; 00563 /*!< Channel-specific configuration details */ 00564 } ADI_SENSE_1000_CONFIG ; 00565 00566 #ifdef __cplusplus 00567 } 00568 #endif 00569 00570 /*! 00571 * @} 00572 */ 00573 00574 #endif /* __ADI_SENSE_1000_CONFIG_H__ */ 00575
Generated on Tue Jul 12 2022 19:29:35 by
