initial commit

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