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