Code clean up, removed unwanted enums and configurations

Committer:
Vkadaba
Date:
Tue Apr 14 11:43:05 2020 +0000
Revision:
66:cc7069bc0ead
Parent:
63:2655a04c00f5
changed the MBED version to 1.17.75

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Vkadaba 5:0728bde67bdb 1 /*
Vkadaba 6:9d393a9677f4 2 Copyright 2019 (c) Analog Devices, Inc.
Vkadaba 5:0728bde67bdb 3
Vkadaba 5:0728bde67bdb 4 All rights reserved.
Vkadaba 5:0728bde67bdb 5
Vkadaba 5:0728bde67bdb 6 Redistribution and use in source and binary forms, with or without
Vkadaba 5:0728bde67bdb 7 modification, are permitted provided that the following conditions are met:
Vkadaba 5:0728bde67bdb 8 - Redistributions of source code must retain the above copyright
Vkadaba 5:0728bde67bdb 9 notice, this list of conditions and the following disclaimer.
Vkadaba 5:0728bde67bdb 10 - Redistributions in binary form must reproduce the above copyright
Vkadaba 5:0728bde67bdb 11 notice, this list of conditions and the following disclaimer in
Vkadaba 5:0728bde67bdb 12 the documentation and/or other materials provided with the
Vkadaba 5:0728bde67bdb 13 distribution.
Vkadaba 5:0728bde67bdb 14 - Neither the name of Analog Devices, Inc. nor the names of its
Vkadaba 5:0728bde67bdb 15 contributors may be used to endorse or promote products derived
Vkadaba 5:0728bde67bdb 16 from this software without specific prior written permission.
Vkadaba 5:0728bde67bdb 17 - The use of this software may or may not infringe the patent rights
Vkadaba 5:0728bde67bdb 18 of one or more patent holders. This license does not release you
Vkadaba 5:0728bde67bdb 19 from the requirement that you obtain separate licenses from these
Vkadaba 5:0728bde67bdb 20 patent holders to use this software.
Vkadaba 5:0728bde67bdb 21 - Use of the software either in source or binary form, must be run
Vkadaba 5:0728bde67bdb 22 on or directly connected to an Analog Devices Inc. component.
Vkadaba 5:0728bde67bdb 23
Vkadaba 5:0728bde67bdb 24 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
Vkadaba 5:0728bde67bdb 25 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
Vkadaba 5:0728bde67bdb 26 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
Vkadaba 5:0728bde67bdb 27 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
Vkadaba 5:0728bde67bdb 28 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
Vkadaba 5:0728bde67bdb 29 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
Vkadaba 5:0728bde67bdb 30 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Vkadaba 5:0728bde67bdb 31 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Vkadaba 5:0728bde67bdb 32 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Vkadaba 5:0728bde67bdb 33 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Vkadaba 5:0728bde67bdb 34 */
Vkadaba 5:0728bde67bdb 35
Vkadaba 5:0728bde67bdb 36 /*!
Vkadaba 5:0728bde67bdb 37 ******************************************************************************
Vkadaba 5:0728bde67bdb 38 * @file: admw1001_config.h
Vkadaba 5:0728bde67bdb 39 * @brief: Configuration type definitions for ADMW1001.
Vkadaba 5:0728bde67bdb 40 *-----------------------------------------------------------------------------
Vkadaba 5:0728bde67bdb 41 */
Vkadaba 5:0728bde67bdb 42
Vkadaba 5:0728bde67bdb 43 #ifndef __ADMW1001_CONFIG_H__
Vkadaba 5:0728bde67bdb 44 #define __ADMW1001_CONFIG_H__
Vkadaba 5:0728bde67bdb 45
Vkadaba 5:0728bde67bdb 46 #include "admw_platform.h"
Vkadaba 5:0728bde67bdb 47 #include "admw1001_sensor_types.h"
Vkadaba 5:0728bde67bdb 48
Vkadaba 5:0728bde67bdb 49 /*! @addtogroup ADMW1001_Api
Vkadaba 5:0728bde67bdb 50 * @{
Vkadaba 5:0728bde67bdb 51 */
Vkadaba 5:0728bde67bdb 52
Vkadaba 5:0728bde67bdb 53 #ifdef __cplusplus
Vkadaba 5:0728bde67bdb 54 extern "C" {
Vkadaba 5:0728bde67bdb 55 #endif
Vkadaba 5:0728bde67bdb 56
Vkadaba 5:0728bde67bdb 57 /*! Maximum length allowed for a digital sensor command */
Vkadaba 5:0728bde67bdb 58 #define ADMW1001_SENSOR_COMMAND_MAX_LENGTH 7
Vkadaba 5:0728bde67bdb 59
Vkadaba 5:0728bde67bdb 60 /*! ADMW1001 channel priority options */
Vkadaba 45:f5f553b8c0d5 61 typedef enum
Vkadaba 45:f5f553b8c0d5 62 {
Vkadaba 5:0728bde67bdb 63 ADMW1001_CHANNEL_PRIORITY_0 = 0,
Vkadaba 5:0728bde67bdb 64 ADMW1001_CHANNEL_PRIORITY_1,
Vkadaba 5:0728bde67bdb 65 ADMW1001_CHANNEL_PRIORITY_2,
Vkadaba 5:0728bde67bdb 66 ADMW1001_CHANNEL_PRIORITY_3,
Vkadaba 5:0728bde67bdb 67 ADMW1001_CHANNEL_PRIORITY_4,
Vkadaba 5:0728bde67bdb 68 ADMW1001_CHANNEL_PRIORITY_5,
Vkadaba 5:0728bde67bdb 69 ADMW1001_CHANNEL_PRIORITY_6,
Vkadaba 5:0728bde67bdb 70 ADMW1001_CHANNEL_PRIORITY_7,
Vkadaba 5:0728bde67bdb 71 ADMW1001_CHANNEL_PRIORITY_8,
Vkadaba 5:0728bde67bdb 72 ADMW1001_CHANNEL_PRIORITY_9,
Vkadaba 5:0728bde67bdb 73 ADMW1001_CHANNEL_PRIORITY_10,
Vkadaba 5:0728bde67bdb 74 ADMW1001_CHANNEL_PRIORITY_11,
Vkadaba 5:0728bde67bdb 75 ADMW1001_CHANNEL_PRIORITY_12,
Vkadaba 5:0728bde67bdb 76
Vkadaba 5:0728bde67bdb 77 ADMW1001_CHANNEL_PRIORITY_HIGHEST = ADMW1001_CHANNEL_PRIORITY_0,
Vkadaba 8:2f2775c34640 78 ADMW1001_CHANNEL_PRIORITY_LOWEST = ADMW1001_CHANNEL_PRIORITY_12,
Vkadaba 8:2f2775c34640 79
Vkadaba 8:2f2775c34640 80 } ADMW1001_CHANNEL_PRIORITY;
Vkadaba 5:0728bde67bdb 81
Vkadaba 5:0728bde67bdb 82 /*! ADMW1001 operating mode options */
Vkadaba 45:f5f553b8c0d5 83 typedef enum
Vkadaba 45:f5f553b8c0d5 84 {
Vkadaba 5:0728bde67bdb 85 ADMW1001_OPERATING_MODE_SINGLECYCLE = 0,
Vkadaba 5:0728bde67bdb 86 /*!< Executes a single measurement cycle and stops */
Vkadaba 5:0728bde67bdb 87 ADMW1001_OPERATING_MODE_CONTINUOUS,
Vkadaba 5:0728bde67bdb 88 /*!< Continuously executes measurement cycles */
Vkadaba 8:2f2775c34640 89
Vkadaba 8:2f2775c34640 90 } ADMW1001_OPERATING_MODE;
Vkadaba 5:0728bde67bdb 91
Vkadaba 5:0728bde67bdb 92 /*! ADMW1001 data ready mode options */
Vkadaba 45:f5f553b8c0d5 93 typedef enum
Vkadaba 45:f5f553b8c0d5 94 {
Vkadaba 5:0728bde67bdb 95 ADMW1001_DATAREADY_PER_CONVERSION = 0,
Vkadaba 5:0728bde67bdb 96 /*!< The DATAREADY signal is asserted after completion of each conversion
Vkadaba 5:0728bde67bdb 97 * - a single data sample only from the latest completed conversion is
Vkadaba 5:0728bde67bdb 98 * stored in this mode
Vkadaba 5:0728bde67bdb 99 */
Vkadaba 5:0728bde67bdb 100 ADMW1001_DATAREADY_PER_CYCLE,
Vkadaba 5:0728bde67bdb 101 /*!< The DATAREADY signal is asserted after completion of each measurement
Vkadaba 5:0728bde67bdb 102 * cycle
Vkadaba 5:0728bde67bdb 103 * - data samples only from the lastest completed measurement cycle are
Vkadaba 5:0728bde67bdb 104 * stored in this mode
Vkadaba 5:0728bde67bdb 105 */
Vkadaba 8:2f2775c34640 106 ADMW1001_DATAREADY_PER_FIFO_FILL,
Vkadaba 8:2f2775c34640 107 /*!< The DATAREADY signal is asserted after each fill of the data FIFO
Vkadaba 8:2f2775c34640 108 * - applicable only when @ref ADMW1001_OPERATING_MODE_CONTINUOUS or
Vkadaba 8:2f2775c34640 109 * @ref ADMW1001_OPERATING_MODE_MULTICYCLE is also selected
Vkadaba 5:0728bde67bdb 110 */
Vkadaba 8:2f2775c34640 111
Vkadaba 8:2f2775c34640 112 } ADMW1001_DATAREADY_MODE;
Vkadaba 5:0728bde67bdb 113
Vkadaba 5:0728bde67bdb 114 /*! ADMW1001 power mode options */
Vkadaba 45:f5f553b8c0d5 115 typedef enum
Vkadaba 45:f5f553b8c0d5 116 {
Vkadaba 50:d84305e5e1c0 117 ADMW1001_POWER_MODE_ACTIVE = 0,
Vkadaba 50:d84305e5e1c0 118 /*!< Part is fully powered up and either cycling through a sequence or awaiting a configuration */
Vkadaba 50:d84305e5e1c0 119 ADMW1001_POWER_MODE_HIBERNATION,
Vkadaba 6:9d393a9677f4 120 /*!< module has entede hibernation mode. All analog circuitry is disabled. All peripherals disabled apart from the Wake-up pin functionality. */
Vkadaba 5:0728bde67bdb 121
Vkadaba 8:2f2775c34640 122 } ADMW1001_POWER_MODE;
Vkadaba 8:2f2775c34640 123
Vkadaba 5:0728bde67bdb 124
Vkadaba 5:0728bde67bdb 125 /*! ADMW1001 measurement unit options
Vkadaba 5:0728bde67bdb 126 *
Vkadaba 5:0728bde67bdb 127 * Optionally select a measurement unit for final conversion results.
Vkadaba 5:0728bde67bdb 128 * Currently applicable only to specific temperature sensor types.
Vkadaba 5:0728bde67bdb 129 */
Vkadaba 45:f5f553b8c0d5 130 typedef enum
Vkadaba 45:f5f553b8c0d5 131 {
Vkadaba 5:0728bde67bdb 132 ADMW1001_MEASUREMENT_UNIT_UNSPECIFIED = 0,
Vkadaba 5:0728bde67bdb 133 /*!< No measurement unit specified */
Vkadaba 5:0728bde67bdb 134 ADMW1001_MEASUREMENT_UNIT_CELSIUS,
Vkadaba 5:0728bde67bdb 135 /*!< Celsius temperature unit - applicable to temperature sensors only */
Vkadaba 5:0728bde67bdb 136 ADMW1001_MEASUREMENT_UNIT_FAHRENHEIT,
Vkadaba 5:0728bde67bdb 137 /*!< Fahrenheit temperature unit - applicable to temperature sensors only */
Vkadaba 8:2f2775c34640 138
Vkadaba 8:2f2775c34640 139 } ADMW1001_MEASUREMENT_UNIT;
Vkadaba 5:0728bde67bdb 140
Vkadaba 45:f5f553b8c0d5 141 typedef enum
Vkadaba 45:f5f553b8c0d5 142 {
Vkadaba 33:df7a00f1b8e1 143 ADMW1001_BUFFER_BYPASSS_DISABLED = 0,
Vkadaba 33:df7a00f1b8e1 144 /*!< Buffer Bypass Disabled */
Vkadaba 33:df7a00f1b8e1 145 ADMW1001_BUFFER_BYPASSS_ENABLED,
Vkadaba 33:df7a00f1b8e1 146 /*!< Buffer Bypass Enabled */
Vkadaba 34:b60ee1e0af2b 147
Vkadaba 33:df7a00f1b8e1 148 } ADMW1001_BUFFER_BYPASSS;
Vkadaba 33:df7a00f1b8e1 149
Vkadaba 5:0728bde67bdb 150 /*! ADMW1001 analog input signal amplification gain options
Vkadaba 5:0728bde67bdb 151 *
Vkadaba 5:0728bde67bdb 152 * @note applicable only to ADC analog sensor channels
Vkadaba 5:0728bde67bdb 153 */
Vkadaba 45:f5f553b8c0d5 154 typedef enum
Vkadaba 45:f5f553b8c0d5 155 {
Vkadaba 6:9d393a9677f4 156 ADMW1001_ADC_RTD_CURVE_EUROPEAN = 0,
Vkadaba 6:9d393a9677f4 157 /*!< EUROPEAN RTD curve used. */
Vkadaba 6:9d393a9677f4 158 ADMW1001_ADC_RTD_CURVE_AMERICAN,
Vkadaba 6:9d393a9677f4 159 /*!< AMERICAN RTD curve used. */
Vkadaba 6:9d393a9677f4 160 ADMW1001_ADC_RTD_CURVE_JAPANESE,
Vkadaba 6:9d393a9677f4 161 /*!< JAPANESE RTD curve used. */
Vkadaba 6:9d393a9677f4 162 ADMW1001_ADC_RTD_CURVE_ITS90,
Vkadaba 6:9d393a9677f4 163 /*!< ITS90 RTD curve used. */
Vkadaba 8:2f2775c34640 164
Vkadaba 8:2f2775c34640 165 } ADMW1001_ADC_RTD_CURVE;
Vkadaba 6:9d393a9677f4 166 /*! ADMW1001 analog input signal amplification gain options
Vkadaba 6:9d393a9677f4 167 *
Vkadaba 6:9d393a9677f4 168 * @note applicable only to ADC analog sensor channels
Vkadaba 6:9d393a9677f4 169 */
Vkadaba 45:f5f553b8c0d5 170 typedef enum
Vkadaba 45:f5f553b8c0d5 171 {
Vkadaba 5:0728bde67bdb 172 ADMW1001_ADC_GAIN_1X = 0,
Vkadaba 5:0728bde67bdb 173 /*!< no amplification gain */
Vkadaba 5:0728bde67bdb 174 ADMW1001_ADC_GAIN_2X,
Vkadaba 5:0728bde67bdb 175 /*!< x2 amplification gain */
Vkadaba 5:0728bde67bdb 176 ADMW1001_ADC_GAIN_4X,
Vkadaba 5:0728bde67bdb 177 /*!< x4 amplification gain */
Vkadaba 5:0728bde67bdb 178 ADMW1001_ADC_GAIN_8X,
Vkadaba 5:0728bde67bdb 179 /*!< x8 amplification gain */
Vkadaba 5:0728bde67bdb 180 ADMW1001_ADC_GAIN_16X,
Vkadaba 5:0728bde67bdb 181 /*!< x16 amplification gain */
Vkadaba 5:0728bde67bdb 182 ADMW1001_ADC_GAIN_32X,
Vkadaba 5:0728bde67bdb 183 /*!< x32 amplification gain */
Vkadaba 5:0728bde67bdb 184 ADMW1001_ADC_GAIN_64X,
Vkadaba 5:0728bde67bdb 185 /*!< x64 amplification gain */
Vkadaba 8:2f2775c34640 186
Vkadaba 8:2f2775c34640 187 } ADMW1001_ADC_GAIN;
Vkadaba 5:0728bde67bdb 188
Vkadaba 6:9d393a9677f4 189 /*! ADMW1001 analog sensor excitation state options
Vkadaba 6:9d393a9677f4 190 *
Vkadaba 6:9d393a9677f4 191 * @note applicable only to ADC analog sensor channels, and
Vkadaba 6:9d393a9677f4 192 * specific sensor types
Vkadaba 6:9d393a9677f4 193 */
Vkadaba 45:f5f553b8c0d5 194 typedef enum
Vkadaba 45:f5f553b8c0d5 195 {
Vkadaba 45:f5f553b8c0d5 196 ADMW1001_ADC_EXC_STATE_CYCLE_POWER = 0,
Vkadaba 33:df7a00f1b8e1 197 /*!< Excitation for measurement is active only during measurement */
Vkadaba 6:9d393a9677f4 198 ADMW1001_ADC_EXC_STATE_ALWAYS_ON,
Vkadaba 6:9d393a9677f4 199 /*!< Excitation for measurement is always on */
Vkadaba 45:f5f553b8c0d5 200
Vkadaba 8:2f2775c34640 201 } ADMW1001_ADC_EXC_STATE;
Vkadaba 6:9d393a9677f4 202
Vkadaba 5:0728bde67bdb 203 /*! ADMW1001 analog sensor excitation current output level options
Vkadaba 5:0728bde67bdb 204 *
Vkadaba 5:0728bde67bdb 205 * @note applicable only to ADC analog sensor channels, and
Vkadaba 5:0728bde67bdb 206 * specific sensor types
Vkadaba 5:0728bde67bdb 207 */
Vkadaba 45:f5f553b8c0d5 208 typedef enum
Vkadaba 45:f5f553b8c0d5 209 {
Vkadaba 18:cbf514cce921 210 ADMW1001_ADC_NO_EXTERNAL_EXC_CURRENT = -1,
Vkadaba 34:b60ee1e0af2b 211 /*!< NO External excitation is provided */
Vkadaba 6:9d393a9677f4 212 ADMW1001_ADC_EXC_CURRENT_EXTERNAL = 0,
Vkadaba 34:b60ee1e0af2b 213 /*!< External excitation is provided */
Vkadaba 5:0728bde67bdb 214 ADMW1001_ADC_EXC_CURRENT_50uA,
Vkadaba 5:0728bde67bdb 215 /*!< 50uA excitation current enabled */
Vkadaba 5:0728bde67bdb 216 ADMW1001_ADC_EXC_CURRENT_100uA,
Vkadaba 5:0728bde67bdb 217 /*!< 100uA excitation current */
Vkadaba 5:0728bde67bdb 218 ADMW1001_ADC_EXC_CURRENT_250uA,
Vkadaba 5:0728bde67bdb 219 /*!< 250uA excitation current enabled */
Vkadaba 5:0728bde67bdb 220 ADMW1001_ADC_EXC_CURRENT_500uA,
Vkadaba 5:0728bde67bdb 221 /*!< 500uA excitation current enabled */
Vkadaba 5:0728bde67bdb 222 ADMW1001_ADC_EXC_CURRENT_1000uA,
Vkadaba 5:0728bde67bdb 223 /*!< 1mA excitation current enabled */
Vkadaba 8:2f2775c34640 224
Vkadaba 8:2f2775c34640 225 } ADMW1001_ADC_EXC_CURRENT;
Vkadaba 5:0728bde67bdb 226
Vkadaba 5:0728bde67bdb 227 /*! ADMW1001 analog sensor excitation current ratios used for diode sensor
Vkadaba 5:0728bde67bdb 228 *
Vkadaba 5:0728bde67bdb 229 * @note applicable only to a diode sensor
Vkadaba 5:0728bde67bdb 230 */
Vkadaba 45:f5f553b8c0d5 231 typedef enum
Vkadaba 45:f5f553b8c0d5 232 {
Vkadaba 34:b60ee1e0af2b 233 ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_10UA_100UA = 0,
Vkadaba 6:9d393a9677f4 234 /**< 2 Current measurement 10uA 100uA */
Vkadaba 34:b60ee1e0af2b 235 ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_20UA_160UA,
Vkadaba 6:9d393a9677f4 236 /**< 2 Current measurement 20uA 160uA */
Vkadaba 34:b60ee1e0af2b 237 ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_50UA_300UA,
Vkadaba 6:9d393a9677f4 238 /**< 2 Current measurement 50uA 300uA */
Vkadaba 34:b60ee1e0af2b 239 ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_100UA_600UA,
Vkadaba 6:9d393a9677f4 240 /**< 2 Current measurement 100uA 600uA */
Vkadaba 34:b60ee1e0af2b 241 ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_10UA_50UA_100UA,
Vkadaba 6:9d393a9677f4 242 /**< 3 current measuremetn 10uA 50uA 100uA */
Vkadaba 34:b60ee1e0af2b 243 ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_20UA_100UA_160UA,
Vkadaba 6:9d393a9677f4 244 /**< 3 current measuremetn 20uA 100uA 160uA */
Vkadaba 34:b60ee1e0af2b 245 ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_50UA_150UA_300UA,
Vkadaba 6:9d393a9677f4 246 /**< 3 current measuremetn 50uA 150uA 300uA */
Vkadaba 6:9d393a9677f4 247 ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_100UA_300UA_600UA,
Vkadaba 6:9d393a9677f4 248 /**< 3 current measuremetn 100uA 300uA 600uA */
Vkadaba 8:2f2775c34640 249
Vkadaba 8:2f2775c34640 250 } ADMW1001_ADC_EXC_CURRENT_DIODE_RATIO;
Vkadaba 5:0728bde67bdb 251
Vkadaba 5:0728bde67bdb 252 /*! ADMW1001 analog reference selection options
Vkadaba 5:0728bde67bdb 253 *
Vkadaba 5:0728bde67bdb 254 * @note applicable only to ADC analog sensor channels, and
Vkadaba 5:0728bde67bdb 255 * specific sensor types
Vkadaba 5:0728bde67bdb 256 */
Vkadaba 45:f5f553b8c0d5 257 typedef enum
Vkadaba 45:f5f553b8c0d5 258 {
Vkadaba 8:2f2775c34640 259 ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL = 0,
Vkadaba 8:2f2775c34640 260 /*!< Internal VRef - 1.2V */
Vkadaba 61:0f16a2e3b58b 261 ADMW1001_ADC_REFERENCE_VOLTAGE_EXTERNAL_1 = 1,
Vkadaba 8:2f2775c34640 262 /*!< External reference voltage #1 */
Vkadaba 61:0f16a2e3b58b 263 ADMW1001_ADC_REFERENCE_VOLTAGE_AVDD = 3,
Vkadaba 61:0f16a2e3b58b 264 /*!< Analog Supply Voltage AVDD reference (typically 3.3V) is selected */
Vkadaba 5:0728bde67bdb 265
Vkadaba 8:2f2775c34640 266 } ADMW1001_ADC_REFERENCE_TYPE;
Vkadaba 5:0728bde67bdb 267
Vkadaba 6:9d393a9677f4 268 /*! ADMW1001 ADC Reference configuration
Vkadaba 6:9d393a9677f4 269 *
Vkadaba 6:9d393a9677f4 270 * @note applicable only to ADC analog sensor channels
Vkadaba 6:9d393a9677f4 271 */
Vkadaba 45:f5f553b8c0d5 272 typedef enum
Vkadaba 45:f5f553b8c0d5 273 {
Vkadaba 6:9d393a9677f4 274 ADMW1001_ADC_GND_SW_OPEN = 0,
Vkadaba 6:9d393a9677f4 275 /*!< Ground switch not enabled for measurement. */
Vkadaba 6:9d393a9677f4 276 ADMW1001_ADC_GND_SW_CLOSED,
Vkadaba 8:2f2775c34640 277 /*!< Ground switch enabled for measurement. */
Vkadaba 8:2f2775c34640 278
Vkadaba 8:2f2775c34640 279 } ADMW1001_ADC_GND_SW;
Vkadaba 8:2f2775c34640 280
Vkadaba 8:2f2775c34640 281 /*! ADMW1001 analog filter chop mode
Vkadaba 8:2f2775c34640 282 *
Vkadaba 8:2f2775c34640 283 * @note applicable only to ADC analog sensor channels
Vkadaba 8:2f2775c34640 284 */
Vkadaba 45:f5f553b8c0d5 285 typedef enum
Vkadaba 45:f5f553b8c0d5 286 {
Vkadaba 63:2655a04c00f5 287 ADMW1001_CHOP_MD_OFF = 0,
Vkadaba 63:2655a04c00f5 288 /*!< chop performed. */
Vkadaba 63:2655a04c00f5 289 ADMW1001_CHOP_MD_ON,
Vkadaba 34:b60ee1e0af2b 290
Vkadaba 8:2f2775c34640 291 } ADMW1001_CHOP_MD;
Vkadaba 6:9d393a9677f4 292
Vkadaba 5:0728bde67bdb 293 /*! ADMW1001 analog filter selection options
Vkadaba 5:0728bde67bdb 294 *
Vkadaba 5:0728bde67bdb 295 * @note applicable only to ADC analog sensor channels
Vkadaba 5:0728bde67bdb 296 */
Vkadaba 45:f5f553b8c0d5 297 typedef enum
Vkadaba 45:f5f553b8c0d5 298 {
Vkadaba 6:9d393a9677f4 299 ADMW1001_ADC_FILTER_SINC4 = 0,
Vkadaba 8:2f2775c34640 300 /*!< SINC4 - 4th order sinc response filter */
Vkadaba 6:9d393a9677f4 301 ADMW1001_ADC_FILTER_SINC3,
Vkadaba 8:2f2775c34640 302 /*!< SINC3 - 3rd order sinc response filter */
Vkadaba 8:2f2775c34640 303
Vkadaba 8:2f2775c34640 304 } ADMW1001_ADC_FILTER_TYPE;
Vkadaba 8:2f2775c34640 305
Vkadaba 8:2f2775c34640 306 /*! ADMW1001 Sinc Filter range (SF)
Vkadaba 8:2f2775c34640 307 *
Vkadaba 8:2f2775c34640 308 * @note applicable only to ADC analog sensor channels
Vkadaba 34:b60ee1e0af2b 309 * @note SF must be set in conjunction with chop mode
Vkadaba 8:2f2775c34640 310 * and sinc filter type to achieve the desired sampling rate.
Vkadaba 8:2f2775c34640 311 */
Vkadaba 45:f5f553b8c0d5 312 typedef enum
Vkadaba 45:f5f553b8c0d5 313 {
Vkadaba 8:2f2775c34640 314 ADMW1001_SF_122HZ = 7,
Vkadaba 8:2f2775c34640 315 /*!< SF setting for 122Hz sample rate. */
Vkadaba 8:2f2775c34640 316 ADMW1001_SF_61HZ = 31,
Vkadaba 8:2f2775c34640 317 /*!< SF setting for 61Hz sample rate. */
Vkadaba 8:2f2775c34640 318 ADMW1001_SF_30P5HZ = 51,
Vkadaba 8:2f2775c34640 319 /*!< SF setting for 61Hz sample rate. */
Vkadaba 8:2f2775c34640 320 ADMW1001_SF_10HZ = 124,
Vkadaba 8:2f2775c34640 321 /*!< SF setting for 10Hz sample rate. */
Vkadaba 8:2f2775c34640 322 ADMW1001_SF_8P24HZ = 125,
Vkadaba 8:2f2775c34640 323 /*!< SF setting for 8.24Hz sample rate. */
Vkadaba 8:2f2775c34640 324 ADMW1001_SF_5HZ = 127,
Vkadaba 8:2f2775c34640 325 /*!< SF setting for 5Hz sample rate. */
Vkadaba 8:2f2775c34640 326
Vkadaba 8:2f2775c34640 327 } ADMW1001_SINC_FILTER_RANGE;
Vkadaba 5:0728bde67bdb 328
Vkadaba 5:0728bde67bdb 329 /*! ADMW1001 I2C clock speed options
Vkadaba 5:0728bde67bdb 330 *
Vkadaba 5:0728bde67bdb 331 * @note applicable only for I2C sensors
Vkadaba 5:0728bde67bdb 332 */
Vkadaba 45:f5f553b8c0d5 333 typedef enum
Vkadaba 45:f5f553b8c0d5 334 {
Vkadaba 8:2f2775c34640 335 ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED_100K = 0,
Vkadaba 5:0728bde67bdb 336 /*!< 100kHz I2C clock speed */
Vkadaba 8:2f2775c34640 337 ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED_400K,
Vkadaba 5:0728bde67bdb 338 /*!< 400kHz I2C clock speed */
Vkadaba 8:2f2775c34640 339
Vkadaba 8:2f2775c34640 340 } ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED;
Vkadaba 5:0728bde67bdb 341
Vkadaba 5:0728bde67bdb 342
Vkadaba 5:0728bde67bdb 343 /*! ADMW1001 Power Configuration options */
Vkadaba 45:f5f553b8c0d5 344 typedef struct
Vkadaba 45:f5f553b8c0d5 345 {
Vkadaba 5:0728bde67bdb 346 ADMW1001_POWER_MODE powerMode;
Vkadaba 5:0728bde67bdb 347 /*!< Power mode selection */
Vkadaba 8:2f2775c34640 348
Vkadaba 8:2f2775c34640 349 } ADMW1001_POWER_CONFIG;
Vkadaba 5:0728bde67bdb 350
Vkadaba 5:0728bde67bdb 351 /*! ADMW1001 Multi-Cycle Configuration options
Vkadaba 5:0728bde67bdb 352 *
Vkadaba 5:0728bde67bdb 353 * @note required only when ADMW1001_OPERATING_MODE_MULTICYCLE is selected
Vkadaba 5:0728bde67bdb 354 * as the operatingMode (@ref ADMW1001_MEASUREMENT_CONFIG)
Vkadaba 5:0728bde67bdb 355 */
Vkadaba 45:f5f553b8c0d5 356 typedef struct
Vkadaba 45:f5f553b8c0d5 357 {
Vkadaba 8:2f2775c34640 358 uint32_t cyclesPerBurst;
Vkadaba 5:0728bde67bdb 359 /*!< Number of cycles to complete for a single burst */
Vkadaba 8:2f2775c34640 360 uint32_t burstInterval;
Vkadaba 5:0728bde67bdb 361 /*!< Interval, in seconds, between each successive burst of cycles */
Vkadaba 8:2f2775c34640 362
Vkadaba 8:2f2775c34640 363 } ADMW1001_MULTICYCLE_CONFIG;
Vkadaba 5:0728bde67bdb 364
Vkadaba 5:0728bde67bdb 365 /*! ADMW1001 Measurement Configuration options */
Vkadaba 45:f5f553b8c0d5 366 typedef struct
Vkadaba 45:f5f553b8c0d5 367 {
Vkadaba 5:0728bde67bdb 368 ADMW1001_OPERATING_MODE operatingMode;
Vkadaba 5:0728bde67bdb 369 /*!< Operating mode - specifies how measurement cycles are scheduled */
Vkadaba 5:0728bde67bdb 370 ADMW1001_DATAREADY_MODE dataReadyMode;
Vkadaba 5:0728bde67bdb 371 /*!< Data read mode - specifies how output samples are stored for reading */
Vkadaba 45:f5f553b8c0d5 372 uint8_t excitationState;
Vkadaba 43:e1789b7214cf 373 /*!< Excitation current state */
Vkadaba 45:f5f553b8c0d5 374 uint8_t groundSwitch;
Vkadaba 45:f5f553b8c0d5 375 /*!< Option to open or close sensor ground switch */
Vkadaba 50:d84305e5e1c0 376 uint8_t fifoNumCycles;
Vkadaba 50:d84305e5e1c0 377 /*!< Specifies the number of cycles to fill a FIFO buffer
Vkadaba 50:d84305e5e1c0 378 * Applicable only when operatingMode is ADMW1001_OPERATING_MODE_CONTINUOUS
Vkadaba 34:b60ee1e0af2b 379 */
Vkadaba 8:2f2775c34640 380 uint32_t cycleInterval;
Vkadaba 8:2f2775c34640 381 /*!< Cycle interval - specifies the time interval between the start of each
Vkadaba 8:2f2775c34640 382 * successive measurement cycle. Applicable only when operatingMode is
Vkadaba 8:2f2775c34640 383 * not ADMW1001_OPERATING_MODE_SINGLECYCLE
Vkadaba 8:2f2775c34640 384 */
Vkadaba 8:2f2775c34640 385 bool vBiasEnable;
Vkadaba 8:2f2775c34640 386 /*!< Enable voltage Bias output of ADC
Vkadaba 8:2f2775c34640 387 */
Vkadaba 8:2f2775c34640 388 float32_t externalRef1Value;
Vkadaba 8:2f2775c34640 389 /*!< Voltage value connected to external reference input #1.
Vkadaba 5:0728bde67bdb 390 * Applicable only if the selected reference type is
Vkadaba 8:2f2775c34640 391 * voltage.
Vkadaba 5:0728bde67bdb 392 * (see @ref ADMW1001_ADC_REFERENCE_TYPE)
Vkadaba 34:b60ee1e0af2b 393 */
Vkadaba 33:df7a00f1b8e1 394 float32_t RSenseValue;
Vkadaba 34:b60ee1e0af2b 395 /*!< Sense resistor value in Ohms. */
Vkadaba 34:b60ee1e0af2b 396 float32_t externalRefVoltage;
Vkadaba 34:b60ee1e0af2b 397 /*!< External Reference Voltage.
Vkadaba 34:b60ee1e0af2b 398 */
Vkadaba 45:f5f553b8c0d5 399 float32_t AVDDVoltage;
Vkadaba 45:f5f553b8c0d5 400 /*!< AVDD Voltage.
Vkadaba 45:f5f553b8c0d5 401 */
Vkadaba 45:f5f553b8c0d5 402 uint32_t reserved1[1];
Vkadaba 45:f5f553b8c0d5 403 /*!< Reserved for future use and ensure word alignment.
Vkadaba 45:f5f553b8c0d5 404 */
Vkadaba 8:2f2775c34640 405
Vkadaba 8:2f2775c34640 406 } ADMW1001_MEASUREMENT_CONFIG;
Vkadaba 5:0728bde67bdb 407
Vkadaba 5:0728bde67bdb 408 /*! ADMW1001 ADC Excitation Current output configuration
Vkadaba 5:0728bde67bdb 409 *
Vkadaba 5:0728bde67bdb 410 * @note applicable only to ADC analog sensor channels, and
Vkadaba 5:0728bde67bdb 411 * specific sensor types
Vkadaba 5:0728bde67bdb 412 */
Vkadaba 45:f5f553b8c0d5 413 typedef struct
Vkadaba 45:f5f553b8c0d5 414 {
Vkadaba 5:0728bde67bdb 415 ADMW1001_ADC_EXC_CURRENT outputLevel;
Vkadaba 5:0728bde67bdb 416 /*!< Excitation current output level */
Vkadaba 5:0728bde67bdb 417 ADMW1001_ADC_EXC_CURRENT_DIODE_RATIO diodeRatio;
Vkadaba 5:0728bde67bdb 418 /*!< Excitation current output diode ratio */
Vkadaba 45:f5f553b8c0d5 419 float32_t idealityRatio;
Vkadaba 8:2f2775c34640 420
Vkadaba 8:2f2775c34640 421 } ADMW1001_ADC_EXC_CURRENT_CONFIG;
Vkadaba 5:0728bde67bdb 422
Vkadaba 5:0728bde67bdb 423 /*! ADMW1001 ADC Filter configuration
Vkadaba 5:0728bde67bdb 424 *
Vkadaba 5:0728bde67bdb 425 * @note applicable only to ADC analog sensor channels
Vkadaba 5:0728bde67bdb 426 */
Vkadaba 45:f5f553b8c0d5 427 typedef struct
Vkadaba 45:f5f553b8c0d5 428 {
Vkadaba 8:2f2775c34640 429 ADMW1001_ADC_FILTER_TYPE type;
Vkadaba 5:0728bde67bdb 430 /*!< Filter type selection */
Vkadaba 8:2f2775c34640 431 ADMW1001_SINC_FILTER_RANGE sf;
Vkadaba 8:2f2775c34640 432 /*!< SF value used along with filter type and chop mode to determine speed */
Vkadaba 17:2f0028880874 433 ADMW1001_CHOP_MD chopMode;
Vkadaba 6:9d393a9677f4 434 /*!< Enable filter chop */
Vkadaba 8:2f2775c34640 435 bool notch1p2;
Vkadaba 6:9d393a9677f4 436 /*!< Enable Notch 2 Filter Mode */
Vkadaba 45:f5f553b8c0d5 437
Vkadaba 8:2f2775c34640 438 } ADMW1001_ADC_FILTER_CONFIG;
Vkadaba 5:0728bde67bdb 439
Vkadaba 5:0728bde67bdb 440 /*! ADMW1001 ADC analog channel configuration details
Vkadaba 5:0728bde67bdb 441 *
Vkadaba 5:0728bde67bdb 442 * @note applicable only to ADC analog sensor channels
Vkadaba 5:0728bde67bdb 443 */
Vkadaba 45:f5f553b8c0d5 444 typedef struct
Vkadaba 45:f5f553b8c0d5 445 {
Vkadaba 5:0728bde67bdb 446 ADMW1001_ADC_SENSOR_TYPE sensor;
Vkadaba 5:0728bde67bdb 447 /*!< Sensor type selection */
Vkadaba 6:9d393a9677f4 448 ADMW1001_ADC_RTD_CURVE rtdCurve;
Vkadaba 6:9d393a9677f4 449 /*!< Rtd curve selection */
Vkadaba 5:0728bde67bdb 450 ADMW1001_ADC_GAIN gain;
Vkadaba 5:0728bde67bdb 451 /*!< ADC Gain selection */
Vkadaba 5:0728bde67bdb 452 ADMW1001_ADC_EXC_CURRENT_CONFIG current;
Vkadaba 5:0728bde67bdb 453 /*!< ADC Excitation Current configuration */
Vkadaba 5:0728bde67bdb 454 ADMW1001_ADC_FILTER_CONFIG filter;
Vkadaba 5:0728bde67bdb 455 /*!< ADC Filter configuration */
Vkadaba 8:2f2775c34640 456 ADMW1001_ADC_REFERENCE_TYPE reference;
Vkadaba 5:0728bde67bdb 457 /*!< ADC Reference configuration */
Vkadaba 33:df7a00f1b8e1 458 uint8_t bufferBypass;
Vkadaba 45:f5f553b8c0d5 459 /*!< Buffer Bypass configuration */
Vkadaba 33:df7a00f1b8e1 460 uint8_t reserved0[2];
Vkadaba 8:2f2775c34640 461 /*!< Reserved for future use and ensure word alignment. */
Vkadaba 8:2f2775c34640 462 uint32_t reserved1[6];
Vkadaba 8:2f2775c34640 463 /*!< Reserved for future use and ensure word alignment. */
Vkadaba 8:2f2775c34640 464
Vkadaba 8:2f2775c34640 465 } ADMW1001_ADC_CHANNEL_CONFIG;
Vkadaba 8:2f2775c34640 466
Vkadaba 8:2f2775c34640 467 /*! ADMW1001 look-up table selection
Vkadaba 8:2f2775c34640 468 * Select table used to linearise the measurement.
Vkadaba 8:2f2775c34640 469 */
Vkadaba 45:f5f553b8c0d5 470 typedef enum
Vkadaba 45:f5f553b8c0d5 471 {
Vkadaba 8:2f2775c34640 472 ADMW1001_LUT_DEFAULT = 0,
Vkadaba 8:2f2775c34640 473 /*!< Default LUT */
Vkadaba 45:f5f553b8c0d5 474 ADMW1001_LUT_CUSTOM = 1,
Vkadaba 8:2f2775c34640 475 /*!< User defined custom LUT */
Vkadaba 45:f5f553b8c0d5 476 ADMW1001_LUT_RESERVED = 2,
Vkadaba 8:2f2775c34640 477 /*!< Reserved for future use */
Vkadaba 34:b60ee1e0af2b 478
Vkadaba 8:2f2775c34640 479 } ADMW1001_LUT_SELECT;
Vkadaba 5:0728bde67bdb 480
Vkadaba 5:0728bde67bdb 481 /*! ADMW1001 digital sensor data encoding
Vkadaba 5:0728bde67bdb 482 *
Vkadaba 5:0728bde67bdb 483 * @note applicable only to SPI and I2C digital sensor channels
Vkadaba 5:0728bde67bdb 484 */
Vkadaba 45:f5f553b8c0d5 485 typedef enum
Vkadaba 45:f5f553b8c0d5 486 {
Vkadaba 8:2f2775c34640 487 ADMW1001_DIGITAL_SENSOR_DATA_CODING_NONE = 0,
Vkadaba 5:0728bde67bdb 488 /**< None/Invalid - data format is ignored if coding is set to this value */
Vkadaba 5:0728bde67bdb 489 ADMW1001_DIGITAL_SENSOR_DATA_CODING_UNIPOLAR,
Vkadaba 5:0728bde67bdb 490 /**< Unipolar - unsigned integer values */
Vkadaba 5:0728bde67bdb 491 ADMW1001_DIGITAL_SENSOR_DATA_CODING_TWOS_COMPLEMENT,
Vkadaba 5:0728bde67bdb 492 /**< Twos-complement - signed integer values */
Vkadaba 5:0728bde67bdb 493 ADMW1001_DIGITAL_SENSOR_DATA_CODING_OFFSET_BINARY,
Vkadaba 5:0728bde67bdb 494 /**< Offset Binary - used to represent signed values with unsigned integers,
Vkadaba 5:0728bde67bdb 495 * with the mid-range value representing 0 */
Vkadaba 8:2f2775c34640 496
Vkadaba 8:2f2775c34640 497 } ADMW1001_DIGITAL_SENSOR_DATA_CODING;
Vkadaba 5:0728bde67bdb 498
Vkadaba 5:0728bde67bdb 499 /*! ADMW1001 digital sensor data format configuration
Vkadaba 5:0728bde67bdb 500 *
Vkadaba 5:0728bde67bdb 501 * @note applicable only to SPI and I2C digital sensor channels
Vkadaba 5:0728bde67bdb 502 */
Vkadaba 45:f5f553b8c0d5 503 typedef struct
Vkadaba 45:f5f553b8c0d5 504 {
Vkadaba 5:0728bde67bdb 505 ADMW1001_DIGITAL_SENSOR_DATA_CODING coding;
Vkadaba 5:0728bde67bdb 506 /**< Data Encoding of Sensor Result */
Vkadaba 5:0728bde67bdb 507 bool littleEndian;
Vkadaba 5:0728bde67bdb 508 /**< Set as true if data format is little-endian, false otherwise */
Vkadaba 5:0728bde67bdb 509 bool leftJustified;
Vkadaba 5:0728bde67bdb 510 /**< Set as true if data is left-justified in the data frame, false otherwise */
Vkadaba 5:0728bde67bdb 511 uint8_t frameLength;
Vkadaba 5:0728bde67bdb 512 /**< Data frame length (number of bytes to read from the sensor) */
Vkadaba 5:0728bde67bdb 513 uint8_t numDataBits;
Vkadaba 5:0728bde67bdb 514 /**< Number of relevant data bits to extract from the data frame */
Vkadaba 5:0728bde67bdb 515 uint8_t bitOffset;
Vkadaba 5:0728bde67bdb 516 /**< Data bit offset, relative to data alignment within the data frame */
Vkadaba 8:2f2775c34640 517 uint8_t reserved[2];
Vkadaba 8:2f2775c34640 518 /*!< Reserved for future use and ensure word alignment. */
Vkadaba 8:2f2775c34640 519
Vkadaba 8:2f2775c34640 520 } ADMW1001_DIGITAL_SENSOR_DATA_FORMAT;
Vkadaba 5:0728bde67bdb 521
Vkadaba 5:0728bde67bdb 522
Vkadaba 5:0728bde67bdb 523 /*! ADMW1001 digital sensor communication config
Vkadaba 5:0728bde67bdb 524 *
Vkadaba 5:0728bde67bdb 525 * @note applicable only to digital sensor channels
Vkadaba 5:0728bde67bdb 526 */
Vkadaba 45:f5f553b8c0d5 527 typedef struct
Vkadaba 45:f5f553b8c0d5 528 {
Vkadaba 8:2f2775c34640 529 bool useCustomCommsConfig;
Vkadaba 5:0728bde67bdb 530 /*!< Optional parameter to enable user digital communication settings */
Vkadaba 8:2f2775c34640 531 ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED i2cClockSpeed;
Vkadaba 5:0728bde67bdb 532 /*!< Optional parameter to configure specific i2c speed for i2c sensor */
Vkadaba 8:2f2775c34640 533
Vkadaba 8:2f2775c34640 534 } ADMW1001_DIGITAL_SENSOR_COMMS;
Vkadaba 5:0728bde67bdb 535
Vkadaba 5:0728bde67bdb 536 /*! ADMW1001 I2C digital channel configuration details
Vkadaba 5:0728bde67bdb 537 *
Vkadaba 5:0728bde67bdb 538 * @note applicable only to I2C digital sensor channels
Vkadaba 5:0728bde67bdb 539 */
Vkadaba 45:f5f553b8c0d5 540 typedef struct
Vkadaba 45:f5f553b8c0d5 541 {
Vkadaba 8:2f2775c34640 542 ADMW1001_I2C_SENSOR_TYPE sensor;
Vkadaba 5:0728bde67bdb 543 /*!< Sensor type selection */
Vkadaba 8:2f2775c34640 544 uint8_t deviceAddress;
Vkadaba 5:0728bde67bdb 545 /*!< I2C device address (7-bit) */
Vkadaba 8:2f2775c34640 546 uint8_t reserved;
Vkadaba 8:2f2775c34640 547 /*!< Reserved for future use and ensure word alignment. */
Vkadaba 8:2f2775c34640 548 ADMW1001_DIGITAL_SENSOR_DATA_FORMAT dataFormat;
Vkadaba 5:0728bde67bdb 549 /*!< Optional data format configuration to parse/extract data from the device.
Vkadaba 5:0728bde67bdb 550 * A default data format will be used if this is not specified.
Vkadaba 5:0728bde67bdb 551 * Applicable only to specific I2C sensor types
Vkadaba 5:0728bde67bdb 552 */
Vkadaba 8:2f2775c34640 553 ADMW1001_DIGITAL_SENSOR_COMMS configureComms;
Vkadaba 5:0728bde67bdb 554 /*!< Optional configuration to setup a user communication config.
Vkadaba 5:0728bde67bdb 555 * A default configuration will be used if this is not specified.
Vkadaba 5:0728bde67bdb 556 * Applicable only to specific I2C sensor types.
Vkadaba 5:0728bde67bdb 557 */
Vkadaba 8:2f2775c34640 558
Vkadaba 8:2f2775c34640 559 } ADMW1001_I2C_CHANNEL_CONFIG;
Vkadaba 5:0728bde67bdb 560
Vkadaba 5:0728bde67bdb 561
Vkadaba 5:0728bde67bdb 562 /*! ADMW1001 Measurement Channel configuration details */
Vkadaba 45:f5f553b8c0d5 563 typedef struct
Vkadaba 45:f5f553b8c0d5 564 {
Vkadaba 8:2f2775c34640 565 bool enableChannel;
Vkadaba 5:0728bde67bdb 566 /*!< Option to include this channel in normal measurement cycles */
Vkadaba 8:2f2775c34640 567 bool disablePublishing;
Vkadaba 5:0728bde67bdb 568 /*!< Option to disable publishing of data samples from this channel. The
Vkadaba 5:0728bde67bdb 569 * channel may still be included in measurement cycles, but data samples
Vkadaba 5:0728bde67bdb 570 * obtained from this channel will not be published. This is typically
Vkadaba 5:0728bde67bdb 571 * used for channels which are required only as a compensation reference
Vkadaba 5:0728bde67bdb 572 * for another channel (e.g. Cold-Junction Compensation channels).
Vkadaba 5:0728bde67bdb 573 */
Vkadaba 8:2f2775c34640 574 ADMW1001_CH_ID compensationChannel;
Vkadaba 8:2f2775c34640 575 /*!< Optional compensation channel. Set to ADMW1001_CH_ID_NONE if not
Vkadaba 5:0728bde67bdb 576 * required. Typically used for thermocouple sensors that require a
Vkadaba 5:0728bde67bdb 577 * separate measurement of the "cold-junction" temperature, which can be
Vkadaba 5:0728bde67bdb 578 * be provided by an RTD temperature sensor connected on a separate
Vkadaba 5:0728bde67bdb 579 * "compensation channel" */
Vkadaba 8:2f2775c34640 580 ADMW1001_LUT_SELECT lutSelect;
Vkadaba 8:2f2775c34640 581 /*!<Select Look Up Table LUT for calculations, this implies that the
Vkadaba 5:0728bde67bdb 582 * fundamental measurement for the sensor (typically mV or Ohms)
Vkadaba 8:2f2775c34640 583 * 0 = default, 1= unity, 2 = custom
Vkadaba 5:0728bde67bdb 584 */
Vkadaba 8:2f2775c34640 585 ADMW1001_MEASUREMENT_UNIT measurementUnit;
Vkadaba 5:0728bde67bdb 586 /*!< Optional measurement unit selection for conversion results. Applicable
Vkadaba 5:0728bde67bdb 587 * only for certain sensor types. Set to
Vkadaba 5:0728bde67bdb 588 * ADMW1001_MEASUREMENT_UNIT_DEFAULT if not applicable.
Vkadaba 5:0728bde67bdb 589 */
Vkadaba 8:2f2775c34640 590 float32_t lowThreshold;
Vkadaba 5:0728bde67bdb 591 /*!< Optional minimum threshold value for each processed sample, to be
Vkadaba 5:0728bde67bdb 592 * checked prior to publishing. A channel ALERT condition is raised
Vkadaba 5:0728bde67bdb 593 * if the processed value is lower than this threshold. Set to NaN
Vkadaba 5:0728bde67bdb 594 * if not required.
Vkadaba 5:0728bde67bdb 595 */
Vkadaba 8:2f2775c34640 596 float32_t highThreshold;
Vkadaba 5:0728bde67bdb 597 /*!< Optional maximum threshold value for each processed sample, to be
Vkadaba 5:0728bde67bdb 598 * checked prior to publishing. A channel ALERT condition is raised
Vkadaba 5:0728bde67bdb 599 * if the processed value is higher than this threshold. Set to NaN
Vkadaba 5:0728bde67bdb 600 * if not required.
Vkadaba 5:0728bde67bdb 601 */
Vkadaba 8:2f2775c34640 602 float32_t offsetAdjustment;
Vkadaba 5:0728bde67bdb 603 /*!< Optional offset adjustment value applied to each processed sample.
Vkadaba 5:0728bde67bdb 604 * Set to NaN or 0.0 if not required.
Vkadaba 5:0728bde67bdb 605 */
Vkadaba 8:2f2775c34640 606 float32_t gainAdjustment;
Vkadaba 5:0728bde67bdb 607 /*!< Optional gain adjustment value applied to each processed sample.
Vkadaba 5:0728bde67bdb 608 * Set to NaN or 1.0 if not required.
Vkadaba 5:0728bde67bdb 609 */
Vkadaba 8:2f2775c34640 610 float32_t sensorParameter;
Vkadaba 5:0728bde67bdb 611 /*!< Optional sensor parameter adjustment.
Vkadaba 5:0728bde67bdb 612 * Set to NaN or 0 if not required.
Vkadaba 5:0728bde67bdb 613 */
Vkadaba 8:2f2775c34640 614 uint32_t measurementsPerCycle;
Vkadaba 5:0728bde67bdb 615 /*!< The number of measurements to obtain from this channel within each
Vkadaba 5:0728bde67bdb 616 * cycle. Each enabled channel is measured in turn, until the number of
Vkadaba 5:0728bde67bdb 617 * measurements requested for the channel has been reached. A different
Vkadaba 5:0728bde67bdb 618 * number of measurements-per-cycle may be specified for each channel.
Vkadaba 5:0728bde67bdb 619 */
Vkadaba 8:2f2775c34640 620 uint32_t cycleSkipCount;
Vkadaba 5:0728bde67bdb 621 /*!< Optional number of cycles to skip, such that this channel is included
Vkadaba 5:0728bde67bdb 622 * in the sequence in only one of every (cycleSkipCount + 1) cycles that
Vkadaba 5:0728bde67bdb 623 * occur. If set to 0 (default), this channel is included in every cycle;
Vkadaba 5:0728bde67bdb 624 * if set to 1, this channel is included in every 2nd cycle; if set to 2,
Vkadaba 5:0728bde67bdb 625 * this channel is included in every 3rd cycle, and so on.
Vkadaba 5:0728bde67bdb 626 */
Vkadaba 8:2f2775c34640 627 uint32_t extraSettlingTime;
Vkadaba 5:0728bde67bdb 628 /*!< A minimum settling time is applied internally for each channel, based
Vkadaba 45:f5f553b8c0d5 629 * on the sensor type. However, additional settling time (milliseconds)
Vkadaba 5:0728bde67bdb 630 * can optionally be specified. Set to 0 if not required.
Vkadaba 5:0728bde67bdb 631 */
Vkadaba 8:2f2775c34640 632 ADMW1001_CHANNEL_PRIORITY priority;
Vkadaba 5:0728bde67bdb 633 /*!< By default, channels are arranged in the measurement sequence based on
Vkadaba 5:0728bde67bdb 634 * ascending order of channel ID. However, a priority-level may be
Vkadaba 5:0728bde67bdb 635 * specified per channel to force a different ordering of the channels,
Vkadaba 5:0728bde67bdb 636 * with higher-priority channels appearing before lower-priority channels.
Vkadaba 5:0728bde67bdb 637 * Channels with equal priority are ordered by ascending order of channel
Vkadaba 5:0728bde67bdb 638 * ID. Lower numbers indicate higher priority, with 0 being the highest.
Vkadaba 5:0728bde67bdb 639 * Set to 0 if not required.
Vkadaba 5:0728bde67bdb 640 */
Vkadaba 45:f5f553b8c0d5 641 union
Vkadaba 45:f5f553b8c0d5 642 {
Vkadaba 8:2f2775c34640 643 ADMW1001_ADC_CHANNEL_CONFIG adcChannelConfig;
Vkadaba 5:0728bde67bdb 644 /*!< ADC channel configuration - applicable only to ADC channels */
Vkadaba 8:2f2775c34640 645 ADMW1001_I2C_CHANNEL_CONFIG i2cChannelConfig;
Vkadaba 5:0728bde67bdb 646 /*!< I2C channel configuration - applicable only to I2C channels */
Vkadaba 5:0728bde67bdb 647 };
Vkadaba 6:9d393a9677f4 648 /*!< Only one of adcChannelConfig, i2cChannelConfig, spiChannelConfig
Vkadaba 6:9d393a9677f4 649 * is required, depending on the channel designation
Vkadaba 6:9d393a9677f4 650 * (analog, I2C, SPI)
Vkadaba 5:0728bde67bdb 651 */
Vkadaba 8:2f2775c34640 652
Vkadaba 8:2f2775c34640 653 } ADMW1001_CHANNEL_CONFIG;
Vkadaba 5:0728bde67bdb 654
Vkadaba 5:0728bde67bdb 655 /*! ADMW1001 Diagnostics configuration details */
Vkadaba 45:f5f553b8c0d5 656 typedef struct
Vkadaba 45:f5f553b8c0d5 657 {
Vkadaba 8:2f2775c34640 658 bool disableGlobalDiag;
Vkadaba 5:0728bde67bdb 659 /*!< Option to disable the following diagnostic checks on the ADC:
Vkadaba 5:0728bde67bdb 660 * - Reference Detection errors
Vkadaba 5:0728bde67bdb 661 * - Input under-/over-voltage errors
Vkadaba 5:0728bde67bdb 662 * - Calibration, Conversion and Saturation errors
Vkadaba 5:0728bde67bdb 663 */
Vkadaba 8:2f2775c34640 664 bool disableMeasurementDiag;
Vkadaba 5:0728bde67bdb 665 /*!< Option to disable additional checks per measurement channel:
Vkadaba 5:0728bde67bdb 666 * - High/low threshold limit violation
Vkadaba 5:0728bde67bdb 667 */
Vkadaba 8:2f2775c34640 668
Vkadaba 8:2f2775c34640 669 bool disableCriticalTempAbort;
Vkadaba 5:0728bde67bdb 670 /*!< Option to disable abort of measurement cycle if the operating
Vkadaba 5:0728bde67bdb 671 * temperature of the ADMW1001 has exceeded critical limits
Vkadaba 5:0728bde67bdb 672 */
Vkadaba 8:2f2775c34640 673
Vkadaba 45:f5f553b8c0d5 674 uint8_t osdFrequency;
Vkadaba 5:0728bde67bdb 675 /*!< Option to enable Open-Circuit Detection at a selected cycle interval */
Vkadaba 5:0728bde67bdb 676
Vkadaba 8:2f2775c34640 677 } ADMW1001_DIAGNOSTICS_CONFIG;
Vkadaba 8:2f2775c34640 678
Vkadaba 5:0728bde67bdb 679
Vkadaba 5:0728bde67bdb 680 /*! ADMW1001 Device configuration details */
Vkadaba 45:f5f553b8c0d5 681 typedef struct
Vkadaba 45:f5f553b8c0d5 682 {
Vkadaba 5:0728bde67bdb 683 ADMW1001_POWER_CONFIG power;
Vkadaba 5:0728bde67bdb 684 /*!< Power configuration details */
Vkadaba 5:0728bde67bdb 685 ADMW1001_MEASUREMENT_CONFIG measurement;
Vkadaba 5:0728bde67bdb 686 /*!< Measurement configuration details */
Vkadaba 5:0728bde67bdb 687 ADMW1001_DIAGNOSTICS_CONFIG diagnostics;
Vkadaba 5:0728bde67bdb 688 /*!< FFT configuration details */
Vkadaba 5:0728bde67bdb 689 ADMW1001_CHANNEL_CONFIG channels[ADMW1001_MAX_CHANNELS];
Vkadaba 5:0728bde67bdb 690 /*!< Channel-specific configuration details */
Vkadaba 8:2f2775c34640 691
Vkadaba 8:2f2775c34640 692 } ADMW1001_CONFIG;
Vkadaba 5:0728bde67bdb 693
Vkadaba 5:0728bde67bdb 694 #ifdef __cplusplus
Vkadaba 5:0728bde67bdb 695 }
Vkadaba 5:0728bde67bdb 696 #endif
Vkadaba 5:0728bde67bdb 697
Vkadaba 5:0728bde67bdb 698 /*!
Vkadaba 5:0728bde67bdb 699 * @}
Vkadaba 5:0728bde67bdb 700 */
Vkadaba 5:0728bde67bdb 701
Vkadaba 5:0728bde67bdb 702 #endif /* __ADMW1001_CONFIG_H__ */