initial commit

Committer:
Vkadaba
Date:
Sat Jun 15 14:30:49 2019 +0000
Revision:
6:9d393a9677f4
Parent:
5:0728bde67bdb
Child:
8:2f2775c34640
Register map is updated and sensor config files are modified

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ADIJake 0:85855ecd3257 1 /*!
ADIJake 0:85855ecd3257 2 ******************************************************************************
ADIJake 0:85855ecd3257 3 * @file: config.c
ADIJake 0:85855ecd3257 4 * @brief:
ADIJake 0:85855ecd3257 5 *-----------------------------------------------------------------------------
ADIJake 0:85855ecd3257 6 *
ADIJake 0:85855ecd3257 7 Copyright 2017 (c) Analog Devices, Inc.
ADIJake 0:85855ecd3257 8
ADIJake 0:85855ecd3257 9 All rights reserved.
ADIJake 0:85855ecd3257 10
ADIJake 0:85855ecd3257 11 Redistribution and use in source and binary forms, with or without
ADIJake 0:85855ecd3257 12 modification, are permitted provided that the following conditions are met:
ADIJake 0:85855ecd3257 13 - Redistributions of source code must retain the above copyright
ADIJake 0:85855ecd3257 14 notice, this list of conditions and the following disclaimer.
ADIJake 0:85855ecd3257 15 - Redistributions in binary form must reproduce the above copyright
ADIJake 0:85855ecd3257 16 notice, this list of conditions and the following disclaimer in
ADIJake 0:85855ecd3257 17 the documentation and/or other materials provided with the
ADIJake 0:85855ecd3257 18 distribution.
ADIJake 0:85855ecd3257 19 - Neither the name of Analog Devices, Inc. nor the names of its
ADIJake 0:85855ecd3257 20 contributors may be used to endorse or promote products derived
ADIJake 0:85855ecd3257 21 from this software without specific prior written permission.
ADIJake 0:85855ecd3257 22 - The use of this software may or may not infringe the patent rights
ADIJake 0:85855ecd3257 23 of one or more patent holders. This license does not release you
ADIJake 0:85855ecd3257 24 from the requirement that you obtain separate licenses from these
ADIJake 0:85855ecd3257 25 patent holders to use this software.
ADIJake 0:85855ecd3257 26 - Use of the software either in source or binary form, must be run
ADIJake 0:85855ecd3257 27 on or directly connected to an Analog Devices Inc. component.
ADIJake 0:85855ecd3257 28
ADIJake 0:85855ecd3257 29 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
ADIJake 0:85855ecd3257 30 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
ADIJake 0:85855ecd3257 31 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
ADIJake 0:85855ecd3257 32 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
ADIJake 0:85855ecd3257 33 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
ADIJake 0:85855ecd3257 34 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
ADIJake 0:85855ecd3257 35 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
ADIJake 0:85855ecd3257 36 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
ADIJake 0:85855ecd3257 37 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
ADIJake 0:85855ecd3257 38 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ADIJake 0:85855ecd3257 39 *
ADIJake 0:85855ecd3257 40 *****************************************************************************/
ADIJake 0:85855ecd3257 41
Vkadaba 5:0728bde67bdb 42 #include "admw_config_types.h"
ADIJake 0:85855ecd3257 43
Vkadaba 5:0728bde67bdb 44 ADMW_CONFIG multichannel_continuous_config = {
ADIJake 0:85855ecd3257 45 .versionId = { .major = 1, .minor = 4 },
Vkadaba 5:0728bde67bdb 46 .productId = ADMW_PRODUCT_ID_ADMW1001,
Vkadaba 5:0728bde67bdb 47 .admw1001 = {
ADIJake 0:85855ecd3257 48 .power = {
Vkadaba 6:9d393a9677f4 49 .powerMode = ADMW1001_POWER_MODE_ACTIVE,
ADIJake 0:85855ecd3257 50 },
ADIJake 0:85855ecd3257 51 .measurement = {
Vkadaba 5:0728bde67bdb 52 .operatingMode = ADMW1001_OPERATING_MODE_CONTINUOUS,
Vkadaba 5:0728bde67bdb 53 .dataReadyMode = ADMW1001_DATAREADY_PER_CYCLE,
ADIJake 0:85855ecd3257 54 .cycleInterval = 5000000,
ADIJake 0:85855ecd3257 55 },
ADIJake 0:85855ecd3257 56 .channels = {
Vkadaba 6:9d393a9677f4 57 [ADMW1001_CHANNEL_ID_ANALOG_1_UNIVERSAL] = {
ADIJake 0:85855ecd3257 58 .enableChannel = true,
ADIJake 0:85855ecd3257 59 .disablePublishing = false,
Vkadaba 5:0728bde67bdb 60 .compensationChannel = ADMW1001_CHANNEL_ID_NONE,
Vkadaba 5:0728bde67bdb 61 .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS,
ADIJake 0:85855ecd3257 62 .measurementsPerCycle = 10,
ADIJake 0:85855ecd3257 63 .extraSettlingTime = 0,
ADIJake 0:85855ecd3257 64 .adcChannelConfig = {
Vkadaba 5:0728bde67bdb 65 .sensor = ADMW1001_ADC_SENSOR_RTD_2WIRE_PT100_DEF_L1,
Vkadaba 5:0728bde67bdb 66 .gain = ADMW1001_ADC_GAIN_8X,
ADIJake 0:85855ecd3257 67 .current = {
Vkadaba 5:0728bde67bdb 68 .outputLevel = ADMW1001_ADC_EXC_CURRENT_500uA,
ADIJake 0:85855ecd3257 69 },
ADIJake 0:85855ecd3257 70 .filter = {
Vkadaba 6:9d393a9677f4 71 .type = ADMW1001_ADC_FILTER_SINC3,
ADIJake 0:85855ecd3257 72 },
ADIJake 0:85855ecd3257 73 .reference = {
Vkadaba 5:0728bde67bdb 74 .type = ADMW1001_ADC_REFERENCE_RESISTOR_INTERNAL_1,
ADIJake 0:85855ecd3257 75 },
ADIJake 0:85855ecd3257 76 .enableVbias = false,
ADIJake 0:85855ecd3257 77 },
ADIJake 0:85855ecd3257 78 },
Vkadaba 6:9d393a9677f4 79 [ADMW1001_CHANNEL_ID_ANALOG_2_UNIVERSAL] = {
ADIJake 0:85855ecd3257 80 .enableChannel = true,
ADIJake 0:85855ecd3257 81 .disablePublishing = false,
Vkadaba 5:0728bde67bdb 82 .compensationChannel = ADMW1001_CHANNEL_ID_NONE,
Vkadaba 5:0728bde67bdb 83 .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS,
ADIJake 0:85855ecd3257 84 .measurementsPerCycle = 10,
ADIJake 0:85855ecd3257 85 .extraSettlingTime = 0,
ADIJake 0:85855ecd3257 86 .adcChannelConfig = {
Vkadaba 5:0728bde67bdb 87 .sensor = ADMW1001_ADC_SENSOR_RTD_2WIRE_PT100_DEF_L1,
Vkadaba 5:0728bde67bdb 88 .gain = ADMW1001_ADC_GAIN_8X,
ADIJake 0:85855ecd3257 89 .current = {
Vkadaba 5:0728bde67bdb 90 .outputLevel = ADMW1001_ADC_EXC_CURRENT_500uA,
ADIJake 0:85855ecd3257 91 },
ADIJake 0:85855ecd3257 92 .filter = {
Vkadaba 6:9d393a9677f4 93 .type = ADMW1001_CHANNEL_ID_ANALOG_2_UNIVERSAL,
ADIJake 0:85855ecd3257 94 },
ADIJake 0:85855ecd3257 95 .reference = {
Vkadaba 5:0728bde67bdb 96 .type = ADMW1001_ADC_REFERENCE_RESISTOR_INTERNAL_1,
Vkadaba 6:9d393a9677f4 97
ADIJake 0:85855ecd3257 98 },
ADIJake 0:85855ecd3257 99 .enableVbias = false,
ADIJake 0:85855ecd3257 100 },
ADIJake 0:85855ecd3257 101 },
Vkadaba 6:9d393a9677f4 102 [ADMW1001_CHANNEL_ID_ANALOG_1_DIFFERENTIAL] = {
ADIJake 0:85855ecd3257 103 .enableChannel = true,
ADIJake 0:85855ecd3257 104 .disablePublishing = false,
Vkadaba 6:9d393a9677f4 105 .compensationChannel = ADMW1001_CHANNEL_ID_NONE,
Vkadaba 6:9d393a9677f4 106 .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS,
Vkadaba 6:9d393a9677f4 107 .measurementsPerCycle = 10,
Vkadaba 6:9d393a9677f4 108 .extraSettlingTime = 0,
Vkadaba 6:9d393a9677f4 109 .adcChannelConfig = {
Vkadaba 6:9d393a9677f4 110 .sensor = ADMW1001_ADC_SENSOR_RTD_2WIRE_PT100_DEF_L1,
Vkadaba 6:9d393a9677f4 111 .gain = ADMW1001_ADC_GAIN_8X,
Vkadaba 6:9d393a9677f4 112 .current = {
Vkadaba 6:9d393a9677f4 113 .outputLevel = ADMW1001_ADC_EXC_CURRENT_500uA,
Vkadaba 6:9d393a9677f4 114 },
Vkadaba 6:9d393a9677f4 115 .filter = {
Vkadaba 6:9d393a9677f4 116 .type = ADMW1001_ADC_FILTER_SINC3,
Vkadaba 6:9d393a9677f4 117 },
Vkadaba 6:9d393a9677f4 118 .reference = {
Vkadaba 6:9d393a9677f4 119 .type = ADMW1001_ADC_REFERENCE_RESISTOR_INTERNAL_1,
Vkadaba 6:9d393a9677f4 120
Vkadaba 6:9d393a9677f4 121 },
Vkadaba 6:9d393a9677f4 122 .enableVbias = false,
Vkadaba 6:9d393a9677f4 123 },
Vkadaba 6:9d393a9677f4 124 },
Vkadaba 6:9d393a9677f4 125 [ADMW1001_CHANNEL_ID_ANALOG_2_DIFFERENTIAL] = {
Vkadaba 6:9d393a9677f4 126 .enableChannel = true,
Vkadaba 6:9d393a9677f4 127 .disablePublishing = false,
Vkadaba 6:9d393a9677f4 128 .compensationChannel = ADMW1001_CHANNEL_ID_ANALOG_2_UNIVERSAL,
Vkadaba 5:0728bde67bdb 129 .measurementUnit = ADMW1001_MEASUREMENT_UNIT_CELSIUS,
ADIJake 0:85855ecd3257 130 .measurementsPerCycle = 10,
ADIJake 0:85855ecd3257 131 .extraSettlingTime = 0,
ADIJake 0:85855ecd3257 132 .adcChannelConfig = {
Vkadaba 5:0728bde67bdb 133 .sensor = ADMW1001_ADC_SENSOR_THERMOCOUPLE_K_DEF_L1,
Vkadaba 5:0728bde67bdb 134 .gain = ADMW1001_ADC_GAIN_32X,
ADIJake 0:85855ecd3257 135 .filter = {
Vkadaba 6:9d393a9677f4 136 .type = ADMW1001_ADC_FILTER_SINC3,
ADIJake 0:85855ecd3257 137 },
ADIJake 0:85855ecd3257 138 .reference = {
Vkadaba 5:0728bde67bdb 139 .type = ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL,
ADIJake 0:85855ecd3257 140 },
ADIJake 0:85855ecd3257 141 .enableVbias = true,
ADIJake 0:85855ecd3257 142 },
ADIJake 0:85855ecd3257 143 },
Vkadaba 5:0728bde67bdb 144 [ADMW1001_CHANNEL_ID_I2C_0] = {
ADIJake 0:85855ecd3257 145 .enableChannel = true,
ADIJake 0:85855ecd3257 146 .disablePublishing = false,
Vkadaba 5:0728bde67bdb 147 .compensationChannel = ADMW1001_CHANNEL_ID_NONE,
ADIJake 0:85855ecd3257 148 .measurementsPerCycle = 10,
ADIJake 0:85855ecd3257 149 .extraSettlingTime = 36500,
ADIJake 0:85855ecd3257 150 .i2cChannelConfig = {
Vkadaba 5:0728bde67bdb 151 .sensor = ADMW1001_I2C_SENSOR_HUMIDITY_A_DEF_L1,
ADIJake 0:85855ecd3257 152 .deviceAddress = 0x27,
ADIJake 0:85855ecd3257 153 },
ADIJake 0:85855ecd3257 154 },
ADIJake 0:85855ecd3257 155 },
ADIJake 0:85855ecd3257 156 },
ADIJake 0:85855ecd3257 157 };
ADIJake 0:85855ecd3257 158