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