Vybhav Kadaba / Mbed OS EV-PRO-MW1001_dec_18
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers admw1001_config.h Source File

admw1001_config.h

Go to the documentation of this file.
00001 /*
00002 Copyright 2019 (c) Analog Devices, Inc.
00003 
00004 All rights reserved.
00005 
00006 Redistribution and use in source and binary forms, with or without
00007 modification, are permitted provided that the following conditions are met:
00008   - Redistributions of source code must retain the above copyright
00009     notice, this list of conditions and the following disclaimer.
00010   - Redistributions in binary form must reproduce the above copyright
00011     notice, this list of conditions and the following disclaimer in
00012     the documentation and/or other materials provided with the
00013     distribution.
00014   - Neither the name of Analog Devices, Inc. nor the names of its
00015     contributors may be used to endorse or promote products derived
00016     from this software without specific prior written permission.
00017   - The use of this software may or may not infringe the patent rights
00018     of one or more patent holders. This license does not release you
00019     from the requirement that you obtain separate licenses from these
00020     patent holders to use this software.
00021   - Use of the software either in source or binary form, must be run
00022     on or directly connected to an Analog Devices Inc. component.
00023 
00024 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
00025 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
00026 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00027 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
00028 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00029 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
00030 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00031 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00032 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00033 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00034  */
00035 
00036 /*!
00037  ******************************************************************************
00038  * @file:   admw1001_config.h
00039  * @brief:  Configuration type definitions for ADMW1001.
00040  *-----------------------------------------------------------------------------
00041  */
00042 
00043 #ifndef __ADMW1001_CONFIG_H__
00044 #define __ADMW1001_CONFIG_H__
00045 
00046 #include "admw_platform.h"
00047 #include "admw1001_sensor_types.h"
00048 
00049 /*! @addtogroup ADMW1001_Api
00050  *  @{
00051  */
00052 
00053 #ifdef __cplusplus
00054 extern "C" {
00055 #endif
00056 
00057 /*! Maximum length allowed for a digital sensor command */
00058 #define ADMW1001_SENSOR_COMMAND_MAX_LENGTH 7
00059 
00060 /*! ADMW1001 channel priority options */
00061 typedef enum {
00062     ADMW1001_CHANNEL_PRIORITY_0 = 0,
00063     ADMW1001_CHANNEL_PRIORITY_1,
00064     ADMW1001_CHANNEL_PRIORITY_2,
00065     ADMW1001_CHANNEL_PRIORITY_3,
00066     ADMW1001_CHANNEL_PRIORITY_4,
00067     ADMW1001_CHANNEL_PRIORITY_5,
00068     ADMW1001_CHANNEL_PRIORITY_6,
00069     ADMW1001_CHANNEL_PRIORITY_7,
00070     ADMW1001_CHANNEL_PRIORITY_8,
00071     ADMW1001_CHANNEL_PRIORITY_9,
00072     ADMW1001_CHANNEL_PRIORITY_10,
00073     ADMW1001_CHANNEL_PRIORITY_11,
00074     ADMW1001_CHANNEL_PRIORITY_12,
00075 
00076     ADMW1001_CHANNEL_PRIORITY_HIGHEST = ADMW1001_CHANNEL_PRIORITY_0,
00077     ADMW1001_CHANNEL_PRIORITY_LOWEST  = ADMW1001_CHANNEL_PRIORITY_12,
00078 
00079 }   ADMW1001_CHANNEL_PRIORITY ;
00080 
00081 /*! ADMW1001 operating mode options */
00082 typedef enum {
00083     ADMW1001_OPERATING_MODE_SINGLECYCLE  = 0,
00084     /*!< Executes a single measurement cycle and stops */
00085     ADMW1001_OPERATING_MODE_CONTINUOUS ,
00086     /*!< Continuously executes measurement cycles */
00087     ADMW1001_OPERATING_MODE_MULTICYCLE ,
00088     /*!< Executes a burst of measurement cycles, repeated at defined intervals */
00089 
00090 }   ADMW1001_OPERATING_MODE ;
00091 
00092 /*! ADMW1001 data ready mode options */
00093 typedef enum {
00094     ADMW1001_DATAREADY_PER_CONVERSION  = 0,
00095     /*!< The DATAREADY signal is asserted after completion of each conversion
00096      *   - a single data sample only from the latest completed conversion is
00097      *     stored in this mode
00098      */
00099     ADMW1001_DATAREADY_PER_CYCLE ,
00100     /*!< The DATAREADY signal is asserted after completion of each measurement
00101      *   cycle
00102      *   - data samples only from the lastest completed measurement cycle are
00103      *     stored in this mode
00104      */
00105     ADMW1001_DATAREADY_PER_FIFO_FILL ,
00106     /*!< The DATAREADY signal is asserted after each fill of the data FIFO
00107      *   - applicable only when @ref ADMW1001_OPERATING_MODE_CONTINUOUS or
00108      *     @ref ADMW1001_OPERATING_MODE_MULTICYCLE is also selected
00109      */
00110 
00111 }   ADMW1001_DATAREADY_MODE ;
00112 
00113 /*! ADMW1001 power mode options */
00114 typedef enum {
00115     ADMW1001_POWER_MODE_HIBERNATION  = 0,
00116     /*!< module has entede hibernation mode. All analog circuitry is disabled. All peripherals disabled apart from the Wake-up pin functionality. */
00117     ADMW1001_POWER_MODE_ACTIVE ,
00118     /*!< Part is fully powered up and either cycling through a sequence or awaiting a configuration */
00119 
00120 }   ADMW1001_POWER_MODE ;
00121 
00122 /*! ADMW1001 measurement analog filter settling options */
00123 typedef enum {
00124     ADMW1001_FILTER_SETTLING_ALWAYS  = 0,
00125     /*!< Allow full settling time to elapse between every measurement from an analog sensor */
00126     ADMW1001_FILTER_SETTLING_FAST ,
00127     /*!< Skip settling time between consecutive measurements from an analog sensor */
00128 
00129 }   ADMW1001_FILTER_SETTLING ;
00130 
00131 /*! ADMW1001 measurement unit options
00132  *
00133  *  Optionally select a measurement unit for final conversion results.
00134  *  Currently applicable only to specific temperature sensor types.
00135  */
00136 typedef enum {
00137     ADMW1001_MEASUREMENT_UNIT_UNSPECIFIED  = 0,
00138     /*!< No measurement unit specified */
00139     ADMW1001_MEASUREMENT_UNIT_CELSIUS ,
00140     /*!< Celsius temperature unit - applicable to temperature sensors only */
00141     ADMW1001_MEASUREMENT_UNIT_FAHRENHEIT ,
00142     /*!< Fahrenheit temperature unit - applicable to temperature sensors only */
00143 
00144 }   ADMW1001_MEASUREMENT_UNIT ;
00145 
00146 /*! ADMW1001 Open-Sensor Diagnostics frequency
00147  *
00148  *  Select the per-cycle frequency at which open-sensor diagnostic
00149  *  checks should be performed.  Open-sensor diagnostic checks typically require
00150  *  specific or time-consuming processing which cannot be executed while a
00151  *  measurement cycle is running.
00152  *
00153  *  @note Open-sensor diagnostic checks, when performed, will add a delay to the
00154  *        start of the next measurement cycle.
00155  */
00156 typedef enum {
00157     ADMW1001_OPEN_SENSOR_DIAGNOSTICS_DISABLED  = 0,
00158     /*!< No Open-Sensor Detection is performed */
00159     ADMW1001_OPEN_SENSOR_DIAGNOSTICS_PER_CYCLE ,
00160     /*!< No Open-Sensor Detection is performed prior to each cycle */
00161     ADMW1001_OPEN_SENSOR_DIAGNOSTICS_PER_100_CYCLES ,
00162     /*!< No Open-Sensor Detection is performed at intervals of 100 cycles */
00163     ADMW1001_OPEN_SENSOR_DIAGNOSTICS_PER_1000_CYCLES ,
00164     /*!< No Open-Sensor Detection is performed at intervals of 1001 cycles */
00165 
00166 }   ADMW1001_OPEN_SENSOR_DIAGNOSTICS ;
00167 
00168 
00169 typedef enum {
00170     ADMW1001_BUFFER_BYPASSS_DISABLED  = 0,
00171     /*!< Buffer Bypass Disabled */
00172     ADMW1001_BUFFER_BYPASSS_ENABLED ,
00173     /*!< Buffer Bypass Enabled */
00174 
00175 }   ADMW1001_BUFFER_BYPASSS ;
00176 
00177 /*! ADMW1001 analog input signal amplification gain options
00178  *
00179  *  @note applicable only to ADC analog sensor channels
00180  */
00181 typedef enum {
00182     ADMW1001_ADC_RTD_CURVE_EUROPEAN  = 0,
00183     /*!< EUROPEAN RTD curve used. */
00184     ADMW1001_ADC_RTD_CURVE_AMERICAN ,
00185     /*!< AMERICAN RTD curve used. */
00186     ADMW1001_ADC_RTD_CURVE_JAPANESE ,
00187     /*!< JAPANESE RTD curve used. */
00188     ADMW1001_ADC_RTD_CURVE_ITS90 ,
00189     /*!< ITS90 RTD curve used. */
00190 
00191 }   ADMW1001_ADC_RTD_CURVE ;
00192 /*! ADMW1001 analog input signal amplification gain options
00193  *
00194  *  @note applicable only to ADC analog sensor channels
00195  */
00196 typedef enum {
00197     ADMW1001_ADC_GAIN_1X  = 0,
00198     /*!< no amplification gain */
00199     ADMW1001_ADC_GAIN_2X ,
00200     /*!< x2 amplification gain */
00201     ADMW1001_ADC_GAIN_4X ,
00202     /*!< x4 amplification gain */
00203     ADMW1001_ADC_GAIN_8X ,
00204     /*!< x8 amplification gain */
00205     ADMW1001_ADC_GAIN_16X ,
00206     /*!< x16 amplification gain */
00207     ADMW1001_ADC_GAIN_32X ,
00208     /*!< x32 amplification gain */
00209     ADMW1001_ADC_GAIN_64X ,
00210     /*!< x64 amplification gain */
00211     ADMW1001_ADC_GAIN_128X ,
00212     /*!< x128 amplification gain */
00213 
00214 }   ADMW1001_ADC_GAIN ;
00215 
00216 /*! ADMW1001 analog sensor excitation state options
00217  *
00218  *  @note applicable only to ADC analog sensor channels, and
00219  *        specific sensor types
00220  */
00221 typedef enum {
00222     ADMW1001_ADC_EXC_STATE_CYCLE_POWER =0,
00223     /*!< Excitation for measurement is active only during measurement */
00224     ADMW1001_ADC_EXC_STATE_ALWAYS_ON ,
00225     /*!< Excitation for measurement is always on */
00226 }   ADMW1001_ADC_EXC_STATE ;
00227 
00228 /*! ADMW1001 analog sensor excitation current output level options
00229  *
00230  *  @note applicable only to ADC analog sensor channels, and
00231  *        specific sensor types
00232  */
00233 typedef enum {
00234     ADMW1001_ADC_NO_EXTERNAL_EXC_CURRENT  = -1,
00235     /*!< NO External excitation is provided */
00236     ADMW1001_ADC_EXC_CURRENT_EXTERNAL  = 0,
00237     /*!< External excitation is provided */
00238     ADMW1001_ADC_EXC_CURRENT_50uA ,
00239     /*!< 50uA excitation current enabled */
00240     ADMW1001_ADC_EXC_CURRENT_100uA ,
00241     /*!< 100uA excitation current  */
00242     ADMW1001_ADC_EXC_CURRENT_250uA ,
00243     /*!< 250uA excitation current enabled */
00244     ADMW1001_ADC_EXC_CURRENT_500uA ,
00245     /*!< 500uA excitation current enabled */
00246     ADMW1001_ADC_EXC_CURRENT_1000uA ,
00247     /*!< 1mA excitation current enabled */
00248 
00249 }   ADMW1001_ADC_EXC_CURRENT ;
00250 
00251 /*! ADMW1001 analog sensor excitation current ratios used for diode sensor
00252  *
00253  *  @note applicable only to a diode sensor
00254  */
00255 typedef enum {
00256     ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_10UA_100UA = 0,
00257     /**< 2 Current measurement 10uA 100uA        */
00258     ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_20UA_160UA,
00259     /**< 2 Current measurement 20uA 160uA        */
00260     ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_50UA_300UA,
00261     /**< 2 Current measurement 50uA 300uA        */
00262     ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_100UA_600UA,
00263     /**< 2 Current measurement 100uA 600uA       */
00264     ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_10UA_50UA_100UA,
00265     /**< 3 current measuremetn 10uA 50uA 100uA   */
00266     ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_20UA_100UA_160UA,
00267     /**< 3 current measuremetn 20uA 100uA 160uA  */
00268     ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_50UA_150UA_300UA,
00269     /**< 3 current measuremetn 50uA 150uA 300uA  */
00270     ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_100UA_300UA_600UA,
00271     /**< 3 current measuremetn 100uA 300uA 600uA */
00272 
00273 }   ADMW1001_ADC_EXC_CURRENT_DIODE_RATIO ;
00274 
00275 /*! ADMW1001 analog reference selection options
00276  *
00277  *  @note applicable only to ADC analog sensor channels, and
00278  *        specific sensor types
00279  */
00280 typedef enum {
00281     ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL  = 0,
00282     /*!< Internal VRef - 1.2V */
00283     ADMW1001_ADC_REFERENCE_VOLTAGE_EXTERNAL_1 ,
00284     /*!< External reference voltage #1 */
00285     ADMW1001_ADC_REFERENCE_VOLTAGE_EXTERNAL_2 ,
00286     /*!< External reference voltage #2 */
00287     ADMW1001_ADC_REFERENCE_VOLTAGE_AVDD ,
00288     /*!< Analag Supply Voltage AVDD reference (typically 3.3V) is selected */
00289 
00290 }   ADMW1001_ADC_REFERENCE_TYPE ;
00291 
00292 /*! ADMW1001 ADC Reference configuration
00293  *
00294  *  @note applicable only to ADC analog sensor channels
00295  */
00296 typedef enum {
00297     ADMW1001_ADC_GND_SW_OPEN  = 0,
00298     /*!< Ground switch not enabled for measurement. */
00299     ADMW1001_ADC_GND_SW_CLOSED ,
00300     /*!< Ground switch enabled for measurement. */
00301 
00302 }   ADMW1001_ADC_GND_SW ;
00303 
00304 /*! ADMW1001 analog filter chop mode
00305  *
00306  *  @note applicable only to ADC analog sensor channels
00307  */
00308 typedef enum {
00309     ADMW1001_CHOP_MD_NONE  = 0,
00310     /*!< No chop performed. */
00311     ADMW1001_CHOP_MD_HW ,
00312     /*!< Hardware only chop performed. */
00313     ADMW1001_CHOP_MD_SW ,
00314     /*!< Software only chop performed. */
00315     ADMW1001_CHOP_MD_HWSW ,
00316     /*!< Hardware and software chop performed. */
00317 
00318 }   ADMW1001_CHOP_MD ;
00319 
00320 /*! ADMW1001 analog filter selection options
00321  *
00322  *  @note applicable only to ADC analog sensor channels
00323  */
00324 typedef enum {
00325     ADMW1001_ADC_FILTER_SINC4  = 0,
00326     /*!< SINC4 - 4th order sinc response filter */
00327     ADMW1001_ADC_FILTER_SINC3 ,
00328     /*!< SINC3 - 3rd order sinc response filter */
00329 
00330 }   ADMW1001_ADC_FILTER_TYPE ;
00331 
00332 /*! ADMW1001 Sinc Filter range (SF)
00333  *
00334  *  @note applicable only to ADC analog sensor channels
00335  *  @note SF must be set in conjunction with chop mode
00336  *  and sinc filter type to achieve the desired sampling rate.
00337  */
00338 typedef enum {
00339     ADMW1001_SF_976HZ   = 0,
00340     /*!< SF setting for 976Hz sample rate. */
00341     ADMW1001_SF_488HZ   = 1,
00342     /*!< SF setting for 488Hz sample rate. */
00343     ADMW1001_SF_244HZ   = 3,
00344     /*!< SF setting for 244Hz sample rate. */
00345     ADMW1001_SF_122HZ   = 7,
00346     /*!< SF setting for 122Hz sample rate. */
00347     ADMW1001_SF_61HZ    = 31,
00348     /*!< SF setting for 61Hz sample rate. */
00349     ADMW1001_SF_30P5HZ  = 51,
00350     /*!< SF setting for 61Hz sample rate. */
00351     ADMW1001_SF_10HZ    = 124,
00352     /*!< SF setting for 10Hz sample rate. */
00353     ADMW1001_SF_8P24HZ  = 125,
00354     /*!< SF setting for 8.24Hz sample rate. */
00355     ADMW1001_SF_5HZ     = 127,
00356     /*!< SF setting for 5Hz sample rate. */
00357 
00358 }   ADMW1001_SINC_FILTER_RANGE ;
00359 
00360 /*! ADMW1001 I2C clock speed options
00361  *
00362  *  @note applicable only for I2C sensors
00363  */
00364 typedef enum {
00365     ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED_100K  = 0,
00366     /*!< 100kHz I2C clock speed */
00367     ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED_400K ,
00368     /*!< 400kHz I2C clock speed */
00369 
00370 }   ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED ;
00371 
00372 /*! ADMW1001 SPI mode options
00373  *
00374  *  @note applicable only for SPI sensors
00375  */
00376 typedef enum {
00377     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_MODE_0  = 0,
00378     /*!< SPI mode 0 Clock Polarity = 0 Clock Phase = 0 */
00379     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_MODE_1 ,
00380     /*!< SPI mode 0 Clock Polarity = 0 Clock Phase = 1 */
00381     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_MODE_2 ,
00382     /*!< SPI mode 0 Clock Polarity = 1 Clock Phase = 0 */
00383     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_MODE_3 ,
00384     /*!< SPI mode 0 Clock Polarity = 1 Clock Phase = 1 */
00385 
00386 }   ADMW1001_DIGITAL_SENSOR_COMMS_SPI_MODE ;
00387 
00388 /*! ADMW1001 SPI clock speed options
00389  *
00390  *  @note applicable only for SPI sensors
00391  */
00392 typedef enum {
00393     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_8MHZ  = 0,
00394     /*!< SPI Clock Speed configured to 8MHz */
00395     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_4MHZ ,
00396     /*!< SPI Clock Speed configured to 4MHz */
00397     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_2MHZ ,
00398     /*!< SPI Clock Speed configured to 2MHz */
00399     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_1MHZ ,
00400     /*!< SPI Clock Speed configured to 1MHz */
00401     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_500KHZ ,
00402     /*!< SPI Clock Speed configured to 500kHz */
00403     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_250KHZ ,
00404     /*!< SPI Clock Speed configured to 250kHz */
00405     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_125KHZ ,
00406     /*!< SPI Clock Speed configured to 125kHz */
00407     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_62P5KHZ ,
00408     /*!< SPI Clock Speed configured to 62.5kHz */
00409     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_31P3KHZ ,
00410     /*!< SPI Clock Speed configured to 31.3kHz */
00411     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_15P6KHZ ,
00412     /*!< SPI Clock Speed configured to 15.6kHz */
00413     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_7P8KHZ ,
00414     /*!< SPI Clock Speed configured to 7.8kHz */
00415     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_3P9KHZ ,
00416     /*!< SPI Clock Speed configured to 3.9kHz */
00417     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_1P9KHZ ,
00418     /*!< SPI Clock Speed configured to 1.9kHz */
00419     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_977HZ ,
00420     /*!< SPI Clock Speed configured to 977Hz */
00421     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_488HZ ,
00422     /*!< SPI Clock Speed configured to 488Hz */
00423     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_244HZ ,
00424     /*!< SPI Clock Speed configured to 244Hz */
00425 
00426 }   ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK ;
00427 
00428 /*! ADMW1001 Power Configuration options */
00429 typedef struct {
00430     ADMW1001_POWER_MODE         powerMode;
00431     /*!< Power mode selection */
00432 
00433 }   ADMW1001_POWER_CONFIG ;
00434 
00435 /*! ADMW1001 Multi-Cycle Configuration options
00436  *
00437  * @note required only when ADMW1001_OPERATING_MODE_MULTICYCLE is selected
00438  *       as the operatingMode (@ref ADMW1001_MEASUREMENT_CONFIG)
00439  */
00440 typedef struct {
00441     uint32_t    cyclesPerBurst;
00442     /*!< Number of cycles to complete for a single burst */
00443     uint32_t    burstInterval;
00444     /*!< Interval, in seconds, between each successive burst of cycles */
00445 
00446 }   ADMW1001_MULTICYCLE_CONFIG ;
00447 
00448 /*! ADMW1001 Measurement Configuration options */
00449 typedef struct {
00450     ADMW1001_OPERATING_MODE     operatingMode;
00451     /*!< Operating mode - specifies how measurement cycles are scheduled */
00452     ADMW1001_DATAREADY_MODE     dataReadyMode;
00453     /*!< Data read mode - specifies how output samples are stored for reading */
00454     ADMW1001_MULTICYCLE_CONFIG  multiCycleConfig;
00455     /*!< Multi-Cycle configuration - specifies how bursts of measurement cycles
00456      *   are scheduled.  Applicable only when operatingMode is
00457      *   ADMW1001_OPERATING_MODE_MULTICYCLE
00458      */
00459     ADMW1001_FILTER_SETTLING    filterSettling;
00460     /*!< Analog filter settling - specifies the policy for settling time
00461      *   between consecutive measurements from an analog channel in a multi-
00462      *   channel configuration.  Note that, in single analog channel
00463      *   configurations, settling time is always skipped between consecutive
00464      *   measurements in a measurement cycle.
00465      */
00466     uint8_t                     reserved0[3];
00467     /*!< Reserved for future use and ensure word alignment.
00468      */
00469     uint32_t                    cycleInterval;
00470     /*!< Cycle interval - specifies the time interval between the start of each
00471      *   successive measurement cycle.  Applicable only when operatingMode is
00472      *   not ADMW1001_OPERATING_MODE_SINGLECYCLE
00473      */
00474     bool                        vBiasEnable;
00475     /*!< Enable voltage Bias output of ADC
00476      */
00477     float32_t                   externalRef1Value;
00478     /*!< Voltage value connected to external reference input #1.
00479      *   Applicable only if the selected reference type is
00480      *   voltage.
00481      *   (see @ref ADMW1001_ADC_REFERENCE_TYPE)
00482      */
00483     float32_t                   RSenseValue;
00484     /*!< Sense resistor value in Ohms. */
00485     float32_t                   externalRefVoltage;
00486     /*!< External Reference Voltage.
00487      */
00488     uint32_t                    reserved1[2];
00489 
00490 }   ADMW1001_MEASUREMENT_CONFIG ;
00491 
00492 /*! ADMW1001 ADC Excitation Current output configuration
00493  *
00494  *  @note applicable only to ADC analog sensor channels, and
00495  *        specific sensor types
00496  */
00497 typedef struct {
00498     ADMW1001_ADC_EXC_STATE                 excitationState;
00499     /*!< Excitation current state */
00500     ADMW1001_ADC_EXC_CURRENT               outputLevel;
00501     /*!< Excitation current output level */
00502     ADMW1001_ADC_EXC_CURRENT_DIODE_RATIO   diodeRatio;
00503     /*!< Excitation current output diode ratio */
00504 
00505 }   ADMW1001_ADC_EXC_CURRENT_CONFIG ;
00506 
00507 /*! ADMW1001 ADC Filter configuration
00508  *
00509  *  @note applicable only to ADC analog sensor channels
00510  */
00511 typedef struct {
00512     ADMW1001_ADC_FILTER_TYPE     type;
00513     /*!< Filter type selection */
00514     ADMW1001_SINC_FILTER_RANGE   sf;
00515     /*!< SF value used along with filter type and chop mode to determine speed */
00516     ADMW1001_CHOP_MD             chopMode;
00517     /*!< Enable filter chop */
00518     bool                        notch1p2;
00519     /*!< Enable Notch 2 Filter Mode */
00520     ADMW1001_ADC_GND_SW          groundSwitch;
00521     /*!< Option to open or close sensor ground switch */
00522 
00523 }   ADMW1001_ADC_FILTER_CONFIG ;
00524 
00525 /*! ADMW1001 ADC analog channel configuration details
00526  *
00527  *  @note applicable only to ADC analog sensor channels
00528  */
00529 typedef struct {
00530     ADMW1001_ADC_SENSOR_TYPE         sensor;
00531     /*!< Sensor type selection */
00532     ADMW1001_ADC_RTD_CURVE           rtdCurve;
00533     /*!< Rtd curve selection */
00534     ADMW1001_ADC_GAIN                gain;
00535     /*!< ADC Gain selection */
00536     ADMW1001_ADC_EXC_CURRENT_CONFIG  current;
00537     /*!< ADC Excitation Current configuration */
00538     ADMW1001_ADC_FILTER_CONFIG       filter;
00539     /*!< ADC Filter configuration */
00540     ADMW1001_ADC_REFERENCE_TYPE      reference;
00541     bool                        vBiasEnable;
00542     /*!< ADC Reference configuration */
00543     uint8_t                         bufferBypass;
00544     /*!< Buffer Bypass configuration */
00545     uint8_t                         reserved0[2];
00546     /*!< Reserved for future use and ensure word alignment. */
00547     uint32_t                        reserved1[6];
00548     /*!< Reserved for future use and ensure word alignment. */
00549 
00550 }   ADMW1001_ADC_CHANNEL_CONFIG ;
00551 
00552 /*! ADMW1001 look-up table selection
00553  *  Select table used to linearise the measurement.
00554  */
00555 typedef enum {
00556     ADMW1001_LUT_DEFAULT   = 0,
00557     /*!< Default LUT */
00558     ADMW1001_LUT_UNITY     = 1,
00559     /*!< Unity LUT */
00560     ADMW1001_LUT_CUSTOM    = 2,
00561     /*!< User defined custom LUT */
00562     ADMW1001_LUT_RESERVED  = 3,
00563     /*!< Reserved for future use */
00564 
00565 }   ADMW1001_LUT_SELECT ;
00566 
00567 /*! ADMW1001 digital sensor data encoding
00568  *
00569  *  @note applicable only to SPI and I2C digital sensor channels
00570  */
00571 typedef enum {
00572     ADMW1001_DIGITAL_SENSOR_DATA_CODING_NONE = 0,
00573     /**< None/Invalid - data format is ignored if coding is set to this value */
00574     ADMW1001_DIGITAL_SENSOR_DATA_CODING_UNIPOLAR,
00575     /**< Unipolar - unsigned integer values */
00576     ADMW1001_DIGITAL_SENSOR_DATA_CODING_TWOS_COMPLEMENT,
00577     /**< Twos-complement - signed integer values */
00578     ADMW1001_DIGITAL_SENSOR_DATA_CODING_OFFSET_BINARY,
00579     /**< Offset Binary - used to represent signed values with unsigned integers,
00580      *   with the mid-range value representing 0 */
00581 
00582 }   ADMW1001_DIGITAL_SENSOR_DATA_CODING ;
00583 
00584 /*! ADMW1001 digital sensor data format configuration
00585  *
00586  *  @note applicable only to SPI and I2C digital sensor channels
00587  */
00588 typedef struct {
00589     ADMW1001_DIGITAL_SENSOR_DATA_CODING  coding;
00590     /**< Data Encoding of Sensor Result */
00591     bool littleEndian;
00592     /**< Set as true if data format is little-endian, false otherwise */
00593     bool leftJustified;
00594     /**< Set as true if data is left-justified in the data frame, false otherwise */
00595     uint8_t frameLength;
00596     /**< Data frame length (number of bytes to read from the sensor) */
00597     uint8_t numDataBits;
00598     /**< Number of relevant data bits to extract from the data frame */
00599     uint8_t bitOffset;
00600     /**< Data bit offset, relative to data alignment within the data frame */
00601     uint8_t reserved[2];
00602     /*!< Reserved for future use and ensure word alignment. */
00603 
00604 }   ADMW1001_DIGITAL_SENSOR_DATA_FORMAT ;
00605 
00606 /*! ADMW1001 digital sensor command
00607  *
00608  *  @note applicable only to SPI and I2C digital sensor channels
00609  */
00610 typedef struct {
00611     uint8_t command[ADMW1001_SENSOR_COMMAND_MAX_LENGTH];
00612     /*!< Optional command bytes to send to the device */
00613     uint8_t commandLength;
00614     /*!< Number of valid command bytes.  Set to 0 if unused */
00615 
00616 }   ADMW1001_DIGITAL_SENSOR_COMMAND ;
00617 
00618 /*! ADMW1001 digital sensor calibration param
00619  *
00620  *  @note applicable only to digital sensor channels
00621  */
00622 typedef struct {
00623     uint32_t calibrationParam;
00624     /*!< Independently established environmental variable used during calibration
00625      *   of a digital sensor. Used only if the sensor supports calibration
00626      *   and expects an environmental parameter
00627      */
00628     bool enableCalibrationParam;
00629     /*!< Allow Calibration_Parameter to be used during calibration of any digital sensor */
00630     uint8_t                         reserved[3];
00631     /*!< Reserved for future use and ensure word alignment. */
00632 
00633 }   ADMW1001_DIGITAL_CALIBRATION_COMMAND ;
00634 
00635 /*! ADMW1001 digital sensor communication config
00636  *
00637  *  @note applicable only to digital sensor channels
00638  */
00639 typedef struct {
00640     bool                                            useCustomCommsConfig;
00641     /*!< Optional parameter to enable user digital communication settings */
00642     ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED    i2cClockSpeed;
00643     /*!< Optional parameter to configure specific i2c speed for i2c sensor */
00644     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_MODE           spiMode;
00645     /*!< Optional parameter to configure specific spi mode for spi sensor */
00646     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK          spiClock;
00647     /*!< Optional parameter to configure specific spi clock for spi sensor */
00648 
00649 }   ADMW1001_DIGITAL_SENSOR_COMMS ;
00650 
00651 /*! ADMW1001 I2C digital channel configuration details
00652  *
00653  *  @note applicable only to I2C digital sensor channels
00654  */
00655 typedef struct {
00656     ADMW1001_I2C_SENSOR_TYPE                 sensor;
00657     /*!< Sensor type selection */
00658     uint8_t                                 deviceAddress;
00659     /*!< I2C device address (7-bit) */
00660     uint8_t                                 reserved;
00661     /*!< Reserved for future use and ensure word alignment. */
00662     ADMW1001_DIGITAL_SENSOR_COMMAND          configurationCommand;
00663     /*!< Optional configuration command to send to the device at start-up.
00664      *   A default configuration command will be used if this is not specified.
00665      *   Applicable only to specific I2C sensor types.
00666      */
00667     ADMW1001_DIGITAL_SENSOR_COMMAND          dataRequestCommand;
00668     /*!< Optional data request command to send to the device for each sample.
00669      *   A default data request command will be used if this is not specified.
00670      *   Applicable only to specific I2C sensor types.
00671      */
00672     ADMW1001_DIGITAL_SENSOR_DATA_FORMAT      dataFormat;
00673     /*!< Optional data format configuration to parse/extract data from the device.
00674      *   A default data format will be used if this is not specified.
00675      *   Applicable only to specific I2C sensor types
00676      */
00677     ADMW1001_DIGITAL_CALIBRATION_COMMAND     digitalCalibrationParam;
00678     /*!< This is used to supply an independently established environmental variable
00679      *   that must be used during calibration of a [digital] sensor which a)
00680      *   supports calibration and b) expects an environmental parameter.
00681      *   An example is a CO2 sensor, which may require the CO2 concentration level
00682      *   when performing a calibration
00683      */
00684     ADMW1001_DIGITAL_SENSOR_COMMS            configureComms;
00685     /*!< Optional configuration to setup a user communication config.
00686      *   A default configuration  will be used if this is not specified.
00687      *   Applicable only to specific I2C sensor types.
00688      */
00689 
00690 }   ADMW1001_I2C_CHANNEL_CONFIG ;
00691 
00692 /*! ADMW1001 SPI digital channel configuration details
00693  *
00694  *  @note applicable only to SPI digital sensor channels
00695  */
00696 typedef struct {
00697     ADMW1001_SPI_SENSOR_TYPE         sensor;
00698     /*!< Sensor type selection */
00699     uint8_t                         reserved[2];
00700     /*!< Reserved for future use and ensure word alignment. */
00701     ADMW1001_DIGITAL_SENSOR_COMMAND  configurationCommand;
00702     /*!< Optional configuration command to send to the device at start-up.
00703      *   A default configuration command will be used if this is not specified.
00704      *   Applicable only to specific SPI sensor types.
00705      */
00706     ADMW1001_DIGITAL_SENSOR_COMMAND  dataRequestCommand;
00707     /*!< Optional data request command to send to the device for each sample.
00708      *   A default data request command will be used if this is not specified.
00709      *   Applicable only to specific SPI sensor types.
00710      */
00711     ADMW1001_DIGITAL_SENSOR_DATA_FORMAT  dataFormat;
00712     /*!< Optional data format configuration to parse/extract data from the device.
00713      *   A default data format will be used if this is not specified.
00714      *   Applicable only to specific SPI sensor types
00715      */
00716     ADMW1001_DIGITAL_CALIBRATION_COMMAND  digitalCalibrationParam;
00717     /*!< This is used to supply an independently established environmental variable
00718      *   that must be used during calibration of a [digital] sensor which a)
00719      *   supports calibration and b) expects an environmental parameter.
00720      *   An example is a CO2 sensor, which may require the CO2 concentration level
00721      *   when performing a calibration
00722      */
00723     ADMW1001_DIGITAL_SENSOR_COMMS        configureComms;
00724     /*!< Optional configuration to setup a user communication config.
00725      *   A default configuration  will be used if this is not specified.
00726      *   Applicable only to specific SPI sensor types.
00727      */
00728 
00729 }   ADMW1001_SPI_CHANNEL_CONFIG ;
00730 
00731 /*! ADMW1001 Measurement Channel configuration details */
00732 typedef struct {
00733     bool                                enableChannel;
00734     /*!< Option to include this channel in normal measurement cycles */
00735     bool                                disablePublishing;
00736     /*!< Option to disable publishing of data samples from this channel.  The
00737      *   channel may still be included in measurement cycles, but data samples
00738      *   obtained from this channel will not be published.  This is typically
00739      *   used for channels which are required only as a compensation reference
00740      *   for another channel (e.g. Cold-Junction Compensation channels).
00741      */
00742     ADMW1001_CH_ID                       compensationChannel;
00743     /*!< Optional compensation channel.  Set to ADMW1001_CH_ID_NONE if not
00744      *   required.  Typically used for thermocouple sensors that require a
00745      *   separate measurement of the "cold-junction" temperature, which can be
00746      *   be provided by an RTD temperature sensor connected on a separate
00747      *   "compensation channel" */
00748     ADMW1001_LUT_SELECT                  lutSelect;
00749     /*!<Select Look Up Table LUT for calculations, this implies that the
00750      * fundamental measurement for the sensor (typically mV or Ohms)
00751      * 0 = default, 1= unity, 2 = custom
00752      */
00753     ADMW1001_MEASUREMENT_UNIT            measurementUnit;
00754     /*!< Optional measurement unit selection for conversion results.  Applicable
00755      *   only for certain sensor types.  Set to
00756      *   ADMW1001_MEASUREMENT_UNIT_DEFAULT if not applicable.
00757      */
00758     float32_t                           lowThreshold;
00759     /*!< Optional minimum threshold value for each processed sample, to be
00760      *   checked prior to publishing.  A channel ALERT condition is raised
00761      *   if the processed value is lower than this threshold.  Set to NaN
00762      *   if not required.
00763      */
00764     float32_t                           highThreshold;
00765     /*!< Optional maximum threshold value for each processed sample, to be
00766      *   checked prior to publishing.  A channel ALERT condition is raised
00767      *   if the processed value is higher than this threshold.  Set to NaN
00768      *   if not required.
00769      */
00770     float32_t                           offsetAdjustment;
00771     /*!< Optional offset adjustment value applied to each processed sample.
00772      *   Set to NaN or 0.0 if not required.
00773      */
00774     float32_t                           gainAdjustment;
00775     /*!< Optional gain adjustment value applied to each processed sample.
00776      *   Set to NaN or 1.0 if not required.
00777      */
00778     float32_t                           sensorParameter;
00779     /*!< Optional sensor parameter adjustment.
00780      *   Set to NaN or 0 if not required.
00781      */
00782     uint32_t                            measurementsPerCycle;
00783     /*!< The number of measurements to obtain from this channel within each
00784      *   cycle.  Each enabled channel is measured in turn, until the number of
00785      *   measurements requested for the channel has been reached.  A different
00786      *   number of measurements-per-cycle may be specified for each channel.
00787      */
00788     uint32_t                            cycleSkipCount;
00789     /*!< Optional number of cycles to skip, such that this channel is included
00790      *   in the sequence in only one of every (cycleSkipCount + 1) cycles that
00791      *   occur.  If set to 0 (default), this channel is included in every cycle;
00792      *   if set to 1, this channel is included in every 2nd cycle; if set to 2,
00793      *   this channel is included in every 3rd cycle, and so on.
00794      */
00795     uint32_t                            extraSettlingTime;
00796     /*!< A minimum settling time is applied internally for each channel, based
00797      *   on the sensor type.  However, additional settling time (microseconds)
00798      *   can optionally be specified.  Set to 0 if not required.
00799      */
00800     ADMW1001_CHANNEL_PRIORITY            priority;
00801     /*!< By default, channels are arranged in the measurement sequence based on
00802      *   ascending order of channel ID.  However, a priority-level may be
00803      *   specified per channel to force a different ordering of the channels,
00804      *   with higher-priority channels appearing before lower-priority channels.
00805      *   Channels with equal priority are ordered by ascending order of channel
00806      *   ID.  Lower numbers indicate higher priority, with 0 being the highest.
00807      *   Set to 0 if not required.
00808      */
00809     union {
00810         ADMW1001_ADC_CHANNEL_CONFIG      adcChannelConfig;
00811         /*!< ADC channel configuration - applicable only to ADC channels */
00812         ADMW1001_I2C_CHANNEL_CONFIG      i2cChannelConfig;
00813         /*!< I2C channel configuration - applicable only to I2C channels */
00814         ADMW1001_SPI_CHANNEL_CONFIG      spiChannelConfig;
00815         /*!< SPI channel configuration - applicable only to SPI channels */
00816     };
00817     /*!< Only one of adcChannelConfig, i2cChannelConfig, spiChannelConfig
00818      *  is required, depending on the channel designation
00819      *   (analog, I2C, SPI)
00820      */
00821 
00822 }   ADMW1001_CHANNEL_CONFIG ;
00823 
00824 /*! ADMW1001 Diagnostics configuration details */
00825 typedef struct {
00826     bool                                disableGlobalDiag;
00827     /*!< Option to disable the following diagnostic checks on the ADC:
00828      *   - Reference Detection errors
00829      *   - Input under-/over-voltage errors
00830      *   - Calibration, Conversion and Saturation errors
00831      */
00832     bool                                disableMeasurementDiag;
00833     /*!< Option to disable additional checks per measurement channel:
00834      *   - High/low threshold limit violation
00835      */
00836 
00837     bool                                disableCriticalTempAbort;
00838     /*!< Option to disable abort of measurement cycle if the operating
00839      *   temperature of the ADMW1001 has exceeded critical limits
00840      */
00841 
00842     ADMW1001_OPEN_SENSOR_DIAGNOSTICS     osdFrequency;
00843     /*!< Option to enable Open-Circuit Detection at a selected cycle interval */
00844 
00845 }   ADMW1001_DIAGNOSTICS_CONFIG ;
00846 
00847 typedef uint16_t ADMW1001_ADVANCED_ACCESS_KEY;
00848 
00849 /*! ADMW1001 Device configuration details */
00850 typedef struct {
00851     ADMW1001_POWER_CONFIG            power;
00852     /*!< Power configuration details */
00853     ADMW1001_MEASUREMENT_CONFIG      measurement;
00854     /*!< Measurement configuration details */
00855     ADMW1001_DIAGNOSTICS_CONFIG      diagnostics;
00856     /*!< FFT configuration details */
00857     ADMW1001_CHANNEL_CONFIG          channels[ADMW1001_MAX_CHANNELS ];
00858     /*!< Channel-specific configuration details */
00859     ADMW1001_ADVANCED_ACCESS_KEY    advancedAccessKey;
00860     /*!< Key to enable access to advanced sensor configuration options */
00861 
00862 }   ADMW1001_CONFIG ;
00863 
00864 #ifdef __cplusplus
00865 }
00866 #endif
00867 
00868 /*!
00869  * @}
00870  */
00871 
00872 #endif /* __ADMW1001_CONFIG_H__ */