Diaz George / Mbed OS EV-PRO-MW1001_EXTVLTG-Dec18
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     ADMW1001_ADC_EXC_STATE                 excitationState;
00467     /*!< Excitation current state */
00468     ADMW1001_ADC_GND_SW                          groundSwitch;
00469     /*!< Option to open or close sensor ground switch */         
00470     uint8_t                     reserved0;
00471     /*!< Reserved for future use and ensure word alignment.
00472      */
00473     uint32_t                    cycleInterval;
00474     /*!< Cycle interval - specifies the time interval between the start of each
00475      *   successive measurement cycle.  Applicable only when operatingMode is
00476      *   not ADMW1001_OPERATING_MODE_SINGLECYCLE
00477      */
00478     bool                        vBiasEnable;
00479     /*!< Enable voltage Bias output of ADC
00480      */
00481     float32_t                   externalRef1Value;
00482     /*!< Voltage value connected to external reference input #1.
00483      *   Applicable only if the selected reference type is
00484      *   voltage.
00485      *   (see @ref ADMW1001_ADC_REFERENCE_TYPE)
00486      */
00487     float32_t                   RSenseValue;
00488     /*!< Sense resistor value in Ohms. */
00489     float32_t                   externalRefVoltage;
00490     /*!< External Reference Voltage.
00491      */
00492     uint32_t                    reserved1[2];
00493 
00494 }   ADMW1001_MEASUREMENT_CONFIG ;
00495 
00496 /*! ADMW1001 ADC Excitation Current output configuration
00497  *
00498  *  @note applicable only to ADC analog sensor channels, and
00499  *        specific sensor types
00500  */
00501 typedef struct {
00502     ADMW1001_ADC_EXC_CURRENT               outputLevel;
00503     /*!< Excitation current output level */
00504     ADMW1001_ADC_EXC_CURRENT_DIODE_RATIO   diodeRatio;
00505     /*!< Excitation current output diode ratio */
00506 
00507 }   ADMW1001_ADC_EXC_CURRENT_CONFIG ;
00508 
00509 /*! ADMW1001 ADC Filter configuration
00510  *
00511  *  @note applicable only to ADC analog sensor channels
00512  */
00513 typedef struct {
00514     ADMW1001_ADC_FILTER_TYPE     type;
00515     /*!< Filter type selection */
00516     ADMW1001_SINC_FILTER_RANGE   sf;
00517     /*!< SF value used along with filter type and chop mode to determine speed */
00518     ADMW1001_CHOP_MD             chopMode;
00519     /*!< Enable filter chop */
00520     bool                        notch1p2;
00521     /*!< Enable Notch 2 Filter Mode */
00522 }   ADMW1001_ADC_FILTER_CONFIG ;
00523 
00524 /*! ADMW1001 ADC analog channel configuration details
00525  *
00526  *  @note applicable only to ADC analog sensor channels
00527  */
00528 typedef struct {
00529     ADMW1001_ADC_SENSOR_TYPE         sensor;
00530     /*!< Sensor type selection */
00531     ADMW1001_ADC_RTD_CURVE           rtdCurve;
00532     /*!< Rtd curve selection */
00533     ADMW1001_ADC_GAIN                gain;
00534     /*!< ADC Gain selection */
00535     ADMW1001_ADC_EXC_CURRENT_CONFIG  current;
00536     /*!< ADC Excitation Current configuration */
00537     ADMW1001_ADC_FILTER_CONFIG       filter;
00538     /*!< ADC Filter configuration */
00539     ADMW1001_ADC_REFERENCE_TYPE      reference;
00540     bool                        vBiasEnable;
00541     /*!< ADC Reference configuration */
00542     uint8_t                         bufferBypass;
00543     /*!< Buffer Bypass configuration */
00544     uint8_t                         reserved0[2];
00545     /*!< Reserved for future use and ensure word alignment. */
00546     uint32_t                        reserved1[6];
00547     /*!< Reserved for future use and ensure word alignment. */
00548 
00549 }   ADMW1001_ADC_CHANNEL_CONFIG ;
00550 
00551 /*! ADMW1001 look-up table selection
00552  *  Select table used to linearise the measurement.
00553  */
00554 typedef enum {
00555     ADMW1001_LUT_DEFAULT   = 0,
00556     /*!< Default LUT */
00557     ADMW1001_LUT_UNITY     = 1,
00558     /*!< Unity LUT */
00559     ADMW1001_LUT_CUSTOM    = 2,
00560     /*!< User defined custom LUT */
00561     ADMW1001_LUT_RESERVED  = 3,
00562     /*!< Reserved for future use */
00563 
00564 }   ADMW1001_LUT_SELECT ;
00565 
00566 /*! ADMW1001 digital sensor data encoding
00567  *
00568  *  @note applicable only to SPI and I2C digital sensor channels
00569  */
00570 typedef enum {
00571     ADMW1001_DIGITAL_SENSOR_DATA_CODING_NONE = 0,
00572     /**< None/Invalid - data format is ignored if coding is set to this value */
00573     ADMW1001_DIGITAL_SENSOR_DATA_CODING_UNIPOLAR,
00574     /**< Unipolar - unsigned integer values */
00575     ADMW1001_DIGITAL_SENSOR_DATA_CODING_TWOS_COMPLEMENT,
00576     /**< Twos-complement - signed integer values */
00577     ADMW1001_DIGITAL_SENSOR_DATA_CODING_OFFSET_BINARY,
00578     /**< Offset Binary - used to represent signed values with unsigned integers,
00579      *   with the mid-range value representing 0 */
00580 
00581 }   ADMW1001_DIGITAL_SENSOR_DATA_CODING ;
00582 
00583 /*! ADMW1001 digital sensor data format configuration
00584  *
00585  *  @note applicable only to SPI and I2C digital sensor channels
00586  */
00587 typedef struct {
00588     ADMW1001_DIGITAL_SENSOR_DATA_CODING  coding;
00589     /**< Data Encoding of Sensor Result */
00590     bool littleEndian;
00591     /**< Set as true if data format is little-endian, false otherwise */
00592     bool leftJustified;
00593     /**< Set as true if data is left-justified in the data frame, false otherwise */
00594     uint8_t frameLength;
00595     /**< Data frame length (number of bytes to read from the sensor) */
00596     uint8_t numDataBits;
00597     /**< Number of relevant data bits to extract from the data frame */
00598     uint8_t bitOffset;
00599     /**< Data bit offset, relative to data alignment within the data frame */
00600     uint8_t reserved[2];
00601     /*!< Reserved for future use and ensure word alignment. */
00602 
00603 }   ADMW1001_DIGITAL_SENSOR_DATA_FORMAT ;
00604 
00605 /*! ADMW1001 digital sensor command
00606  *
00607  *  @note applicable only to SPI and I2C digital sensor channels
00608  */
00609 typedef struct {
00610     uint8_t command[ADMW1001_SENSOR_COMMAND_MAX_LENGTH];
00611     /*!< Optional command bytes to send to the device */
00612     uint8_t commandLength;
00613     /*!< Number of valid command bytes.  Set to 0 if unused */
00614 
00615 }   ADMW1001_DIGITAL_SENSOR_COMMAND ;
00616 
00617 /*! ADMW1001 digital sensor calibration param
00618  *
00619  *  @note applicable only to digital sensor channels
00620  */
00621 typedef struct {
00622     uint32_t calibrationParam;
00623     /*!< Independently established environmental variable used during calibration
00624      *   of a digital sensor. Used only if the sensor supports calibration
00625      *   and expects an environmental parameter
00626      */
00627     bool enableCalibrationParam;
00628     /*!< Allow Calibration_Parameter to be used during calibration of any digital sensor */
00629     uint8_t                         reserved[3];
00630     /*!< Reserved for future use and ensure word alignment. */
00631 
00632 }   ADMW1001_DIGITAL_CALIBRATION_COMMAND ;
00633 
00634 /*! ADMW1001 digital sensor communication config
00635  *
00636  *  @note applicable only to digital sensor channels
00637  */
00638 typedef struct {
00639     bool                                            useCustomCommsConfig;
00640     /*!< Optional parameter to enable user digital communication settings */
00641     ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED    i2cClockSpeed;
00642     /*!< Optional parameter to configure specific i2c speed for i2c sensor */
00643     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_MODE           spiMode;
00644     /*!< Optional parameter to configure specific spi mode for spi sensor */
00645     ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK          spiClock;
00646     /*!< Optional parameter to configure specific spi clock for spi sensor */
00647 
00648 }   ADMW1001_DIGITAL_SENSOR_COMMS ;
00649 
00650 /*! ADMW1001 I2C digital channel configuration details
00651  *
00652  *  @note applicable only to I2C digital sensor channels
00653  */
00654 typedef struct {
00655     ADMW1001_I2C_SENSOR_TYPE                 sensor;
00656     /*!< Sensor type selection */
00657     uint8_t                                 deviceAddress;
00658     /*!< I2C device address (7-bit) */
00659     uint8_t                                 reserved;
00660     /*!< Reserved for future use and ensure word alignment. */
00661     ADMW1001_DIGITAL_SENSOR_COMMAND          configurationCommand;
00662     /*!< Optional configuration command to send to the device at start-up.
00663      *   A default configuration command will be used if this is not specified.
00664      *   Applicable only to specific I2C sensor types.
00665      */
00666     ADMW1001_DIGITAL_SENSOR_COMMAND          dataRequestCommand;
00667     /*!< Optional data request command to send to the device for each sample.
00668      *   A default data request command will be used if this is not specified.
00669      *   Applicable only to specific I2C sensor types.
00670      */
00671     ADMW1001_DIGITAL_SENSOR_DATA_FORMAT      dataFormat;
00672     /*!< Optional data format configuration to parse/extract data from the device.
00673      *   A default data format will be used if this is not specified.
00674      *   Applicable only to specific I2C sensor types
00675      */
00676     ADMW1001_DIGITAL_CALIBRATION_COMMAND     digitalCalibrationParam;
00677     /*!< This is used to supply an independently established environmental variable
00678      *   that must be used during calibration of a [digital] sensor which a)
00679      *   supports calibration and b) expects an environmental parameter.
00680      *   An example is a CO2 sensor, which may require the CO2 concentration level
00681      *   when performing a calibration
00682      */
00683     ADMW1001_DIGITAL_SENSOR_COMMS            configureComms;
00684     /*!< Optional configuration to setup a user communication config.
00685      *   A default configuration  will be used if this is not specified.
00686      *   Applicable only to specific I2C sensor types.
00687      */
00688 
00689 }   ADMW1001_I2C_CHANNEL_CONFIG ;
00690 
00691 /*! ADMW1001 SPI digital channel configuration details
00692  *
00693  *  @note applicable only to SPI digital sensor channels
00694  */
00695 typedef struct {
00696     ADMW1001_SPI_SENSOR_TYPE         sensor;
00697     /*!< Sensor type selection */
00698     uint8_t                         reserved[2];
00699     /*!< Reserved for future use and ensure word alignment. */
00700     ADMW1001_DIGITAL_SENSOR_COMMAND  configurationCommand;
00701     /*!< Optional configuration command to send to the device at start-up.
00702      *   A default configuration command will be used if this is not specified.
00703      *   Applicable only to specific SPI sensor types.
00704      */
00705     ADMW1001_DIGITAL_SENSOR_COMMAND  dataRequestCommand;
00706     /*!< Optional data request command to send to the device for each sample.
00707      *   A default data request command will be used if this is not specified.
00708      *   Applicable only to specific SPI sensor types.
00709      */
00710     ADMW1001_DIGITAL_SENSOR_DATA_FORMAT  dataFormat;
00711     /*!< Optional data format configuration to parse/extract data from the device.
00712      *   A default data format will be used if this is not specified.
00713      *   Applicable only to specific SPI sensor types
00714      */
00715     ADMW1001_DIGITAL_CALIBRATION_COMMAND  digitalCalibrationParam;
00716     /*!< This is used to supply an independently established environmental variable
00717      *   that must be used during calibration of a [digital] sensor which a)
00718      *   supports calibration and b) expects an environmental parameter.
00719      *   An example is a CO2 sensor, which may require the CO2 concentration level
00720      *   when performing a calibration
00721      */
00722     ADMW1001_DIGITAL_SENSOR_COMMS        configureComms;
00723     /*!< Optional configuration to setup a user communication config.
00724      *   A default configuration  will be used if this is not specified.
00725      *   Applicable only to specific SPI sensor types.
00726      */
00727 
00728 }   ADMW1001_SPI_CHANNEL_CONFIG ;
00729 
00730 /*! ADMW1001 Measurement Channel configuration details */
00731 typedef struct {
00732     bool                                enableChannel;
00733     /*!< Option to include this channel in normal measurement cycles */
00734     bool                                disablePublishing;
00735     /*!< Option to disable publishing of data samples from this channel.  The
00736      *   channel may still be included in measurement cycles, but data samples
00737      *   obtained from this channel will not be published.  This is typically
00738      *   used for channels which are required only as a compensation reference
00739      *   for another channel (e.g. Cold-Junction Compensation channels).
00740      */
00741     ADMW1001_CH_ID                       compensationChannel;
00742     /*!< Optional compensation channel.  Set to ADMW1001_CH_ID_NONE if not
00743      *   required.  Typically used for thermocouple sensors that require a
00744      *   separate measurement of the "cold-junction" temperature, which can be
00745      *   be provided by an RTD temperature sensor connected on a separate
00746      *   "compensation channel" */
00747     ADMW1001_LUT_SELECT                  lutSelect;
00748     /*!<Select Look Up Table LUT for calculations, this implies that the
00749      * fundamental measurement for the sensor (typically mV or Ohms)
00750      * 0 = default, 1= unity, 2 = custom
00751      */
00752     ADMW1001_MEASUREMENT_UNIT            measurementUnit;
00753     /*!< Optional measurement unit selection for conversion results.  Applicable
00754      *   only for certain sensor types.  Set to
00755      *   ADMW1001_MEASUREMENT_UNIT_DEFAULT if not applicable.
00756      */
00757     float32_t                           lowThreshold;
00758     /*!< Optional minimum threshold value for each processed sample, to be
00759      *   checked prior to publishing.  A channel ALERT condition is raised
00760      *   if the processed value is lower than this threshold.  Set to NaN
00761      *   if not required.
00762      */
00763     float32_t                           highThreshold;
00764     /*!< Optional maximum threshold value for each processed sample, to be
00765      *   checked prior to publishing.  A channel ALERT condition is raised
00766      *   if the processed value is higher than this threshold.  Set to NaN
00767      *   if not required.
00768      */
00769     float32_t                           offsetAdjustment;
00770     /*!< Optional offset adjustment value applied to each processed sample.
00771      *   Set to NaN or 0.0 if not required.
00772      */
00773     float32_t                           gainAdjustment;
00774     /*!< Optional gain adjustment value applied to each processed sample.
00775      *   Set to NaN or 1.0 if not required.
00776      */
00777     float32_t                           sensorParameter;
00778     /*!< Optional sensor parameter adjustment.
00779      *   Set to NaN or 0 if not required.
00780      */
00781     uint32_t                            measurementsPerCycle;
00782     /*!< The number of measurements to obtain from this channel within each
00783      *   cycle.  Each enabled channel is measured in turn, until the number of
00784      *   measurements requested for the channel has been reached.  A different
00785      *   number of measurements-per-cycle may be specified for each channel.
00786      */
00787     uint32_t                            cycleSkipCount;
00788     /*!< Optional number of cycles to skip, such that this channel is included
00789      *   in the sequence in only one of every (cycleSkipCount + 1) cycles that
00790      *   occur.  If set to 0 (default), this channel is included in every cycle;
00791      *   if set to 1, this channel is included in every 2nd cycle; if set to 2,
00792      *   this channel is included in every 3rd cycle, and so on.
00793      */
00794     uint32_t                            extraSettlingTime;
00795     /*!< A minimum settling time is applied internally for each channel, based
00796      *   on the sensor type.  However, additional settling time (microseconds)
00797      *   can optionally be specified.  Set to 0 if not required.
00798      */
00799     ADMW1001_CHANNEL_PRIORITY            priority;
00800     /*!< By default, channels are arranged in the measurement sequence based on
00801      *   ascending order of channel ID.  However, a priority-level may be
00802      *   specified per channel to force a different ordering of the channels,
00803      *   with higher-priority channels appearing before lower-priority channels.
00804      *   Channels with equal priority are ordered by ascending order of channel
00805      *   ID.  Lower numbers indicate higher priority, with 0 being the highest.
00806      *   Set to 0 if not required.
00807      */
00808     union {
00809         ADMW1001_ADC_CHANNEL_CONFIG      adcChannelConfig;
00810         /*!< ADC channel configuration - applicable only to ADC channels */
00811         ADMW1001_I2C_CHANNEL_CONFIG      i2cChannelConfig;
00812         /*!< I2C channel configuration - applicable only to I2C channels */
00813         ADMW1001_SPI_CHANNEL_CONFIG      spiChannelConfig;
00814         /*!< SPI channel configuration - applicable only to SPI channels */
00815     };
00816     /*!< Only one of adcChannelConfig, i2cChannelConfig, spiChannelConfig
00817      *  is required, depending on the channel designation
00818      *   (analog, I2C, SPI)
00819      */
00820 
00821 }   ADMW1001_CHANNEL_CONFIG ;
00822 
00823 /*! ADMW1001 Diagnostics configuration details */
00824 typedef struct {
00825     bool                                disableGlobalDiag;
00826     /*!< Option to disable the following diagnostic checks on the ADC:
00827      *   - Reference Detection errors
00828      *   - Input under-/over-voltage errors
00829      *   - Calibration, Conversion and Saturation errors
00830      */
00831     bool                                disableMeasurementDiag;
00832     /*!< Option to disable additional checks per measurement channel:
00833      *   - High/low threshold limit violation
00834      */
00835 
00836     bool                                disableCriticalTempAbort;
00837     /*!< Option to disable abort of measurement cycle if the operating
00838      *   temperature of the ADMW1001 has exceeded critical limits
00839      */
00840 
00841     ADMW1001_OPEN_SENSOR_DIAGNOSTICS     osdFrequency;
00842     /*!< Option to enable Open-Circuit Detection at a selected cycle interval */
00843 
00844 }   ADMW1001_DIAGNOSTICS_CONFIG ;
00845 
00846 typedef uint16_t ADMW1001_ADVANCED_ACCESS_KEY;
00847 
00848 /*! ADMW1001 Device configuration details */
00849 typedef struct {
00850     ADMW1001_POWER_CONFIG            power;
00851     /*!< Power configuration details */
00852     ADMW1001_MEASUREMENT_CONFIG      measurement;
00853     /*!< Measurement configuration details */
00854     ADMW1001_DIAGNOSTICS_CONFIG      diagnostics;
00855     /*!< FFT configuration details */
00856     ADMW1001_CHANNEL_CONFIG          channels[ADMW1001_MAX_CHANNELS ];
00857     /*!< Channel-specific configuration details */
00858     ADMW1001_ADVANCED_ACCESS_KEY    advancedAccessKey;
00859     /*!< Key to enable access to advanced sensor configuration options */
00860 
00861 }   ADMW1001_CONFIG ;
00862 
00863 #ifdef __cplusplus
00864 }
00865 #endif
00866 
00867 /*!
00868  * @}
00869  */
00870 
00871 #endif /* __ADMW1001_CONFIG_H__ */