Vybhav Kadaba / Mbed OS EV-PRO-MW1001_Development_MWARE2390
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 
00090 }   ADMW1001_OPERATING_MODE ;
00091 
00092 /*! ADMW1001 data ready mode options */
00093 typedef enum
00094 {
00095     ADMW1001_DATAREADY_PER_CONVERSION  = 0,
00096     /*!< The DATAREADY signal is asserted after completion of each conversion
00097      *   - a single data sample only from the latest completed conversion is
00098      *     stored in this mode
00099      */
00100     ADMW1001_DATAREADY_PER_CYCLE ,
00101     /*!< The DATAREADY signal is asserted after completion of each measurement
00102      *   cycle
00103      *   - data samples only from the lastest completed measurement cycle are
00104      *     stored in this mode
00105      */
00106     ADMW1001_DATAREADY_PER_FIFO_FILL ,
00107     /*!< The DATAREADY signal is asserted after each fill of the data FIFO
00108      *   - applicable only when @ref ADMW1001_OPERATING_MODE_CONTINUOUS or
00109      *     @ref ADMW1001_OPERATING_MODE_MULTICYCLE is also selected
00110      */
00111 
00112 }   ADMW1001_DATAREADY_MODE ;
00113 
00114 /*! ADMW1001 power mode options */
00115 typedef enum
00116 {
00117     ADMW1001_POWER_MODE_ACTIVE  = 0,
00118     /*!< Part is fully powered up and either cycling through a sequence or awaiting a configuration */
00119     ADMW1001_POWER_MODE_HIBERNATION ,
00120     /*!< module has entede hibernation mode. All analog circuitry is disabled. All peripherals disabled apart from the Wake-up pin functionality. */
00121 
00122 }   ADMW1001_POWER_MODE ;
00123 
00124 
00125 /*! ADMW1001 measurement unit options
00126  *
00127  *  Optionally select a measurement unit for final conversion results.
00128  *  Currently applicable only to specific temperature sensor types.
00129  */
00130 typedef enum
00131 {
00132     ADMW1001_MEASUREMENT_UNIT_UNSPECIFIED  = 0,
00133     /*!< No measurement unit specified */
00134     ADMW1001_MEASUREMENT_UNIT_CELSIUS ,
00135     /*!< Celsius temperature unit - applicable to temperature sensors only */
00136     ADMW1001_MEASUREMENT_UNIT_FAHRENHEIT ,
00137     /*!< Fahrenheit temperature unit - applicable to temperature sensors only */
00138 
00139 }   ADMW1001_MEASUREMENT_UNIT ;
00140 
00141 typedef enum
00142 {
00143     ADMW1001_BUFFER_BYPASSS_DISABLED  = 0,
00144     /*!< Buffer Bypass Disabled */
00145     ADMW1001_BUFFER_BYPASSS_ENABLED ,
00146     /*!< Buffer Bypass Enabled */
00147 
00148 }   ADMW1001_BUFFER_BYPASSS ;
00149 
00150 /*! ADMW1001 analog input signal amplification gain options
00151  *
00152  *  @note applicable only to ADC analog sensor channels
00153  */
00154 typedef enum
00155 {
00156     ADMW1001_ADC_RTD_CURVE_EUROPEAN  = 0,
00157     /*!< EUROPEAN RTD curve used. */
00158     ADMW1001_ADC_RTD_CURVE_AMERICAN ,
00159     /*!< AMERICAN RTD curve used. */
00160     ADMW1001_ADC_RTD_CURVE_JAPANESE ,
00161     /*!< JAPANESE RTD curve used. */
00162     ADMW1001_ADC_RTD_CURVE_ITS90 ,
00163     /*!< ITS90 RTD curve used. */
00164 
00165 }   ADMW1001_ADC_RTD_CURVE ;
00166 /*! ADMW1001 analog input signal amplification gain options
00167  *
00168  *  @note applicable only to ADC analog sensor channels
00169  */
00170 typedef enum
00171 {
00172     ADMW1001_ADC_GAIN_1X  = 0,
00173     /*!< no amplification gain */
00174     ADMW1001_ADC_GAIN_2X ,
00175     /*!< x2 amplification gain */
00176     ADMW1001_ADC_GAIN_4X ,
00177     /*!< x4 amplification gain */
00178     ADMW1001_ADC_GAIN_8X ,
00179     /*!< x8 amplification gain */
00180     ADMW1001_ADC_GAIN_16X ,
00181     /*!< x16 amplification gain */
00182     ADMW1001_ADC_GAIN_32X ,
00183     /*!< x32 amplification gain */
00184     ADMW1001_ADC_GAIN_64X ,
00185     /*!< x64 amplification gain */
00186 
00187 }   ADMW1001_ADC_GAIN ;
00188 
00189 /*! ADMW1001 analog sensor excitation state options
00190  *
00191  *  @note applicable only to ADC analog sensor channels, and
00192  *        specific sensor types
00193  */
00194 typedef enum
00195 {
00196     ADMW1001_ADC_EXC_STATE_CYCLE_POWER  = 0,
00197     /*!< Excitation for measurement is active only during measurement */
00198     ADMW1001_ADC_EXC_STATE_ALWAYS_ON ,
00199     /*!< Excitation for measurement is always on */
00200 
00201 }   ADMW1001_ADC_EXC_STATE ;
00202 
00203 /*! ADMW1001 analog sensor excitation current output level options
00204  *
00205  *  @note applicable only to ADC analog sensor channels, and
00206  *        specific sensor types
00207  */
00208 typedef enum
00209 {
00210     ADMW1001_ADC_NO_EXTERNAL_EXC_CURRENT  = -1,
00211     /*!< NO External excitation is provided */
00212     ADMW1001_ADC_EXC_CURRENT_EXTERNAL  = 0,
00213     /*!< External excitation is provided */
00214     ADMW1001_ADC_EXC_CURRENT_50uA ,
00215     /*!< 50uA excitation current enabled */
00216     ADMW1001_ADC_EXC_CURRENT_100uA ,
00217     /*!< 100uA excitation current  */
00218     ADMW1001_ADC_EXC_CURRENT_250uA ,
00219     /*!< 250uA excitation current enabled */
00220     ADMW1001_ADC_EXC_CURRENT_500uA ,
00221     /*!< 500uA excitation current enabled */
00222     ADMW1001_ADC_EXC_CURRENT_1000uA ,
00223     /*!< 1mA excitation current enabled */
00224 
00225 }   ADMW1001_ADC_EXC_CURRENT ;
00226 
00227 /*! ADMW1001 analog sensor excitation current ratios used for diode sensor
00228  *
00229  *  @note applicable only to a diode sensor
00230  */
00231 typedef enum
00232 {
00233     ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_10UA_100UA = 0,
00234     /**< 2 Current measurement 10uA 100uA        */
00235     ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_20UA_160UA,
00236     /**< 2 Current measurement 20uA 160uA        */
00237     ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_50UA_300UA,
00238     /**< 2 Current measurement 50uA 300uA        */
00239     ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_100UA_600UA,
00240     /**< 2 Current measurement 100uA 600uA       */
00241     ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_10UA_50UA_100UA,
00242     /**< 3 current measuremetn 10uA 50uA 100uA   */
00243     ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_20UA_100UA_160UA,
00244     /**< 3 current measuremetn 20uA 100uA 160uA  */
00245     ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_50UA_150UA_300UA,
00246     /**< 3 current measuremetn 50uA 150uA 300uA  */
00247     ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_100UA_300UA_600UA,
00248     /**< 3 current measuremetn 100uA 300uA 600uA */
00249 
00250 }   ADMW1001_ADC_EXC_CURRENT_DIODE_RATIO ;
00251 
00252 /*! ADMW1001 analog reference selection options
00253  *
00254  *  @note applicable only to ADC analog sensor channels, and
00255  *        specific sensor types
00256  */
00257 typedef enum
00258 {
00259     ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL  = 0,
00260     /*!< Internal VRef - 1.2V */
00261     ADMW1001_ADC_REFERENCE_VOLTAGE_EXTERNAL_1  = 1,
00262     /*!< External reference voltage #1 */
00263     ADMW1001_ADC_REFERENCE_VOLTAGE_AVDD  = 3,
00264     /*!< Analog Supply Voltage AVDD reference (typically 3.3V) is selected */
00265 
00266 }   ADMW1001_ADC_REFERENCE_TYPE ;
00267 
00268 /*! ADMW1001 ADC Reference configuration
00269  *
00270  *  @note applicable only to ADC analog sensor channels
00271  */
00272 typedef enum
00273 {
00274     ADMW1001_ADC_GND_SW_OPEN  = 0,
00275     /*!< Ground switch not enabled for measurement. */
00276     ADMW1001_ADC_GND_SW_CLOSED ,
00277     /*!< Ground switch enabled for measurement. */
00278 
00279 }   ADMW1001_ADC_GND_SW ;
00280 
00281 /*! ADMW1001 analog filter chop mode
00282  *
00283  *  @note applicable only to ADC analog sensor channels
00284  */
00285 typedef enum
00286 {
00287     ADMW1001_CHOP_MD_OFF  = 0,
00288     /*!< chop performed. */
00289     ADMW1001_CHOP_MD_ON,
00290 
00291 }   ADMW1001_CHOP_MD ;
00292 
00293 /*! ADMW1001 analog filter selection options
00294  *
00295  *  @note applicable only to ADC analog sensor channels
00296  */
00297 typedef enum
00298 {
00299     ADMW1001_ADC_FILTER_SINC4  = 0,
00300     /*!< SINC4 - 4th order sinc response filter */
00301     ADMW1001_ADC_FILTER_SINC3 ,
00302     /*!< SINC3 - 3rd order sinc response filter */
00303 
00304 }   ADMW1001_ADC_FILTER_TYPE ;
00305 
00306 /*! ADMW1001 Sinc Filter range (SF)
00307  *
00308  *  @note applicable only to ADC analog sensor channels
00309  *  @note SF must be set in conjunction with chop mode
00310  *  and sinc filter type to achieve the desired sampling rate.
00311  */
00312 typedef enum
00313 {
00314     ADMW1001_SF_122HZ   = 7,
00315     /*!< SF setting for 122Hz sample rate. */
00316     ADMW1001_SF_61HZ    = 31,
00317     /*!< SF setting for 61Hz sample rate. */
00318     ADMW1001_SF_30P5HZ  = 51,
00319     /*!< SF setting for 61Hz sample rate. */
00320     ADMW1001_SF_10HZ    = 124,
00321     /*!< SF setting for 10Hz sample rate. */
00322     ADMW1001_SF_8P24HZ  = 125,
00323     /*!< SF setting for 8.24Hz sample rate. */
00324     ADMW1001_SF_5HZ     = 127,
00325     /*!< SF setting for 5Hz sample rate. */
00326 
00327 }   ADMW1001_SINC_FILTER_RANGE ;
00328 
00329 /*! ADMW1001 I2C clock speed options
00330  *
00331  *  @note applicable only for I2C sensors
00332  */
00333 typedef enum
00334 {
00335     ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED_100K  = 0,
00336     /*!< 100kHz I2C clock speed */
00337     ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED_400K ,
00338     /*!< 400kHz I2C clock speed */
00339 
00340 }   ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED ;
00341 
00342 
00343 /*! ADMW1001 Power Configuration options */
00344 typedef struct
00345 {
00346     ADMW1001_POWER_MODE         powerMode;
00347     /*!< Power mode selection */
00348 
00349 }   ADMW1001_POWER_CONFIG ;
00350 
00351 /*! ADMW1001 Multi-Cycle Configuration options
00352  *
00353  * @note required only when ADMW1001_OPERATING_MODE_MULTICYCLE is selected
00354  *       as the operatingMode (@ref ADMW1001_MEASUREMENT_CONFIG)
00355  */
00356 typedef struct
00357 {
00358     uint32_t    cyclesPerBurst;
00359     /*!< Number of cycles to complete for a single burst */
00360     uint32_t    burstInterval;
00361     /*!< Interval, in seconds, between each successive burst of cycles */
00362 
00363 }   ADMW1001_MULTICYCLE_CONFIG ;
00364 
00365 /*! ADMW1001 Measurement Configuration options */
00366 typedef struct
00367 {
00368     ADMW1001_OPERATING_MODE     operatingMode;
00369     /*!< Operating mode - specifies how measurement cycles are scheduled */
00370     ADMW1001_DATAREADY_MODE     dataReadyMode;
00371     /*!< Data read mode - specifies how output samples are stored for reading */
00372     uint8_t                      excitationState;
00373     /*!< Excitation current state */
00374     uint8_t                         groundSwitch;
00375     /*!< Option to open or close sensor ground switch */
00376     uint8_t                     fifoNumCycles;
00377     /*!< Specifies the number of cycles to fill a FIFO buffer
00378      *   Applicable only when operatingMode is ADMW1001_OPERATING_MODE_CONTINUOUS
00379      */
00380     uint32_t                    cycleInterval;
00381     /*!< Cycle interval - specifies the time interval between the start of each
00382      *   successive measurement cycle.  Applicable only when operatingMode is
00383      *   not ADMW1001_OPERATING_MODE_SINGLECYCLE
00384      */
00385     bool                        vBiasEnable;
00386     /*!< Enable voltage Bias output of ADC
00387      */
00388     float32_t                   externalRef1Value;
00389     /*!< Voltage value connected to external reference input #1.
00390      *   Applicable only if the selected reference type is
00391      *   voltage.
00392      *   (see @ref ADMW1001_ADC_REFERENCE_TYPE)
00393      */
00394     float32_t                   RSenseValue;
00395     /*!< Sense resistor value in Ohms. */
00396     float32_t                   externalRefVoltage;
00397     /*!< External Reference Voltage.
00398      */
00399     float32_t                   AVDDVoltage;
00400     /*!< AVDD Voltage.
00401      */
00402     uint32_t                    reserved1[1];
00403     /*!< Reserved for future use and ensure word alignment.
00404      */
00405 
00406 }   ADMW1001_MEASUREMENT_CONFIG ;
00407 
00408 /*! ADMW1001 ADC Excitation Current output configuration
00409  *
00410  *  @note applicable only to ADC analog sensor channels, and
00411  *        specific sensor types
00412  */
00413 typedef struct
00414 {
00415     ADMW1001_ADC_EXC_CURRENT               outputLevel;
00416     /*!< Excitation current output level */
00417     ADMW1001_ADC_EXC_CURRENT_DIODE_RATIO   diodeRatio;
00418     /*!< Excitation current output diode ratio */
00419     float32_t                             idealityRatio;
00420 
00421 }   ADMW1001_ADC_EXC_CURRENT_CONFIG ;
00422 
00423 /*! ADMW1001 ADC Filter configuration
00424  *
00425  *  @note applicable only to ADC analog sensor channels
00426  */
00427 typedef struct
00428 {
00429     ADMW1001_ADC_FILTER_TYPE     type;
00430     /*!< Filter type selection */
00431     ADMW1001_SINC_FILTER_RANGE   sf;
00432     /*!< SF value used along with filter type and chop mode to determine speed */
00433     ADMW1001_CHOP_MD             chopMode;
00434     /*!< Enable filter chop */
00435     bool                        notch1p2;
00436     /*!< Enable Notch 2 Filter Mode */
00437 
00438 }   ADMW1001_ADC_FILTER_CONFIG ;
00439 
00440 /*! ADMW1001 ADC analog channel configuration details
00441  *
00442  *  @note applicable only to ADC analog sensor channels
00443  */
00444 typedef struct
00445 {
00446     ADMW1001_ADC_SENSOR_TYPE         sensor;
00447     /*!< Sensor type selection */
00448     ADMW1001_ADC_RTD_CURVE           rtdCurve;
00449     /*!< Rtd curve selection */
00450     ADMW1001_ADC_GAIN                gain;
00451     /*!< ADC Gain selection */
00452     ADMW1001_ADC_EXC_CURRENT_CONFIG  current;
00453     /*!< ADC Excitation Current configuration */
00454     ADMW1001_ADC_FILTER_CONFIG       filter;
00455     /*!< ADC Filter configuration */
00456     ADMW1001_ADC_REFERENCE_TYPE      reference;
00457     /*!< ADC Reference configuration */
00458     uint8_t                         bufferBypass;
00459      /*!< Buffer Bypass configuration */
00460     uint8_t                         reserved0[2];
00461     /*!< Reserved for future use and ensure word alignment. */
00462     uint32_t                        reserved1[6];
00463     /*!< Reserved for future use and ensure word alignment. */
00464 
00465 }   ADMW1001_ADC_CHANNEL_CONFIG ;
00466 
00467 /*! ADMW1001 look-up table selection
00468  *  Select table used to linearise the measurement.
00469  */
00470 typedef enum
00471 {
00472     ADMW1001_LUT_DEFAULT   = 0,
00473     /*!< Default LUT */
00474     ADMW1001_LUT_CUSTOM    = 1,
00475     /*!< User defined custom LUT */
00476     ADMW1001_LUT_RESERVED  = 2,
00477     /*!< Reserved for future use */
00478 
00479 }   ADMW1001_LUT_SELECT ;
00480 
00481 /*! ADMW1001 digital sensor data encoding
00482  *
00483  *  @note applicable only to SPI and I2C digital sensor channels
00484  */
00485 typedef enum
00486 {
00487     ADMW1001_DIGITAL_SENSOR_DATA_CODING_NONE = 0,
00488     /**< None/Invalid - data format is ignored if coding is set to this value */
00489     ADMW1001_DIGITAL_SENSOR_DATA_CODING_UNIPOLAR,
00490     /**< Unipolar - unsigned integer values */
00491     ADMW1001_DIGITAL_SENSOR_DATA_CODING_TWOS_COMPLEMENT,
00492     /**< Twos-complement - signed integer values */
00493     ADMW1001_DIGITAL_SENSOR_DATA_CODING_OFFSET_BINARY,
00494     /**< Offset Binary - used to represent signed values with unsigned integers,
00495      *   with the mid-range value representing 0 */
00496 
00497 }   ADMW1001_DIGITAL_SENSOR_DATA_CODING ;
00498 
00499 /*! ADMW1001 digital sensor data format configuration
00500  *
00501  *  @note applicable only to SPI and I2C digital sensor channels
00502  */
00503 typedef struct
00504 {
00505     ADMW1001_DIGITAL_SENSOR_DATA_CODING  coding;
00506     /**< Data Encoding of Sensor Result */
00507     bool littleEndian;
00508     /**< Set as true if data format is little-endian, false otherwise */
00509     bool leftJustified;
00510     /**< Set as true if data is left-justified in the data frame, false otherwise */
00511     uint8_t frameLength;
00512     /**< Data frame length (number of bytes to read from the sensor) */
00513     uint8_t numDataBits;
00514     /**< Number of relevant data bits to extract from the data frame */
00515     uint8_t bitOffset;
00516     /**< Data bit offset, relative to data alignment within the data frame */
00517     uint8_t reserved[2];
00518     /*!< Reserved for future use and ensure word alignment. */
00519 
00520 }   ADMW1001_DIGITAL_SENSOR_DATA_FORMAT ;
00521 
00522 
00523 /*! ADMW1001 digital sensor communication config
00524  *
00525  *  @note applicable only to digital sensor channels
00526  */
00527 typedef struct
00528 {
00529     bool                                            useCustomCommsConfig;
00530     /*!< Optional parameter to enable user digital communication settings */
00531     ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED    i2cClockSpeed;
00532     /*!< Optional parameter to configure specific i2c speed for i2c sensor */
00533 
00534 }   ADMW1001_DIGITAL_SENSOR_COMMS ;
00535 
00536 /*! ADMW1001 I2C digital channel configuration details
00537  *
00538  *  @note applicable only to I2C digital sensor channels
00539  */
00540 typedef struct
00541 {
00542     ADMW1001_I2C_SENSOR_TYPE                 sensor;
00543     /*!< Sensor type selection */
00544     uint8_t                                 deviceAddress;
00545     /*!< I2C device address (7-bit) */
00546     uint8_t                                 reserved;
00547     /*!< Reserved for future use and ensure word alignment. */
00548     ADMW1001_DIGITAL_SENSOR_DATA_FORMAT      dataFormat;
00549     /*!< Optional data format configuration to parse/extract data from the device.
00550      *   A default data format will be used if this is not specified.
00551      *   Applicable only to specific I2C sensor types
00552      */
00553     ADMW1001_DIGITAL_SENSOR_COMMS            configureComms;
00554     /*!< Optional configuration to setup a user communication config.
00555      *   A default configuration  will be used if this is not specified.
00556      *   Applicable only to specific I2C sensor types.
00557      */
00558 
00559 }   ADMW1001_I2C_CHANNEL_CONFIG ;
00560 
00561 
00562 /*! ADMW1001 Measurement Channel configuration details */
00563 typedef struct
00564 {
00565     bool                                enableChannel;
00566     /*!< Option to include this channel in normal measurement cycles */
00567     bool                                disablePublishing;
00568     /*!< Option to disable publishing of data samples from this channel.  The
00569      *   channel may still be included in measurement cycles, but data samples
00570      *   obtained from this channel will not be published.  This is typically
00571      *   used for channels which are required only as a compensation reference
00572      *   for another channel (e.g. Cold-Junction Compensation channels).
00573      */
00574     ADMW1001_CH_ID                       compensationChannel;
00575     /*!< Optional compensation channel.  Set to ADMW1001_CH_ID_NONE if not
00576      *   required.  Typically used for thermocouple sensors that require a
00577      *   separate measurement of the "cold-junction" temperature, which can be
00578      *   be provided by an RTD temperature sensor connected on a separate
00579      *   "compensation channel" */
00580     ADMW1001_LUT_SELECT                  lutSelect;
00581     /*!<Select Look Up Table LUT for calculations, this implies that the
00582      * fundamental measurement for the sensor (typically mV or Ohms)
00583      * 0 = default, 1= unity, 2 = custom
00584      */
00585     ADMW1001_MEASUREMENT_UNIT            measurementUnit;
00586     /*!< Optional measurement unit selection for conversion results.  Applicable
00587      *   only for certain sensor types.  Set to
00588      *   ADMW1001_MEASUREMENT_UNIT_DEFAULT if not applicable.
00589      */
00590     float32_t                           lowThreshold;
00591     /*!< Optional minimum threshold value for each processed sample, to be
00592      *   checked prior to publishing.  A channel ALERT condition is raised
00593      *   if the processed value is lower than this threshold.  Set to NaN
00594      *   if not required.
00595      */
00596     float32_t                           highThreshold;
00597     /*!< Optional maximum threshold value for each processed sample, to be
00598      *   checked prior to publishing.  A channel ALERT condition is raised
00599      *   if the processed value is higher than this threshold.  Set to NaN
00600      *   if not required.
00601      */
00602     float32_t                           offsetAdjustment;
00603     /*!< Optional offset adjustment value applied to each processed sample.
00604      *   Set to NaN or 0.0 if not required.
00605      */
00606     float32_t                           gainAdjustment;
00607     /*!< Optional gain adjustment value applied to each processed sample.
00608      *   Set to NaN or 1.0 if not required.
00609      */
00610     float32_t                           sensorParameter;
00611     /*!< Optional sensor parameter adjustment.
00612      *   Set to NaN or 0 if not required.
00613      */
00614     uint32_t                            measurementsPerCycle;
00615     /*!< The number of measurements to obtain from this channel within each
00616      *   cycle.  Each enabled channel is measured in turn, until the number of
00617      *   measurements requested for the channel has been reached.  A different
00618      *   number of measurements-per-cycle may be specified for each channel.
00619      */
00620     uint32_t                            cycleSkipCount;
00621     /*!< Optional number of cycles to skip, such that this channel is included
00622      *   in the sequence in only one of every (cycleSkipCount + 1) cycles that
00623      *   occur.  If set to 0 (default), this channel is included in every cycle;
00624      *   if set to 1, this channel is included in every 2nd cycle; if set to 2,
00625      *   this channel is included in every 3rd cycle, and so on.
00626      */
00627     uint32_t                            extraSettlingTime;
00628     /*!< A minimum settling time is applied internally for each channel, based
00629      *   on the sensor type.  However, additional settling time (milliseconds)
00630      *   can optionally be specified.  Set to 0 if not required.
00631      */
00632     ADMW1001_CHANNEL_PRIORITY            priority;
00633     /*!< By default, channels are arranged in the measurement sequence based on
00634      *   ascending order of channel ID.  However, a priority-level may be
00635      *   specified per channel to force a different ordering of the channels,
00636      *   with higher-priority channels appearing before lower-priority channels.
00637      *   Channels with equal priority are ordered by ascending order of channel
00638      *   ID.  Lower numbers indicate higher priority, with 0 being the highest.
00639      *   Set to 0 if not required.
00640      */
00641     union
00642     {
00643         ADMW1001_ADC_CHANNEL_CONFIG      adcChannelConfig;
00644         /*!< ADC channel configuration - applicable only to ADC channels */
00645         ADMW1001_I2C_CHANNEL_CONFIG      i2cChannelConfig;
00646         /*!< I2C channel configuration - applicable only to I2C channels */
00647     };
00648     /*!< Only one of adcChannelConfig, i2cChannelConfig, spiChannelConfig
00649      *  is required, depending on the channel designation
00650      *   (analog, I2C, SPI)
00651      */
00652 
00653 }   ADMW1001_CHANNEL_CONFIG ;
00654 
00655 /*! ADMW1001 Diagnostics configuration details */
00656 typedef struct
00657 {
00658     bool                                disableGlobalDiag;
00659     /*!< Option to disable the following diagnostic checks on the ADC:
00660      *   - Reference Detection errors
00661      *   - Input under-/over-voltage errors
00662      *   - Calibration, Conversion and Saturation errors
00663      */
00664     bool                                disableMeasurementDiag;
00665     /*!< Option to disable additional checks per measurement channel:
00666      *   - High/low threshold limit violation
00667      */
00668 
00669     bool                                disableCriticalTempAbort;
00670     /*!< Option to disable abort of measurement cycle if the operating
00671      *   temperature of the ADMW1001 has exceeded critical limits
00672      */
00673 
00674     uint8_t    osdFrequency;
00675     /*!< Option to enable Open-Circuit Detection at a selected cycle interval */
00676 
00677 }   ADMW1001_DIAGNOSTICS_CONFIG ;
00678 
00679 
00680 /*! ADMW1001 Device configuration details */
00681 typedef struct
00682 {
00683     ADMW1001_POWER_CONFIG            power;
00684     /*!< Power configuration details */
00685     ADMW1001_MEASUREMENT_CONFIG      measurement;
00686     /*!< Measurement configuration details */
00687     ADMW1001_DIAGNOSTICS_CONFIG      diagnostics;
00688     /*!< FFT configuration details */
00689     ADMW1001_CHANNEL_CONFIG          channels[ADMW1001_MAX_CHANNELS ];
00690     /*!< Channel-specific configuration details */
00691 
00692 }   ADMW1001_CONFIG ;
00693 
00694 #ifdef __cplusplus
00695 }
00696 #endif
00697 
00698 /*!
00699  * @}
00700  */
00701 
00702 #endif /* __ADMW1001_CONFIG_H__ */