SDMP_IOT / Mbed OS AdiSense1000_SmartBabySeat

Fork of Babyseat_NewFirmware_copy_sean by Ross O'Halloran

Committer:
kevin1990
Date:
Thu May 17 10:34:45 2018 +0100
Revision:
28:4eb837cd71df
Parent:
26:12d0204be712
Adding host library and example code for v1.3 release

Who changed what in which revision?

UserRevisionLine numberNew contents of line
kevin1990 28:4eb837cd71df 1 /*
kevin1990 28:4eb837cd71df 2 CONFIDENTIAL AND PROPRIETARY INFORMATION
kevin1990 28:4eb837cd71df 3
kevin1990 28:4eb837cd71df 4 Copyright (c) 2018 Emutex Ltd. All rights reserved.
kevin1990 28:4eb837cd71df 5 This software and documentation contain confidential and
kevin1990 28:4eb837cd71df 6 proprietary information that is the property of
kevin1990 28:4eb837cd71df 7 Emutex Ltd. The software and documentation are
kevin1990 28:4eb837cd71df 8 furnished under a license agreement and may be used
kevin1990 28:4eb837cd71df 9 or copied only in accordance with the terms of the license
kevin1990 28:4eb837cd71df 10 agreement. No part of the software and documentation
kevin1990 28:4eb837cd71df 11 may be reproduced, transmitted, or translated, in any
kevin1990 28:4eb837cd71df 12 form or by any means, electronic, mechanical, manual,
kevin1990 28:4eb837cd71df 13 optical, or otherwise, without prior written permission
kevin1990 28:4eb837cd71df 14 of Emutex Ltd., or as expressly provided by the license agreement.
kevin1990 28:4eb837cd71df 15 Reverse engineering is prohibited, and reproduction,
kevin1990 28:4eb837cd71df 16 disclosure or use without specific written authorization
kevin1990 28:4eb837cd71df 17 of Emutex Ltd. is strictly forbidden.
danodonovan 26:12d0204be712 18 */
danodonovan 26:12d0204be712 19
danodonovan 26:12d0204be712 20 /*
danodonovan 26:12d0204be712 21 Copyright (c) 2017 Analog Devices, Inc.
danodonovan 26:12d0204be712 22
danodonovan 26:12d0204be712 23 All rights reserved.
danodonovan 26:12d0204be712 24
danodonovan 26:12d0204be712 25 Redistribution and use in source and binary forms, with or without modification,
danodonovan 26:12d0204be712 26 are permitted provided that the following conditions are met:
danodonovan 26:12d0204be712 27 - Redistributions of source code must retain the above copyright notice,
danodonovan 26:12d0204be712 28 this list of conditions and the following disclaimer.
danodonovan 26:12d0204be712 29 - Redistributions in binary form must reproduce the above copyright notice,
danodonovan 26:12d0204be712 30 this list of conditions and the following disclaimer in the documentation
danodonovan 26:12d0204be712 31 and/or other materials provided with the distribution.
danodonovan 26:12d0204be712 32 - Modified versions of the software must be conspicuously marked as such.
danodonovan 26:12d0204be712 33 - This software is licensed solely and exclusively for use with processors
danodonovan 26:12d0204be712 34 manufactured by or for Analog Devices, Inc.
danodonovan 26:12d0204be712 35 - This software may not be combined or merged with other code in any manner
danodonovan 26:12d0204be712 36 that would cause the software to become subject to terms and conditions
danodonovan 26:12d0204be712 37 which differ from those listed here.
danodonovan 26:12d0204be712 38 - Neither the name of Analog Devices, Inc. nor the names of its
danodonovan 26:12d0204be712 39 contributors may be used to endorse or promote products derived
danodonovan 26:12d0204be712 40 from this software without specific prior written permission.
danodonovan 26:12d0204be712 41 - The use of this software may or may not infringe the patent rights of one
danodonovan 26:12d0204be712 42 or more patent holders. This license does not release you from the
danodonovan 26:12d0204be712 43 requirement that you obtain separate licenses from these patent holders
danodonovan 26:12d0204be712 44 to use this software.
danodonovan 26:12d0204be712 45
danodonovan 26:12d0204be712 46 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS" AND ANY
danodonovan 26:12d0204be712 47 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
danodonovan 26:12d0204be712 48 TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
danodonovan 26:12d0204be712 49 NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
danodonovan 26:12d0204be712 50 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR CONSEQUENTIAL DAMAGES
danodonovan 26:12d0204be712 51 (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF CLAIMS OF INTELLECTUAL
danodonovan 26:12d0204be712 52 PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
danodonovan 26:12d0204be712 53 OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
danodonovan 26:12d0204be712 54 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
danodonovan 26:12d0204be712 55 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
danodonovan 26:12d0204be712 56 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
danodonovan 26:12d0204be712 57 */
danodonovan 26:12d0204be712 58
kevin1990 28:4eb837cd71df 59 /*!
kevin1990 28:4eb837cd71df 60 ******************************************************************************
kevin1990 28:4eb837cd71df 61 * @file: adi_sense_1000_config.h
kevin1990 28:4eb837cd71df 62 * @brief: Configuration type definitions for ADSNS1000.
kevin1990 28:4eb837cd71df 63 *-----------------------------------------------------------------------------
kevin1990 28:4eb837cd71df 64 */
kevin1990 28:4eb837cd71df 65
danodonovan 26:12d0204be712 66 #ifndef __ADI_SENSE_1000_CONFIG_H__
danodonovan 26:12d0204be712 67 #define __ADI_SENSE_1000_CONFIG_H__
danodonovan 26:12d0204be712 68
danodonovan 26:12d0204be712 69 #include "adi_sense_platform.h"
danodonovan 26:12d0204be712 70 #include "adi_sense_1000_sensor_types.h"
danodonovan 26:12d0204be712 71
danodonovan 26:12d0204be712 72 /*! @addtogroup ADSNS1000_Api
danodonovan 26:12d0204be712 73 * @{
danodonovan 26:12d0204be712 74 */
danodonovan 26:12d0204be712 75
danodonovan 26:12d0204be712 76 #ifdef __cplusplus
danodonovan 26:12d0204be712 77 extern "C" {
danodonovan 26:12d0204be712 78 #endif
danodonovan 26:12d0204be712 79
danodonovan 26:12d0204be712 80 /*! Maximum length allowed for a digital sensor command */
danodonovan 26:12d0204be712 81 #define ADI_SENSE_1000_SENSOR_COMMAND_MAX_LENGTH 7
danodonovan 26:12d0204be712 82
kevin1990 28:4eb837cd71df 83 /*! ADSNS1000 channel priority options */
kevin1990 28:4eb837cd71df 84 typedef enum {
kevin1990 28:4eb837cd71df 85 ADI_SENSE_1000_CHANNEL_PRIORITY_0 = 0,
kevin1990 28:4eb837cd71df 86 ADI_SENSE_1000_CHANNEL_PRIORITY_1,
kevin1990 28:4eb837cd71df 87 ADI_SENSE_1000_CHANNEL_PRIORITY_2,
kevin1990 28:4eb837cd71df 88 ADI_SENSE_1000_CHANNEL_PRIORITY_3,
kevin1990 28:4eb837cd71df 89 ADI_SENSE_1000_CHANNEL_PRIORITY_4,
kevin1990 28:4eb837cd71df 90 ADI_SENSE_1000_CHANNEL_PRIORITY_5,
kevin1990 28:4eb837cd71df 91 ADI_SENSE_1000_CHANNEL_PRIORITY_6,
kevin1990 28:4eb837cd71df 92 ADI_SENSE_1000_CHANNEL_PRIORITY_7,
kevin1990 28:4eb837cd71df 93 ADI_SENSE_1000_CHANNEL_PRIORITY_8,
kevin1990 28:4eb837cd71df 94 ADI_SENSE_1000_CHANNEL_PRIORITY_9,
kevin1990 28:4eb837cd71df 95 ADI_SENSE_1000_CHANNEL_PRIORITY_10,
kevin1990 28:4eb837cd71df 96 ADI_SENSE_1000_CHANNEL_PRIORITY_11,
kevin1990 28:4eb837cd71df 97 ADI_SENSE_1000_CHANNEL_PRIORITY_12,
kevin1990 28:4eb837cd71df 98 ADI_SENSE_1000_CHANNEL_PRIORITY_13,
kevin1990 28:4eb837cd71df 99 ADI_SENSE_1000_CHANNEL_PRIORITY_14,
kevin1990 28:4eb837cd71df 100 ADI_SENSE_1000_CHANNEL_PRIORITY_15,
kevin1990 28:4eb837cd71df 101
kevin1990 28:4eb837cd71df 102 ADI_SENSE_1000_CHANNEL_PRIORITY_HIGHEST = ADI_SENSE_1000_CHANNEL_PRIORITY_0,
kevin1990 28:4eb837cd71df 103 ADI_SENSE_1000_CHANNEL_PRIORITY_LOWEST = ADI_SENSE_1000_CHANNEL_PRIORITY_15,
kevin1990 28:4eb837cd71df 104 } ADI_SENSE_1000_CHANNEL_PRIORITY;
kevin1990 28:4eb837cd71df 105
danodonovan 26:12d0204be712 106 /*! ADSNS1000 operating mode options */
danodonovan 26:12d0204be712 107 typedef enum {
danodonovan 26:12d0204be712 108 ADI_SENSE_1000_OPERATING_MODE_SINGLECYCLE = 1,
danodonovan 26:12d0204be712 109 /*!< Executes a single measurement cycle and stops */
danodonovan 26:12d0204be712 110 ADI_SENSE_1000_OPERATING_MODE_CONTINUOUS,
danodonovan 26:12d0204be712 111 /*!< Continuously executes measurement cycles */
danodonovan 26:12d0204be712 112 ADI_SENSE_1000_OPERATING_MODE_MULTICYCLE,
danodonovan 26:12d0204be712 113 /*!< Executes a burst of measurement cycles, repeated at defined intervals */
danodonovan 26:12d0204be712 114 } ADI_SENSE_1000_OPERATING_MODE;
danodonovan 26:12d0204be712 115
danodonovan 26:12d0204be712 116 /*! ADSNS1000 data ready mode options */
danodonovan 26:12d0204be712 117 typedef enum {
danodonovan 26:12d0204be712 118 ADI_SENSE_1000_DATAREADY_PER_CONVERSION = 1,
danodonovan 26:12d0204be712 119 /*!< The DATAREADY signal is asserted after completion of each conversion
danodonovan 26:12d0204be712 120 * - a single data sample only from the latest completed conversion is
danodonovan 26:12d0204be712 121 * stored in this mode
danodonovan 26:12d0204be712 122 */
danodonovan 26:12d0204be712 123 ADI_SENSE_1000_DATAREADY_PER_CYCLE,
danodonovan 26:12d0204be712 124 /*!< The DATAREADY signal is asserted after completion of each measurement
danodonovan 26:12d0204be712 125 * cycle
danodonovan 26:12d0204be712 126 * - data samples only from the lastest completed measurement cycle are
danodonovan 26:12d0204be712 127 * stored in this mode
danodonovan 26:12d0204be712 128 */
danodonovan 26:12d0204be712 129 ADI_SENSE_1000_DATAREADY_PER_MULTICYCLE_BURST,
danodonovan 26:12d0204be712 130 /*!< The DATAREADY signal is asserted after completion of each burst of
danodonovan 26:12d0204be712 131 * measurement cycles
danodonovan 26:12d0204be712 132 * - applicable only when @ref ADI_SENSE_1000_OPERATING_MODE_MULTICYCLE
danodonovan 26:12d0204be712 133 * is also selected
danodonovan 26:12d0204be712 134 * - data samples only from the lastest completed burst of measurement
danodonovan 26:12d0204be712 135 * cycles are stored in this mode
danodonovan 26:12d0204be712 136 */
danodonovan 26:12d0204be712 137 } ADI_SENSE_1000_DATAREADY_MODE;
danodonovan 26:12d0204be712 138
kevin1990 28:4eb837cd71df 139 /*! ADSNS1000 calibration mode options */
kevin1990 28:4eb837cd71df 140 typedef enum {
kevin1990 28:4eb837cd71df 141 ADI_SENSE_1000_NO_CALIBRATION = 0,
kevin1990 28:4eb837cd71df 142 /*!< No full scale ADC calibration is performed after a latch command is sent.
kevin1990 28:4eb837cd71df 143 */
kevin1990 28:4eb837cd71df 144 ADI_SENSE_1000_DO_CALIBRATION,
kevin1990 28:4eb837cd71df 145 /*!< Full scale ADC Calibration is performed after a latch command is sent.
kevin1990 28:4eb837cd71df 146 */
kevin1990 28:4eb837cd71df 147 } ADI_SENSE_1000_CALIBRATION_MODE;
kevin1990 28:4eb837cd71df 148
kevin1990 28:4eb837cd71df 149 /*! ADSNS1000 power mode options */
danodonovan 26:12d0204be712 150 typedef enum {
danodonovan 26:12d0204be712 151 ADI_SENSE_1000_POWER_MODE_LOW = 1,
danodonovan 26:12d0204be712 152 /*!< Lowest ADC power consumption mode, with lowest conversion rate */
danodonovan 26:12d0204be712 153 ADI_SENSE_1000_POWER_MODE_MID,
danodonovan 26:12d0204be712 154 /*!< Medium ADC power consumption mode, with medium conversion rate */
danodonovan 26:12d0204be712 155 ADI_SENSE_1000_POWER_MODE_FULL,
danodonovan 26:12d0204be712 156 /*!< Highest ADC power consumption mode, with highest conversion rate */
danodonovan 26:12d0204be712 157 } ADI_SENSE_1000_POWER_MODE;
danodonovan 26:12d0204be712 158
kevin1990 28:4eb837cd71df 159 /*! ADSNS1000 measurement cycle types */
kevin1990 28:4eb837cd71df 160 typedef enum
kevin1990 28:4eb837cd71df 161 {
kevin1990 28:4eb837cd71df 162 ADI_SENSE_1000_CYCLE_TYPE_SWITCH = 0,
kevin1990 28:4eb837cd71df 163 /*!< Switch channels after every conversion */
kevin1990 28:4eb837cd71df 164 ADI_SENSE_1000_CYCLE_TYPE_FULL = 1
kevin1990 28:4eb837cd71df 165 /*!< Perform full number of requested conversions on a channel
kevin1990 28:4eb837cd71df 166 * consecutively before switching to the next channel */
kevin1990 28:4eb837cd71df 167 } ADI_SENSE_1000_CYCLE_TYPE;
kevin1990 28:4eb837cd71df 168
danodonovan 26:12d0204be712 169 /*! ADSNS1000 measurement unit options
danodonovan 26:12d0204be712 170 *
danodonovan 26:12d0204be712 171 * Optionally select a measurement unit for final conversion results.
danodonovan 26:12d0204be712 172 * Currently applicable only to specific temperature sensor types.
danodonovan 26:12d0204be712 173 */
danodonovan 26:12d0204be712 174 typedef enum {
kevin1990 28:4eb837cd71df 175 ADI_SENSE_1000_MEASUREMENT_UNIT_UNSPECIFIED = 0,
kevin1990 28:4eb837cd71df 176 /*!< No measurement unit specified */
danodonovan 26:12d0204be712 177 ADI_SENSE_1000_MEASUREMENT_UNIT_CELSIUS,
danodonovan 26:12d0204be712 178 /*!< Celsius temperature unit - applicable to temperature sensors only */
danodonovan 26:12d0204be712 179 ADI_SENSE_1000_MEASUREMENT_UNIT_FAHRENHEIT,
danodonovan 26:12d0204be712 180 /*!< Fahrenheit temperature unit - applicable to temperature sensors only */
danodonovan 26:12d0204be712 181 } ADI_SENSE_1000_MEASUREMENT_UNIT;
danodonovan 26:12d0204be712 182
danodonovan 26:12d0204be712 183 /*! ADSNS1000 Open-Sensor Diagnostics frequency
danodonovan 26:12d0204be712 184 *
danodonovan 26:12d0204be712 185 * Select the per-cycle frequency at which open-sensor diagnostic
danodonovan 26:12d0204be712 186 * checks should be performed. Open-sensor diagnostic checks typically require
danodonovan 26:12d0204be712 187 * specific or time-consuming processing which cannot be executed while a
danodonovan 26:12d0204be712 188 * measurement cycle is running.
danodonovan 26:12d0204be712 189 *
danodonovan 26:12d0204be712 190 * @note Open-sensor diagnostic checks, when performed, will add a delay to the
danodonovan 26:12d0204be712 191 * start of the next measurement cycle.
danodonovan 26:12d0204be712 192 */
danodonovan 26:12d0204be712 193 typedef enum {
danodonovan 26:12d0204be712 194 ADI_SENSE_1000_OPEN_SENSOR_DIAGNOSTICS_DISABLED = 0,
danodonovan 26:12d0204be712 195 /*!< No Open-Sensor Detection is performed */
danodonovan 26:12d0204be712 196 ADI_SENSE_1000_OPEN_SENSOR_DIAGNOSTICS_PER_CYCLE,
danodonovan 26:12d0204be712 197 /*!< No Open-Sensor Detection is performed prior to each cycle */
danodonovan 26:12d0204be712 198 ADI_SENSE_1000_OPEN_SENSOR_DIAGNOSTICS_PER_100_CYCLES,
danodonovan 26:12d0204be712 199 /*!< No Open-Sensor Detection is performed at intervals of 100 cycles */
danodonovan 26:12d0204be712 200 ADI_SENSE_1000_OPEN_SENSOR_DIAGNOSTICS_PER_1000_CYCLES,
danodonovan 26:12d0204be712 201 /*!< No Open-Sensor Detection is performed at intervals of 1000 cycles */
danodonovan 26:12d0204be712 202 } ADI_SENSE_1000_OPEN_SENSOR_DIAGNOSTICS;
danodonovan 26:12d0204be712 203
danodonovan 26:12d0204be712 204 /*! ADSNS1000 analog input signal amplification gain options
danodonovan 26:12d0204be712 205 *
danodonovan 26:12d0204be712 206 * @note applicable only to ADC analog sensor channels
danodonovan 26:12d0204be712 207 */
danodonovan 26:12d0204be712 208 typedef enum {
danodonovan 26:12d0204be712 209 ADI_SENSE_1000_ADC_GAIN_1X = 0,
danodonovan 26:12d0204be712 210 /*!< no amplification gain */
danodonovan 26:12d0204be712 211 ADI_SENSE_1000_ADC_GAIN_2X,
danodonovan 26:12d0204be712 212 /*!< x2 amplification gain */
danodonovan 26:12d0204be712 213 ADI_SENSE_1000_ADC_GAIN_4X,
danodonovan 26:12d0204be712 214 /*!< x4 amplification gain */
danodonovan 26:12d0204be712 215 ADI_SENSE_1000_ADC_GAIN_8X,
danodonovan 26:12d0204be712 216 /*!< x8 amplification gain */
danodonovan 26:12d0204be712 217 ADI_SENSE_1000_ADC_GAIN_16X,
danodonovan 26:12d0204be712 218 /*!< x16 amplification gain */
danodonovan 26:12d0204be712 219 ADI_SENSE_1000_ADC_GAIN_32X,
danodonovan 26:12d0204be712 220 /*!< x32 amplification gain */
danodonovan 26:12d0204be712 221 ADI_SENSE_1000_ADC_GAIN_64X,
danodonovan 26:12d0204be712 222 /*!< x64 amplification gain */
danodonovan 26:12d0204be712 223 ADI_SENSE_1000_ADC_GAIN_128X,
danodonovan 26:12d0204be712 224 /*!< x128 amplification gain */
danodonovan 26:12d0204be712 225 } ADI_SENSE_1000_ADC_GAIN;
danodonovan 26:12d0204be712 226
danodonovan 26:12d0204be712 227 /*! ADSNS1000 analog sensor excitation current output level options
danodonovan 26:12d0204be712 228 *
danodonovan 26:12d0204be712 229 * @note applicable only to ADC analog sensor channels, and
danodonovan 26:12d0204be712 230 * specific sensor types
danodonovan 26:12d0204be712 231 */
danodonovan 26:12d0204be712 232 typedef enum {
danodonovan 26:12d0204be712 233 ADI_SENSE_1000_ADC_EXC_CURRENT_NONE = 0,
danodonovan 26:12d0204be712 234 /*!< Excitation current disabled */
danodonovan 26:12d0204be712 235 ADI_SENSE_1000_ADC_EXC_CURRENT_50uA,
danodonovan 26:12d0204be712 236 /*!< 50uA excitation current enabled */
danodonovan 26:12d0204be712 237 ADI_SENSE_1000_ADC_EXC_CURRENT_100uA,
danodonovan 26:12d0204be712 238 /*!< 100uA excitation current */
danodonovan 26:12d0204be712 239 ADI_SENSE_1000_ADC_EXC_CURRENT_250uA,
danodonovan 26:12d0204be712 240 /*!< 250uA excitation current enabled */
danodonovan 26:12d0204be712 241 ADI_SENSE_1000_ADC_EXC_CURRENT_500uA,
danodonovan 26:12d0204be712 242 /*!< 500uA excitation current enabled */
danodonovan 26:12d0204be712 243 ADI_SENSE_1000_ADC_EXC_CURRENT_750uA,
danodonovan 26:12d0204be712 244 /*!< 750uA excitation current enabled */
danodonovan 26:12d0204be712 245 ADI_SENSE_1000_ADC_EXC_CURRENT_1000uA,
danodonovan 26:12d0204be712 246 /*!< 1mA excitation current enabled */
danodonovan 26:12d0204be712 247 } ADI_SENSE_1000_ADC_EXC_CURRENT;
danodonovan 26:12d0204be712 248
kevin1990 28:4eb837cd71df 249 /*! ADSNS1000 analog sensor excitation current ratios used for diode sensor
kevin1990 28:4eb837cd71df 250 *
kevin1990 28:4eb837cd71df 251 * @note applicable only to a diode sensor
kevin1990 28:4eb837cd71df 252 */
kevin1990 28:4eb837cd71df 253 typedef enum {
kevin1990 28:4eb837cd71df 254 ADI_SENSE_1000_ADC_EXC_CURRENT_IOUT_DIODE_DEFAULT = 0,
kevin1990 28:4eb837cd71df 255 ADI_SENSE_1000_ADC_EXC_CURRENT_IOUT_DIODE_MAX,
kevin1990 28:4eb837cd71df 256 } ADI_SENSE_1000_ADC_EXC_CURRENT_DIODE_RATIO;
kevin1990 28:4eb837cd71df 257
danodonovan 26:12d0204be712 258 /*! ADSNS1000 analog reference selection options
danodonovan 26:12d0204be712 259 *
danodonovan 26:12d0204be712 260 * @note applicable only to ADC analog sensor channels, and
danodonovan 26:12d0204be712 261 * specific sensor types
danodonovan 26:12d0204be712 262 */
danodonovan 26:12d0204be712 263 typedef enum {
danodonovan 26:12d0204be712 264 ADI_SENSE_1000_ADC_REFERENCE_NONE = 0,
danodonovan 26:12d0204be712 265 /*!< No reference is selected */
danodonovan 26:12d0204be712 266
danodonovan 26:12d0204be712 267 ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_INTERNAL_1,
danodonovan 26:12d0204be712 268 /*!< Internal reference resistor #1 (4320 ohms) is selected */
danodonovan 26:12d0204be712 269 ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_INTERNAL_2,
danodonovan 26:12d0204be712 270 /*!< Internal reference resistor #2 (10000 ohms) is selected */
danodonovan 26:12d0204be712 271 ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_INTERNAL,
danodonovan 26:12d0204be712 272 /*!< Internal ADC voltage reference (2.5V) is selected */
danodonovan 26:12d0204be712 273 ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_AVDD,
danodonovan 26:12d0204be712 274 /*!< Analag Supply Voltage AVDD reference (typically 3.3V) is selected */
danodonovan 26:12d0204be712 275
danodonovan 26:12d0204be712 276 ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_EXTERNAL_1,
danodonovan 26:12d0204be712 277 /*!< External user-supplied reference resistor #1 is selected
danodonovan 26:12d0204be712 278 *
danodonovan 26:12d0204be712 279 * @note reference resistor value externalRef1Value must be specified
danodonovan 26:12d0204be712 280 * (see @ref ADI_SENSE_1000_MEASUREMENT_CONFIG) */
danodonovan 26:12d0204be712 281 ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_EXTERNAL_2,
danodonovan 26:12d0204be712 282 /*!< External user-supplied reference resistor #2 is selected
danodonovan 26:12d0204be712 283 *
danodonovan 26:12d0204be712 284 * @note reference resistor value externalRef2Value must be specified
danodonovan 26:12d0204be712 285 * (see @ref ADI_SENSE_1000_MEASUREMENT_CONFIG) */
danodonovan 26:12d0204be712 286 ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_EXTERNAL_1,
danodonovan 26:12d0204be712 287 /*!< External user-supplied reference voltage #1 is selected
danodonovan 26:12d0204be712 288 *
danodonovan 26:12d0204be712 289 * @note reference voltage value externalRef1Value must be specified
danodonovan 26:12d0204be712 290 * (see @ref ADI_SENSE_1000_MEASUREMENT_CONFIG) */
danodonovan 26:12d0204be712 291 ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_EXTERNAL_2,
danodonovan 26:12d0204be712 292 /*!< External user-supplied reference voltage #2 is selected
danodonovan 26:12d0204be712 293 *
danodonovan 26:12d0204be712 294 * @note reference voltage value externalRef2Value must be specified
danodonovan 26:12d0204be712 295 * (see @ref ADI_SENSE_1000_MEASUREMENT_CONFIG) */
danodonovan 26:12d0204be712 296 ADI_SENSE_1000_ADC_REFERENCE_BRIDGE_EXCITATION,
danodonovan 26:12d0204be712 297 /*!< Bridge Excition Voltage is selected as reference
danodonovan 26:12d0204be712 298 *
danodonovan 26:12d0204be712 299 * @note this reference MUST be selected for 4/6-wire bridge sensor types
danodonovan 26:12d0204be712 300 * (see @ref ADI_SENSE_1000_ADC_SENSOR_TYPE) */
danodonovan 26:12d0204be712 301 } ADI_SENSE_1000_ADC_REFERENCE_TYPE;
danodonovan 26:12d0204be712 302
danodonovan 26:12d0204be712 303 /*! ADSNS1000 analog filter selection options
danodonovan 26:12d0204be712 304 *
danodonovan 26:12d0204be712 305 * @note applicable only to ADC analog sensor channels
danodonovan 26:12d0204be712 306 */
danodonovan 26:12d0204be712 307 typedef enum {
danodonovan 26:12d0204be712 308 ADI_SENSE_1000_ADC_FILTER_SINC4 = 1,
danodonovan 26:12d0204be712 309 /*!< SINC4 filter
danodonovan 26:12d0204be712 310 *
danodonovan 26:12d0204be712 311 * @note The number of input samples to be averaged by the filter
danodonovan 26:12d0204be712 312 * must be specified by fs (see @ref ADI_SENSE_1000_ADC_FILTER_CONFIG).
danodonovan 26:12d0204be712 313 * The fs value affects the output sample rate and settling times
danodonovan 26:12d0204be712 314 * of the ADC */
danodonovan 26:12d0204be712 315 ADI_SENSE_1000_ADC_FILTER_FIR_20SPS,
danodonovan 26:12d0204be712 316 /*!< FIR post filter, producing a 20sps output sample rate */
danodonovan 26:12d0204be712 317 ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
danodonovan 26:12d0204be712 318 /*!< FIR post filter, producing a 25sps output sample rate */
danodonovan 26:12d0204be712 319 } ADI_SENSE_1000_ADC_FILTER_TYPE;
danodonovan 26:12d0204be712 320
kevin1990 28:4eb837cd71df 321 /*! ADSNS1000 FFT sequence mode options
kevin1990 28:4eb837cd71df 322 *
kevin1990 28:4eb837cd71df 323 * @note applicable only for FFT measurement modes
kevin1990 28:4eb837cd71df 324 */
kevin1990 28:4eb837cd71df 325 typedef enum {
kevin1990 28:4eb837cd71df 326 ADI_SENSE_1000_FFT_MODE_SINGLE = 0,
kevin1990 28:4eb837cd71df 327 /*!< Performs a single sequence of FFTs on selected channels and stops */
kevin1990 28:4eb837cd71df 328 ADI_SENSE_1000_FFT_MODE_CONTINUOUS,
kevin1990 28:4eb837cd71df 329 /*!< Performs continuous sequences of FFTs on selected channels */
kevin1990 28:4eb837cd71df 330 } ADI_SENSE_1000_FFT_MODE;
kevin1990 28:4eb837cd71df 331
kevin1990 28:4eb837cd71df 332 /*! ADSNS1000 FFT size options (number of bins)
kevin1990 28:4eb837cd71df 333 *
kevin1990 28:4eb837cd71df 334 * @note applicable only for FFT measurement modes
kevin1990 28:4eb837cd71df 335 */
kevin1990 28:4eb837cd71df 336 typedef enum {
kevin1990 28:4eb837cd71df 337 ADI_SENSE_1000_FFT_SIZE_256 = 0,
kevin1990 28:4eb837cd71df 338 /*!< 256 bins */
kevin1990 28:4eb837cd71df 339 ADI_SENSE_1000_FFT_SIZE_512,
kevin1990 28:4eb837cd71df 340 /*!< 512 bins */
kevin1990 28:4eb837cd71df 341 ADI_SENSE_1000_FFT_SIZE_1024,
kevin1990 28:4eb837cd71df 342 /*!< 1024 bins */
kevin1990 28:4eb837cd71df 343 ADI_SENSE_1000_FFT_SIZE_2048,
kevin1990 28:4eb837cd71df 344 /*!< 2048 bins */
kevin1990 28:4eb837cd71df 345 } ADI_SENSE_1000_FFT_SIZE;
kevin1990 28:4eb837cd71df 346
kevin1990 28:4eb837cd71df 347 /*! ADSNS1000 FFT window type options
kevin1990 28:4eb837cd71df 348 *
kevin1990 28:4eb837cd71df 349 * @note applicable only for FFT measurement modes
kevin1990 28:4eb837cd71df 350 */
kevin1990 28:4eb837cd71df 351 typedef enum {
kevin1990 28:4eb837cd71df 352 ADI_SENSE_1000_FFT_WINDOW_NONE = 0,
kevin1990 28:4eb837cd71df 353 /*!< No Window */
kevin1990 28:4eb837cd71df 354 ADI_SENSE_1000_FFT_WINDOW_HANN,
kevin1990 28:4eb837cd71df 355 /*!< Hann Window */
kevin1990 28:4eb837cd71df 356 ADI_SENSE_1000_FFT_WINDOW_BLACKMAN_HARRIS,
kevin1990 28:4eb837cd71df 357 /*!< Blackman-Harris Window */
kevin1990 28:4eb837cd71df 358 } ADI_SENSE_1000_FFT_WINDOW;
kevin1990 28:4eb837cd71df 359
kevin1990 28:4eb837cd71df 360 /*! ADSNS1000 FFT output format options
kevin1990 28:4eb837cd71df 361 *
kevin1990 28:4eb837cd71df 362 * @note applicable only for FFT measurement modes
kevin1990 28:4eb837cd71df 363 */
kevin1990 28:4eb837cd71df 364 typedef enum {
kevin1990 28:4eb837cd71df 365 ADI_SENSE_1000_FFT_OUTPUT_FULL = 0,
kevin1990 28:4eb837cd71df 366 /*!< N/2-Term Amplitude Response */
kevin1990 28:4eb837cd71df 367 ADI_SENSE_1000_FFT_OUTPUT_FULL_WITH_RAW,
kevin1990 28:4eb837cd71df 368 /**< N/2-Term Amplitude Response Plus N Raw ADC Samples */
kevin1990 28:4eb837cd71df 369 ADI_SENSE_1000_FFT_OUTPUT_MAX16,
kevin1990 28:4eb837cd71df 370 /*!< Bin-Number and Amplitude of 16 Highest Peaks of Amplitude Response */
kevin1990 28:4eb837cd71df 371 } ADI_SENSE_1000_FFT_OUTPUT;
kevin1990 28:4eb837cd71df 372
kevin1990 28:4eb837cd71df 373 /*! ADSNS1000 I2C clock speed options
kevin1990 28:4eb837cd71df 374 *
kevin1990 28:4eb837cd71df 375 * @note applicable only for I2C sensors
kevin1990 28:4eb837cd71df 376 */
kevin1990 28:4eb837cd71df 377 typedef enum
kevin1990 28:4eb837cd71df 378 {
kevin1990 28:4eb837cd71df 379 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED_100K = 0,
kevin1990 28:4eb837cd71df 380 /*!< 100kHz I2C clock speed */
kevin1990 28:4eb837cd71df 381 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED_400K,
kevin1990 28:4eb837cd71df 382 /*!< 400kHz I2C clock speed */
kevin1990 28:4eb837cd71df 383 } ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED;
kevin1990 28:4eb837cd71df 384
kevin1990 28:4eb837cd71df 385 /*! ADSNS1000 UART baud rate options
kevin1990 28:4eb837cd71df 386 *
kevin1990 28:4eb837cd71df 387 * @note applicable only for UART sensors
kevin1990 28:4eb837cd71df 388 */
kevin1990 28:4eb837cd71df 389 typedef enum
kevin1990 28:4eb837cd71df 390 {
kevin1990 28:4eb837cd71df 391 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_UART_BAUD_RATE_115200 = 0,
kevin1990 28:4eb837cd71df 392 /*!< 115200 UART baud rate */
kevin1990 28:4eb837cd71df 393 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_UART_BAUD_RATE_57600,
kevin1990 28:4eb837cd71df 394 /*!< 57600 UART baud rate */
kevin1990 28:4eb837cd71df 395 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_UART_BAUD_RATE_38400,
kevin1990 28:4eb837cd71df 396 /*!< 38400 UART baud rate */
kevin1990 28:4eb837cd71df 397 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_UART_BAUD_RATE_19200,
kevin1990 28:4eb837cd71df 398 /*!< 19200 UART baud rate */
kevin1990 28:4eb837cd71df 399 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_UART_BAUD_RATE_9600,
kevin1990 28:4eb837cd71df 400 /*!< 9600 UART baud rate */
kevin1990 28:4eb837cd71df 401 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_UART_BAUD_RATE_4800,
kevin1990 28:4eb837cd71df 402 /*!< 4800 UART baud rate */
kevin1990 28:4eb837cd71df 403 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_UART_BAUD_RATE_2400,
kevin1990 28:4eb837cd71df 404 /*!< 2400 UART baud rate */
kevin1990 28:4eb837cd71df 405 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_UART_BAUD_RATE_1200,
kevin1990 28:4eb837cd71df 406 /*!< 1200 UART baud rate */
kevin1990 28:4eb837cd71df 407 } ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_UART_BAUD_RATE;
kevin1990 28:4eb837cd71df 408
kevin1990 28:4eb837cd71df 409 /*! ADSNS1000 UART line config options
kevin1990 28:4eb837cd71df 410 *
kevin1990 28:4eb837cd71df 411 * @note applicable only for UART sensors
kevin1990 28:4eb837cd71df 412 */
kevin1990 28:4eb837cd71df 413 typedef enum
kevin1990 28:4eb837cd71df 414 {
kevin1990 28:4eb837cd71df 415 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_UART_LINE_CONFIG_8N1 = 0,
kevin1990 28:4eb837cd71df 416 /*!< UART line control 8 data bits / no parity / 1 stop bit */
kevin1990 28:4eb837cd71df 417 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_UART_LINE_CONFIG_8N2,
kevin1990 28:4eb837cd71df 418 /*!< UART line control 8 data bits / no parity / 2 stop bits */
kevin1990 28:4eb837cd71df 419 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_UART_LINE_CONFIG_8N3,
kevin1990 28:4eb837cd71df 420 /*!< UART line control 8 data bits / no parity / 3 stop bits */
kevin1990 28:4eb837cd71df 421 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_UART_LINE_CONFIG_8E1,
kevin1990 28:4eb837cd71df 422 /*!< UART line control 8 data bits / even parity / 1 stop bit */
kevin1990 28:4eb837cd71df 423 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_UART_LINE_CONFIG_8E2,
kevin1990 28:4eb837cd71df 424 /*!< UART line control 8 data bits / even parity / 2 stop bits */
kevin1990 28:4eb837cd71df 425 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_UART_LINE_CONFIG_8E3,
kevin1990 28:4eb837cd71df 426 /*!< UART line control 8 data bits / even parity / 3 stop bits */
kevin1990 28:4eb837cd71df 427 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_UART_LINE_CONFIG_8O1,
kevin1990 28:4eb837cd71df 428 /*!< UART line control 8 data bits / odd parity / 1 stop bit */
kevin1990 28:4eb837cd71df 429 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_UART_LINE_CONFIG_8O2,
kevin1990 28:4eb837cd71df 430 /*!< UART line control 8 data bits / odd parity / 2 stop bits */
kevin1990 28:4eb837cd71df 431 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_UART_LINE_CONFIG_8O3,
kevin1990 28:4eb837cd71df 432 /*!< UART line control 8 data bits / odd parity / 3 stop bits */
kevin1990 28:4eb837cd71df 433 } ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_UART_LINE_CONFIG;
kevin1990 28:4eb837cd71df 434
kevin1990 28:4eb837cd71df 435 /*! ADSNS1000 SPI mode options
kevin1990 28:4eb837cd71df 436 *
kevin1990 28:4eb837cd71df 437 * @note applicable only for SPI sensors
kevin1990 28:4eb837cd71df 438 */
kevin1990 28:4eb837cd71df 439 typedef enum
kevin1990 28:4eb837cd71df 440 {
kevin1990 28:4eb837cd71df 441 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_MODE_0 = 0,
kevin1990 28:4eb837cd71df 442 /*!< SPI mode 0 Clock Polarity = 0 Clock Phase = 0 */
kevin1990 28:4eb837cd71df 443 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_MODE_1,
kevin1990 28:4eb837cd71df 444 /*!< SPI mode 0 Clock Polarity = 0 Clock Phase = 1 */
kevin1990 28:4eb837cd71df 445 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_MODE_2,
kevin1990 28:4eb837cd71df 446 /*!< SPI mode 0 Clock Polarity = 1 Clock Phase = 0 */
kevin1990 28:4eb837cd71df 447 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_MODE_3,
kevin1990 28:4eb837cd71df 448 /*!< SPI mode 0 Clock Polarity = 1 Clock Phase = 1 */
kevin1990 28:4eb837cd71df 449 } ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_MODE;
kevin1990 28:4eb837cd71df 450
kevin1990 28:4eb837cd71df 451 /*! ADSNS1000 SPI clock speed options
kevin1990 28:4eb837cd71df 452 *
kevin1990 28:4eb837cd71df 453 * @note applicable only for SPI sensors
kevin1990 28:4eb837cd71df 454 */
kevin1990 28:4eb837cd71df 455 typedef enum
kevin1990 28:4eb837cd71df 456 {
kevin1990 28:4eb837cd71df 457 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_CLOCK_13MHZ = 0,
kevin1990 28:4eb837cd71df 458 /*!< SPI Clock Speed configured to 13MHz */
kevin1990 28:4eb837cd71df 459 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_CLOCK_6_5MHZ,
kevin1990 28:4eb837cd71df 460 /*!< SPI Clock Speed configured to 6.5MHz */
kevin1990 28:4eb837cd71df 461 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_CLOCK_3_25MHZ,
kevin1990 28:4eb837cd71df 462 /*!< SPI Clock Speed configured to 3.25MHz */
kevin1990 28:4eb837cd71df 463 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_CLOCK_1_625MHZ,
kevin1990 28:4eb837cd71df 464 /*!< SPI Clock Speed configured to 1.625MHz */
kevin1990 28:4eb837cd71df 465 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_CLOCK_812KHZ,
kevin1990 28:4eb837cd71df 466 /*!< SPI Clock Speed configured to 812kHz */
kevin1990 28:4eb837cd71df 467 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_CLOCK_406KHZ,
kevin1990 28:4eb837cd71df 468 /*!< SPI Clock Speed configured to 406kHz */
kevin1990 28:4eb837cd71df 469 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_CLOCK_203KHZ,
kevin1990 28:4eb837cd71df 470 /*!< SPI Clock Speed configured to 203kHz */
kevin1990 28:4eb837cd71df 471 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_CLOCK_101KHZ,
kevin1990 28:4eb837cd71df 472 /*!< SPI Clock Speed configured to 101kHz */
kevin1990 28:4eb837cd71df 473 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_CLOCK_50KHZ,
kevin1990 28:4eb837cd71df 474 /*!< SPI Clock Speed configured to 50kHz */
kevin1990 28:4eb837cd71df 475 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_CLOCK_25KHZ,
kevin1990 28:4eb837cd71df 476 /*!< SPI Clock Speed configured to 25kHz */
kevin1990 28:4eb837cd71df 477 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_CLOCK_12KHZ,
kevin1990 28:4eb837cd71df 478 /*!< SPI Clock Speed configured to 12kHz */
kevin1990 28:4eb837cd71df 479 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_CLOCK_6KHZ,
kevin1990 28:4eb837cd71df 480 /*!< SPI Clock Speed configured to 6kHz */
kevin1990 28:4eb837cd71df 481 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_CLOCK_3KHZ,
kevin1990 28:4eb837cd71df 482 /*!< SPI Clock Speed configured to 3kHz */
kevin1990 28:4eb837cd71df 483 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_CLOCK_1_5KHZ,
kevin1990 28:4eb837cd71df 484 /*!< SPI Clock Speed configured to 1.5kHz */
kevin1990 28:4eb837cd71df 485 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_CLOCK_793HZ,
kevin1990 28:4eb837cd71df 486 /*!< SPI Clock Speed configured to 793hz */
kevin1990 28:4eb837cd71df 487 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_CLOCK_396HZ,
kevin1990 28:4eb837cd71df 488 /*!< SPI Clock Speed configured to 396hz */
kevin1990 28:4eb837cd71df 489 } ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_CLOCK;
kevin1990 28:4eb837cd71df 490
danodonovan 26:12d0204be712 491 /*! ADSNS1000 Power Configuration options */
danodonovan 26:12d0204be712 492 typedef struct {
danodonovan 26:12d0204be712 493 ADI_SENSE_1000_POWER_MODE powerMode;
danodonovan 26:12d0204be712 494 /*!< Power mode selection */
danodonovan 26:12d0204be712 495 } ADI_SENSE_1000_POWER_CONFIG;
danodonovan 26:12d0204be712 496
danodonovan 26:12d0204be712 497 /*! ADSNS1000 Multi-Cycle Configuration options
danodonovan 26:12d0204be712 498 *
danodonovan 26:12d0204be712 499 * @note required only when ADI_SENSE_1000_OPERATING_MODE_MULTICYCLE is selected
danodonovan 26:12d0204be712 500 * as the operatingMode (@ref ADI_SENSE_1000_MEASUREMENT_CONFIG)
danodonovan 26:12d0204be712 501 */
danodonovan 26:12d0204be712 502 typedef struct {
danodonovan 26:12d0204be712 503 uint32_t cyclesPerBurst;
danodonovan 26:12d0204be712 504 /*!< Number of cycles to complete for a single burst */
danodonovan 26:12d0204be712 505 uint32_t burstInterval;
danodonovan 26:12d0204be712 506 /*!< Interval, in seconds, between each successive burst of cycles */
danodonovan 26:12d0204be712 507 } ADI_SENSE_1000_MULTICYCLE_CONFIG;
danodonovan 26:12d0204be712 508
danodonovan 26:12d0204be712 509 /*! ADSNS1000 Measurement Configuration options */
danodonovan 26:12d0204be712 510 typedef struct {
danodonovan 26:12d0204be712 511 ADI_SENSE_1000_OPERATING_MODE operatingMode;
danodonovan 26:12d0204be712 512 /*!< Operating mode - specifies how measurement cycles are scheduled */
danodonovan 26:12d0204be712 513 ADI_SENSE_1000_DATAREADY_MODE dataReadyMode;
danodonovan 26:12d0204be712 514 /*!< Data read mode - specifies how output samples are stored for reading */
kevin1990 28:4eb837cd71df 515 ADI_SENSE_1000_CALIBRATION_MODE calibrationMode;
kevin1990 28:4eb837cd71df 516 /*!< Calibration mode - specifies if adc calibration is performed after a latch command */
danodonovan 26:12d0204be712 517 ADI_SENSE_1000_MULTICYCLE_CONFIG multiCycleConfig;
danodonovan 26:12d0204be712 518 /*!< Multi-Cycle configuration - specifies how bursts of measurement cycles
danodonovan 26:12d0204be712 519 * are scheduled. Applicable only when operatingMode is
danodonovan 26:12d0204be712 520 * ADI_SENSE_1000_OPERATING_MODE_MULTICYCLE
danodonovan 26:12d0204be712 521 */
danodonovan 26:12d0204be712 522 uint32_t cycleInterval;
danodonovan 26:12d0204be712 523 /*!< Cycle interval - specifies the time interval between the start of each
danodonovan 26:12d0204be712 524 * successive measurement cycle. Applicable only when operatingMode is
danodonovan 26:12d0204be712 525 * not ADI_SENSE_1000_OPERATING_MODE_SINGLECYCLE
danodonovan 26:12d0204be712 526 */
kevin1990 28:4eb837cd71df 527 ADI_SENSE_1000_CYCLE_TYPE cycleType;
kevin1990 28:4eb837cd71df 528 /*!< Cycle type - specifies how the channel list is traversed with each
kevin1990 28:4eb837cd71df 529 * conversion during the cycle.
kevin1990 28:4eb837cd71df 530 */
danodonovan 26:12d0204be712 531 float32_t externalRef1Value;
danodonovan 26:12d0204be712 532 /*!< Resistance/voltage value connected to external reference input #1.
danodonovan 26:12d0204be712 533 * Applicable only if the selected reference type is
danodonovan 26:12d0204be712 534 * ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_EXTERNAL_1 or
danodonovan 26:12d0204be712 535 * ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_EXTERNAL_1
danodonovan 26:12d0204be712 536 * (see @ref ADI_SENSE_1000_ADC_REFERENCE_TYPE)
danodonovan 26:12d0204be712 537 */
danodonovan 26:12d0204be712 538 float32_t externalRef2Value;
danodonovan 26:12d0204be712 539 /*!< Resistance/voltage value connected to external reference input #2.
danodonovan 26:12d0204be712 540 * Applicable only if the selected reference type is
danodonovan 26:12d0204be712 541 * ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_EXTERNAL_2 or
danodonovan 26:12d0204be712 542 * ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_EXTERNAL_2
danodonovan 26:12d0204be712 543 * (see @ref ADI_SENSE_1000_ADC_REFERENCE_TYPE)
kevin1990 28:4eb837cd71df 544 */
kevin1990 28:4eb837cd71df 545 bool enableExternalFlash;
kevin1990 28:4eb837cd71df 546 /*!< Enable the use of external flash memory for storage of samples.
danodonovan 26:12d0204be712 547 */
danodonovan 26:12d0204be712 548 } ADI_SENSE_1000_MEASUREMENT_CONFIG;
danodonovan 26:12d0204be712 549
danodonovan 26:12d0204be712 550 /*! ADSNS1000 ADC Excitation Current output configuration
danodonovan 26:12d0204be712 551 *
danodonovan 26:12d0204be712 552 * @note applicable only to ADC analog sensor channels, and
danodonovan 26:12d0204be712 553 * specific sensor types
danodonovan 26:12d0204be712 554 */
danodonovan 26:12d0204be712 555 typedef struct {
kevin1990 28:4eb837cd71df 556 ADI_SENSE_1000_ADC_EXC_CURRENT outputLevel;
danodonovan 26:12d0204be712 557 /*!< Excitation current output level */
kevin1990 28:4eb837cd71df 558 ADI_SENSE_1000_ADC_EXC_CURRENT_DIODE_RATIO diodeRatio;
kevin1990 28:4eb837cd71df 559 /*!< Excitation current output diode ratio */
danodonovan 26:12d0204be712 560 } ADI_SENSE_1000_ADC_EXC_CURRENT_CONFIG;
danodonovan 26:12d0204be712 561
danodonovan 26:12d0204be712 562 /*! ADSNS1000 ADC Filter configuration
danodonovan 26:12d0204be712 563 *
danodonovan 26:12d0204be712 564 * @note applicable only to ADC analog sensor channels
danodonovan 26:12d0204be712 565 */
danodonovan 26:12d0204be712 566 typedef struct {
danodonovan 26:12d0204be712 567 ADI_SENSE_1000_ADC_FILTER_TYPE type;
danodonovan 26:12d0204be712 568 /*!< Filter type selection */
danodonovan 26:12d0204be712 569 uint32_t fs;
danodonovan 26:12d0204be712 570 /*!< Number of input samples to accumulate and average in the filter.
danodonovan 26:12d0204be712 571 * Applicable only when type is ADI_SENSE_1000_ADC_FILTER_SINC4 */
danodonovan 26:12d0204be712 572 } ADI_SENSE_1000_ADC_FILTER_CONFIG;
danodonovan 26:12d0204be712 573
danodonovan 26:12d0204be712 574 /*! ADSNS1000 ADC Referemce configuration
danodonovan 26:12d0204be712 575 *
danodonovan 26:12d0204be712 576 * @note applicable only to ADC analog sensor channels
danodonovan 26:12d0204be712 577 */
danodonovan 26:12d0204be712 578 typedef struct {
danodonovan 26:12d0204be712 579 ADI_SENSE_1000_ADC_REFERENCE_TYPE type;
danodonovan 26:12d0204be712 580 /*!< Filter type selection */
danodonovan 26:12d0204be712 581 bool_t disableBuffer;
danodonovan 26:12d0204be712 582 /*!< Option to disable internal ADC reference buffer */
danodonovan 26:12d0204be712 583 } ADI_SENSE_1000_ADC_REFERENCE_CONFIG;
danodonovan 26:12d0204be712 584
danodonovan 26:12d0204be712 585 /*! ADSNS1000 ADC analog channel configuration details
danodonovan 26:12d0204be712 586 *
danodonovan 26:12d0204be712 587 * @note applicable only to ADC analog sensor channels
danodonovan 26:12d0204be712 588 */
danodonovan 26:12d0204be712 589 typedef struct {
danodonovan 26:12d0204be712 590 ADI_SENSE_1000_ADC_SENSOR_TYPE sensor;
danodonovan 26:12d0204be712 591 /*!< Sensor type selection */
danodonovan 26:12d0204be712 592 ADI_SENSE_1000_ADC_GAIN gain;
danodonovan 26:12d0204be712 593 /*!< ADC Gain selection */
danodonovan 26:12d0204be712 594 ADI_SENSE_1000_ADC_EXC_CURRENT_CONFIG current;
danodonovan 26:12d0204be712 595 /*!< ADC Excitation Current configuration */
danodonovan 26:12d0204be712 596 ADI_SENSE_1000_ADC_FILTER_CONFIG filter;
danodonovan 26:12d0204be712 597 /*!< ADC Filter configuration */
danodonovan 26:12d0204be712 598 ADI_SENSE_1000_ADC_REFERENCE_CONFIG reference;
danodonovan 26:12d0204be712 599 /*!< ADC Reference configuration */
danodonovan 26:12d0204be712 600 bool_t enableVbias;
danodonovan 26:12d0204be712 601 /*!< Option to enable internal ADC voltage bias */
danodonovan 26:12d0204be712 602 } ADI_SENSE_1000_ADC_CHANNEL_CONFIG;
danodonovan 26:12d0204be712 603
danodonovan 26:12d0204be712 604 /*! ADSNS1000 digital sensor data encoding
danodonovan 26:12d0204be712 605 *
danodonovan 26:12d0204be712 606 * @note applicable only to SPI and I2C digital sensor channels
danodonovan 26:12d0204be712 607 */
danodonovan 26:12d0204be712 608 typedef enum
danodonovan 26:12d0204be712 609 {
danodonovan 26:12d0204be712 610 ADI_SENSE_1000_DIGITAL_SENSOR_DATA_CODING_NONE,
danodonovan 26:12d0204be712 611 /**< None/Invalid - data format is ignored if coding is set to this value */
danodonovan 26:12d0204be712 612 ADI_SENSE_1000_DIGITAL_SENSOR_DATA_CODING_UNIPOLAR,
danodonovan 26:12d0204be712 613 /**< Unipolar - unsigned integer values */
danodonovan 26:12d0204be712 614 ADI_SENSE_1000_DIGITAL_SENSOR_DATA_CODING_TWOS_COMPLEMENT,
danodonovan 26:12d0204be712 615 /**< Twos-complement - signed integer values */
danodonovan 26:12d0204be712 616 ADI_SENSE_1000_DIGITAL_SENSOR_DATA_CODING_OFFSET_BINARY,
danodonovan 26:12d0204be712 617 /**< Offset Binary - used to represent signed values with unsigned integers,
danodonovan 26:12d0204be712 618 * with the mid-range value representing 0 */
danodonovan 26:12d0204be712 619 } ADI_SENSE_1000_DIGITAL_SENSOR_DATA_CODING;
danodonovan 26:12d0204be712 620
danodonovan 26:12d0204be712 621 /*! ADSNS1000 digital sensor data format configuration
danodonovan 26:12d0204be712 622 *
danodonovan 26:12d0204be712 623 * @note applicable only to SPI and I2C digital sensor channels
danodonovan 26:12d0204be712 624 */
danodonovan 26:12d0204be712 625 typedef struct {
danodonovan 26:12d0204be712 626 ADI_SENSE_1000_DIGITAL_SENSOR_DATA_CODING coding;
danodonovan 26:12d0204be712 627 /**< Data Encoding of Sensor Result */
danodonovan 26:12d0204be712 628 bool_t littleEndian;
danodonovan 26:12d0204be712 629 /**< Set as true if data format is little-endian, false otherwise */
danodonovan 26:12d0204be712 630 bool_t leftJustified;
danodonovan 26:12d0204be712 631 /**< Set as true if data is left-justified in the data frame, false otherwise */
danodonovan 26:12d0204be712 632 uint8_t frameLength;
danodonovan 26:12d0204be712 633 /**< Data frame length (number of bytes to read from the sensor) */
danodonovan 26:12d0204be712 634 uint8_t numDataBits;
danodonovan 26:12d0204be712 635 /**< Number of relevant data bits to extract from the data frame */
danodonovan 26:12d0204be712 636 uint8_t bitOffset;
danodonovan 26:12d0204be712 637 /**< Data bit offset, relative to data alignment within the data frame */
danodonovan 26:12d0204be712 638 } ADI_SENSE_1000_DIGITAL_SENSOR_DATA_FORMAT;
danodonovan 26:12d0204be712 639
danodonovan 26:12d0204be712 640 /*! ADSNS1000 digital sensor command
danodonovan 26:12d0204be712 641 *
danodonovan 26:12d0204be712 642 * @note applicable only to SPI and I2C digital sensor channels
danodonovan 26:12d0204be712 643 */
danodonovan 26:12d0204be712 644 typedef struct {
danodonovan 26:12d0204be712 645 uint8_t command[ADI_SENSE_1000_SENSOR_COMMAND_MAX_LENGTH];
danodonovan 26:12d0204be712 646 /*!< Optional command bytes to send to the device */
danodonovan 26:12d0204be712 647 uint8_t commandLength;
danodonovan 26:12d0204be712 648 /*!< Number of valid command bytes. Set to 0 if unused */
danodonovan 26:12d0204be712 649 } ADI_SENSE_1000_DIGITAL_SENSOR_COMMAND;
danodonovan 26:12d0204be712 650
kevin1990 28:4eb837cd71df 651 /*! ADSNS1000 digital sensor calibration param
kevin1990 28:4eb837cd71df 652 *
kevin1990 28:4eb837cd71df 653 * @note applicable only to digital sensor channels
kevin1990 28:4eb837cd71df 654 */
kevin1990 28:4eb837cd71df 655 typedef struct {
kevin1990 28:4eb837cd71df 656 uint32_t calibrationParam;
kevin1990 28:4eb837cd71df 657 /*!< Independently established environmental variable used during calibration
kevin1990 28:4eb837cd71df 658 * of a digital sensor. Used only if the sensor supports calibration
kevin1990 28:4eb837cd71df 659 * and expects an environmental parameter
kevin1990 28:4eb837cd71df 660 */
kevin1990 28:4eb837cd71df 661 bool_t enableCalibrationParam;
kevin1990 28:4eb837cd71df 662 /*!< Allow Calibration_Parameter to be used during calibration of any digital sensor */
kevin1990 28:4eb837cd71df 663 } ADI_SENSE_1000_DIGITAL_CALIBRATION_COMMAND;
kevin1990 28:4eb837cd71df 664
kevin1990 28:4eb837cd71df 665 /*! ADSNS1000 digital sensor communication config
kevin1990 28:4eb837cd71df 666 *
kevin1990 28:4eb837cd71df 667 * @note applicable only to digital sensor channels
kevin1990 28:4eb837cd71df 668 */
kevin1990 28:4eb837cd71df 669 typedef struct {
kevin1990 28:4eb837cd71df 670 bool_t useCustomCommsConfig;
kevin1990 28:4eb837cd71df 671 /*!< Optional parameter to enable user digital communication settings */
kevin1990 28:4eb837cd71df 672 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED i2cClockSpeed;
kevin1990 28:4eb837cd71df 673 /*!< Optional parameter to configure specific i2c speed for i2c sensor */
kevin1990 28:4eb837cd71df 674 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_MODE spiMode;
kevin1990 28:4eb837cd71df 675 /*!< Optional parameter to configure specific spi mode for spi sensor */
kevin1990 28:4eb837cd71df 676 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_SPI_CLOCK spiClock;
kevin1990 28:4eb837cd71df 677 /*!< Optional parameter to configure specific spi clock for spi sensor */
kevin1990 28:4eb837cd71df 678 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_UART_BAUD_RATE uartBaudRate;
kevin1990 28:4eb837cd71df 679 /*!< Optional parameter to configure specific uart baud rate for uart sensor */
kevin1990 28:4eb837cd71df 680 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS_UART_LINE_CONFIG uartLineConfig;
kevin1990 28:4eb837cd71df 681 /*!< Optional parameter to configure specific uart line control for uart sensor */
kevin1990 28:4eb837cd71df 682 } ADI_SENSE_1000_DIGITAL_SENSOR_COMMS;
kevin1990 28:4eb837cd71df 683
danodonovan 26:12d0204be712 684 /*! ADSNS1000 I2C digital channel configuration details
danodonovan 26:12d0204be712 685 *
danodonovan 26:12d0204be712 686 * @note applicable only to I2C digital sensor channels
danodonovan 26:12d0204be712 687 */
danodonovan 26:12d0204be712 688 typedef struct {
danodonovan 26:12d0204be712 689 ADI_SENSE_1000_I2C_SENSOR_TYPE sensor;
danodonovan 26:12d0204be712 690 /*!< Sensor type selection */
danodonovan 26:12d0204be712 691 uint32_t deviceAddress;
danodonovan 26:12d0204be712 692 /*!< I2C device address (7-bit) */
danodonovan 26:12d0204be712 693 ADI_SENSE_1000_DIGITAL_SENSOR_COMMAND configurationCommand;
danodonovan 26:12d0204be712 694 /*!< Optional configuration command to send to the device at start-up.
danodonovan 26:12d0204be712 695 * A default configuration command will be used if this is not specified.
danodonovan 26:12d0204be712 696 * Applicable only to specific I2C sensor types.
danodonovan 26:12d0204be712 697 */
danodonovan 26:12d0204be712 698 ADI_SENSE_1000_DIGITAL_SENSOR_COMMAND dataRequestCommand;
danodonovan 26:12d0204be712 699 /*!< Optional data request command to send to the device for each sample.
danodonovan 26:12d0204be712 700 * A default data request command will be used if this is not specified.
danodonovan 26:12d0204be712 701 * Applicable only to specific I2C sensor types.
danodonovan 26:12d0204be712 702 */
danodonovan 26:12d0204be712 703 ADI_SENSE_1000_DIGITAL_SENSOR_DATA_FORMAT dataFormat;
danodonovan 26:12d0204be712 704 /*!< Optional data format configuration to parse/extract data from the device.
danodonovan 26:12d0204be712 705 * A default data format will be used if this is not specified.
danodonovan 26:12d0204be712 706 * Applicable only to specific I2C sensor types
danodonovan 26:12d0204be712 707 */
kevin1990 28:4eb837cd71df 708 ADI_SENSE_1000_DIGITAL_CALIBRATION_COMMAND digitalCalibrationParam;
kevin1990 28:4eb837cd71df 709 /*!< This is used to supply an independently established environmental variable
kevin1990 28:4eb837cd71df 710 * that must be used during calibration of a [digital] sensor which a)
kevin1990 28:4eb837cd71df 711 * supports calibration and b) expects an environmental parameter.
kevin1990 28:4eb837cd71df 712 * An example is a CO2 sensor, which may require the CO2 concentration level
kevin1990 28:4eb837cd71df 713 * when performing a calibration
kevin1990 28:4eb837cd71df 714 */
kevin1990 28:4eb837cd71df 715 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS configureComms;
kevin1990 28:4eb837cd71df 716 /*!< Optional configuration to setup a user communication config.
kevin1990 28:4eb837cd71df 717 * A default configuration will be used if this is not specified.
kevin1990 28:4eb837cd71df 718 * Applicable only to specific I2C sensor types.
kevin1990 28:4eb837cd71df 719 */
danodonovan 26:12d0204be712 720 } ADI_SENSE_1000_I2C_CHANNEL_CONFIG;
danodonovan 26:12d0204be712 721
danodonovan 26:12d0204be712 722 /*! ADSNS1000 SPI digital channel configuration details
danodonovan 26:12d0204be712 723 *
danodonovan 26:12d0204be712 724 * @note applicable only to SPI digital sensor channels
danodonovan 26:12d0204be712 725 */
danodonovan 26:12d0204be712 726 typedef struct {
danodonovan 26:12d0204be712 727 ADI_SENSE_1000_SPI_SENSOR_TYPE sensor;
danodonovan 26:12d0204be712 728 /*!< Sensor type selection */
danodonovan 26:12d0204be712 729 ADI_SENSE_1000_DIGITAL_SENSOR_COMMAND configurationCommand;
danodonovan 26:12d0204be712 730 /*!< Optional configuration command to send to the device at start-up.
danodonovan 26:12d0204be712 731 * A default configuration command will be used if this is not specified.
danodonovan 26:12d0204be712 732 * Applicable only to specific SPI sensor types.
danodonovan 26:12d0204be712 733 */
danodonovan 26:12d0204be712 734 ADI_SENSE_1000_DIGITAL_SENSOR_COMMAND dataRequestCommand;
danodonovan 26:12d0204be712 735 /*!< Optional data request command to send to the device for each sample.
danodonovan 26:12d0204be712 736 * A default data request command will be used if this is not specified.
danodonovan 26:12d0204be712 737 * Applicable only to specific SPI sensor types.
danodonovan 26:12d0204be712 738 */
danodonovan 26:12d0204be712 739 ADI_SENSE_1000_DIGITAL_SENSOR_DATA_FORMAT dataFormat;
danodonovan 26:12d0204be712 740 /*!< Optional data format configuration to parse/extract data from the device.
danodonovan 26:12d0204be712 741 * A default data format will be used if this is not specified.
danodonovan 26:12d0204be712 742 * Applicable only to specific SPI sensor types
danodonovan 26:12d0204be712 743 */
kevin1990 28:4eb837cd71df 744 ADI_SENSE_1000_DIGITAL_CALIBRATION_COMMAND digitalCalibrationParam;
kevin1990 28:4eb837cd71df 745 /*!< This is used to supply an independently established environmental variable
kevin1990 28:4eb837cd71df 746 * that must be used during calibration of a [digital] sensor which a)
kevin1990 28:4eb837cd71df 747 * supports calibration and b) expects an environmental parameter.
kevin1990 28:4eb837cd71df 748 * An example is a CO2 sensor, which may require the CO2 concentration level
kevin1990 28:4eb837cd71df 749 * when performing a calibration
kevin1990 28:4eb837cd71df 750 */
kevin1990 28:4eb837cd71df 751 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS configureComms;
kevin1990 28:4eb837cd71df 752 /*!< Optional configuration to setup a user communication config.
kevin1990 28:4eb837cd71df 753 * A default configuration will be used if this is not specified.
kevin1990 28:4eb837cd71df 754 * Applicable only to specific SPI sensor types.
kevin1990 28:4eb837cd71df 755 */
danodonovan 26:12d0204be712 756 } ADI_SENSE_1000_SPI_CHANNEL_CONFIG;
danodonovan 26:12d0204be712 757
kevin1990 28:4eb837cd71df 758 /*! ADSNS1000 UART digital channel configuration details
kevin1990 28:4eb837cd71df 759 *
kevin1990 28:4eb837cd71df 760 * @note applicable only to UART digital sensor channels
kevin1990 28:4eb837cd71df 761 */
kevin1990 28:4eb837cd71df 762 typedef struct {
kevin1990 28:4eb837cd71df 763 ADI_SENSE_1000_UART_SENSOR_TYPE sensor;
kevin1990 28:4eb837cd71df 764 /*!< Sensor type selection */
kevin1990 28:4eb837cd71df 765 ADI_SENSE_1000_DIGITAL_CALIBRATION_COMMAND digitalCalibrationParam;
kevin1990 28:4eb837cd71df 766 /*!< This is used to supply an independently established environmental variable
kevin1990 28:4eb837cd71df 767 * that must be used during calibration of a [digital] sensor which a)
kevin1990 28:4eb837cd71df 768 * supports calibration and b) expects an environmental parameter.
kevin1990 28:4eb837cd71df 769 * An example is a CO2 sensor, which may require the CO2 concentration level
kevin1990 28:4eb837cd71df 770 * when performing a calibration
kevin1990 28:4eb837cd71df 771 */
kevin1990 28:4eb837cd71df 772 ADI_SENSE_1000_DIGITAL_SENSOR_COMMS configureComms;
kevin1990 28:4eb837cd71df 773 /*!< Optional configuration to setup a user communication config.
kevin1990 28:4eb837cd71df 774 * A default configuration will be used if this is not specified.
kevin1990 28:4eb837cd71df 775 * Applicable only to specific UART sensor types.
kevin1990 28:4eb837cd71df 776 */
kevin1990 28:4eb837cd71df 777 } ADI_SENSE_1000_UART_CHANNEL_CONFIG;
kevin1990 28:4eb837cd71df 778
danodonovan 26:12d0204be712 779 /*! ADSNS1000 Measurement Channel configuration details */
danodonovan 26:12d0204be712 780 typedef struct {
danodonovan 26:12d0204be712 781 bool_t enableChannel;
danodonovan 26:12d0204be712 782 /*!< Option to enable this channel. If set to false, all other fields
danodonovan 26:12d0204be712 783 * are ignored and this channel will be omitted from measurement cycles
danodonovan 26:12d0204be712 784 */
kevin1990 28:4eb837cd71df 785 bool_t enableFFT;
kevin1990 28:4eb837cd71df 786 /*!< Option to include this channel in FFT mode measurements */
danodonovan 26:12d0204be712 787 bool_t disablePublishing;
danodonovan 26:12d0204be712 788 /*!< Option to disable publishing of data samples from this channel. The
danodonovan 26:12d0204be712 789 * channel may still be included in measurement cycles, but data samples
danodonovan 26:12d0204be712 790 * obtained from this channel will not be published. This is typically
danodonovan 26:12d0204be712 791 * used for channels which are required only as a compensation reference
danodonovan 26:12d0204be712 792 * for another channel (e.g. Cold-Junction Compensation channels).
danodonovan 26:12d0204be712 793 */
danodonovan 26:12d0204be712 794 ADI_SENSE_1000_CHANNEL_ID compensationChannel;
danodonovan 26:12d0204be712 795 /*!< Optional compensation channel. Set to ADI_SENSE_1000_CHANNEL_ID_NONE if not
danodonovan 26:12d0204be712 796 * required. Typically used for thermocouple sensors that require a
danodonovan 26:12d0204be712 797 * separate measurement of the "cold-junction" temperature, which can be
danodonovan 26:12d0204be712 798 * be provided by an RTD temperature sensor connected on a separate
danodonovan 26:12d0204be712 799 * "compensation channel" */
kevin1990 28:4eb837cd71df 800 bool_t enableUnityLut;
kevin1990 28:4eb837cd71df 801 /*!< Option to choose the LUT for calculations, this implies that the
kevin1990 28:4eb837cd71df 802 * fundamental measurement for the sensor (typically mV or Ohms)
kevin1990 28:4eb837cd71df 803 * would be returned as the measurement result.
kevin1990 28:4eb837cd71df 804 */
danodonovan 26:12d0204be712 805 ADI_SENSE_1000_MEASUREMENT_UNIT measurementUnit;
danodonovan 26:12d0204be712 806 /*!< Optional measurement unit selection for conversion results. Applicable
danodonovan 26:12d0204be712 807 * only for certain sensor types. Set to
danodonovan 26:12d0204be712 808 * ADI_SENSE_1000_MEASUREMENT_UNIT_DEFAULT if not applicable.
danodonovan 26:12d0204be712 809 */
danodonovan 26:12d0204be712 810 float32_t lowThreshold;
danodonovan 26:12d0204be712 811 /*!< Optional minimum threshold value for each processed sample, to be
danodonovan 26:12d0204be712 812 * checked prior to publishing. A channel ALERT condition is raised
danodonovan 26:12d0204be712 813 * if the processed value is lower than this threshold. Set to NaN
danodonovan 26:12d0204be712 814 * if not required.
danodonovan 26:12d0204be712 815 */
danodonovan 26:12d0204be712 816 float32_t highThreshold;
danodonovan 26:12d0204be712 817 /*!< Optional maximum threshold value for each processed sample, to be
danodonovan 26:12d0204be712 818 * checked prior to publishing. A channel ALERT condition is raised
danodonovan 26:12d0204be712 819 * if the processed value is higher than this threshold. Set to NaN
danodonovan 26:12d0204be712 820 * if not required.
danodonovan 26:12d0204be712 821 */
danodonovan 26:12d0204be712 822 float32_t offsetAdjustment;
danodonovan 26:12d0204be712 823 /*!< Optional offset adjustment value applied to each processed sample.
danodonovan 26:12d0204be712 824 * Set to NaN or 0.0 if not required.
danodonovan 26:12d0204be712 825 */
danodonovan 26:12d0204be712 826 float32_t gainAdjustment;
danodonovan 26:12d0204be712 827 /*!< Optional gain adjustment value applied to each processed sample.
danodonovan 26:12d0204be712 828 * Set to NaN or 1.0 if not required.
danodonovan 26:12d0204be712 829 */
kevin1990 28:4eb837cd71df 830 float32_t sensorParameter;
kevin1990 28:4eb837cd71df 831 /*!< Optional sensor parameter adjustment.
kevin1990 28:4eb837cd71df 832 * Set to NaN or 0 if not required.
kevin1990 28:4eb837cd71df 833 */
danodonovan 26:12d0204be712 834 uint32_t measurementsPerCycle;
danodonovan 26:12d0204be712 835 /*!< The number of measurements to obtain from this channel within each
danodonovan 26:12d0204be712 836 * cycle. Each enabled channel is measured in turn, until the number of
danodonovan 26:12d0204be712 837 * measurements requested for the channel has been reached. A different
danodonovan 26:12d0204be712 838 * number of measurements-per-cycle may be specified for each channel.
danodonovan 26:12d0204be712 839 */
kevin1990 28:4eb837cd71df 840 uint32_t cycleSkipCount;
kevin1990 28:4eb837cd71df 841 /*!< Optional number of cycles to skip, such that this channel is included
kevin1990 28:4eb837cd71df 842 * in the sequence in only one of every (cycleSkipCount + 1) cycles that
kevin1990 28:4eb837cd71df 843 * occur. If set to 0 (default), this channel is included in every cycle;
kevin1990 28:4eb837cd71df 844 * if set to 1, this channel is included in every 2nd cycle; if set to 2,
kevin1990 28:4eb837cd71df 845 * this channel is included in every 3rd cycle, and so on.
kevin1990 28:4eb837cd71df 846 */
danodonovan 26:12d0204be712 847 uint32_t extraSettlingTime;
danodonovan 26:12d0204be712 848 /*!< A minimum settling time is applied internally for each channel, based
danodonovan 26:12d0204be712 849 * on the sensor type. However, additional settling time (microseconds)
danodonovan 26:12d0204be712 850 * can optionally be specified. Set to 0 if not required.
danodonovan 26:12d0204be712 851 */
kevin1990 28:4eb837cd71df 852 ADI_SENSE_1000_CHANNEL_PRIORITY priority;
kevin1990 28:4eb837cd71df 853 /*!< By default, channels are arranged in the measurement sequence based on
kevin1990 28:4eb837cd71df 854 * ascending order of channel ID. However, a priority-level may be
kevin1990 28:4eb837cd71df 855 * specified per channel to force a different ordering of the channels,
kevin1990 28:4eb837cd71df 856 * with higher-priority channels appearing before lower-priority channels.
kevin1990 28:4eb837cd71df 857 * Channels with equal priority are ordered by ascending order of channel
kevin1990 28:4eb837cd71df 858 * ID. Lower numbers indicate higher priority, with 0 being the highest.
kevin1990 28:4eb837cd71df 859 * Set to 0 if not required.
kevin1990 28:4eb837cd71df 860 */
danodonovan 26:12d0204be712 861 union {
danodonovan 26:12d0204be712 862 ADI_SENSE_1000_ADC_CHANNEL_CONFIG adcChannelConfig;
danodonovan 26:12d0204be712 863 /*!< ADC channel configuration - applicable only to ADC channels */
danodonovan 26:12d0204be712 864 ADI_SENSE_1000_I2C_CHANNEL_CONFIG i2cChannelConfig;
danodonovan 26:12d0204be712 865 /*!< I2C channel configuration - applicable only to I2C channels */
danodonovan 26:12d0204be712 866 ADI_SENSE_1000_SPI_CHANNEL_CONFIG spiChannelConfig;
danodonovan 26:12d0204be712 867 /*!< SPI channel configuration - applicable only to SPI channels */
kevin1990 28:4eb837cd71df 868 ADI_SENSE_1000_UART_CHANNEL_CONFIG uartChannelConfig;
kevin1990 28:4eb837cd71df 869 /*!< UART channel configuration - applicable only to UART channels */
danodonovan 26:12d0204be712 870 };
kevin1990 28:4eb837cd71df 871 /*!< Only one of adcChannelConfig, i2cChannelConfig, spiChannelConfig or
kevin1990 28:4eb837cd71df 872 * uartChannelConfig is required, depending on the channel designation
kevin1990 28:4eb837cd71df 873 * (analog, I2C, SPI or UART)
danodonovan 26:12d0204be712 874 */
danodonovan 26:12d0204be712 875 } ADI_SENSE_1000_CHANNEL_CONFIG;
danodonovan 26:12d0204be712 876
danodonovan 26:12d0204be712 877 /*! ADSNS1000 Diagnostics configuration details */
danodonovan 26:12d0204be712 878 typedef struct {
danodonovan 26:12d0204be712 879 bool_t disableGlobalDiag;
danodonovan 26:12d0204be712 880 /*!< Option to disable the following diagnostic checks on the ADC:
danodonovan 26:12d0204be712 881 * - Reference Detection errors
danodonovan 26:12d0204be712 882 * - Input under-/over-voltage errors
danodonovan 26:12d0204be712 883 * - Calibration, Conversion and Saturation errors
danodonovan 26:12d0204be712 884 */
danodonovan 26:12d0204be712 885 bool_t disableMeasurementDiag;
danodonovan 26:12d0204be712 886 /*!< Option to disable additional checks per measurement channel:
danodonovan 26:12d0204be712 887 * - High/low threshold limit violation
danodonovan 26:12d0204be712 888 */
danodonovan 26:12d0204be712 889 ADI_SENSE_1000_OPEN_SENSOR_DIAGNOSTICS osdFrequency;
danodonovan 26:12d0204be712 890 /*!< Option to enable Open-Circuit Detection at a selected cycle interval */
danodonovan 26:12d0204be712 891 } ADI_SENSE_1000_DIAGNOSTICS_CONFIG;
danodonovan 26:12d0204be712 892
kevin1990 28:4eb837cd71df 893 /*! ADSNS1000 FFT Measurement Mode configuration options */
kevin1990 28:4eb837cd71df 894 typedef struct {
kevin1990 28:4eb837cd71df 895 ADI_SENSE_1000_FFT_MODE mode;
kevin1990 28:4eb837cd71df 896 /*!< FFT sequence mode */
kevin1990 28:4eb837cd71df 897 ADI_SENSE_1000_FFT_SIZE size;
kevin1990 28:4eb837cd71df 898 /*!< FFT size selection */
kevin1990 28:4eb837cd71df 899 ADI_SENSE_1000_FFT_WINDOW window;
kevin1990 28:4eb837cd71df 900 /*!< FFT window type selection */
kevin1990 28:4eb837cd71df 901 ADI_SENSE_1000_FFT_OUTPUT output;
kevin1990 28:4eb837cd71df 902 /*!< FFT output type selection */
kevin1990 28:4eb837cd71df 903 } ADI_SENSE_1000_FFT_CONFIG;
kevin1990 28:4eb837cd71df 904
danodonovan 26:12d0204be712 905 /*! ADSNS1000 Device configuration details */
danodonovan 26:12d0204be712 906 typedef struct {
danodonovan 26:12d0204be712 907 ADI_SENSE_1000_POWER_CONFIG power;
danodonovan 26:12d0204be712 908 /*!< Power configuration details */
danodonovan 26:12d0204be712 909 ADI_SENSE_1000_MEASUREMENT_CONFIG measurement;
danodonovan 26:12d0204be712 910 /*!< Measurement configuration details */
danodonovan 26:12d0204be712 911 ADI_SENSE_1000_DIAGNOSTICS_CONFIG diagnostics;
danodonovan 26:12d0204be712 912 /*!< Diagnostics configuration details */
kevin1990 28:4eb837cd71df 913 ADI_SENSE_1000_FFT_CONFIG fft;
kevin1990 28:4eb837cd71df 914 /*!< FFT configuration details */
danodonovan 26:12d0204be712 915 ADI_SENSE_1000_CHANNEL_CONFIG channels[ADI_SENSE_1000_MAX_CHANNELS];
danodonovan 26:12d0204be712 916 /*!< Channel-specific configuration details */
danodonovan 26:12d0204be712 917 } ADI_SENSE_1000_CONFIG;
danodonovan 26:12d0204be712 918
danodonovan 26:12d0204be712 919 #ifdef __cplusplus
danodonovan 26:12d0204be712 920 }
danodonovan 26:12d0204be712 921 #endif
danodonovan 26:12d0204be712 922
danodonovan 26:12d0204be712 923 /*!
danodonovan 26:12d0204be712 924 * @}
danodonovan 26:12d0204be712 925 */
danodonovan 26:12d0204be712 926
danodonovan 26:12d0204be712 927 #endif /* __ADI_SENSE_1000_CONFIG_H__ */