ADMW1001_Mbed_FW / Mbed OS EV-PRO-MW1001_Development
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers admw1001_config.h Source File

admw1001_config.h

Go to the documentation of this file.
00001 /*
00002 Copyright 2019 (c) Analog Devices, Inc.
00003 
00004 All rights reserved.
00005 
00006 Redistribution and use in source and binary forms, with or without
00007 modification, are permitted provided that the following conditions are met:
00008   - Redistributions of source code must retain the above copyright
00009     notice, this list of conditions and the following disclaimer.
00010   - Redistributions in binary form must reproduce the above copyright
00011     notice, this list of conditions and the following disclaimer in
00012     the documentation and/or other materials provided with the
00013     distribution.
00014   - Neither the name of Analog Devices, Inc. nor the names of its
00015     contributors may be used to endorse or promote products derived
00016     from this software without specific prior written permission.
00017   - The use of this software may or may not infringe the patent rights
00018     of one or more patent holders. This license does not release you
00019     from the requirement that you obtain separate licenses from these
00020     patent holders to use this software.
00021   - Use of the software either in source or binary form, must be run
00022     on or directly connected to an Analog Devices Inc. component.
00023 
00024 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
00025 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
00026 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00027 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
00028 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00029 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
00030 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00031 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00032 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00033 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00034  */
00035 
00036 /*!
00037  ******************************************************************************
00038  * @file:   admw1001_config.h
00039  * @brief:  Configuration type definitions for ADMW1001.
00040  *-----------------------------------------------------------------------------
00041  */
00042 
00043 #ifndef __ADMW1001_CONFIG_H__
00044 #define __ADMW1001_CONFIG_H__
00045 
00046 #include "admw_platform.h"
00047 #include "admw1001_sensor_types.h"
00048 
00049 /*! @addtogroup ADMW1001_Api
00050  *  @{
00051  */
00052 
00053 #ifdef __cplusplus
00054 extern "C" {
00055 #endif
00056 
00057 /*! Maximum length allowed for a digital sensor command */
00058 #define ADMW1001_SENSOR_COMMAND_MAX_LENGTH 7
00059 
00060 /*! ADMW1001 channel priority options */
00061 typedef enum {
00062     ADMW1001_CHANNEL_PRIORITY_0 = 0,
00063     ADMW1001_CHANNEL_PRIORITY_1,
00064     ADMW1001_CHANNEL_PRIORITY_2,
00065     ADMW1001_CHANNEL_PRIORITY_3,
00066     ADMW1001_CHANNEL_PRIORITY_4,
00067     ADMW1001_CHANNEL_PRIORITY_5,
00068     ADMW1001_CHANNEL_PRIORITY_6,
00069     ADMW1001_CHANNEL_PRIORITY_7,
00070     ADMW1001_CHANNEL_PRIORITY_8,
00071     ADMW1001_CHANNEL_PRIORITY_9,
00072     ADMW1001_CHANNEL_PRIORITY_10,
00073     ADMW1001_CHANNEL_PRIORITY_11,
00074     ADMW1001_CHANNEL_PRIORITY_12,
00075 
00076     ADMW1001_CHANNEL_PRIORITY_HIGHEST = ADMW1001_CHANNEL_PRIORITY_0,
00077     ADMW1001_CHANNEL_PRIORITY_LOWEST  = ADMW1001_CHANNEL_PRIORITY_12,
00078 
00079 }   ADMW1001_CHANNEL_PRIORITY ;
00080 
00081 /*! ADMW1001 operating mode options */
00082 typedef enum {
00083     ADMW1001_OPERATING_MODE_SINGLECYCLE  = 0,
00084     /*!< Executes a single measurement cycle and stops */
00085     ADMW1001_OPERATING_MODE_CONTINUOUS ,
00086     /*!< Continuously executes measurement cycles */
00087 
00088 }   ADMW1001_OPERATING_MODE ;
00089 
00090 /*! ADMW1001 data ready mode options */
00091 typedef enum {
00092     ADMW1001_DATAREADY_PER_CONVERSION  = 0,
00093     /*!< The DATAREADY signal is asserted after completion of each conversion
00094      *   - a single data sample only from the latest completed conversion is
00095      *     stored in this mode
00096      */
00097     ADMW1001_DATAREADY_PER_CYCLE ,
00098     /*!< The DATAREADY signal is asserted after completion of each measurement
00099      *   cycle
00100      *   - data samples only from the lastest completed measurement cycle are
00101      *     stored in this mode
00102      */
00103     ADMW1001_DATAREADY_PER_FIFO_FILL ,
00104     /*!< The DATAREADY signal is asserted after each fill of the data FIFO
00105      *   - applicable only when @ref ADMW1001_OPERATING_MODE_CONTINUOUS or
00106      *     @ref ADMW1001_OPERATING_MODE_MULTICYCLE is also selected
00107      */
00108 
00109 }   ADMW1001_DATAREADY_MODE ;
00110 
00111 /*! ADMW1001 power mode options */
00112 typedef enum {
00113     ADMW1001_POWER_MODE_ACTIVE  = 0,
00114     /*!< Part is fully powered up and either cycling through a sequence or awaiting a configuration */
00115     ADMW1001_POWER_MODE_HIBERNATION ,
00116     /*!< module has entede hibernation mode. All analog circuitry is disabled. All peripherals disabled apart from the Wake-up pin functionality. */
00117 
00118 }   ADMW1001_POWER_MODE ;
00119 
00120 /*! ADMW1001 External Vref Buffer Mode options */
00121 typedef enum {
00122     ADMW1001_VREF_BUFF_MODE_DISABLE_BOTH  = 0,
00123     /*!< Both Vref+ and Vref- buffers to be disabled */
00124     ADMW1001_VREF_BUFF_MODE_ONLY_POS ,
00125     /*!< only Vref+ buffer to be disabled */
00126     ADMW1001_VREF_BUFF_MODE_ONLY_NEG ,
00127     /*!< Only Vref- buffers to be disabled */
00128     ADMW1001_VREF_BUFF_MODE_ENABLE_BOTH ,
00129     /*!< Both Vref+ and Vref- buffers to be Enabled */
00130 }   ADMW1001_VREF_BUFFER_MODE ;
00131 
00132 /*! ADMW1001 measurement unit options
00133  *
00134  *  Optionally select a measurement unit for final conversion results.
00135  *  Currently applicable only to specific temperature sensor types.
00136  */
00137 typedef enum {
00138     ADMW1001_MEASUREMENT_UNIT_UNSPECIFIED  = 0,
00139     /*!< No measurement unit specified */
00140     ADMW1001_MEASUREMENT_UNIT_CELSIUS ,
00141     /*!< Celsius temperature unit - applicable to temperature sensors only */
00142     ADMW1001_MEASUREMENT_UNIT_FAHRENHEIT ,
00143     /*!< Fahrenheit temperature unit - applicable to temperature sensors only */
00144 
00145 }   ADMW1001_MEASUREMENT_UNIT ;
00146 
00147 typedef enum {
00148     ADMW1001_BUFFER_BYPASSS_DISABLED  = 0,
00149     /*!< Buffer Bypass Disabled */
00150     ADMW1001_BUFFER_BYPASSS_ENABLED ,
00151     /*!< Buffer Bypass Enabled */
00152 
00153 }   ADMW1001_BUFFER_BYPASSS ;
00154 
00155 /*! ADMW1001 analog input signal amplification gain options
00156  *
00157  *  @note applicable only to ADC analog sensor channels
00158  */
00159 typedef enum {
00160     ADMW1001_ADC_RTD_CURVE_EUROPEAN  = 0,
00161     /*!< EUROPEAN RTD curve used. */
00162     ADMW1001_ADC_RTD_CURVE_AMERICAN ,
00163     /*!< AMERICAN RTD curve used. */
00164     ADMW1001_ADC_RTD_CURVE_JAPANESE ,
00165     /*!< JAPANESE RTD curve used. */
00166     ADMW1001_ADC_RTD_CURVE_ITS90 ,
00167     /*!< ITS90 RTD curve used. */
00168 
00169 }   ADMW1001_ADC_RTD_CURVE ;
00170 /*! ADMW1001 analog input signal amplification gain options
00171  *
00172  *  @note applicable only to ADC analog sensor channels
00173  */
00174 typedef enum {
00175     ADMW1001_ADC_GAIN_1X  = 0,
00176     /*!< no amplification gain */
00177     ADMW1001_ADC_GAIN_2X ,
00178     /*!< x2 amplification gain */
00179     ADMW1001_ADC_GAIN_4X ,
00180     /*!< x4 amplification gain */
00181     ADMW1001_ADC_GAIN_8X ,
00182     /*!< x8 amplification gain */
00183     ADMW1001_ADC_GAIN_16X ,
00184     /*!< x16 amplification gain */
00185     ADMW1001_ADC_GAIN_32X ,
00186     /*!< x32 amplification gain */
00187     ADMW1001_ADC_GAIN_64X ,
00188     /*!< x64 amplification gain */
00189 
00190 }   ADMW1001_ADC_GAIN ;
00191 
00192 /*! ADMW1001 analog sensor excitation state options
00193  *
00194  *  @note applicable only to ADC analog sensor channels, and
00195  *        specific sensor types
00196  */
00197 typedef enum {
00198     ADMW1001_ADC_EXC_STATE_CYCLE_POWER  = 0,
00199     /*!< Excitation for measurement is active only during measurement */
00200     ADMW1001_ADC_EXC_STATE_ALWAYS_ON ,
00201     /*!< Excitation for measurement is always on */
00202 
00203 }   ADMW1001_ADC_EXC_STATE ;
00204 
00205 /*! ADMW1001 analog sensor excitation current output level options
00206  *
00207  *  @note applicable only to ADC analog sensor channels, and
00208  *        specific sensor types
00209  */
00210 typedef enum {
00211     ADMW1001_ADC_NO_EXTERNAL_EXC_CURRENT  = -1,
00212     /*!< NO External excitation is provided */
00213     ADMW1001_ADC_EXC_CURRENT_EXTERNAL  = 0,
00214     /*!< External excitation is provided */
00215     ADMW1001_ADC_EXC_CURRENT_50uA ,
00216     /*!< 50uA excitation current enabled */
00217     ADMW1001_ADC_EXC_CURRENT_100uA ,
00218     /*!< 100uA excitation current  */
00219     ADMW1001_ADC_EXC_CURRENT_250uA ,
00220     /*!< 250uA excitation current enabled */
00221     ADMW1001_ADC_EXC_CURRENT_500uA ,
00222     /*!< 500uA excitation current enabled */
00223     ADMW1001_ADC_EXC_CURRENT_1000uA ,
00224     /*!< 1mA excitation current enabled */
00225 
00226 }   ADMW1001_ADC_EXC_CURRENT ;
00227 
00228 /*! ADMW1001 analog sensor excitation current ratios used for diode sensor
00229  *
00230  *  @note applicable only to a diode sensor
00231  */
00232 typedef enum {
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     ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL  = 0,
00259     /*!< Internal VRef - 1.2V */
00260     ADMW1001_ADC_REFERENCE_VOLTAGE_EXTERNAL_1  = 1,
00261     /*!< External reference voltage #1 */
00262     ADMW1001_ADC_REFERENCE_VOLTAGE_AVDD  = 3,
00263     /*!< Analog Supply Voltage AVDD reference (typically 3.3V) is selected */
00264 
00265 }   ADMW1001_ADC_REFERENCE_TYPE ;
00266 
00267 /*! ADMW1001 ADC Reference configuration
00268  *
00269  *  @note applicable only to ADC analog sensor channels
00270  */
00271 typedef enum {
00272     ADMW1001_ADC_GND_SW_OPEN  = 0,
00273     /*!< Ground switch not enabled for measurement. */
00274     ADMW1001_ADC_GND_SW_CLOSED ,
00275     /*!< Ground switch enabled for measurement. */
00276 
00277 }   ADMW1001_ADC_GND_SW ;
00278 
00279 /*! ADMW1001 analog filter chop mode
00280  *
00281  *  @note applicable only to ADC analog sensor channels
00282  */
00283 typedef enum {
00284     ADMW1001_DISABLE_CHOP  = 0,
00285     /*!< chop performed. */
00286     ADMW1001_ENABLE_CHOP,
00287 
00288 }   ADMW1001_CHOP_MD ;
00289 
00290 /*! ADMW1001 analog filter selection options
00291  *
00292  *  @note applicable only to ADC analog sensor channels
00293  */
00294 typedef enum {
00295     ADMW1001_ADC_FILTER_SINC4  = 0,
00296     /*!< SINC4 - 4th order sinc response filter */
00297     ADMW1001_ADC_FILTER_SINC3 ,
00298     /*!< SINC3 - 3rd order sinc response filter */
00299 
00300 }   ADMW1001_ADC_FILTER_TYPE ;
00301 
00302 /*! ADMW1001 Sinc Filter range (SF)
00303  *
00304  *  @note applicable only to ADC analog sensor channels
00305  *  @note SF must be set in conjunction with chop mode
00306  *  and sinc filter type to achieve the desired sampling rate.
00307  */
00308 typedef enum {
00309     ADMW1001_SF_7   = 7,
00310     /*!< SF setting for fastest sampling rate, enable SINC4 filter. */
00311     ADMW1001_SF_31    = 31,
00312     /*!< SF setting for medium speed mode, enable SINC3 Filter. */
00313     ADMW1001_SF_51  = 51,
00314     /*!< SF setting for medium speed mode, enable SINC3 Filter. */
00315     ADMW1001_SF_124    = 124,
00316     /*!< SF setting for 60Hz rejection. */
00317     ADMW1001_SF_125  = 125,
00318     /*!< SF setting for 50Hz and 60Hz rejection when notch1p2 is enabled. Enable SINC3 Filter. */
00319     ADMW1001_SF_127     = 127,
00320     /*!< SF setting for Lowest noise, enable SINC3 Filter. */
00321 
00322 }   ADMW1001_SINC_FILTER_RANGE ;
00323 
00324 
00325 /*! ADMW1001 I2C clock speed options
00326  *
00327  *  @note applicable only for I2C sensors
00328  */
00329 typedef enum {
00330     ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED_100K  = 0,
00331     /*!< 100kHz I2C clock speed */
00332     ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED_400K ,
00333     /*!< 400kHz I2C clock speed */
00334 
00335 }   ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED ;
00336 
00337 
00338 /*! ADMW1001 Power Configuration options */
00339 typedef struct {
00340     ADMW1001_POWER_MODE         powerMode;
00341     /*!< Power mode selection */
00342 
00343 }   ADMW1001_POWER_CONFIG ;
00344 
00345 /*! ADMW1001 Multi-Cycle Configuration options
00346  *
00347  * @note required only when ADMW1001_OPERATING_MODE_MULTICYCLE is selected
00348  *       as the operatingMode (@ref ADMW1001_MEASUREMENT_CONFIG)
00349  */
00350 typedef struct {
00351     uint32_t    cyclesPerBurst;
00352     /*!< Number of cycles to complete for a single burst */
00353     uint32_t    burstInterval;
00354     /*!< Interval, in seconds, between each successive burst of cycles */
00355 
00356 }   ADMW1001_MULTICYCLE_CONFIG ;
00357 
00358 /*! ADMW1001 Measurement Configuration options */
00359 typedef struct {
00360     ADMW1001_OPERATING_MODE     operatingMode;
00361     /*!< Operating mode - specifies how measurement cycles are scheduled */
00362     ADMW1001_DATAREADY_MODE     dataReadyMode;
00363     /*!< Data read mode - specifies how output samples are stored for reading */
00364     uint8_t                      excitationState;
00365     /*!< Excitation current state */
00366     uint8_t                         groundSwitch;
00367     /*!< Option to open or close sensor ground switch */
00368     uint8_t                     fifoNumCycles;
00369     /*!< Specifies the number of cycles to fill a FIFO buffer
00370      *   Applicable only when operatingMode is ADMW1001_OPERATING_MODE_CONTINUOUS
00371      */
00372     uint32_t                    cycleInterval;
00373     /*!< Cycle interval - specifies the time interval between the start of each
00374      *   successive measurement cycle.  Applicable only when operatingMode is
00375      *   not ADMW1001_OPERATING_MODE_SINGLECYCLE
00376      */
00377     bool                        vBiasEnable;
00378     /*!< Enable voltage Bias output of ADC
00379      */
00380     float32_t                   externalRef1Value;
00381     /*!< Voltage value connected to external reference input #1.
00382      *   Applicable only if the selected reference type is
00383      *   voltage.
00384      *   (see @ref ADMW1001_ADC_REFERENCE_TYPE)
00385      */
00386     float32_t                   RSenseValue;
00387     /*!< Sense resistor value in Ohms. */
00388     float32_t                   externalRefVoltage;
00389     /*!< External Reference Voltage.
00390      */
00391     float32_t                   AVDDVoltage;
00392     /*!< AVDD Voltage.
00393      */
00394     uint8_t                     extVrefBuffMode;
00395     /*!< External Vref Buff mode.
00396     uint32_t                    reserved1[3];
00397     /*!< Reserved for future use and ensure word alignment.
00398     */
00399 
00400 }   ADMW1001_MEASUREMENT_CONFIG;
00401 
00402 /*! ADMW1001 ADC Excitation Current output configuration
00403  *
00404  *  @note applicable only to ADC analog sensor channels, and
00405  *        specific sensor types
00406  */
00407 typedef struct {
00408     ADMW1001_ADC_EXC_CURRENT              outputLevel;
00409     /*!< Excitation current output level */
00410     ADMW1001_ADC_EXC_CURRENT_DIODE_RATIO  diodeRatio;
00411     /*!< Excitation current output diode ratio */
00412     float32_t                             idealityRatio;
00413 
00414 }   ADMW1001_ADC_EXC_CURRENT_CONFIG;
00415 
00416 /*! ADMW1001 ADC Filter configuration
00417  *
00418  *  @note applicable only to ADC analog sensor channels
00419  */
00420 typedef struct {
00421     ADMW1001_ADC_FILTER_TYPE    type;
00422     /*!< Filter type selection */
00423     ADMW1001_SINC_FILTER_RANGE  sf;
00424     /*!< SF value used along with filter type and chop mode to determine speed */
00425     ADMW1001_CHOP_MD            chopMode;
00426     /*!< Enable filter chop */
00427     bool                        notch1p2;
00428     /*!< Enable Notch 2 Filter Mode */
00429 
00430 }   ADMW1001_ADC_FILTER_CONFIG;
00431 
00432 /*! ADMW1001 ADC analog channel configuration details
00433  *
00434  *  @note applicable only to ADC analog sensor channels
00435  */
00436 typedef struct {
00437     ADMW1001_ADC_SENSOR_TYPE        sensor;
00438     /*!< Sensor type selection */
00439     ADMW1001_ADC_RTD_CURVE          rtdCurve;
00440     /*!< Rtd curve selection */
00441     ADMW1001_ADC_GAIN               gain;
00442     /*!< ADC Gain selection */
00443     ADMW1001_ADC_EXC_CURRENT_CONFIG current;
00444     /*!< ADC Excitation Current configuration */
00445     ADMW1001_ADC_FILTER_CONFIG      filter;
00446     /*!< ADC Filter configuration */
00447     ADMW1001_ADC_REFERENCE_TYPE     reference;
00448     /*!< ADC Reference configuration */
00449     uint8_t                         bufferBypass;
00450     /*!< Buffer Bypass configuration */
00451     uint8_t                         reserved0[2];
00452     /*!< Reserved for future use and ensure word alignment. */
00453     uint32_t                        reserved1[6];
00454     /*!< Reserved for future use and ensure word alignment. */
00455 
00456 }   ADMW1001_ADC_CHANNEL_CONFIG;
00457 
00458 /*! ADMW1001 look-up table selection
00459  *  Select table used to linearise the measurement.
00460  */
00461 typedef enum {
00462     ADMW1001_LUT_DEFAULT  = 0,
00463     /*!< Default LUT */
00464     ADMW1001_LUT_CUSTOM   = 1,
00465     /*!< User defined custom LUT */
00466     ADMW1001_LUT_RESERVED = 2,
00467     /*!< Reserved for future use */
00468 
00469 }   ADMW1001_LUT_SELECT;
00470 
00471 /*! ADMW1001 digital sensor data encoding
00472  *
00473  *  @note applicable only to SPI and I2C digital sensor channels
00474  */
00475 typedef enum {
00476     ADMW1001_DIGITAL_SENSOR_DATA_CODING_NONE = 0,
00477     /**< None/Invalid - data format is ignored if coding is set to this value */
00478     ADMW1001_DIGITAL_SENSOR_DATA_CODING_UNIPOLAR,
00479     /**< Unipolar - unsigned integer values */
00480     ADMW1001_DIGITAL_SENSOR_DATA_CODING_TWOS_COMPLEMENT,
00481     /**< Twos-complement - signed integer values */
00482     ADMW1001_DIGITAL_SENSOR_DATA_CODING_OFFSET_BINARY,
00483     /**< Offset Binary - used to represent signed values with unsigned integers,
00484      *   with the mid-range value representing 0 */
00485 
00486 }   ADMW1001_DIGITAL_SENSOR_DATA_CODING;
00487 
00488 /*! ADMW1001 digital sensor data format configuration
00489  *
00490  *  @note applicable only to SPI and I2C digital sensor channels
00491  */
00492 typedef struct {
00493     ADMW1001_DIGITAL_SENSOR_DATA_CODING coding;
00494     /**< Data Encoding of Sensor Result */
00495     bool littleEndian;
00496     /**< Set as true if data format is little-endian, false otherwise */
00497     bool leftJustified;
00498     /**< Set as true if data is left-justified in the data frame, false otherwise */
00499     uint8_t frameLength;
00500     /**< Data frame length (number of bytes to read from the sensor) */
00501     uint8_t numDataBits;
00502     /**< Number of relevant data bits to extract from the data frame */
00503     uint8_t bitOffset;
00504     /**< Data bit offset, relative to data alignment within the data frame */
00505     uint8_t reserved[2];
00506     /*!< Reserved for future use and ensure word alignment. */
00507 
00508 }   ADMW1001_DIGITAL_SENSOR_DATA_FORMAT;
00509 
00510 
00511 /*! ADMW1001 digital sensor communication config
00512  *
00513  *  @note applicable only to digital sensor channels
00514  */
00515 typedef struct {
00516     bool                                            useCustomCommsConfig;
00517     /*!< Optional parameter to enable user digital communication settings */
00518     ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED   i2cClockSpeed;
00519     /*!< Optional parameter to configure specific i2c speed for i2c sensor */
00520 
00521 }   ADMW1001_DIGITAL_SENSOR_COMMS;
00522 
00523 /*! ADMW1001 I2C digital channel configuration details
00524  *
00525  *  @note applicable only to I2C digital sensor channels
00526  */
00527 typedef struct {
00528     ADMW1001_I2C_SENSOR_TYPE                sensor;
00529     /*!< Sensor type selection */
00530     uint8_t                                 deviceAddress;
00531     /*!< I2C device address (7-bit) */
00532     uint8_t                                 reserved;
00533     /*!< Reserved for future use and ensure word alignment. */
00534     ADMW1001_DIGITAL_SENSOR_DATA_FORMAT     dataFormat;
00535     /*!< Optional data format configuration to parse/extract data from the device.
00536      *   A default data format will be used if this is not specified.
00537      *   Applicable only to specific I2C sensor types
00538      */
00539     ADMW1001_DIGITAL_SENSOR_COMMS           configureComms;
00540     /*!< Optional configuration to setup a user communication config.
00541      *   A default configuration  will be used if this is not specified.
00542      *   Applicable only to specific I2C sensor types.
00543      */
00544 
00545 }   ADMW1001_I2C_CHANNEL_CONFIG;
00546 
00547 
00548 /*! ADMW1001 Measurement Channel configuration details */
00549 typedef struct {
00550     bool                                enableChannel;
00551     /*!< Option to include this channel in normal measurement cycles */
00552     bool                                disablePublishing;
00553     /*!< Option to disable publishing of data samples from this channel.  The
00554      *   channel may still be included in measurement cycles, but data samples
00555      *   obtained from this channel will not be published.  This is typically
00556      *   used for channels which are required only as a compensation reference
00557      *   for another channel (e.g. Cold-Junction Compensation channels).
00558      */
00559     ADMW1001_CH_ID                      compensationChannel;
00560     /*!< Optional compensation channel.  Set to ADMW1001_CH_ID_NONE if not
00561      *   required.  Typically used for thermocouple sensors that require a
00562      *   separate measurement of the "cold-junction" temperature, which can be
00563      *   be provided by an RTD temperature sensor connected on a separate
00564      *   "compensation channel" */
00565     ADMW1001_LUT_SELECT                 lutSelect;
00566     /*!<Select Look Up Table LUT for calculations, this implies that the
00567      * fundamental measurement for the sensor (typically mV or Ohms)
00568      * 0 = default, 1= unity, 2 = custom
00569      */
00570     ADMW1001_MEASUREMENT_UNIT           measurementUnit;
00571     /*!< Optional measurement unit selection for conversion results.  Applicable
00572      *   only for certain sensor types.  Set to
00573      *   ADMW1001_MEASUREMENT_UNIT_DEFAULT if not applicable.
00574      */
00575     float32_t                           lowThreshold;
00576     /*!< Optional minimum threshold value for each processed sample, to be
00577      *   checked prior to publishing.  A channel ALERT condition is raised
00578      *   if the processed value is lower than this threshold.  Set to NaN
00579      *   if not required.
00580      */
00581     float32_t                           highThreshold;
00582     /*!< Optional maximum threshold value for each processed sample, to be
00583      *   checked prior to publishing.  A channel ALERT condition is raised
00584      *   if the processed value is higher than this threshold.  Set to NaN
00585      *   if not required.
00586      */
00587     float32_t                           offsetAdjustment;
00588     /*!< Optional offset adjustment value applied to each processed sample.
00589      *   Set to NaN or 0.0 if not required.
00590      */
00591     float32_t                           gainAdjustment;
00592     /*!< Optional gain adjustment value applied to each processed sample.
00593      *   Set to NaN or 1.0 if not required.
00594      */
00595     float32_t                           sensorParameter;
00596     /*!< Optional sensor parameter adjustment.
00597      *   Set to NaN or 0 if not required.
00598      */
00599     uint32_t                            measurementsPerCycle;
00600     /*!< The number of measurements to obtain from this channel within each
00601      *   cycle.  Each enabled channel is measured in turn, until the number of
00602      *   measurements requested for the channel has been reached.  A different
00603      *   number of measurements-per-cycle may be specified for each channel.
00604      */
00605     uint32_t                            cycleSkipCount;
00606     /*!< Optional number of cycles to skip, such that this channel is included
00607      *   in the sequence in only one of every (cycleSkipCount + 1) cycles that
00608      *   occur.  If set to 0 (default), this channel is included in every cycle;
00609      *   if set to 1, this channel is included in every 2nd cycle; if set to 2,
00610      *   this channel is included in every 3rd cycle, and so on.
00611      */
00612     uint32_t                            extraSettlingTime;
00613     /*!< A minimum settling time is applied internally for each channel, based
00614      *   on the sensor type.  However, additional settling time (milliseconds)
00615      *   can optionally be specified.  Set to 0 if not required.
00616      */
00617     ADMW1001_CHANNEL_PRIORITY           priority;
00618     /*!< By default, channels are arranged in the measurement sequence based on
00619      *   ascending order of channel ID.  However, a priority-level may be
00620      *   specified per channel to force a different ordering of the channels,
00621      *   with higher-priority channels appearing before lower-priority channels.
00622      *   Channels with equal priority are ordered by ascending order of channel
00623      *   ID.  Lower numbers indicate higher priority, with 0 being the highest.
00624      *   Set to 0 if not required.
00625      */
00626     union {
00627         ADMW1001_ADC_CHANNEL_CONFIG     adcChannelConfig;
00628         /*!< ADC channel configuration - applicable only to ADC channels */
00629         ADMW1001_I2C_CHANNEL_CONFIG     i2cChannelConfig;
00630         /*!< I2C channel configuration - applicable only to I2C channels */
00631     };
00632     /*!< Only one of adcChannelConfig, i2cChannelConfig, spiChannelConfig
00633      *  is required, depending on the channel designation
00634      *   (analog, I2C, SPI)
00635      */
00636 
00637 }   ADMW1001_CHANNEL_CONFIG;
00638 
00639 /*! ADMW1001 Diagnostics configuration details */
00640 typedef struct {
00641     bool                                disableGlobalDiag;
00642     /*!< Option to disable the following diagnostic checks on the ADC:
00643      *   - Reference Detection errors
00644      *   - Input under-/over-voltage errors
00645      *   - Calibration, Conversion and Saturation errors
00646      */
00647     bool                                disableMeasurementDiag;
00648     /*!< Option to disable additional checks per measurement channel:
00649      *   - High/low threshold limit violation
00650      */
00651 
00652     bool                                disableCriticalTempAbort;
00653     /*!< Option to disable abort of measurement cycle if the operating
00654      *   temperature of the ADMW1001 has exceeded critical limits
00655      */
00656 
00657     uint8_t    osdFrequency;
00658     /*!< Option to enable Open-Circuit Detection at a selected cycle interval */
00659 
00660 }   ADMW1001_DIAGNOSTICS_CONFIG;
00661 
00662 
00663 /*! ADMW1001 Device configuration details */
00664 typedef struct {
00665     ADMW1001_POWER_CONFIG           power;
00666     /*!< Power configuration details */
00667     ADMW1001_MEASUREMENT_CONFIG     measurement;
00668     /*!< Measurement configuration details */
00669     ADMW1001_DIAGNOSTICS_CONFIG     diagnostics;
00670     /*!< FFT configuration details */
00671     ADMW1001_CHANNEL_CONFIG         channels[ADMW1001_MAX_CHANNELS];
00672     /*!< Channel-specific configuration details */
00673 
00674 }   ADMW1001_CONFIG;
00675 
00676 #ifdef __cplusplus
00677 }
00678 #endif
00679 
00680 /*!
00681  * @}
00682  */
00683 
00684 #endif /* __ADMW1001_CONFIG_H__ */