Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 34:b60ee1e0af2b, committed 2019-11-19
- Comitter:
- Vkadaba
- Date:
- Tue Nov 19 11:17:35 2019 +0000
- Parent:
- 33:df7a00f1b8e1
- Child:
- 35:cf6a5a005a58
- Commit message:
- External Voltage Reference support
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bridge_4w_load_cell_config.c Tue Nov 19 11:17:35 2019 +0000 @@ -0,0 +1,95 @@ +/* +Copyright 2019 (c) Analog Devices, Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + - Neither the name of Analog Devices, Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + - The use of this software may or may not infringe the patent rights + of one or more patent holders. This license does not release you + from the requirement that you obtain separate licenses from these + patent holders to use this software. + - Use of the software either in source or binary form, must be run + on or directly connected to an Analog Devices Inc. component. + +THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *****************************************************************************/ + +/*! + ****************************************************************************** + * @file: + * @brief: + *----------------------------------------------------------------------------- + */ +#include "inc/admw_config_types.h" + +ADMW_CONFIG bridge_4w_load_cell_config= { + .versionId = { .major = 2, .minor = 0 }, + .productId = ADMW_PRODUCT_ID_ADMW1001, + .admw1001 = { + .power = { + .powerMode = ADMW1001_POWER_MODE_ACTIVE, + }, + .measurement = { + .operatingMode = ADMW1001_OPERATING_MODE_CONTINUOUS, + .dataReadyMode = ADMW1001_DATAREADY_PER_CYCLE, // FIX: Temporarily all values from json are hardcoded to this one in the Contracts.FileGenerator - > file translations!! + .cycleInterval = 0, + .RSenseValue = 1000.0, + }, + .diagnostics = { + .disableGlobalDiag = true, + .disableMeasurementDiag = true, + .osdFrequency = ADMW1001_OPEN_SENSOR_DIAGNOSTICS_DISABLED, + }, + .channels = { + [ADMW1001_CH_ID_ANLG_1_UNIVERSAL] = { + .enableChannel = true, + .disablePublishing = false, + .compensationChannel = ADMW1001_CH_ID_NONE, + .lutSelect = ADMW1001_LUT_DEFAULT, + .measurementUnit = ADMW1001_MEASUREMENT_UNIT_UNSPECIFIED, + .lowThreshold = 0, + .highThreshold = 45359.2, + .offsetAdjustment = 0.0, + .gainAdjustment = 0.0, + .sensorParameter = 0.0, + .measurementsPerCycle = 1, + .cycleSkipCount = 0, + .extraSettlingTime = 4499.99986449257, + .priority = 0, + .adcChannelConfig = { + .sensor = ADMW1001_ADC_SENSOR_BRIDGE_4WIRE_1, + .gain = ADMW1001_ADC_GAIN_32X, + .filter = { + .type = ADMW1001_ADC_FILTER_SINC3, + .sf = ADMW1001_SF_8P24HZ, + .chopMode = ADMW1001_CHOP_MD_SW, + .notch1p2 = true, + .groundSwitch = ADMW1001_ADC_GND_SW_CLOSED + }, + .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_AVDD, + .bufferBypass = ADMW1001_BUFFER_BYPASSS_DISABLED, + }, + }, + }, + }, +};
--- a/config.c Thu Nov 14 05:35:08 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,274 +0,0 @@ -/*! - - ****************************************************************************** - - * @file: config.c - - * @brief: - - *----------------------------------------------------------------------------- - - * - -Copyright (c) 2019 Analog Devices, Inc. - - - -All rights reserved. - - - -Redistribution and use in source and binary forms, with or without modification, - -are permitted provided that the following conditions are met: - - - Redistributions of source code must retain the above copyright notice, - - this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright notice, - - this list of conditions and the following disclaimer in the documentation - - and/or other materials provided with the distribution. - - - Modified versions of the software must be conspicuously marked as such. - - - This software is licensed solely and exclusively for use with processors - - manufactured by or for Analog Devices, Inc. - - - This software may not be combined or merged with other code in any manner - - that would cause the software to become subject to terms and conditions - - which differ from those listed here. - - - Neither the name of Analog Devices, Inc. nor the names of its - - contributors may be used to endorse or promote products derived - - from this software without specific prior written permission. - - - The use of this software may or may not infringe the patent rights of one - - or more patent holders. This license does not release you from the - - requirement that you obtain separate licenses from these patent holders - - to use this software. - - - -THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS" AND ANY - -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, - -TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - -NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR CONSEQUENTIAL DAMAGES - -(INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF CLAIMS OF INTELLECTUAL - -PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - -EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - * - - *****************************************************************************/ - - - -#include "inc/admw_config_types.h" - - - -ADMW_CONFIG config= { - - .versionId = { .major = 2, .minor = 0 }, - - .productId = ADMW_PRODUCT_ID_ADMW1001, - - .admw1001 = { - - .power = { - - .powerMode = ADMW1001_POWER_MODE_ACTIVE, - - }, - - .measurement = { - - .operatingMode = ADMW1001_OPERATING_MODE_CONTINUOUS, - - .dataReadyMode = ADMW1001_DATAREADY_PER_CYCLE, // FIX: Temporarily all values from json are hardcoded to this one in the Contracts.FileGenerator - > file translations!! - - .cycleInterval = 0, - - .vBiasEnable = true, - - }, - - .diagnostics = { - - .disableGlobalDiag = true, - - .disableMeasurementDiag = true, - - .osdFrequency = ADMW1001_OPEN_SENSOR_DIAGNOSTICS_DISABLED, - - }, - - .channels = { - - [ADMW1001_CH_ID_ANLG_1_UNIVERSAL] = { - - .enableChannel = true, - - .disablePublishing = false, - - .compensationChannel = ADMW1001_CH_ID_NONE, - - .lutSelect = ADMW1001_LUT_DEFAULT, - - .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS, - - .lowThreshold = -50, - - .highThreshold = 250, - - .offsetAdjustment = 0.0, - - .gainAdjustment = 0.0, - - .sensorParameter = 0.0, - - .measurementsPerCycle = 1, - - .cycleSkipCount = 0, - - .extraSettlingTime = 0, - - .priority = 0, - - .adcChannelConfig = { - - .sensor = ADMW1001_ADC_SENSOR_RTD_2WIRE_PT100, - - .rtdCurve = ADMW1001_ADC_RTD_CURVE_EUROPEAN, - - .gain = ADMW1001_ADC_GAIN_2X, - - .current = { - - .excitationState= ADMW1001_ADC_EXC_STATE_ALWAYS_ON, - - .outputLevel = ADMW1001_ADC_EXC_CURRENT_250uA, - - .diodeRatio = 0, - - }, - - .filter = { - - .type = ADMW1001_ADC_FILTER_SINC3, - - .sf = ADMW1001_SF_8P24HZ, - - .chopMode = ADMW1001_CHOP_MD_SW, - - .notch1p2 = false, - - .groundSwitch = ADMW1001_ADC_GND_SW_OPEN - - }, - - .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL, - - }, - - }, - - [ADMW1001_CH_ID_ANLG_1_DIFFERENTIAL] = { - - .enableChannel = true, - - .disablePublishing = false, - - .compensationChannel = ADMW1001_CH_ID_ANLG_1_UNIVERSAL, - - .lutSelect = ADMW1001_LUT_DEFAULT, - - .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS, - - .lowThreshold = -50, - - .highThreshold = 250, - - .offsetAdjustment = 0.0, - - .gainAdjustment = 0.0, - - .sensorParameter = 0.0, - - .measurementsPerCycle = 1, - - .cycleSkipCount = 0, - - .extraSettlingTime = 4499.99986449257, - - .priority = 0, - - .adcChannelConfig = { - - .sensor = ADMW1001_ADC_SENSOR_THERMOCOUPLE_K, - - .rtdCurve = ADMW1001_ADC_RTD_CURVE_EUROPEAN, - - .gain = 8, - - .current = { - - .excitationState= ADMW1001_ADC_EXC_STATE_CYCLE_POWER, - - .outputLevel = ADMW1001_ADC_EXC_CURRENT_EXTERNAL, - - .diodeRatio = 0, - - }, - - .filter = { - - .type = ADMW1001_ADC_FILTER_SINC3, - - .sf = ADMW1001_SF_8P24HZ, - - .chopMode = ADMW1001_CHOP_MD_SW, - - .notch1p2 = false, - - .groundSwitch = ADMW1001_ADC_GND_SW_OPEN - - }, - - .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL, - - }, - - }, - - }, - - }, - -}; -
--- a/inc/admw1001/admw1001_config.h Thu Nov 14 05:35:08 2019 +0000 +++ b/inc/admw1001/admw1001_config.h Tue Nov 19 11:17:35 2019 +0000 @@ -58,8 +58,7 @@ #define ADMW1001_SENSOR_COMMAND_MAX_LENGTH 7 /*! ADMW1001 channel priority options */ -typedef enum -{ +typedef enum { ADMW1001_CHANNEL_PRIORITY_0 = 0, ADMW1001_CHANNEL_PRIORITY_1, ADMW1001_CHANNEL_PRIORITY_2, @@ -80,8 +79,7 @@ } ADMW1001_CHANNEL_PRIORITY; /*! ADMW1001 operating mode options */ -typedef enum -{ +typedef enum { ADMW1001_OPERATING_MODE_SINGLECYCLE = 0, /*!< Executes a single measurement cycle and stops */ ADMW1001_OPERATING_MODE_CONTINUOUS, @@ -92,8 +90,7 @@ } ADMW1001_OPERATING_MODE; /*! ADMW1001 data ready mode options */ -typedef enum -{ +typedef enum { ADMW1001_DATAREADY_PER_CONVERSION = 0, /*!< The DATAREADY signal is asserted after completion of each conversion * - a single data sample only from the latest completed conversion is @@ -114,8 +111,7 @@ } ADMW1001_DATAREADY_MODE; /*! ADMW1001 power mode options */ -typedef enum -{ +typedef enum { ADMW1001_POWER_MODE_HIBERNATION = 0, /*!< module has entede hibernation mode. All analog circuitry is disabled. All peripherals disabled apart from the Wake-up pin functionality. */ ADMW1001_POWER_MODE_ACTIVE, @@ -124,8 +120,7 @@ } ADMW1001_POWER_MODE; /*! ADMW1001 measurement analog filter settling options */ -typedef enum -{ +typedef enum { ADMW1001_FILTER_SETTLING_ALWAYS = 0, /*!< Allow full settling time to elapse between every measurement from an analog sensor */ ADMW1001_FILTER_SETTLING_FAST, @@ -138,8 +133,7 @@ * Optionally select a measurement unit for final conversion results. * Currently applicable only to specific temperature sensor types. */ -typedef enum -{ +typedef enum { ADMW1001_MEASUREMENT_UNIT_UNSPECIFIED = 0, /*!< No measurement unit specified */ ADMW1001_MEASUREMENT_UNIT_CELSIUS, @@ -159,8 +153,7 @@ * @note Open-sensor diagnostic checks, when performed, will add a delay to the * start of the next measurement cycle. */ -typedef enum -{ +typedef enum { ADMW1001_OPEN_SENSOR_DIAGNOSTICS_DISABLED = 0, /*!< No Open-Sensor Detection is performed */ ADMW1001_OPEN_SENSOR_DIAGNOSTICS_PER_CYCLE, @@ -173,21 +166,19 @@ } ADMW1001_OPEN_SENSOR_DIAGNOSTICS; -typedef enum -{ +typedef enum { ADMW1001_BUFFER_BYPASSS_DISABLED = 0, /*!< Buffer Bypass Disabled */ ADMW1001_BUFFER_BYPASSS_ENABLED, /*!< Buffer Bypass Enabled */ - + } ADMW1001_BUFFER_BYPASSS; /*! ADMW1001 analog input signal amplification gain options * * @note applicable only to ADC analog sensor channels */ -typedef enum -{ +typedef enum { ADMW1001_ADC_RTD_CURVE_EUROPEAN = 0, /*!< EUROPEAN RTD curve used. */ ADMW1001_ADC_RTD_CURVE_AMERICAN, @@ -202,8 +193,7 @@ * * @note applicable only to ADC analog sensor channels */ -typedef enum -{ +typedef enum { ADMW1001_ADC_GAIN_1X = 0, /*!< no amplification gain */ ADMW1001_ADC_GAIN_2X, @@ -228,8 +218,7 @@ * @note applicable only to ADC analog sensor channels, and * specific sensor types */ -typedef enum -{ +typedef enum { ADMW1001_ADC_EXC_STATE_CYCLE_POWER=0, /*!< Excitation for measurement is active only during measurement */ ADMW1001_ADC_EXC_STATE_ALWAYS_ON, @@ -241,12 +230,11 @@ * @note applicable only to ADC analog sensor channels, and * specific sensor types */ -typedef enum -{ +typedef enum { ADMW1001_ADC_NO_EXTERNAL_EXC_CURRENT = -1, - /*!< NO External excitation is provided */ + /*!< NO External excitation is provided */ ADMW1001_ADC_EXC_CURRENT_EXTERNAL = 0, - /*!< External excitation is provided */ + /*!< External excitation is provided */ ADMW1001_ADC_EXC_CURRENT_50uA, /*!< 50uA excitation current enabled */ ADMW1001_ADC_EXC_CURRENT_100uA, @@ -264,21 +252,20 @@ * * @note applicable only to a diode sensor */ -typedef enum -{ - ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_10UA_100UA = 0, +typedef enum { + ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_10UA_100UA = 0, /**< 2 Current measurement 10uA 100uA */ - ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_20UA_160UA, + ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_20UA_160UA, /**< 2 Current measurement 20uA 160uA */ - ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_50UA_300UA, + ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_50UA_300UA, /**< 2 Current measurement 50uA 300uA */ - ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_100UA_600UA, + ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_100UA_600UA, /**< 2 Current measurement 100uA 600uA */ - ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_10UA_50UA_100UA, + ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_10UA_50UA_100UA, /**< 3 current measuremetn 10uA 50uA 100uA */ - ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_20UA_100UA_160UA, + ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_20UA_100UA_160UA, /**< 3 current measuremetn 20uA 100uA 160uA */ - ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_50UA_150UA_300UA, + ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_50UA_150UA_300UA, /**< 3 current measuremetn 50uA 150uA 300uA */ ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_100UA_300UA_600UA, /**< 3 current measuremetn 100uA 300uA 600uA */ @@ -290,8 +277,7 @@ * @note applicable only to ADC analog sensor channels, and * specific sensor types */ -typedef enum -{ +typedef enum { ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL = 0, /*!< Internal VRef - 1.2V */ ADMW1001_ADC_REFERENCE_VOLTAGE_EXTERNAL_1, @@ -307,8 +293,7 @@ * * @note applicable only to ADC analog sensor channels */ -typedef enum -{ +typedef enum { ADMW1001_ADC_GND_SW_OPEN = 0, /*!< Ground switch not enabled for measurement. */ ADMW1001_ADC_GND_SW_CLOSED, @@ -320,8 +305,7 @@ * * @note applicable only to ADC analog sensor channels */ -typedef enum -{ +typedef enum { ADMW1001_CHOP_MD_NONE = 0, /*!< No chop performed. */ ADMW1001_CHOP_MD_HW, @@ -330,15 +314,14 @@ /*!< Software only chop performed. */ ADMW1001_CHOP_MD_HWSW, /*!< Hardware and software chop performed. */ - + } ADMW1001_CHOP_MD; /*! ADMW1001 analog filter selection options * * @note applicable only to ADC analog sensor channels */ -typedef enum -{ +typedef enum { ADMW1001_ADC_FILTER_SINC4 = 0, /*!< SINC4 - 4th order sinc response filter */ ADMW1001_ADC_FILTER_SINC3, @@ -349,11 +332,10 @@ /*! ADMW1001 Sinc Filter range (SF) * * @note applicable only to ADC analog sensor channels - * @note SF must be set in conjunction with chop mode + * @note SF must be set in conjunction with chop mode * and sinc filter type to achieve the desired sampling rate. */ -typedef enum -{ +typedef enum { ADMW1001_SF_976HZ = 0, /*!< SF setting for 976Hz sample rate. */ ADMW1001_SF_488HZ = 1, @@ -379,8 +361,7 @@ * * @note applicable only for I2C sensors */ -typedef enum -{ +typedef enum { ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED_100K = 0, /*!< 100kHz I2C clock speed */ ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED_400K, @@ -392,8 +373,7 @@ * * @note applicable only for SPI sensors */ -typedef enum -{ +typedef enum { ADMW1001_DIGITAL_SENSOR_COMMS_SPI_MODE_0 = 0, /*!< SPI mode 0 Clock Polarity = 0 Clock Phase = 0 */ ADMW1001_DIGITAL_SENSOR_COMMS_SPI_MODE_1, @@ -409,8 +389,7 @@ * * @note applicable only for SPI sensors */ -typedef enum -{ +typedef enum { ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_8MHZ = 0, /*!< SPI Clock Speed configured to 8MHz */ ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_4MHZ, @@ -447,8 +426,7 @@ } ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK; /*! ADMW1001 Power Configuration options */ -typedef struct -{ +typedef struct { ADMW1001_POWER_MODE powerMode; /*!< Power mode selection */ @@ -459,8 +437,7 @@ * @note required only when ADMW1001_OPERATING_MODE_MULTICYCLE is selected * as the operatingMode (@ref ADMW1001_MEASUREMENT_CONFIG) */ -typedef struct -{ +typedef struct { uint32_t cyclesPerBurst; /*!< Number of cycles to complete for a single burst */ uint32_t burstInterval; @@ -469,8 +446,7 @@ } ADMW1001_MULTICYCLE_CONFIG; /*! ADMW1001 Measurement Configuration options */ -typedef struct -{ +typedef struct { ADMW1001_OPERATING_MODE operatingMode; /*!< Operating mode - specifies how measurement cycles are scheduled */ ADMW1001_DATAREADY_MODE dataReadyMode; @@ -489,7 +465,7 @@ */ uint8_t reserved0[3]; /*!< Reserved for future use and ensure word alignment. - */ + */ uint32_t cycleInterval; /*!< Cycle interval - specifies the time interval between the start of each * successive measurement cycle. Applicable only when operatingMode is @@ -503,12 +479,13 @@ * Applicable only if the selected reference type is * voltage. * (see @ref ADMW1001_ADC_REFERENCE_TYPE) - */ + */ float32_t RSenseValue; - /*!< Sense resistor value in Ohms. */ - uint32_t reserved1[3]; - /*!< Reserved for future use and ensure word alignment. - */ + /*!< Sense resistor value in Ohms. */ + float32_t externalRefVoltage; + /*!< External Reference Voltage. + */ + uint32_t reserved1[2]; } ADMW1001_MEASUREMENT_CONFIG; @@ -517,8 +494,7 @@ * @note applicable only to ADC analog sensor channels, and * specific sensor types */ -typedef struct -{ +typedef struct { ADMW1001_ADC_EXC_STATE excitationState; /*!< Excitation current state */ ADMW1001_ADC_EXC_CURRENT outputLevel; @@ -532,8 +508,7 @@ * * @note applicable only to ADC analog sensor channels */ -typedef struct -{ +typedef struct { ADMW1001_ADC_FILTER_TYPE type; /*!< Filter type selection */ ADMW1001_SINC_FILTER_RANGE sf; @@ -551,8 +526,7 @@ * * @note applicable only to ADC analog sensor channels */ -typedef struct -{ +typedef struct { ADMW1001_ADC_SENSOR_TYPE sensor; /*!< Sensor type selection */ ADMW1001_ADC_RTD_CURVE rtdCurve; @@ -567,7 +541,7 @@ bool vBiasEnable; /*!< ADC Reference configuration */ uint8_t bufferBypass; - /*!< Buffer Bypass configuration */ + /*!< Buffer Bypass configuration */ uint8_t reserved0[2]; /*!< Reserved for future use and ensure word alignment. */ uint32_t reserved1[6]; @@ -578,8 +552,7 @@ /*! ADMW1001 look-up table selection * Select table used to linearise the measurement. */ -typedef enum -{ +typedef enum { ADMW1001_LUT_DEFAULT = 0, /*!< Default LUT */ ADMW1001_LUT_UNITY = 1, @@ -588,15 +561,14 @@ /*!< User defined custom LUT */ ADMW1001_LUT_RESERVED = 3, /*!< Reserved for future use */ - + } ADMW1001_LUT_SELECT; /*! ADMW1001 digital sensor data encoding * * @note applicable only to SPI and I2C digital sensor channels */ -typedef enum -{ +typedef enum { ADMW1001_DIGITAL_SENSOR_DATA_CODING_NONE = 0, /**< None/Invalid - data format is ignored if coding is set to this value */ ADMW1001_DIGITAL_SENSOR_DATA_CODING_UNIPOLAR, @@ -613,8 +585,7 @@ * * @note applicable only to SPI and I2C digital sensor channels */ -typedef struct -{ +typedef struct { ADMW1001_DIGITAL_SENSOR_DATA_CODING coding; /**< Data Encoding of Sensor Result */ bool littleEndian; @@ -636,8 +607,7 @@ * * @note applicable only to SPI and I2C digital sensor channels */ -typedef struct -{ +typedef struct { uint8_t command[ADMW1001_SENSOR_COMMAND_MAX_LENGTH]; /*!< Optional command bytes to send to the device */ uint8_t commandLength; @@ -649,8 +619,7 @@ * * @note applicable only to digital sensor channels */ -typedef struct -{ +typedef struct { uint32_t calibrationParam; /*!< Independently established environmental variable used during calibration * of a digital sensor. Used only if the sensor supports calibration @@ -667,8 +636,7 @@ * * @note applicable only to digital sensor channels */ -typedef struct -{ +typedef struct { bool useCustomCommsConfig; /*!< Optional parameter to enable user digital communication settings */ ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED i2cClockSpeed; @@ -684,8 +652,7 @@ * * @note applicable only to I2C digital sensor channels */ -typedef struct -{ +typedef struct { ADMW1001_I2C_SENSOR_TYPE sensor; /*!< Sensor type selection */ uint8_t deviceAddress; @@ -726,12 +693,11 @@ * * @note applicable only to SPI digital sensor channels */ -typedef struct -{ +typedef struct { ADMW1001_SPI_SENSOR_TYPE sensor; /*!< Sensor type selection */ uint8_t reserved[2]; - /*!< Reserved for future use and ensure word alignment. */ + /*!< Reserved for future use and ensure word alignment. */ ADMW1001_DIGITAL_SENSOR_COMMAND configurationCommand; /*!< Optional configuration command to send to the device at start-up. * A default configuration command will be used if this is not specified. @@ -763,8 +729,7 @@ } ADMW1001_SPI_CHANNEL_CONFIG; /*! ADMW1001 Measurement Channel configuration details */ -typedef struct -{ +typedef struct { bool enableChannel; /*!< Option to include this channel in normal measurement cycles */ bool disablePublishing; @@ -841,8 +806,7 @@ * ID. Lower numbers indicate higher priority, with 0 being the highest. * Set to 0 if not required. */ - union - { + union { ADMW1001_ADC_CHANNEL_CONFIG adcChannelConfig; /*!< ADC channel configuration - applicable only to ADC channels */ ADMW1001_I2C_CHANNEL_CONFIG i2cChannelConfig; @@ -858,8 +822,7 @@ } ADMW1001_CHANNEL_CONFIG; /*! ADMW1001 Diagnostics configuration details */ -typedef struct -{ +typedef struct { bool disableGlobalDiag; /*!< Option to disable the following diagnostic checks on the ADC: * - Reference Detection errors @@ -884,8 +847,7 @@ typedef uint16_t ADMW1001_ADVANCED_ACCESS_KEY; /*! ADMW1001 Device configuration details */ -typedef struct -{ +typedef struct { ADMW1001_POWER_CONFIG power; /*!< Power configuration details */ ADMW1001_MEASUREMENT_CONFIG measurement;
--- a/main.cpp Thu Nov 14 05:35:08 2019 +0000 +++ b/main.cpp Tue Nov 19 11:17:35 2019 +0000 @@ -47,18 +47,17 @@ #include "common/platform.h" #include "admw1001/ADMW1001_REGISTERS.h" -extern ADMW_CONFIG sensor0_typeK_cjc0_config; -extern ADMW_CONFIG sensor1_rtd_3w_pt100_config; -extern ADMW_CONFIG sensor2_typeT_cjc0_config; -extern ADMW_CONFIG sensor3_typeJ_cjc0_config; -extern ADMW_CONFIG i2c0_sensirionSHT3X_config; +extern ADMW_CONFIG thermocouple_typeK_cjc0_config; +extern ADMW_CONFIG thermocouple_typeT_cjc0_config; +extern ADMW_CONFIG thermocouple_typeJ_cjc0_config; +extern ADMW_CONFIG rtd_3w_pt100_config; +extern ADMW_CONFIG rtd_4w_config; +extern ADMW_CONFIG bridge_4w_load_cell_config; extern ADMW_CONFIG multichannel_continuous_config; extern ADMW_CONFIG multichannel_singlecycle_config; -extern ADMW_CONFIG sensor2_bridge_4w_load_cell_config; -extern ADMW_CONFIG rtd_4w_config; -extern ADMW_CONFIG config; +extern ADMW_CONFIG i2c0_sensirionSHT3X_config; /* Change the following pointer to select any of the configurations above */ -static ADMW_CONFIG *pSelectedConfig = &sensor2_bridge_4w_load_cell_config; +static ADMW_CONFIG *pSelectedConfig = &thermocouple_typeK_cjc0_config; static ADMW_CONNECTION connectionInfo = PLATFORM_CONNECTION_INFO;
--- a/multichannel_continuous_config.c Thu Nov 14 05:35:08 2019 +0000 +++ b/multichannel_continuous_config.c Tue Nov 19 11:17:35 2019 +0000 @@ -71,7 +71,7 @@ .offsetAdjustment = 0.0, .gainAdjustment = 0.0, .sensorParameter = 0.0, - .measurementsPerCycle = 10, + .measurementsPerCycle = 1, .cycleSkipCount = 0, .extraSettlingTime = 0, .priority = 0, @@ -105,7 +105,7 @@ .offsetAdjustment = 0.0, .gainAdjustment = 0.0, .sensorParameter = 0.0, - .measurementsPerCycle = 10, + .measurementsPerCycle = 1, .cycleSkipCount = 0, .extraSettlingTime = 4499.99986449257, .priority = 0, @@ -132,7 +132,7 @@ .enableChannel = true, .disablePublishing = false, .compensationChannel = ADMW1001_CH_ID_NONE, - .measurementsPerCycle = 10, + .measurementsPerCycle = 1, .extraSettlingTime = 15000, .i2cChannelConfig = { .sensor = ADMW1001_I2C_SENSOR_HUMIDITY_B,
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rtd_3w_pt100_config.c Tue Nov 19 11:17:35 2019 +0000 @@ -0,0 +1,100 @@ +/* +Copyright 2019 (c) Analog Devices, Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + - Neither the name of Analog Devices, Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + - The use of this software may or may not infringe the patent rights + of one or more patent holders. This license does not release you + from the requirement that you obtain separate licenses from these + patent holders to use this software. + - Use of the software either in source or binary form, must be run + on or directly connected to an Analog Devices Inc. component. + +THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *****************************************************************************/ + +/*! + ****************************************************************************** + * @file: + * @brief: + *----------------------------------------------------------------------------- + */ +#include "admw_config_types.h" + +ADMW_CONFIG rtd_3w_pt100_config = { + .versionId = { .major = 2, .minor = 0 }, + .productId = ADMW_PRODUCT_ID_ADMW1001, + .admw1001 = { + .power = { + .powerMode = ADMW1001_POWER_MODE_ACTIVE, + }, + .measurement = { + .operatingMode = ADMW1001_OPERATING_MODE_CONTINUOUS, + .dataReadyMode = ADMW1001_DATAREADY_PER_CYCLE, // FIX: Temporarily all values from json are hardcoded to this one in the Contracts.FileGenerator - > file translations!! + .cycleInterval = 0, + .vBiasEnable = false, + }, + .diagnostics = { + .disableGlobalDiag = true, + .disableMeasurementDiag = true, + .osdFrequency = ADMW1001_OPEN_SENSOR_DIAGNOSTICS_DISABLED, + }, + .channels = { + [ADMW1001_CH_ID_ANLG_1_UNIVERSAL] = { + .enableChannel = true, + .disablePublishing = false, + .compensationChannel = ADMW1001_CH_ID_NONE, + .lutSelect = ADMW1001_LUT_DEFAULT, + .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS, + .lowThreshold = -50, + .highThreshold = 250, + .offsetAdjustment = 0.0, + .gainAdjustment = 0.0, + .sensorParameter = 0.0, + .measurementsPerCycle = 1, + .cycleSkipCount = 0, + .extraSettlingTime = 4499.99986449257, + .priority = 0, + .adcChannelConfig = { + .sensor = ADMW1001_ADC_SENSOR_RTD_3WIRE_PT100, + .rtdCurve = ADMW1001_ADC_RTD_CURVE_EUROPEAN, + .gain = ADMW1001_ADC_GAIN_1X, + .current = { + .excitationState= ADMW1001_ADC_EXC_STATE_ALWAYS_ON, + .outputLevel = ADMW1001_ADC_EXC_CURRENT_250uA, + .diodeRatio = 0, + }, + .filter = { + .type = ADMW1001_ADC_FILTER_SINC3, + .sf = ADMW1001_SF_8P24HZ, + .chopMode = ADMW1001_CHOP_MD_SW, + .notch1p2 = false, + .groundSwitch = ADMW1001_ADC_GND_SW_OPEN + }, + .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL, + }, + }, + }, + }, +};
--- a/sensor0_typeK_cjc0_config.c Thu Nov 14 05:35:08 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +0,0 @@ - -/*! - ****************************************************************************** - * @file: config.c - * @brief: - *----------------------------------------------------------------------------- - * -Copyright (c) 2018 Analog Devices, Inc. - -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - Modified versions of the software must be conspicuously marked as such. - - This software is licensed solely and exclusively for use with processors - manufactured by or for Analog Devices, Inc. - - This software may not be combined or merged with other code in any manner - that would cause the software to become subject to terms and conditions - which differ from those listed here. - - Neither the name of Analog Devices, Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - The use of this software may or may not infringe the patent rights of one - or more patent holders. This license does not release you from the - requirement that you obtain separate licenses from these patent holders - to use this software. - -THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, -TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN -NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF CLAIMS OF INTELLECTUAL -PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - *****************************************************************************/ - -#include "inc/admw_config_types.h" - -ADMW_CONFIG sensor0_typeK_cjc0_config= { - .versionId = { .major = 2, .minor = 0 }, - .productId = ADMW_PRODUCT_ID_ADMW1001, - .admw1001 = { - .power = { - .powerMode = ADMW1001_POWER_MODE_ACTIVE, - }, - .measurement = { - .operatingMode = ADMW1001_OPERATING_MODE_CONTINUOUS, - .dataReadyMode = ADMW1001_DATAREADY_PER_CYCLE, // FIX: Temporarily all values from json are hardcoded to this one in the Contracts.FileGenerator - > file translations!! - .cycleInterval = 0, - .vBiasEnable = true, - .RSenseValue = 1000.0, - }, - .diagnostics = { - .disableGlobalDiag = true, - .disableMeasurementDiag = true, - .osdFrequency = ADMW1001_OPEN_SENSOR_DIAGNOSTICS_DISABLED, - }, - .channels = { - [ADMW1001_CH_ID_ANLG_1_UNIVERSAL] = { - .enableChannel = true, - .disablePublishing = false, - .compensationChannel = ADMW1001_CH_ID_NONE, - .lutSelect = ADMW1001_LUT_DEFAULT, - .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS, - .lowThreshold = -50, - .highThreshold = 250, - .offsetAdjustment = 0.0, - .gainAdjustment = 0.0, - .sensorParameter = 0.0, - .measurementsPerCycle = 10, - .cycleSkipCount = 0, - .extraSettlingTime = 0, - .priority = 0, - .adcChannelConfig = { - .sensor = ADMW1001_ADC_SENSOR_RTD_2WIRE_PT100, - .rtdCurve = ADMW1001_ADC_RTD_CURVE_EUROPEAN, - .gain = ADMW1001_ADC_GAIN_1X, - .current = { - .excitationState= ADMW1001_ADC_EXC_STATE_ALWAYS_ON, - .outputLevel = ADMW1001_ADC_EXC_CURRENT_250uA, - .diodeRatio = 0, - }, - .filter = { - .type = ADMW1001_ADC_FILTER_SINC3, - .sf = ADMW1001_SF_8P24HZ, - .chopMode = ADMW1001_CHOP_MD_SW, - .notch1p2 = false, - .groundSwitch = ADMW1001_ADC_GND_SW_OPEN - }, - .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL, - .bufferBypass = ADMW1001_BUFFER_BYPASSS_DISABLED, - }, - }, - [ADMW1001_CH_ID_ANLG_1_DIFFERENTIAL] = { - .enableChannel = true, - .disablePublishing = false, - .compensationChannel = ADMW1001_CH_ID_ANLG_1_UNIVERSAL, - .lutSelect = ADMW1001_LUT_DEFAULT, - .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS, - .lowThreshold = -50, - .highThreshold = 250, - .offsetAdjustment = 0.0, - .gainAdjustment = 0.0, - .sensorParameter = 0.0, - .measurementsPerCycle = 10, - .cycleSkipCount = 0, - .extraSettlingTime = 4499.99986449257, - .priority = 0, - .adcChannelConfig = { - .sensor = ADMW1001_ADC_SENSOR_THERMOCOUPLE_K, - .rtdCurve = ADMW1001_ADC_RTD_CURVE_EUROPEAN, - .gain = ADMW1001_ADC_GAIN_8X, - .current = { - .excitationState= ADMW1001_ADC_EXC_STATE_CYCLE_POWER, - .outputLevel = ADMW1001_ADC_NO_EXTERNAL_EXC_CURRENT, - .diodeRatio = 0, - }, - .filter = { - .type = ADMW1001_ADC_FILTER_SINC3, - .sf = ADMW1001_SF_8P24HZ, - .chopMode = ADMW1001_CHOP_MD_SW, - .notch1p2 = false, - .groundSwitch = ADMW1001_ADC_GND_SW_OPEN - }, - .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL, - .bufferBypass = ADMW1001_BUFFER_BYPASSS_DISABLED, - }, - }, - }, - }, -}; -
--- a/sensor1_rtd-3w-pt100_config.c Thu Nov 14 05:35:08 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/* -Copyright 2019 (c) Analog Devices, Inc. - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - Neither the name of Analog Devices, Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - The use of this software may or may not infringe the patent rights - of one or more patent holders. This license does not release you - from the requirement that you obtain separate licenses from these - patent holders to use this software. - - Use of the software either in source or binary form, must be run - on or directly connected to an Analog Devices Inc. component. - -THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - *****************************************************************************/ - -/*! - ****************************************************************************** - * @file: - * @brief: - *----------------------------------------------------------------------------- - */ -#include "admw_config_types.h" - -ADMW_CONFIG sensor1_rtd_3w_pt100_config = { - .versionId = { .major = 2, .minor = 0 }, - .productId = ADMW_PRODUCT_ID_ADMW1001, - .admw1001 = { - .power = { - .powerMode = ADMW1001_POWER_MODE_ACTIVE, - }, - .measurement = { - .operatingMode = ADMW1001_OPERATING_MODE_CONTINUOUS, - .dataReadyMode = ADMW1001_DATAREADY_PER_CYCLE, // FIX: Temporarily all values from json are hardcoded to this one in the Contracts.FileGenerator - > file translations!! - .cycleInterval = 0, - .vBiasEnable = false, - }, - .diagnostics = { - .disableGlobalDiag = true, - .disableMeasurementDiag = true, - .osdFrequency = ADMW1001_OPEN_SENSOR_DIAGNOSTICS_DISABLED, - }, - .channels = { - [ADMW1001_CH_ID_ANLG_1_UNIVERSAL] = { - .enableChannel = true, - .disablePublishing = false, - .compensationChannel = ADMW1001_CH_ID_NONE, - .lutSelect = ADMW1001_LUT_DEFAULT, - .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS, - .lowThreshold = -50, - .highThreshold = 250, - .offsetAdjustment = 0.0, - .gainAdjustment = 0.0, - .sensorParameter = 0.0, - .measurementsPerCycle = 1, - .cycleSkipCount = 0, - .extraSettlingTime = 4499.99986449257, - .priority = 0, - .adcChannelConfig = { - .sensor = ADMW1001_ADC_SENSOR_RTD_3WIRE_PT100, - .rtdCurve = ADMW1001_ADC_RTD_CURVE_EUROPEAN, - .gain = ADMW1001_ADC_GAIN_1X, - .current = { - .excitationState= ADMW1001_ADC_EXC_STATE_ALWAYS_ON, - .outputLevel = ADMW1001_ADC_EXC_CURRENT_250uA, - .diodeRatio = 0, - }, - .filter = { - .type = ADMW1001_ADC_FILTER_SINC3, - .sf = ADMW1001_SF_8P24HZ, - .chopMode = ADMW1001_CHOP_MD_SW, - .notch1p2 = false, - .groundSwitch = ADMW1001_ADC_GND_SW_OPEN - }, - .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL, - }, - }, - }, - }, -};
--- a/sensor2_bridge_4w_load_cell_config.c Thu Nov 14 05:35:08 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* -Copyright 2019 (c) Analog Devices, Inc. - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - Neither the name of Analog Devices, Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - The use of this software may or may not infringe the patent rights - of one or more patent holders. This license does not release you - from the requirement that you obtain separate licenses from these - patent holders to use this software. - - Use of the software either in source or binary form, must be run - on or directly connected to an Analog Devices Inc. component. - -THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - *****************************************************************************/ - -/*! - ****************************************************************************** - * @file: - * @brief: - *----------------------------------------------------------------------------- - */ -#include "inc/admw_config_types.h" - -ADMW_CONFIG sensor2_bridge_4w_load_cell_config= { - .versionId = { .major = 2, .minor = 0 }, - .productId = ADMW_PRODUCT_ID_ADMW1001, - .admw1001 = { - .power = { - .powerMode = ADMW1001_POWER_MODE_ACTIVE, - }, - .measurement = { - .operatingMode = ADMW1001_OPERATING_MODE_CONTINUOUS, - .dataReadyMode = ADMW1001_DATAREADY_PER_CYCLE, // FIX: Temporarily all values from json are hardcoded to this one in the Contracts.FileGenerator - > file translations!! - .cycleInterval = 0, - .RSenseValue = 1000.0, - }, - .diagnostics = { - .disableGlobalDiag = true, - .disableMeasurementDiag = true, - .osdFrequency = ADMW1001_OPEN_SENSOR_DIAGNOSTICS_DISABLED, - }, - .channels = { - [ADMW1001_CH_ID_ANLG_1_UNIVERSAL] = { - .enableChannel = true, - .disablePublishing = false, - .compensationChannel = ADMW1001_CH_ID_NONE, - .lutSelect = ADMW1001_LUT_DEFAULT, - .measurementUnit = ADMW1001_MEASUREMENT_UNIT_UNSPECIFIED, - .lowThreshold = 0, - .highThreshold = 45359.2, - .offsetAdjustment = 0.0, - .gainAdjustment = 0.0, - .sensorParameter = 0.0, - .measurementsPerCycle = 1, - .cycleSkipCount = 0, - .extraSettlingTime = 4499.99986449257, - .priority = 0, - .adcChannelConfig = { - .sensor = ADMW1001_ADC_SENSOR_BRIDGE_4WIRE_1, - .gain = ADMW1001_ADC_GAIN_32X, - .filter = { - .type = ADMW1001_ADC_FILTER_SINC3, - .sf = ADMW1001_SF_8P24HZ, - .chopMode = ADMW1001_CHOP_MD_SW, - .notch1p2 = true, - .groundSwitch = ADMW1001_ADC_GND_SW_CLOSED - }, - .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_AVDD, - .bufferBypass = ADMW1001_BUFFER_BYPASSS_DISABLED, - }, - }, - }, - }, -};
--- a/sensor2_typeT_cjc0_config.c Thu Nov 14 05:35:08 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,126 +0,0 @@ -/* -Copyright 2019 (c) Analog Devices, Inc. - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - Neither the name of Analog Devices, Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - The use of this software may or may not infringe the patent rights - of one or more patent holders. This license does not release you - from the requirement that you obtain separate licenses from these - patent holders to use this software. - - Use of the software either in source or binary form, must be run - on or directly connected to an Analog Devices Inc. component. - -THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - *****************************************************************************/ - -/*! - ****************************************************************************** - * @file: - * @brief: - *----------------------------------------------------------------------------- - */#include "admw_config_types.h" - -ADMW_CONFIG sensor2_typeT_cjc0_config = { - .versionId = { .major = 2, .minor = 0 }, - .productId = ADMW_PRODUCT_ID_ADMW1001, - .admw1001 = { - .power = { - .powerMode = ADMW1001_POWER_MODE_ACTIVE, - }, - .measurement = { - .operatingMode = ADMW1001_OPERATING_MODE_CONTINUOUS, - .dataReadyMode = ADMW1001_DATAREADY_PER_CYCLE, // FIX: Temporarily all values from json are hardcoded to this one in the Contracts.FileGenerator - > file translations!! - .cycleInterval = 0, - }, - .diagnostics = { - .disableGlobalDiag = true, - .disableMeasurementDiag = true, - .osdFrequency = ADMW1001_OPEN_SENSOR_DIAGNOSTICS_DISABLED, - }, - .channels = { - [ADMW1001_CH_ID_ANLG_1_UNIVERSAL] = { - .enableChannel = true, - .disablePublishing = false, - .compensationChannel = ADMW1001_CH_ID_NONE, - .lutSelect = ADMW1001_LUT_DEFAULT, - .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS, - .lowThreshold = -50, - .highThreshold = 250, - .offsetAdjustment = 0.0, - .gainAdjustment = 0.0, - .sensorParameter = 0.0, - .measurementsPerCycle = 1, - .cycleSkipCount = 0, - .extraSettlingTime = 0, - .priority = 0, - .adcChannelConfig = { - .sensor = ADMW1001_ADC_SENSOR_RTD_2WIRE_PT100, - .gain = ADMW1001_ADC_GAIN_1X, - .current = { - .excitationState= ADMW1001_ADC_EXC_STATE_ALWAYS_ON, - .outputLevel = ADMW1001_ADC_EXC_CURRENT_250uA, - .diodeRatio = 0, - }, - .rtdCurve = ADMW1001_ADC_RTD_CURVE_EUROPEAN, - .filter = { - .type = ADMW1001_ADC_FILTER_SINC3, - .sf = ADMW1001_SF_8P24HZ, - .chopMode = ADMW1001_CHOP_MD_SW, - .notch1p2 = true, - .groundSwitch = ADMW1001_ADC_GND_SW_OPEN - }, - .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL, - }, - }, - [ADMW1001_CH_ID_ANLG_1_DIFFERENTIAL] = { - .enableChannel = true, - .disablePublishing = false, - .compensationChannel = ADMW1001_CH_ID_ANLG_1_UNIVERSAL, - .lutSelect = ADMW1001_LUT_DEFAULT, - .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS, - .lowThreshold = -50, - .highThreshold = 250, - .offsetAdjustment = 0.0, - .gainAdjustment = 0.0, - .sensorParameter = 0.0, - .measurementsPerCycle = 1, - .cycleSkipCount = 0, - .extraSettlingTime = 4499.99986449257, - .priority = 0, - .adcChannelConfig = { - .sensor = ADMW1001_ADC_SENSOR_THERMOCOUPLE_T, - .gain = ADMW1001_ADC_GAIN_8X, - .filter = { - .type = ADMW1001_ADC_FILTER_SINC3, - .sf = ADMW1001_SF_8P24HZ, - .chopMode = ADMW1001_CHOP_MD_SW, - .notch1p2 = true, - .groundSwitch = ADMW1001_ADC_GND_SW_OPEN - }, - .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL, - }, - }, - }, - }, -};
--- a/sensor3_typeJ_cjc0_config.c Thu Nov 14 05:35:08 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -/* -Copyright 2019 (c) Analog Devices, Inc. - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - Neither the name of Analog Devices, Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - The use of this software may or may not infringe the patent rights - of one or more patent holders. This license does not release you - from the requirement that you obtain separate licenses from these - patent holders to use this software. - - Use of the software either in source or binary form, must be run - on or directly connected to an Analog Devices Inc. component. - -THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - *****************************************************************************/ - -/*! - ****************************************************************************** - * @file: - * @brief: - *----------------------------------------------------------------------------- - */ - - -#include "admw_config_types.h" - -ADMW_CONFIG sensor3_typeJ_cjc0_config = { - .versionId = { .major = 2, .minor = 0 }, - .productId = ADMW_PRODUCT_ID_ADMW1001, - .admw1001 = { - .power = { - .powerMode = ADMW1001_POWER_MODE_ACTIVE, - }, - .measurement = { - .operatingMode = ADMW1001_OPERATING_MODE_CONTINUOUS, - .dataReadyMode = ADMW1001_DATAREADY_PER_CYCLE, // FIX: Temporarily all values from json are hardcoded to this one in the Contracts.FileGenerator - > file translations!! - .cycleInterval = 0, - }, - .diagnostics = { - .disableGlobalDiag = true, - .disableMeasurementDiag = true, - .osdFrequency = ADMW1001_OPEN_SENSOR_DIAGNOSTICS_DISABLED, - }, - .channels = { - [ADMW1001_CH_ID_ANLG_1_UNIVERSAL] = { - .enableChannel = true, - .disablePublishing = false, - .compensationChannel = ADMW1001_CH_ID_NONE, - .lutSelect = ADMW1001_LUT_DEFAULT, - .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS, - .lowThreshold = -50, - .highThreshold = 250, - .offsetAdjustment = 0.0, - .gainAdjustment = 0.0, - .sensorParameter = 0.0, - .measurementsPerCycle = 1, - .cycleSkipCount = 0, - .extraSettlingTime = 0, - .priority = 0, - .adcChannelConfig = { - .sensor = ADMW1001_ADC_SENSOR_RTD_2WIRE_PT100, - .gain = ADMW1001_ADC_GAIN_1X, - .current = { - .excitationState= ADMW1001_ADC_EXC_STATE_ALWAYS_ON, - .outputLevel = ADMW1001_ADC_EXC_CURRENT_250uA, - .diodeRatio = 0, - }, - .rtdCurve = ADMW1001_ADC_RTD_CURVE_EUROPEAN, - .filter = { - .type = ADMW1001_ADC_FILTER_SINC3, - .sf = ADMW1001_SF_8P24HZ, - .chopMode = ADMW1001_CHOP_MD_SW, - .notch1p2 = true, - .groundSwitch = ADMW1001_ADC_GND_SW_OPEN - }, - .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL, - }, - }, - [ADMW1001_CH_ID_ANLG_1_DIFFERENTIAL] = { - .enableChannel = true, - .disablePublishing = false, - .compensationChannel = ADMW1001_CH_ID_ANLG_1_UNIVERSAL, - .lutSelect = ADMW1001_LUT_DEFAULT, - .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS, - .lowThreshold = -50, - .highThreshold = 250, - .offsetAdjustment = 0.0, - .gainAdjustment = 0.0, - .sensorParameter = 0.0, - .measurementsPerCycle = 1, - .cycleSkipCount = 0, - .extraSettlingTime = 4499.99986449257, - .priority = 0, - .adcChannelConfig = { - .sensor = ADMW1001_ADC_SENSOR_THERMOCOUPLE_J, - .gain = ADMW1001_ADC_GAIN_8X, - .filter = { - .type = ADMW1001_ADC_FILTER_SINC3, - .sf = ADMW1001_SF_8P24HZ, - .chopMode = ADMW1001_CHOP_MD_SW, - .notch1p2 = true, - .groundSwitch = ADMW1001_ADC_GND_SW_OPEN - }, - .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL, - }, - }, - }, - }, -};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/thermocouple_typeJ_cjc0_config.c Tue Nov 19 11:17:35 2019 +0000 @@ -0,0 +1,129 @@ +/* +Copyright 2019 (c) Analog Devices, Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + - Neither the name of Analog Devices, Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + - The use of this software may or may not infringe the patent rights + of one or more patent holders. This license does not release you + from the requirement that you obtain separate licenses from these + patent holders to use this software. + - Use of the software either in source or binary form, must be run + on or directly connected to an Analog Devices Inc. component. + +THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *****************************************************************************/ + +/*! + ****************************************************************************** + * @file: + * @brief: + *----------------------------------------------------------------------------- + */ + + +#include "admw_config_types.h" + +ADMW_CONFIG thermocouple_typeJ_cjc0_config = { + .versionId = { .major = 2, .minor = 0 }, + .productId = ADMW_PRODUCT_ID_ADMW1001, + .admw1001 = { + .power = { + .powerMode = ADMW1001_POWER_MODE_ACTIVE, + }, + .measurement = { + .operatingMode = ADMW1001_OPERATING_MODE_CONTINUOUS, + .dataReadyMode = ADMW1001_DATAREADY_PER_CYCLE, // FIX: Temporarily all values from json are hardcoded to this one in the Contracts.FileGenerator - > file translations!! + .cycleInterval = 0, + }, + .diagnostics = { + .disableGlobalDiag = true, + .disableMeasurementDiag = true, + .osdFrequency = ADMW1001_OPEN_SENSOR_DIAGNOSTICS_DISABLED, + }, + .channels = { + [ADMW1001_CH_ID_ANLG_1_UNIVERSAL] = { + .enableChannel = true, + .disablePublishing = false, + .compensationChannel = ADMW1001_CH_ID_NONE, + .lutSelect = ADMW1001_LUT_DEFAULT, + .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS, + .lowThreshold = -50, + .highThreshold = 250, + .offsetAdjustment = 0.0, + .gainAdjustment = 0.0, + .sensorParameter = 0.0, + .measurementsPerCycle = 1, + .cycleSkipCount = 0, + .extraSettlingTime = 0, + .priority = 0, + .adcChannelConfig = { + .sensor = ADMW1001_ADC_SENSOR_RTD_2WIRE_PT100, + .gain = ADMW1001_ADC_GAIN_1X, + .current = { + .excitationState= ADMW1001_ADC_EXC_STATE_ALWAYS_ON, + .outputLevel = ADMW1001_ADC_EXC_CURRENT_250uA, + .diodeRatio = 0, + }, + .rtdCurve = ADMW1001_ADC_RTD_CURVE_EUROPEAN, + .filter = { + .type = ADMW1001_ADC_FILTER_SINC3, + .sf = ADMW1001_SF_8P24HZ, + .chopMode = ADMW1001_CHOP_MD_SW, + .notch1p2 = true, + .groundSwitch = ADMW1001_ADC_GND_SW_OPEN + }, + .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL, + }, + }, + [ADMW1001_CH_ID_ANLG_1_DIFFERENTIAL] = { + .enableChannel = true, + .disablePublishing = false, + .compensationChannel = ADMW1001_CH_ID_ANLG_1_UNIVERSAL, + .lutSelect = ADMW1001_LUT_DEFAULT, + .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS, + .lowThreshold = -50, + .highThreshold = 250, + .offsetAdjustment = 0.0, + .gainAdjustment = 0.0, + .sensorParameter = 0.0, + .measurementsPerCycle = 1, + .cycleSkipCount = 0, + .extraSettlingTime = 4499.99986449257, + .priority = 0, + .adcChannelConfig = { + .sensor = ADMW1001_ADC_SENSOR_THERMOCOUPLE_J, + .gain = ADMW1001_ADC_GAIN_8X, + .filter = { + .type = ADMW1001_ADC_FILTER_SINC3, + .sf = ADMW1001_SF_8P24HZ, + .chopMode = ADMW1001_CHOP_MD_SW, + .notch1p2 = true, + .groundSwitch = ADMW1001_ADC_GND_SW_OPEN + }, + .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL, + }, + }, + }, + }, +};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/thermocouple_typeK_cjc0_config.c Tue Nov 19 11:17:35 2019 +0000 @@ -0,0 +1,143 @@ + +/*! + ****************************************************************************** + * @file: config.c + * @brief: + *----------------------------------------------------------------------------- + * +Copyright (c) 2018 Analog Devices, Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + - Modified versions of the software must be conspicuously marked as such. + - This software is licensed solely and exclusively for use with processors + manufactured by or for Analog Devices, Inc. + - This software may not be combined or merged with other code in any manner + that would cause the software to become subject to terms and conditions + which differ from those listed here. + - Neither the name of Analog Devices, Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + - The use of this software may or may not infringe the patent rights of one + or more patent holders. This license does not release you from the + requirement that you obtain separate licenses from these patent holders + to use this software. + +THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS" AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, +TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN +NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF CLAIMS OF INTELLECTUAL +PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *****************************************************************************/ + +#include "inc/admw_config_types.h" + +ADMW_CONFIG thermocouple_typeK_cjc0_config= { + .versionId = { .major = 2, .minor = 0 }, + .productId = ADMW_PRODUCT_ID_ADMW1001, + .admw1001 = { + .power = { + .powerMode = ADMW1001_POWER_MODE_ACTIVE, + }, + .measurement = { + .externalRefVoltage=2.5, + .operatingMode = ADMW1001_OPERATING_MODE_CONTINUOUS, + .dataReadyMode = ADMW1001_DATAREADY_PER_CYCLE, // FIX: Temporarily all values from json are hardcoded to this one in the Contracts.FileGenerator - > file translations!! + .cycleInterval = 0, + .vBiasEnable = true, + .RSenseValue = 1000.0, + }, + .diagnostics = { + .disableGlobalDiag = true, + .disableMeasurementDiag = true, + .osdFrequency = ADMW1001_OPEN_SENSOR_DIAGNOSTICS_DISABLED, + }, + .channels = { + [ADMW1001_CH_ID_ANLG_1_UNIVERSAL] = { + .enableChannel = true, + .disablePublishing = false, + .compensationChannel = ADMW1001_CH_ID_NONE, + .lutSelect = ADMW1001_LUT_DEFAULT, + .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS, + .lowThreshold = -50, + .highThreshold = 250, + .offsetAdjustment = 0.0, + .gainAdjustment = 0.0, + .sensorParameter = 0.0, + .measurementsPerCycle = 1, + .cycleSkipCount = 0, + .extraSettlingTime = 0, + .priority = 0, + .adcChannelConfig = { + .sensor = ADMW1001_ADC_SENSOR_RTD_2WIRE_PT100, + .rtdCurve = ADMW1001_ADC_RTD_CURVE_EUROPEAN, + .gain = ADMW1001_ADC_GAIN_1X, + .current = { + .excitationState= ADMW1001_ADC_EXC_STATE_ALWAYS_ON, + .outputLevel = ADMW1001_ADC_EXC_CURRENT_250uA, + .diodeRatio = 0, + }, + .filter = { + .type = ADMW1001_ADC_FILTER_SINC3, + .sf = ADMW1001_SF_8P24HZ, + .chopMode = ADMW1001_CHOP_MD_SW, + .notch1p2 = false, + .groundSwitch = ADMW1001_ADC_GND_SW_OPEN + }, + .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL, + .bufferBypass = ADMW1001_BUFFER_BYPASSS_DISABLED, + }, + }, + [ADMW1001_CH_ID_ANLG_1_DIFFERENTIAL] = { + .enableChannel = true, + .disablePublishing = false, + .compensationChannel = ADMW1001_CH_ID_ANLG_1_UNIVERSAL, + .lutSelect = ADMW1001_LUT_DEFAULT, + .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS, + .lowThreshold = -50, + .highThreshold = 250, + .offsetAdjustment = 0.0, + .gainAdjustment = 0.0, + .sensorParameter = 0.0, + .measurementsPerCycle = 1, + .cycleSkipCount = 0, + .extraSettlingTime = 4499.99986449257, + .priority = 0, + .adcChannelConfig = { + .sensor = ADMW1001_ADC_SENSOR_THERMOCOUPLE_K, + .rtdCurve = ADMW1001_ADC_RTD_CURVE_EUROPEAN, + .gain = ADMW1001_ADC_GAIN_8X, + .current = { + .excitationState= ADMW1001_ADC_EXC_STATE_CYCLE_POWER, + .outputLevel = ADMW1001_ADC_NO_EXTERNAL_EXC_CURRENT, + .diodeRatio = 0, + }, + .filter = { + .type = ADMW1001_ADC_FILTER_SINC3, + .sf = ADMW1001_SF_8P24HZ, + .chopMode = ADMW1001_CHOP_MD_SW, + .notch1p2 = false, + .groundSwitch = ADMW1001_ADC_GND_SW_OPEN + }, + .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL, + .bufferBypass = ADMW1001_BUFFER_BYPASSS_DISABLED, + }, + }, + }, + }, +}; +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/thermocouple_typeT_cjc0_config.c Tue Nov 19 11:17:35 2019 +0000 @@ -0,0 +1,126 @@ +/* +Copyright 2019 (c) Analog Devices, Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + - Neither the name of Analog Devices, Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + - The use of this software may or may not infringe the patent rights + of one or more patent holders. This license does not release you + from the requirement that you obtain separate licenses from these + patent holders to use this software. + - Use of the software either in source or binary form, must be run + on or directly connected to an Analog Devices Inc. component. + +THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *****************************************************************************/ + +/*! + ****************************************************************************** + * @file: + * @brief: + *----------------------------------------------------------------------------- + */#include "admw_config_types.h" + +ADMW_CONFIG thermocouple_typeT_cjc0_config = { + .versionId = { .major = 2, .minor = 0 }, + .productId = ADMW_PRODUCT_ID_ADMW1001, + .admw1001 = { + .power = { + .powerMode = ADMW1001_POWER_MODE_ACTIVE, + }, + .measurement = { + .operatingMode = ADMW1001_OPERATING_MODE_CONTINUOUS, + .dataReadyMode = ADMW1001_DATAREADY_PER_CYCLE, // FIX: Temporarily all values from json are hardcoded to this one in the Contracts.FileGenerator - > file translations!! + .cycleInterval = 0, + }, + .diagnostics = { + .disableGlobalDiag = true, + .disableMeasurementDiag = true, + .osdFrequency = ADMW1001_OPEN_SENSOR_DIAGNOSTICS_DISABLED, + }, + .channels = { + [ADMW1001_CH_ID_ANLG_1_UNIVERSAL] = { + .enableChannel = true, + .disablePublishing = false, + .compensationChannel = ADMW1001_CH_ID_NONE, + .lutSelect = ADMW1001_LUT_DEFAULT, + .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS, + .lowThreshold = -50, + .highThreshold = 250, + .offsetAdjustment = 0.0, + .gainAdjustment = 0.0, + .sensorParameter = 0.0, + .measurementsPerCycle = 1, + .cycleSkipCount = 0, + .extraSettlingTime = 0, + .priority = 0, + .adcChannelConfig = { + .sensor = ADMW1001_ADC_SENSOR_RTD_2WIRE_PT100, + .gain = ADMW1001_ADC_GAIN_1X, + .current = { + .excitationState= ADMW1001_ADC_EXC_STATE_ALWAYS_ON, + .outputLevel = ADMW1001_ADC_EXC_CURRENT_250uA, + .diodeRatio = 0, + }, + .rtdCurve = ADMW1001_ADC_RTD_CURVE_EUROPEAN, + .filter = { + .type = ADMW1001_ADC_FILTER_SINC3, + .sf = ADMW1001_SF_8P24HZ, + .chopMode = ADMW1001_CHOP_MD_SW, + .notch1p2 = true, + .groundSwitch = ADMW1001_ADC_GND_SW_OPEN + }, + .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL, + }, + }, + [ADMW1001_CH_ID_ANLG_1_DIFFERENTIAL] = { + .enableChannel = true, + .disablePublishing = false, + .compensationChannel = ADMW1001_CH_ID_ANLG_1_UNIVERSAL, + .lutSelect = ADMW1001_LUT_DEFAULT, + .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS, + .lowThreshold = -50, + .highThreshold = 250, + .offsetAdjustment = 0.0, + .gainAdjustment = 0.0, + .sensorParameter = 0.0, + .measurementsPerCycle = 1, + .cycleSkipCount = 0, + .extraSettlingTime = 4499.99986449257, + .priority = 0, + .adcChannelConfig = { + .sensor = ADMW1001_ADC_SENSOR_THERMOCOUPLE_T, + .gain = ADMW1001_ADC_GAIN_8X, + .filter = { + .type = ADMW1001_ADC_FILTER_SINC3, + .sf = ADMW1001_SF_8P24HZ, + .chopMode = ADMW1001_CHOP_MD_SW, + .notch1p2 = true, + .groundSwitch = ADMW1001_ADC_GND_SW_OPEN + }, + .reference = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL, + }, + }, + }, + }, +};