Removed unwanted enums and unused functions

Committer:
Vkadaba
Date:
Thu Apr 09 12:39:43 2020 +0000
Revision:
64:d89d9728ba95
Parent:
63:6d048b2f3f32
code clean up part-2

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 /*! ADMW1001 measurement unit options
Vkadaba 5:0728bde67bdb 125 *
Vkadaba 5:0728bde67bdb 126 * Optionally select a measurement unit for final conversion results.
Vkadaba 5:0728bde67bdb 127 * Currently applicable only to specific temperature sensor types.
Vkadaba 5:0728bde67bdb 128 */
Vkadaba 45:f5f553b8c0d5 129 typedef enum
Vkadaba 45:f5f553b8c0d5 130 {
Vkadaba 5:0728bde67bdb 131 ADMW1001_MEASUREMENT_UNIT_UNSPECIFIED = 0,
Vkadaba 5:0728bde67bdb 132 /*!< No measurement unit specified */
Vkadaba 5:0728bde67bdb 133 ADMW1001_MEASUREMENT_UNIT_CELSIUS,
Vkadaba 5:0728bde67bdb 134 /*!< Celsius temperature unit - applicable to temperature sensors only */
Vkadaba 5:0728bde67bdb 135 ADMW1001_MEASUREMENT_UNIT_FAHRENHEIT,
Vkadaba 5:0728bde67bdb 136 /*!< Fahrenheit temperature unit - applicable to temperature sensors only */
Vkadaba 8:2f2775c34640 137
Vkadaba 8:2f2775c34640 138 } ADMW1001_MEASUREMENT_UNIT;
Vkadaba 5:0728bde67bdb 139
Vkadaba 45:f5f553b8c0d5 140 typedef enum
Vkadaba 45:f5f553b8c0d5 141 {
Vkadaba 33:df7a00f1b8e1 142 ADMW1001_BUFFER_BYPASSS_DISABLED = 0,
Vkadaba 33:df7a00f1b8e1 143 /*!< Buffer Bypass Disabled */
Vkadaba 33:df7a00f1b8e1 144 ADMW1001_BUFFER_BYPASSS_ENABLED,
Vkadaba 33:df7a00f1b8e1 145 /*!< Buffer Bypass Enabled */
Vkadaba 34:b60ee1e0af2b 146
Vkadaba 33:df7a00f1b8e1 147 } ADMW1001_BUFFER_BYPASSS;
Vkadaba 33:df7a00f1b8e1 148
Vkadaba 5:0728bde67bdb 149 /*! ADMW1001 analog input signal amplification gain options
Vkadaba 5:0728bde67bdb 150 *
Vkadaba 5:0728bde67bdb 151 * @note applicable only to ADC analog sensor channels
Vkadaba 5:0728bde67bdb 152 */
Vkadaba 45:f5f553b8c0d5 153 typedef enum
Vkadaba 45:f5f553b8c0d5 154 {
Vkadaba 6:9d393a9677f4 155 ADMW1001_ADC_RTD_CURVE_EUROPEAN = 0,
Vkadaba 6:9d393a9677f4 156 /*!< EUROPEAN RTD curve used. */
Vkadaba 6:9d393a9677f4 157 ADMW1001_ADC_RTD_CURVE_AMERICAN,
Vkadaba 6:9d393a9677f4 158 /*!< AMERICAN RTD curve used. */
Vkadaba 6:9d393a9677f4 159 ADMW1001_ADC_RTD_CURVE_JAPANESE,
Vkadaba 6:9d393a9677f4 160 /*!< JAPANESE RTD curve used. */
Vkadaba 6:9d393a9677f4 161 ADMW1001_ADC_RTD_CURVE_ITS90,
Vkadaba 6:9d393a9677f4 162 /*!< ITS90 RTD curve used. */
Vkadaba 8:2f2775c34640 163
Vkadaba 8:2f2775c34640 164 } ADMW1001_ADC_RTD_CURVE;
Vkadaba 6:9d393a9677f4 165 /*! ADMW1001 analog input signal amplification gain options
Vkadaba 6:9d393a9677f4 166 *
Vkadaba 6:9d393a9677f4 167 * @note applicable only to ADC analog sensor channels
Vkadaba 6:9d393a9677f4 168 */
Vkadaba 45:f5f553b8c0d5 169 typedef enum
Vkadaba 45:f5f553b8c0d5 170 {
Vkadaba 5:0728bde67bdb 171 ADMW1001_ADC_GAIN_1X = 0,
Vkadaba 5:0728bde67bdb 172 /*!< no amplification gain */
Vkadaba 5:0728bde67bdb 173 ADMW1001_ADC_GAIN_2X,
Vkadaba 5:0728bde67bdb 174 /*!< x2 amplification gain */
Vkadaba 5:0728bde67bdb 175 ADMW1001_ADC_GAIN_4X,
Vkadaba 5:0728bde67bdb 176 /*!< x4 amplification gain */
Vkadaba 5:0728bde67bdb 177 ADMW1001_ADC_GAIN_8X,
Vkadaba 5:0728bde67bdb 178 /*!< x8 amplification gain */
Vkadaba 5:0728bde67bdb 179 ADMW1001_ADC_GAIN_16X,
Vkadaba 5:0728bde67bdb 180 /*!< x16 amplification gain */
Vkadaba 5:0728bde67bdb 181 ADMW1001_ADC_GAIN_32X,
Vkadaba 5:0728bde67bdb 182 /*!< x32 amplification gain */
Vkadaba 5:0728bde67bdb 183 ADMW1001_ADC_GAIN_64X,
Vkadaba 5:0728bde67bdb 184 /*!< x64 amplification gain */
Vkadaba 8:2f2775c34640 185
Vkadaba 8:2f2775c34640 186 } ADMW1001_ADC_GAIN;
Vkadaba 5:0728bde67bdb 187
Vkadaba 6:9d393a9677f4 188 /*! ADMW1001 analog sensor excitation state options
Vkadaba 6:9d393a9677f4 189 *
Vkadaba 6:9d393a9677f4 190 * @note applicable only to ADC analog sensor channels, and
Vkadaba 6:9d393a9677f4 191 * specific sensor types
Vkadaba 6:9d393a9677f4 192 */
Vkadaba 45:f5f553b8c0d5 193 typedef enum
Vkadaba 45:f5f553b8c0d5 194 {
Vkadaba 45:f5f553b8c0d5 195 ADMW1001_ADC_EXC_STATE_CYCLE_POWER = 0,
Vkadaba 33:df7a00f1b8e1 196 /*!< Excitation for measurement is active only during measurement */
Vkadaba 6:9d393a9677f4 197 ADMW1001_ADC_EXC_STATE_ALWAYS_ON,
Vkadaba 6:9d393a9677f4 198 /*!< Excitation for measurement is always on */
Vkadaba 45:f5f553b8c0d5 199
Vkadaba 8:2f2775c34640 200 } ADMW1001_ADC_EXC_STATE;
Vkadaba 6:9d393a9677f4 201
Vkadaba 5:0728bde67bdb 202 /*! ADMW1001 analog sensor excitation current output level options
Vkadaba 5:0728bde67bdb 203 *
Vkadaba 5:0728bde67bdb 204 * @note applicable only to ADC analog sensor channels, and
Vkadaba 5:0728bde67bdb 205 * specific sensor types
Vkadaba 5:0728bde67bdb 206 */
Vkadaba 45:f5f553b8c0d5 207 typedef enum
Vkadaba 45:f5f553b8c0d5 208 {
Vkadaba 18:cbf514cce921 209 ADMW1001_ADC_NO_EXTERNAL_EXC_CURRENT = -1,
Vkadaba 34:b60ee1e0af2b 210 /*!< NO External excitation is provided */
Vkadaba 6:9d393a9677f4 211 ADMW1001_ADC_EXC_CURRENT_EXTERNAL = 0,
Vkadaba 34:b60ee1e0af2b 212 /*!< External excitation is provided */
Vkadaba 5:0728bde67bdb 213 ADMW1001_ADC_EXC_CURRENT_50uA,
Vkadaba 5:0728bde67bdb 214 /*!< 50uA excitation current enabled */
Vkadaba 5:0728bde67bdb 215 ADMW1001_ADC_EXC_CURRENT_100uA,
Vkadaba 5:0728bde67bdb 216 /*!< 100uA excitation current */
Vkadaba 5:0728bde67bdb 217 ADMW1001_ADC_EXC_CURRENT_250uA,
Vkadaba 5:0728bde67bdb 218 /*!< 250uA excitation current enabled */
Vkadaba 5:0728bde67bdb 219 ADMW1001_ADC_EXC_CURRENT_500uA,
Vkadaba 5:0728bde67bdb 220 /*!< 500uA excitation current enabled */
Vkadaba 5:0728bde67bdb 221 ADMW1001_ADC_EXC_CURRENT_1000uA,
Vkadaba 5:0728bde67bdb 222 /*!< 1mA excitation current enabled */
Vkadaba 8:2f2775c34640 223
Vkadaba 8:2f2775c34640 224 } ADMW1001_ADC_EXC_CURRENT;
Vkadaba 5:0728bde67bdb 225
Vkadaba 5:0728bde67bdb 226 /*! ADMW1001 analog sensor excitation current ratios used for diode sensor
Vkadaba 5:0728bde67bdb 227 *
Vkadaba 5:0728bde67bdb 228 * @note applicable only to a diode sensor
Vkadaba 5:0728bde67bdb 229 */
Vkadaba 45:f5f553b8c0d5 230 typedef enum
Vkadaba 45:f5f553b8c0d5 231 {
Vkadaba 34:b60ee1e0af2b 232 ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_10UA_100UA = 0,
Vkadaba 6:9d393a9677f4 233 /**< 2 Current measurement 10uA 100uA */
Vkadaba 34:b60ee1e0af2b 234 ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_20UA_160UA,
Vkadaba 6:9d393a9677f4 235 /**< 2 Current measurement 20uA 160uA */
Vkadaba 34:b60ee1e0af2b 236 ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_50UA_300UA,
Vkadaba 6:9d393a9677f4 237 /**< 2 Current measurement 50uA 300uA */
Vkadaba 34:b60ee1e0af2b 238 ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_100UA_600UA,
Vkadaba 6:9d393a9677f4 239 /**< 2 Current measurement 100uA 600uA */
Vkadaba 34:b60ee1e0af2b 240 ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_10UA_50UA_100UA,
Vkadaba 6:9d393a9677f4 241 /**< 3 current measuremetn 10uA 50uA 100uA */
Vkadaba 34:b60ee1e0af2b 242 ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_20UA_100UA_160UA,
Vkadaba 6:9d393a9677f4 243 /**< 3 current measuremetn 20uA 100uA 160uA */
Vkadaba 34:b60ee1e0af2b 244 ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_50UA_150UA_300UA,
Vkadaba 6:9d393a9677f4 245 /**< 3 current measuremetn 50uA 150uA 300uA */
Vkadaba 6:9d393a9677f4 246 ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_100UA_300UA_600UA,
Vkadaba 6:9d393a9677f4 247 /**< 3 current measuremetn 100uA 300uA 600uA */
Vkadaba 8:2f2775c34640 248
Vkadaba 8:2f2775c34640 249 } ADMW1001_ADC_EXC_CURRENT_DIODE_RATIO;
Vkadaba 5:0728bde67bdb 250
Vkadaba 5:0728bde67bdb 251 /*! ADMW1001 analog reference selection options
Vkadaba 5:0728bde67bdb 252 *
Vkadaba 5:0728bde67bdb 253 * @note applicable only to ADC analog sensor channels, and
Vkadaba 5:0728bde67bdb 254 * specific sensor types
Vkadaba 5:0728bde67bdb 255 */
Vkadaba 45:f5f553b8c0d5 256 typedef enum
Vkadaba 45:f5f553b8c0d5 257 {
Vkadaba 8:2f2775c34640 258 ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL = 0,
Vkadaba 8:2f2775c34640 259 /*!< Internal VRef - 1.2V */
Vkadaba 61:0f16a2e3b58b 260 ADMW1001_ADC_REFERENCE_VOLTAGE_EXTERNAL_1 = 1,
Vkadaba 8:2f2775c34640 261 /*!< External reference voltage #1 */
Vkadaba 61:0f16a2e3b58b 262 ADMW1001_ADC_REFERENCE_VOLTAGE_AVDD = 3,
Vkadaba 61:0f16a2e3b58b 263 /*!< Analog Supply Voltage AVDD reference (typically 3.3V) is selected */
Vkadaba 5:0728bde67bdb 264
Vkadaba 8:2f2775c34640 265 } ADMW1001_ADC_REFERENCE_TYPE;
Vkadaba 5:0728bde67bdb 266
Vkadaba 6:9d393a9677f4 267 /*! ADMW1001 ADC Reference configuration
Vkadaba 6:9d393a9677f4 268 *
Vkadaba 6:9d393a9677f4 269 * @note applicable only to ADC analog sensor channels
Vkadaba 6:9d393a9677f4 270 */
Vkadaba 45:f5f553b8c0d5 271 typedef enum
Vkadaba 45:f5f553b8c0d5 272 {
Vkadaba 6:9d393a9677f4 273 ADMW1001_ADC_GND_SW_OPEN = 0,
Vkadaba 6:9d393a9677f4 274 /*!< Ground switch not enabled for measurement. */
Vkadaba 6:9d393a9677f4 275 ADMW1001_ADC_GND_SW_CLOSED,
Vkadaba 8:2f2775c34640 276 /*!< Ground switch enabled for measurement. */
Vkadaba 8:2f2775c34640 277
Vkadaba 8:2f2775c34640 278 } ADMW1001_ADC_GND_SW;
Vkadaba 8:2f2775c34640 279
Vkadaba 8:2f2775c34640 280 /*! ADMW1001 analog filter chop mode
Vkadaba 8:2f2775c34640 281 *
Vkadaba 8:2f2775c34640 282 * @note applicable only to ADC analog sensor channels
Vkadaba 8:2f2775c34640 283 */
Vkadaba 45:f5f553b8c0d5 284 typedef enum
Vkadaba 45:f5f553b8c0d5 285 {
Vkadaba 63:6d048b2f3f32 286 ADMW1001_CHOP_MD_OFF = 0,
Vkadaba 8:2f2775c34640 287 /*!< No chop performed. */
Vkadaba 63:6d048b2f3f32 288 ADMW1001_CHOP_MD_ON = 1,
Vkadaba 63:6d048b2f3f32 289 /*!< Chop performed. */
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 /*! ADMW1001 SPI mode options
Vkadaba 5:0728bde67bdb 343 *
Vkadaba 5:0728bde67bdb 344 * @note applicable only for SPI sensors
Vkadaba 5:0728bde67bdb 345 */
Vkadaba 5:0728bde67bdb 346
Vkadaba 5:0728bde67bdb 347 /*! ADMW1001 SPI clock speed options
Vkadaba 5:0728bde67bdb 348 *
Vkadaba 5:0728bde67bdb 349 * @note applicable only for SPI sensors
Vkadaba 5:0728bde67bdb 350 */
Vkadaba 45:f5f553b8c0d5 351 typedef enum
Vkadaba 45:f5f553b8c0d5 352 {
Vkadaba 8:2f2775c34640 353 ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_8MHZ = 0,
Vkadaba 8:2f2775c34640 354 /*!< SPI Clock Speed configured to 8MHz */
Vkadaba 8:2f2775c34640 355 ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_4MHZ,
Vkadaba 8:2f2775c34640 356 /*!< SPI Clock Speed configured to 4MHz */
Vkadaba 8:2f2775c34640 357 ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_2MHZ,
Vkadaba 8:2f2775c34640 358 /*!< SPI Clock Speed configured to 2MHz */
Vkadaba 8:2f2775c34640 359 ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_1MHZ,
Vkadaba 8:2f2775c34640 360 /*!< SPI Clock Speed configured to 1MHz */
Vkadaba 8:2f2775c34640 361 ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_500KHZ,
Vkadaba 8:2f2775c34640 362 /*!< SPI Clock Speed configured to 500kHz */
Vkadaba 8:2f2775c34640 363 ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_250KHZ,
Vkadaba 8:2f2775c34640 364 /*!< SPI Clock Speed configured to 250kHz */
Vkadaba 8:2f2775c34640 365 ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_125KHZ,
Vkadaba 8:2f2775c34640 366 /*!< SPI Clock Speed configured to 125kHz */
Vkadaba 8:2f2775c34640 367 ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_62P5KHZ,
Vkadaba 8:2f2775c34640 368 /*!< SPI Clock Speed configured to 62.5kHz */
Vkadaba 8:2f2775c34640 369 ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_31P3KHZ,
Vkadaba 8:2f2775c34640 370 /*!< SPI Clock Speed configured to 31.3kHz */
Vkadaba 8:2f2775c34640 371 ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_15P6KHZ,
Vkadaba 8:2f2775c34640 372 /*!< SPI Clock Speed configured to 15.6kHz */
Vkadaba 8:2f2775c34640 373 ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_7P8KHZ,
Vkadaba 8:2f2775c34640 374 /*!< SPI Clock Speed configured to 7.8kHz */
Vkadaba 8:2f2775c34640 375 ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_3P9KHZ,
Vkadaba 8:2f2775c34640 376 /*!< SPI Clock Speed configured to 3.9kHz */
Vkadaba 8:2f2775c34640 377 ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_1P9KHZ,
Vkadaba 8:2f2775c34640 378 /*!< SPI Clock Speed configured to 1.9kHz */
Vkadaba 8:2f2775c34640 379 ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_977HZ,
Vkadaba 8:2f2775c34640 380 /*!< SPI Clock Speed configured to 977Hz */
Vkadaba 8:2f2775c34640 381 ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_488HZ,
Vkadaba 8:2f2775c34640 382 /*!< SPI Clock Speed configured to 488Hz */
Vkadaba 8:2f2775c34640 383 ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK_244HZ,
Vkadaba 8:2f2775c34640 384 /*!< SPI Clock Speed configured to 244Hz */
Vkadaba 8:2f2775c34640 385
Vkadaba 8:2f2775c34640 386 } ADMW1001_DIGITAL_SENSOR_COMMS_SPI_CLOCK;
Vkadaba 5:0728bde67bdb 387
Vkadaba 5:0728bde67bdb 388 /*! ADMW1001 Power Configuration options */
Vkadaba 45:f5f553b8c0d5 389 typedef struct
Vkadaba 45:f5f553b8c0d5 390 {
Vkadaba 5:0728bde67bdb 391 ADMW1001_POWER_MODE powerMode;
Vkadaba 5:0728bde67bdb 392 /*!< Power mode selection */
Vkadaba 8:2f2775c34640 393
Vkadaba 8:2f2775c34640 394 } ADMW1001_POWER_CONFIG;
Vkadaba 5:0728bde67bdb 395
Vkadaba 5:0728bde67bdb 396 /*! ADMW1001 Multi-Cycle Configuration options
Vkadaba 5:0728bde67bdb 397 *
Vkadaba 5:0728bde67bdb 398 * @note required only when ADMW1001_OPERATING_MODE_MULTICYCLE is selected
Vkadaba 5:0728bde67bdb 399 * as the operatingMode (@ref ADMW1001_MEASUREMENT_CONFIG)
Vkadaba 5:0728bde67bdb 400 */
Vkadaba 5:0728bde67bdb 401
Vkadaba 5:0728bde67bdb 402 /*! ADMW1001 Measurement Configuration options */
Vkadaba 45:f5f553b8c0d5 403 typedef struct
Vkadaba 45:f5f553b8c0d5 404 {
Vkadaba 5:0728bde67bdb 405 ADMW1001_OPERATING_MODE operatingMode;
Vkadaba 5:0728bde67bdb 406 /*!< Operating mode - specifies how measurement cycles are scheduled */
Vkadaba 5:0728bde67bdb 407 ADMW1001_DATAREADY_MODE dataReadyMode;
Vkadaba 5:0728bde67bdb 408 /*!< Data read mode - specifies how output samples are stored for reading */
Vkadaba 45:f5f553b8c0d5 409 uint8_t excitationState;
Vkadaba 43:e1789b7214cf 410 /*!< Excitation current state */
Vkadaba 45:f5f553b8c0d5 411 uint8_t groundSwitch;
Vkadaba 45:f5f553b8c0d5 412 /*!< Option to open or close sensor ground switch */
Vkadaba 50:d84305e5e1c0 413 uint8_t fifoNumCycles;
Vkadaba 50:d84305e5e1c0 414 /*!< Specifies the number of cycles to fill a FIFO buffer
Vkadaba 50:d84305e5e1c0 415 * Applicable only when operatingMode is ADMW1001_OPERATING_MODE_CONTINUOUS
Vkadaba 34:b60ee1e0af2b 416 */
Vkadaba 8:2f2775c34640 417 uint32_t cycleInterval;
Vkadaba 8:2f2775c34640 418 /*!< Cycle interval - specifies the time interval between the start of each
Vkadaba 8:2f2775c34640 419 * successive measurement cycle. Applicable only when operatingMode is
Vkadaba 8:2f2775c34640 420 * not ADMW1001_OPERATING_MODE_SINGLECYCLE
Vkadaba 8:2f2775c34640 421 */
Vkadaba 8:2f2775c34640 422 bool vBiasEnable;
Vkadaba 8:2f2775c34640 423 /*!< Enable voltage Bias output of ADC
Vkadaba 8:2f2775c34640 424 */
Vkadaba 8:2f2775c34640 425 float32_t externalRef1Value;
Vkadaba 8:2f2775c34640 426 /*!< Voltage value connected to external reference input #1.
Vkadaba 5:0728bde67bdb 427 * Applicable only if the selected reference type is
Vkadaba 8:2f2775c34640 428 * voltage.
Vkadaba 5:0728bde67bdb 429 * (see @ref ADMW1001_ADC_REFERENCE_TYPE)
Vkadaba 34:b60ee1e0af2b 430 */
Vkadaba 33:df7a00f1b8e1 431 float32_t RSenseValue;
Vkadaba 34:b60ee1e0af2b 432 /*!< Sense resistor value in Ohms. */
Vkadaba 34:b60ee1e0af2b 433 float32_t externalRefVoltage;
Vkadaba 34:b60ee1e0af2b 434 /*!< External Reference Voltage.
Vkadaba 34:b60ee1e0af2b 435 */
Vkadaba 45:f5f553b8c0d5 436 float32_t AVDDVoltage;
Vkadaba 45:f5f553b8c0d5 437 /*!< AVDD Voltage.
Vkadaba 45:f5f553b8c0d5 438 */
Vkadaba 45:f5f553b8c0d5 439 uint32_t reserved1[1];
Vkadaba 45:f5f553b8c0d5 440 /*!< Reserved for future use and ensure word alignment.
Vkadaba 45:f5f553b8c0d5 441 */
Vkadaba 8:2f2775c34640 442
Vkadaba 8:2f2775c34640 443 } ADMW1001_MEASUREMENT_CONFIG;
Vkadaba 5:0728bde67bdb 444
Vkadaba 5:0728bde67bdb 445 /*! ADMW1001 ADC Excitation Current output configuration
Vkadaba 5:0728bde67bdb 446 *
Vkadaba 5:0728bde67bdb 447 * @note applicable only to ADC analog sensor channels, and
Vkadaba 5:0728bde67bdb 448 * specific sensor types
Vkadaba 5:0728bde67bdb 449 */
Vkadaba 45:f5f553b8c0d5 450 typedef struct
Vkadaba 45:f5f553b8c0d5 451 {
Vkadaba 5:0728bde67bdb 452 ADMW1001_ADC_EXC_CURRENT outputLevel;
Vkadaba 5:0728bde67bdb 453 /*!< Excitation current output level */
Vkadaba 5:0728bde67bdb 454 ADMW1001_ADC_EXC_CURRENT_DIODE_RATIO diodeRatio;
Vkadaba 5:0728bde67bdb 455 /*!< Excitation current output diode ratio */
Vkadaba 45:f5f553b8c0d5 456 float32_t idealityRatio;
Vkadaba 8:2f2775c34640 457
Vkadaba 8:2f2775c34640 458 } ADMW1001_ADC_EXC_CURRENT_CONFIG;
Vkadaba 5:0728bde67bdb 459
Vkadaba 5:0728bde67bdb 460 /*! ADMW1001 ADC Filter configuration
Vkadaba 5:0728bde67bdb 461 *
Vkadaba 5:0728bde67bdb 462 * @note applicable only to ADC analog sensor channels
Vkadaba 5:0728bde67bdb 463 */
Vkadaba 45:f5f553b8c0d5 464 typedef struct
Vkadaba 45:f5f553b8c0d5 465 {
Vkadaba 8:2f2775c34640 466 ADMW1001_ADC_FILTER_TYPE type;
Vkadaba 5:0728bde67bdb 467 /*!< Filter type selection */
Vkadaba 8:2f2775c34640 468 ADMW1001_SINC_FILTER_RANGE sf;
Vkadaba 8:2f2775c34640 469 /*!< SF value used along with filter type and chop mode to determine speed */
Vkadaba 17:2f0028880874 470 ADMW1001_CHOP_MD chopMode;
Vkadaba 6:9d393a9677f4 471 /*!< Enable filter chop */
Vkadaba 8:2f2775c34640 472 bool notch1p2;
Vkadaba 6:9d393a9677f4 473 /*!< Enable Notch 2 Filter Mode */
Vkadaba 45:f5f553b8c0d5 474
Vkadaba 8:2f2775c34640 475 } ADMW1001_ADC_FILTER_CONFIG;
Vkadaba 5:0728bde67bdb 476
Vkadaba 5:0728bde67bdb 477 /*! ADMW1001 ADC analog channel configuration details
Vkadaba 5:0728bde67bdb 478 *
Vkadaba 5:0728bde67bdb 479 * @note applicable only to ADC analog sensor channels
Vkadaba 5:0728bde67bdb 480 */
Vkadaba 45:f5f553b8c0d5 481 typedef struct
Vkadaba 45:f5f553b8c0d5 482 {
Vkadaba 5:0728bde67bdb 483 ADMW1001_ADC_SENSOR_TYPE sensor;
Vkadaba 5:0728bde67bdb 484 /*!< Sensor type selection */
Vkadaba 6:9d393a9677f4 485 ADMW1001_ADC_RTD_CURVE rtdCurve;
Vkadaba 6:9d393a9677f4 486 /*!< Rtd curve selection */
Vkadaba 5:0728bde67bdb 487 ADMW1001_ADC_GAIN gain;
Vkadaba 5:0728bde67bdb 488 /*!< ADC Gain selection */
Vkadaba 5:0728bde67bdb 489 ADMW1001_ADC_EXC_CURRENT_CONFIG current;
Vkadaba 5:0728bde67bdb 490 /*!< ADC Excitation Current configuration */
Vkadaba 5:0728bde67bdb 491 ADMW1001_ADC_FILTER_CONFIG filter;
Vkadaba 5:0728bde67bdb 492 /*!< ADC Filter configuration */
Vkadaba 8:2f2775c34640 493 ADMW1001_ADC_REFERENCE_TYPE reference;
Vkadaba 5:0728bde67bdb 494 /*!< ADC Reference configuration */
Vkadaba 33:df7a00f1b8e1 495 uint8_t bufferBypass;
Vkadaba 45:f5f553b8c0d5 496 /*!< Buffer Bypass configuration */
Vkadaba 33:df7a00f1b8e1 497 uint8_t reserved0[2];
Vkadaba 8:2f2775c34640 498 /*!< Reserved for future use and ensure word alignment. */
Vkadaba 8:2f2775c34640 499 uint32_t reserved1[6];
Vkadaba 8:2f2775c34640 500 /*!< Reserved for future use and ensure word alignment. */
Vkadaba 8:2f2775c34640 501
Vkadaba 8:2f2775c34640 502 } ADMW1001_ADC_CHANNEL_CONFIG;
Vkadaba 8:2f2775c34640 503
Vkadaba 8:2f2775c34640 504 /*! ADMW1001 look-up table selection
Vkadaba 8:2f2775c34640 505 * Select table used to linearise the measurement.
Vkadaba 8:2f2775c34640 506 */
Vkadaba 45:f5f553b8c0d5 507 typedef enum
Vkadaba 45:f5f553b8c0d5 508 {
Vkadaba 8:2f2775c34640 509 ADMW1001_LUT_DEFAULT = 0,
Vkadaba 8:2f2775c34640 510 /*!< Default LUT */
Vkadaba 45:f5f553b8c0d5 511 ADMW1001_LUT_CUSTOM = 1,
Vkadaba 8:2f2775c34640 512 /*!< User defined custom LUT */
Vkadaba 45:f5f553b8c0d5 513 ADMW1001_LUT_RESERVED = 2,
Vkadaba 8:2f2775c34640 514 /*!< Reserved for future use */
Vkadaba 34:b60ee1e0af2b 515
Vkadaba 8:2f2775c34640 516 } ADMW1001_LUT_SELECT;
Vkadaba 5:0728bde67bdb 517
Vkadaba 5:0728bde67bdb 518 /*! ADMW1001 digital sensor data encoding
Vkadaba 5:0728bde67bdb 519 *
Vkadaba 5:0728bde67bdb 520 * @note applicable only to SPI and I2C digital sensor channels
Vkadaba 5:0728bde67bdb 521 */
Vkadaba 45:f5f553b8c0d5 522 typedef enum
Vkadaba 45:f5f553b8c0d5 523 {
Vkadaba 8:2f2775c34640 524 ADMW1001_DIGITAL_SENSOR_DATA_CODING_NONE = 0,
Vkadaba 5:0728bde67bdb 525 /**< None/Invalid - data format is ignored if coding is set to this value */
Vkadaba 5:0728bde67bdb 526 ADMW1001_DIGITAL_SENSOR_DATA_CODING_UNIPOLAR,
Vkadaba 5:0728bde67bdb 527 /**< Unipolar - unsigned integer values */
Vkadaba 5:0728bde67bdb 528 ADMW1001_DIGITAL_SENSOR_DATA_CODING_TWOS_COMPLEMENT,
Vkadaba 5:0728bde67bdb 529 /**< Twos-complement - signed integer values */
Vkadaba 5:0728bde67bdb 530 ADMW1001_DIGITAL_SENSOR_DATA_CODING_OFFSET_BINARY,
Vkadaba 5:0728bde67bdb 531 /**< Offset Binary - used to represent signed values with unsigned integers,
Vkadaba 5:0728bde67bdb 532 * with the mid-range value representing 0 */
Vkadaba 8:2f2775c34640 533
Vkadaba 8:2f2775c34640 534 } ADMW1001_DIGITAL_SENSOR_DATA_CODING;
Vkadaba 5:0728bde67bdb 535
Vkadaba 5:0728bde67bdb 536 /*! ADMW1001 digital sensor data format configuration
Vkadaba 5:0728bde67bdb 537 *
Vkadaba 5:0728bde67bdb 538 * @note applicable only to SPI and I2C digital sensor channels
Vkadaba 5:0728bde67bdb 539 */
Vkadaba 45:f5f553b8c0d5 540 typedef struct
Vkadaba 45:f5f553b8c0d5 541 {
Vkadaba 5:0728bde67bdb 542 ADMW1001_DIGITAL_SENSOR_DATA_CODING coding;
Vkadaba 5:0728bde67bdb 543 /**< Data Encoding of Sensor Result */
Vkadaba 5:0728bde67bdb 544 bool littleEndian;
Vkadaba 5:0728bde67bdb 545 /**< Set as true if data format is little-endian, false otherwise */
Vkadaba 5:0728bde67bdb 546 bool leftJustified;
Vkadaba 5:0728bde67bdb 547 /**< Set as true if data is left-justified in the data frame, false otherwise */
Vkadaba 5:0728bde67bdb 548 uint8_t frameLength;
Vkadaba 5:0728bde67bdb 549 /**< Data frame length (number of bytes to read from the sensor) */
Vkadaba 5:0728bde67bdb 550 uint8_t numDataBits;
Vkadaba 5:0728bde67bdb 551 /**< Number of relevant data bits to extract from the data frame */
Vkadaba 5:0728bde67bdb 552 uint8_t bitOffset;
Vkadaba 5:0728bde67bdb 553 /**< Data bit offset, relative to data alignment within the data frame */
Vkadaba 8:2f2775c34640 554 uint8_t reserved[2];
Vkadaba 8:2f2775c34640 555 /*!< Reserved for future use and ensure word alignment. */
Vkadaba 8:2f2775c34640 556
Vkadaba 8:2f2775c34640 557 } ADMW1001_DIGITAL_SENSOR_DATA_FORMAT;
Vkadaba 5:0728bde67bdb 558
Vkadaba 5:0728bde67bdb 559
Vkadaba 5:0728bde67bdb 560 /*! ADMW1001 digital sensor calibration param
Vkadaba 5:0728bde67bdb 561 *
Vkadaba 5:0728bde67bdb 562 * @note applicable only to digital sensor channels
Vkadaba 5:0728bde67bdb 563 */
Vkadaba 45:f5f553b8c0d5 564 typedef struct
Vkadaba 45:f5f553b8c0d5 565 {
Vkadaba 5:0728bde67bdb 566 uint32_t calibrationParam;
Vkadaba 5:0728bde67bdb 567 /*!< Independently established environmental variable used during calibration
Vkadaba 5:0728bde67bdb 568 * of a digital sensor. Used only if the sensor supports calibration
Vkadaba 5:0728bde67bdb 569 * and expects an environmental parameter
Vkadaba 5:0728bde67bdb 570 */
Vkadaba 5:0728bde67bdb 571 bool enableCalibrationParam;
Vkadaba 5:0728bde67bdb 572 /*!< Allow Calibration_Parameter to be used during calibration of any digital sensor */
Vkadaba 8:2f2775c34640 573 uint8_t reserved[3];
Vkadaba 8:2f2775c34640 574 /*!< Reserved for future use and ensure word alignment. */
Vkadaba 8:2f2775c34640 575
Vkadaba 8:2f2775c34640 576 } ADMW1001_DIGITAL_CALIBRATION_COMMAND;
Vkadaba 5:0728bde67bdb 577
Vkadaba 5:0728bde67bdb 578 /*! ADMW1001 digital sensor communication config
Vkadaba 5:0728bde67bdb 579 *
Vkadaba 5:0728bde67bdb 580 * @note applicable only to digital sensor channels
Vkadaba 5:0728bde67bdb 581 */
Vkadaba 45:f5f553b8c0d5 582 typedef struct
Vkadaba 45:f5f553b8c0d5 583 {
Vkadaba 8:2f2775c34640 584 bool useCustomCommsConfig;
Vkadaba 5:0728bde67bdb 585 /*!< Optional parameter to enable user digital communication settings */
Vkadaba 8:2f2775c34640 586 ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED i2cClockSpeed;
Vkadaba 5:0728bde67bdb 587 /*!< Optional parameter to configure specific i2c speed for i2c sensor */
Vkadaba 8:2f2775c34640 588
Vkadaba 8:2f2775c34640 589 } ADMW1001_DIGITAL_SENSOR_COMMS;
Vkadaba 5:0728bde67bdb 590
Vkadaba 5:0728bde67bdb 591 /*! ADMW1001 I2C digital channel configuration details
Vkadaba 5:0728bde67bdb 592 *
Vkadaba 5:0728bde67bdb 593 * @note applicable only to I2C digital sensor channels
Vkadaba 5:0728bde67bdb 594 */
Vkadaba 45:f5f553b8c0d5 595 typedef struct
Vkadaba 45:f5f553b8c0d5 596 {
Vkadaba 8:2f2775c34640 597 ADMW1001_I2C_SENSOR_TYPE sensor;
Vkadaba 5:0728bde67bdb 598 /*!< Sensor type selection */
Vkadaba 8:2f2775c34640 599 uint8_t deviceAddress;
Vkadaba 5:0728bde67bdb 600 /*!< I2C device address (7-bit) */
Vkadaba 8:2f2775c34640 601 uint8_t reserved;
Vkadaba 8:2f2775c34640 602 /*!< Reserved for future use and ensure word alignment. */
Vkadaba 8:2f2775c34640 603 ADMW1001_DIGITAL_SENSOR_DATA_FORMAT dataFormat;
Vkadaba 5:0728bde67bdb 604 /*!< Optional data format configuration to parse/extract data from the device.
Vkadaba 5:0728bde67bdb 605 * A default data format will be used if this is not specified.
Vkadaba 5:0728bde67bdb 606 * Applicable only to specific I2C sensor types
Vkadaba 5:0728bde67bdb 607 */
Vkadaba 8:2f2775c34640 608 ADMW1001_DIGITAL_SENSOR_COMMS configureComms;
Vkadaba 5:0728bde67bdb 609 /*!< Optional configuration to setup a user communication config.
Vkadaba 5:0728bde67bdb 610 * A default configuration will be used if this is not specified.
Vkadaba 5:0728bde67bdb 611 * Applicable only to specific I2C sensor types.
Vkadaba 5:0728bde67bdb 612 */
Vkadaba 8:2f2775c34640 613
Vkadaba 8:2f2775c34640 614 } ADMW1001_I2C_CHANNEL_CONFIG;
Vkadaba 5:0728bde67bdb 615
Vkadaba 5:0728bde67bdb 616
Vkadaba 5:0728bde67bdb 617 /*! ADMW1001 Measurement Channel configuration details */
Vkadaba 45:f5f553b8c0d5 618 typedef struct
Vkadaba 45:f5f553b8c0d5 619 {
Vkadaba 8:2f2775c34640 620 bool enableChannel;
Vkadaba 5:0728bde67bdb 621 /*!< Option to include this channel in normal measurement cycles */
Vkadaba 8:2f2775c34640 622 bool disablePublishing;
Vkadaba 5:0728bde67bdb 623 /*!< Option to disable publishing of data samples from this channel. The
Vkadaba 5:0728bde67bdb 624 * channel may still be included in measurement cycles, but data samples
Vkadaba 5:0728bde67bdb 625 * obtained from this channel will not be published. This is typically
Vkadaba 5:0728bde67bdb 626 * used for channels which are required only as a compensation reference
Vkadaba 5:0728bde67bdb 627 * for another channel (e.g. Cold-Junction Compensation channels).
Vkadaba 5:0728bde67bdb 628 */
Vkadaba 8:2f2775c34640 629 ADMW1001_CH_ID compensationChannel;
Vkadaba 8:2f2775c34640 630 /*!< Optional compensation channel. Set to ADMW1001_CH_ID_NONE if not
Vkadaba 5:0728bde67bdb 631 * required. Typically used for thermocouple sensors that require a
Vkadaba 5:0728bde67bdb 632 * separate measurement of the "cold-junction" temperature, which can be
Vkadaba 5:0728bde67bdb 633 * be provided by an RTD temperature sensor connected on a separate
Vkadaba 5:0728bde67bdb 634 * "compensation channel" */
Vkadaba 8:2f2775c34640 635 ADMW1001_LUT_SELECT lutSelect;
Vkadaba 8:2f2775c34640 636 /*!<Select Look Up Table LUT for calculations, this implies that the
Vkadaba 5:0728bde67bdb 637 * fundamental measurement for the sensor (typically mV or Ohms)
Vkadaba 8:2f2775c34640 638 * 0 = default, 1= unity, 2 = custom
Vkadaba 5:0728bde67bdb 639 */
Vkadaba 8:2f2775c34640 640 ADMW1001_MEASUREMENT_UNIT measurementUnit;
Vkadaba 5:0728bde67bdb 641 /*!< Optional measurement unit selection for conversion results. Applicable
Vkadaba 5:0728bde67bdb 642 * only for certain sensor types. Set to
Vkadaba 5:0728bde67bdb 643 * ADMW1001_MEASUREMENT_UNIT_DEFAULT if not applicable.
Vkadaba 5:0728bde67bdb 644 */
Vkadaba 8:2f2775c34640 645 float32_t lowThreshold;
Vkadaba 5:0728bde67bdb 646 /*!< Optional minimum threshold value for each processed sample, to be
Vkadaba 5:0728bde67bdb 647 * checked prior to publishing. A channel ALERT condition is raised
Vkadaba 5:0728bde67bdb 648 * if the processed value is lower than this threshold. Set to NaN
Vkadaba 5:0728bde67bdb 649 * if not required.
Vkadaba 5:0728bde67bdb 650 */
Vkadaba 8:2f2775c34640 651 float32_t highThreshold;
Vkadaba 5:0728bde67bdb 652 /*!< Optional maximum threshold value for each processed sample, to be
Vkadaba 5:0728bde67bdb 653 * checked prior to publishing. A channel ALERT condition is raised
Vkadaba 5:0728bde67bdb 654 * if the processed value is higher than this threshold. Set to NaN
Vkadaba 5:0728bde67bdb 655 * if not required.
Vkadaba 5:0728bde67bdb 656 */
Vkadaba 8:2f2775c34640 657 float32_t offsetAdjustment;
Vkadaba 5:0728bde67bdb 658 /*!< Optional offset adjustment value applied to each processed sample.
Vkadaba 5:0728bde67bdb 659 * Set to NaN or 0.0 if not required.
Vkadaba 5:0728bde67bdb 660 */
Vkadaba 8:2f2775c34640 661 float32_t gainAdjustment;
Vkadaba 5:0728bde67bdb 662 /*!< Optional gain adjustment value applied to each processed sample.
Vkadaba 5:0728bde67bdb 663 * Set to NaN or 1.0 if not required.
Vkadaba 5:0728bde67bdb 664 */
Vkadaba 8:2f2775c34640 665 float32_t sensorParameter;
Vkadaba 5:0728bde67bdb 666 /*!< Optional sensor parameter adjustment.
Vkadaba 5:0728bde67bdb 667 * Set to NaN or 0 if not required.
Vkadaba 5:0728bde67bdb 668 */
Vkadaba 8:2f2775c34640 669 uint32_t measurementsPerCycle;
Vkadaba 5:0728bde67bdb 670 /*!< The number of measurements to obtain from this channel within each
Vkadaba 5:0728bde67bdb 671 * cycle. Each enabled channel is measured in turn, until the number of
Vkadaba 5:0728bde67bdb 672 * measurements requested for the channel has been reached. A different
Vkadaba 5:0728bde67bdb 673 * number of measurements-per-cycle may be specified for each channel.
Vkadaba 5:0728bde67bdb 674 */
Vkadaba 8:2f2775c34640 675 uint32_t cycleSkipCount;
Vkadaba 5:0728bde67bdb 676 /*!< Optional number of cycles to skip, such that this channel is included
Vkadaba 5:0728bde67bdb 677 * in the sequence in only one of every (cycleSkipCount + 1) cycles that
Vkadaba 5:0728bde67bdb 678 * occur. If set to 0 (default), this channel is included in every cycle;
Vkadaba 5:0728bde67bdb 679 * if set to 1, this channel is included in every 2nd cycle; if set to 2,
Vkadaba 5:0728bde67bdb 680 * this channel is included in every 3rd cycle, and so on.
Vkadaba 5:0728bde67bdb 681 */
Vkadaba 8:2f2775c34640 682 uint32_t extraSettlingTime;
Vkadaba 5:0728bde67bdb 683 /*!< A minimum settling time is applied internally for each channel, based
Vkadaba 45:f5f553b8c0d5 684 * on the sensor type. However, additional settling time (milliseconds)
Vkadaba 5:0728bde67bdb 685 * can optionally be specified. Set to 0 if not required.
Vkadaba 5:0728bde67bdb 686 */
Vkadaba 8:2f2775c34640 687 ADMW1001_CHANNEL_PRIORITY priority;
Vkadaba 5:0728bde67bdb 688 /*!< By default, channels are arranged in the measurement sequence based on
Vkadaba 5:0728bde67bdb 689 * ascending order of channel ID. However, a priority-level may be
Vkadaba 5:0728bde67bdb 690 * specified per channel to force a different ordering of the channels,
Vkadaba 5:0728bde67bdb 691 * with higher-priority channels appearing before lower-priority channels.
Vkadaba 5:0728bde67bdb 692 * Channels with equal priority are ordered by ascending order of channel
Vkadaba 5:0728bde67bdb 693 * ID. Lower numbers indicate higher priority, with 0 being the highest.
Vkadaba 5:0728bde67bdb 694 * Set to 0 if not required.
Vkadaba 5:0728bde67bdb 695 */
Vkadaba 45:f5f553b8c0d5 696 union
Vkadaba 45:f5f553b8c0d5 697 {
Vkadaba 8:2f2775c34640 698 ADMW1001_ADC_CHANNEL_CONFIG adcChannelConfig;
Vkadaba 5:0728bde67bdb 699 /*!< ADC channel configuration - applicable only to ADC channels */
Vkadaba 8:2f2775c34640 700 ADMW1001_I2C_CHANNEL_CONFIG i2cChannelConfig;
Vkadaba 5:0728bde67bdb 701 /*!< I2C channel configuration - applicable only to I2C channels */
Vkadaba 5:0728bde67bdb 702 };
Vkadaba 6:9d393a9677f4 703 /*!< Only one of adcChannelConfig, i2cChannelConfig, spiChannelConfig
Vkadaba 6:9d393a9677f4 704 * is required, depending on the channel designation
Vkadaba 6:9d393a9677f4 705 * (analog, I2C, SPI)
Vkadaba 5:0728bde67bdb 706 */
Vkadaba 8:2f2775c34640 707
Vkadaba 8:2f2775c34640 708 } ADMW1001_CHANNEL_CONFIG;
Vkadaba 5:0728bde67bdb 709
Vkadaba 5:0728bde67bdb 710 /*! ADMW1001 Diagnostics configuration details */
Vkadaba 45:f5f553b8c0d5 711 typedef struct
Vkadaba 45:f5f553b8c0d5 712 {
Vkadaba 8:2f2775c34640 713 bool disableGlobalDiag;
Vkadaba 5:0728bde67bdb 714 /*!< Option to disable the following diagnostic checks on the ADC:
Vkadaba 5:0728bde67bdb 715 * - Reference Detection errors
Vkadaba 5:0728bde67bdb 716 * - Input under-/over-voltage errors
Vkadaba 5:0728bde67bdb 717 * - Calibration, Conversion and Saturation errors
Vkadaba 5:0728bde67bdb 718 */
Vkadaba 8:2f2775c34640 719 bool disableMeasurementDiag;
Vkadaba 5:0728bde67bdb 720 /*!< Option to disable additional checks per measurement channel:
Vkadaba 5:0728bde67bdb 721 * - High/low threshold limit violation
Vkadaba 5:0728bde67bdb 722 */
Vkadaba 8:2f2775c34640 723
Vkadaba 8:2f2775c34640 724 bool disableCriticalTempAbort;
Vkadaba 5:0728bde67bdb 725 /*!< Option to disable abort of measurement cycle if the operating
Vkadaba 5:0728bde67bdb 726 * temperature of the ADMW1001 has exceeded critical limits
Vkadaba 5:0728bde67bdb 727 */
Vkadaba 8:2f2775c34640 728
Vkadaba 45:f5f553b8c0d5 729 uint8_t osdFrequency;
Vkadaba 5:0728bde67bdb 730 /*!< Option to enable Open-Circuit Detection at a selected cycle interval */
Vkadaba 5:0728bde67bdb 731
Vkadaba 8:2f2775c34640 732 } ADMW1001_DIAGNOSTICS_CONFIG;
Vkadaba 8:2f2775c34640 733
Vkadaba 45:f5f553b8c0d5 734 typedef struct
Vkadaba 45:f5f553b8c0d5 735 {
Vkadaba 5:0728bde67bdb 736 ADMW1001_POWER_CONFIG power;
Vkadaba 5:0728bde67bdb 737 /*!< Power configuration details */
Vkadaba 5:0728bde67bdb 738 ADMW1001_MEASUREMENT_CONFIG measurement;
Vkadaba 5:0728bde67bdb 739 /*!< Measurement configuration details */
Vkadaba 5:0728bde67bdb 740 ADMW1001_DIAGNOSTICS_CONFIG diagnostics;
Vkadaba 5:0728bde67bdb 741 /*!< FFT configuration details */
Vkadaba 5:0728bde67bdb 742 ADMW1001_CHANNEL_CONFIG channels[ADMW1001_MAX_CHANNELS];
Vkadaba 5:0728bde67bdb 743 /*!< Channel-specific configuration details */
Vkadaba 8:2f2775c34640 744
Vkadaba 8:2f2775c34640 745 } ADMW1001_CONFIG;
Vkadaba 5:0728bde67bdb 746
Vkadaba 5:0728bde67bdb 747 #ifdef __cplusplus
Vkadaba 5:0728bde67bdb 748 }
Vkadaba 5:0728bde67bdb 749 #endif
Vkadaba 5:0728bde67bdb 750
Vkadaba 5:0728bde67bdb 751 /*!
Vkadaba 5:0728bde67bdb 752 * @}
Vkadaba 5:0728bde67bdb 753 */
Vkadaba 5:0728bde67bdb 754
Vkadaba 5:0728bde67bdb 755 #endif /* __ADMW1001_CONFIG_H__ */