SDMP_IOT / Mbed OS AdiSense1000_SmartBabySeat

Fork of Babyseat_NewFirmware_copy_sean by Ross O'Halloran

Committer:
Ross_o_halloran
Date:
Fri Aug 24 10:46:38 2018 +0000
Revision:
36:7b89e52b48f6
Parent:
35:cc01f0766fc2

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Ross_o_halloran 35:cc01f0766fc2 1 /*
Ross_o_halloran 35:cc01f0766fc2 2 Copyright 2017 (c) Analog Devices, Inc.
Ross_o_halloran 35:cc01f0766fc2 3
Ross_o_halloran 35:cc01f0766fc2 4 All rights reserved.
Ross_o_halloran 35:cc01f0766fc2 5
Ross_o_halloran 35:cc01f0766fc2 6 Redistribution and use in source and binary forms, with or without
Ross_o_halloran 35:cc01f0766fc2 7 modification, are permitted provided that the following conditions are met:
Ross_o_halloran 35:cc01f0766fc2 8 - Redistributions of source code must retain the above copyright
Ross_o_halloran 35:cc01f0766fc2 9 notice, this list of conditions and the following disclaimer.
Ross_o_halloran 35:cc01f0766fc2 10 - Redistributions in binary form must reproduce the above copyright
Ross_o_halloran 35:cc01f0766fc2 11 notice, this list of conditions and the following disclaimer in
Ross_o_halloran 35:cc01f0766fc2 12 the documentation and/or other materials provided with the
Ross_o_halloran 35:cc01f0766fc2 13 distribution.
Ross_o_halloran 35:cc01f0766fc2 14 - Neither the name of Analog Devices, Inc. nor the names of its
Ross_o_halloran 35:cc01f0766fc2 15 contributors may be used to endorse or promote products derived
Ross_o_halloran 35:cc01f0766fc2 16 from this software without specific prior written permission.
Ross_o_halloran 35:cc01f0766fc2 17 - The use of this software may or may not infringe the patent rights
Ross_o_halloran 35:cc01f0766fc2 18 of one or more patent holders. This license does not release you
Ross_o_halloran 35:cc01f0766fc2 19 from the requirement that you obtain separate licenses from these
Ross_o_halloran 35:cc01f0766fc2 20 patent holders to use this software.
Ross_o_halloran 35:cc01f0766fc2 21 - Use of the software either in source or binary form, must be run
Ross_o_halloran 35:cc01f0766fc2 22 on or directly connected to an Analog Devices Inc. component.
Ross_o_halloran 35:cc01f0766fc2 23
Ross_o_halloran 35:cc01f0766fc2 24 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
Ross_o_halloran 35:cc01f0766fc2 25 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
Ross_o_halloran 35:cc01f0766fc2 26 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
Ross_o_halloran 35:cc01f0766fc2 27 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
Ross_o_halloran 35:cc01f0766fc2 28 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
Ross_o_halloran 35:cc01f0766fc2 29 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
Ross_o_halloran 35:cc01f0766fc2 30 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Ross_o_halloran 35:cc01f0766fc2 31 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Ross_o_halloran 35:cc01f0766fc2 32 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Ross_o_halloran 35:cc01f0766fc2 33 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Ross_o_halloran 35:cc01f0766fc2 34 *
Ross_o_halloran 35:cc01f0766fc2 35 *****************************************************************************/
Ross_o_halloran 35:cc01f0766fc2 36
Ross_o_halloran 35:cc01f0766fc2 37 /*!
Ross_o_halloran 35:cc01f0766fc2 38 ******************************************************************************
Ross_o_halloran 35:cc01f0766fc2 39 * @file:
Ross_o_halloran 35:cc01f0766fc2 40 * @brief:
Ross_o_halloran 35:cc01f0766fc2 41 *-----------------------------------------------------------------------------
Ross_o_halloran 35:cc01f0766fc2 42 */
Ross_o_halloran 35:cc01f0766fc2 43 #include "inc/adi_sense_config_types.h"
Ross_o_halloran 35:cc01f0766fc2 44
Ross_o_halloran 35:cc01f0766fc2 45 ADI_SENSE_CONFIG babyseat_conf = {
Ross_o_halloran 35:cc01f0766fc2 46 .versionId = { .major = 1, .minor = 4 },
Ross_o_halloran 35:cc01f0766fc2 47 .productId = ADI_SENSE_PRODUCT_ID_ADSNS1000,
Ross_o_halloran 35:cc01f0766fc2 48 .adisense1000 = {
Ross_o_halloran 35:cc01f0766fc2 49 .power = {
Ross_o_halloran 35:cc01f0766fc2 50 .powerMode = ADI_SENSE_1000_POWER_MODE_FULL,
Ross_o_halloran 35:cc01f0766fc2 51 },
Ross_o_halloran 35:cc01f0766fc2 52 .measurement = {
Ross_o_halloran 35:cc01f0766fc2 53 .operatingMode = ADI_SENSE_1000_OPERATING_MODE_CONTINUOUS,
Ross_o_halloran 35:cc01f0766fc2 54 .dataReadyMode = ADI_SENSE_1000_DATAREADY_PER_CYCLE,
Ross_o_halloran 36:7b89e52b48f6 55 .cycleInterval = 50000,
Ross_o_halloran 35:cc01f0766fc2 56 },
Ross_o_halloran 35:cc01f0766fc2 57 .channels = {
Ross_o_halloran 36:7b89e52b48f6 58 [ADI_SENSE_1000_CHANNEL_ID_CJC_0] = {
Ross_o_halloran 36:7b89e52b48f6 59 .enableChannel = false,
Ross_o_halloran 36:7b89e52b48f6 60 .disablePublishing = false,
Ross_o_halloran 36:7b89e52b48f6 61 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
Ross_o_halloran 36:7b89e52b48f6 62 .measurementUnit = ADI_SENSE_1000_MEASUREMENT_UNIT_CELSIUS,
Ross_o_halloran 36:7b89e52b48f6 63 .measurementsPerCycle = 1,
Ross_o_halloran 36:7b89e52b48f6 64 .extraSettlingTime = 0,
Ross_o_halloran 36:7b89e52b48f6 65 .adcChannelConfig = {
Ross_o_halloran 36:7b89e52b48f6 66 .sensor = ADI_SENSE_1000_ADC_SENSOR_THERMISTOR_B_10K_DEF_L1,
Ross_o_halloran 36:7b89e52b48f6 67 .gain = ADI_SENSE_1000_ADC_GAIN_1X,
Ross_o_halloran 36:7b89e52b48f6 68 .filter = {
Ross_o_halloran 36:7b89e52b48f6 69 .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
Ross_o_halloran 36:7b89e52b48f6 70 },
Ross_o_halloran 36:7b89e52b48f6 71 .reference = {
Ross_o_halloran 36:7b89e52b48f6 72 .type = ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_INTERNAL_2,
Ross_o_halloran 36:7b89e52b48f6 73 .disableBuffer = true,
Ross_o_halloran 36:7b89e52b48f6 74 },
Ross_o_halloran 36:7b89e52b48f6 75 .enableVbias = false,
Ross_o_halloran 36:7b89e52b48f6 76 },
Ross_o_halloran 36:7b89e52b48f6 77 },
Ross_o_halloran 36:7b89e52b48f6 78 [ADI_SENSE_1000_CHANNEL_ID_SENSOR_0] = {
Ross_o_halloran 35:cc01f0766fc2 79 .enableChannel = true,
Ross_o_halloran 35:cc01f0766fc2 80 .disablePublishing = false,
Ross_o_halloran 35:cc01f0766fc2 81 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
Ross_o_halloran 35:cc01f0766fc2 82 .measurementsPerCycle = 1,
Ross_o_halloran 35:cc01f0766fc2 83 .extraSettlingTime = 25000,
Ross_o_halloran 35:cc01f0766fc2 84 .adcChannelConfig = {
Ross_o_halloran 35:cc01f0766fc2 85 .sensor = ADI_SENSE_1000_ADC_SENSOR_BRIDGE_4WIRE_1_DEF_L2,
Ross_o_halloran 35:cc01f0766fc2 86 .gain = ADI_SENSE_1000_ADC_GAIN_32X,
Ross_o_halloran 35:cc01f0766fc2 87 .filter = {
Ross_o_halloran 35:cc01f0766fc2 88 .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
Ross_o_halloran 35:cc01f0766fc2 89 },
Ross_o_halloran 35:cc01f0766fc2 90 .reference = {
Ross_o_halloran 35:cc01f0766fc2 91 .type = ADI_SENSE_1000_ADC_REFERENCE_BRIDGE_EXCITATION,
Ross_o_halloran 35:cc01f0766fc2 92 .disableBuffer = false,
Ross_o_halloran 35:cc01f0766fc2 93 },
Ross_o_halloran 35:cc01f0766fc2 94 .enableVbias = false,
Ross_o_halloran 35:cc01f0766fc2 95 },
Ross_o_halloran 36:7b89e52b48f6 96 },
Ross_o_halloran 36:7b89e52b48f6 97 [ADI_SENSE_1000_CHANNEL_ID_SENSOR_1] = {
Ross_o_halloran 36:7b89e52b48f6 98 .enableChannel = false,
Ross_o_halloran 36:7b89e52b48f6 99 .disablePublishing = false,
Ross_o_halloran 36:7b89e52b48f6 100 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
Ross_o_halloran 36:7b89e52b48f6 101 .measurementUnit = ADI_SENSE_1000_MEASUREMENT_UNIT_CELSIUS,
Ross_o_halloran 36:7b89e52b48f6 102 .measurementsPerCycle = 1,
Ross_o_halloran 36:7b89e52b48f6 103 .extraSettlingTime = 0,
Ross_o_halloran 36:7b89e52b48f6 104 .adcChannelConfig = {
Ross_o_halloran 36:7b89e52b48f6 105 .sensor = ADI_SENSE_1000_ADC_SENSOR_BRIDGE_4WIRE_2_DEF_L2,
Ross_o_halloran 36:7b89e52b48f6 106 .gain = ADI_SENSE_1000_ADC_GAIN_1X,
Ross_o_halloran 36:7b89e52b48f6 107 .filter = {
Ross_o_halloran 36:7b89e52b48f6 108 .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
Ross_o_halloran 36:7b89e52b48f6 109 },
Ross_o_halloran 36:7b89e52b48f6 110 .reference = {
Ross_o_halloran 36:7b89e52b48f6 111 .type = ADI_SENSE_1000_ADC_REFERENCE_BRIDGE_EXCITATION,
Ross_o_halloran 36:7b89e52b48f6 112 .disableBuffer = true,
Ross_o_halloran 36:7b89e52b48f6 113 },
Ross_o_halloran 36:7b89e52b48f6 114 .enableVbias = false,
Ross_o_halloran 35:cc01f0766fc2 115 },
Ross_o_halloran 36:7b89e52b48f6 116 },
Ross_o_halloran 35:cc01f0766fc2 117 [ADI_SENSE_1000_CHANNEL_ID_SENSOR_2] = {
Ross_o_halloran 35:cc01f0766fc2 118 .enableChannel = false,
Ross_o_halloran 35:cc01f0766fc2 119 .disablePublishing = false,
Ross_o_halloran 35:cc01f0766fc2 120 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
Ross_o_halloran 35:cc01f0766fc2 121 .measurementsPerCycle = 1,
Ross_o_halloran 35:cc01f0766fc2 122 .extraSettlingTime = 25000,
Ross_o_halloran 35:cc01f0766fc2 123 .adcChannelConfig = {
Ross_o_halloran 35:cc01f0766fc2 124 .sensor = ADI_SENSE_1000_ADC_SENSOR_BRIDGE_4WIRE_3_DEF_L2,
Ross_o_halloran 35:cc01f0766fc2 125 .gain = ADI_SENSE_1000_ADC_GAIN_32X,
Ross_o_halloran 35:cc01f0766fc2 126 .filter = {
Ross_o_halloran 35:cc01f0766fc2 127 .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
Ross_o_halloran 35:cc01f0766fc2 128 },
Ross_o_halloran 35:cc01f0766fc2 129 .reference = {
Ross_o_halloran 35:cc01f0766fc2 130 .type = ADI_SENSE_1000_ADC_REFERENCE_BRIDGE_EXCITATION,
Ross_o_halloran 35:cc01f0766fc2 131 .disableBuffer = false,
Ross_o_halloran 35:cc01f0766fc2 132 },
Ross_o_halloran 35:cc01f0766fc2 133 .enableVbias = false,
Ross_o_halloran 35:cc01f0766fc2 134 },
Ross_o_halloran 35:cc01f0766fc2 135 },
Ross_o_halloran 35:cc01f0766fc2 136 [ADI_SENSE_1000_CHANNEL_ID_SENSOR_3] = {
Ross_o_halloran 35:cc01f0766fc2 137 .enableChannel = false,
Ross_o_halloran 35:cc01f0766fc2 138 .disablePublishing = false,
Ross_o_halloran 35:cc01f0766fc2 139 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
Ross_o_halloran 35:cc01f0766fc2 140 .measurementsPerCycle = 1,
Ross_o_halloran 35:cc01f0766fc2 141 .extraSettlingTime = 25000,
Ross_o_halloran 35:cc01f0766fc2 142 .adcChannelConfig = {
Ross_o_halloran 35:cc01f0766fc2 143 .sensor = ADI_SENSE_1000_ADC_SENSOR_BRIDGE_4WIRE_4_DEF_L2,
Ross_o_halloran 35:cc01f0766fc2 144 .gain = ADI_SENSE_1000_ADC_GAIN_1X,
Ross_o_halloran 35:cc01f0766fc2 145 .filter = {
Ross_o_halloran 35:cc01f0766fc2 146 .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
Ross_o_halloran 35:cc01f0766fc2 147 },
Ross_o_halloran 35:cc01f0766fc2 148 .reference = {
Ross_o_halloran 35:cc01f0766fc2 149 .type = ADI_SENSE_1000_ADC_REFERENCE_BRIDGE_EXCITATION,
Ross_o_halloran 35:cc01f0766fc2 150 .disableBuffer = false,
Ross_o_halloran 35:cc01f0766fc2 151 },
Ross_o_halloran 35:cc01f0766fc2 152 .enableVbias = false,
Ross_o_halloran 35:cc01f0766fc2 153 },
Ross_o_halloran 36:7b89e52b48f6 154 },
Ross_o_halloran 36:7b89e52b48f6 155 [ADI_SENSE_1000_CHANNEL_ID_VOLTAGE_0] = {
Ross_o_halloran 36:7b89e52b48f6 156 .enableChannel = false,
Ross_o_halloran 36:7b89e52b48f6 157 .disablePublishing = false,
Ross_o_halloran 36:7b89e52b48f6 158 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
Ross_o_halloran 36:7b89e52b48f6 159 .measurementsPerCycle = 1,
Ross_o_halloran 36:7b89e52b48f6 160 .extraSettlingTime = 0,
Ross_o_halloran 36:7b89e52b48f6 161 .adcChannelConfig = {
Ross_o_halloran 36:7b89e52b48f6 162 .sensor = ADI_SENSE_1000_ADC_SENSOR_VOLTAGE_PRESSURE_1_DEF_L2,
Ross_o_halloran 36:7b89e52b48f6 163 .gain = ADI_SENSE_1000_ADC_GAIN_1X,
Ross_o_halloran 36:7b89e52b48f6 164 .filter = {
Ross_o_halloran 36:7b89e52b48f6 165 .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
Ross_o_halloran 36:7b89e52b48f6 166 },
Ross_o_halloran 36:7b89e52b48f6 167 .reference = {
Ross_o_halloran 36:7b89e52b48f6 168 .type = ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_INTERNAL,
Ross_o_halloran 36:7b89e52b48f6 169 .disableBuffer = true,
Ross_o_halloran 36:7b89e52b48f6 170 },
Ross_o_halloran 36:7b89e52b48f6 171 .enableVbias = false,
Ross_o_halloran 36:7b89e52b48f6 172 },
Ross_o_halloran 36:7b89e52b48f6 173 },
Ross_o_halloran 35:cc01f0766fc2 174 [ADI_SENSE_1000_CHANNEL_ID_I2C_0] = {
Ross_o_halloran 35:cc01f0766fc2 175 .enableChannel = false,
Ross_o_halloran 35:cc01f0766fc2 176 .disablePublishing = false,
Ross_o_halloran 35:cc01f0766fc2 177 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
Ross_o_halloran 35:cc01f0766fc2 178 .measurementsPerCycle = 1,
Ross_o_halloran 35:cc01f0766fc2 179 .extraSettlingTime = 15000,
Ross_o_halloran 35:cc01f0766fc2 180 .i2cChannelConfig = {
Ross_o_halloran 35:cc01f0766fc2 181 .sensor = ADI_SENSE_1000_I2C_SENSOR_HUMIDITY_B_DEF_L1,
Ross_o_halloran 35:cc01f0766fc2 182 .deviceAddress = 0x44,
Ross_o_halloran 35:cc01f0766fc2 183 },
Ross_o_halloran 35:cc01f0766fc2 184 },
Ross_o_halloran 35:cc01f0766fc2 185 [ADI_SENSE_1000_CHANNEL_ID_SPI_0] = {
Ross_o_halloran 35:cc01f0766fc2 186 /* Accelerometer X-Axis (and common settings for physical channel) */
Ross_o_halloran 35:cc01f0766fc2 187 .enableChannel = false,
Ross_o_halloran 35:cc01f0766fc2 188 .disablePublishing = false,
Ross_o_halloran 35:cc01f0766fc2 189 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
Ross_o_halloran 35:cc01f0766fc2 190 .measurementsPerCycle = 1,
Ross_o_halloran 35:cc01f0766fc2 191 .extraSettlingTime = 10000,
Ross_o_halloran 35:cc01f0766fc2 192 /* Optional threshold limits applied to the processed measurement results */
Ross_o_halloran 36:7b89e52b48f6 193 .lowThreshold = -60.0,
Ross_o_halloran 36:7b89e52b48f6 194 .highThreshold = 60.0,
Ross_o_halloran 35:cc01f0766fc2 195 .spiChannelConfig = {
Ross_o_halloran 35:cc01f0766fc2 196 .sensor = ADI_SENSE_1000_SPI_SENSOR_ACCELEROMETER_A_DEF_L1,
Ross_o_halloran 35:cc01f0766fc2 197 },
Ross_o_halloran 35:cc01f0766fc2 198 },
Ross_o_halloran 35:cc01f0766fc2 199 [ADI_SENSE_1000_CHANNEL_ID_SPI_1] = {
Ross_o_halloran 35:cc01f0766fc2 200 /* Accelerometer Y-Axis (virtual channel) */
Ross_o_halloran 35:cc01f0766fc2 201 .enableChannel = false,
Ross_o_halloran 35:cc01f0766fc2 202 /* Optional threshold limits applied to the processed measurement results */
Ross_o_halloran 36:7b89e52b48f6 203 .lowThreshold = -60.0,
Ross_o_halloran 36:7b89e52b48f6 204 .highThreshold = 60.0,
Ross_o_halloran 35:cc01f0766fc2 205 },
Ross_o_halloran 35:cc01f0766fc2 206 [ADI_SENSE_1000_CHANNEL_ID_SPI_2] = {
Ross_o_halloran 35:cc01f0766fc2 207 /* Accelerometer Z-Axis (virtual channel) */
Ross_o_halloran 35:cc01f0766fc2 208 .enableChannel = false,
Ross_o_halloran 35:cc01f0766fc2 209 /* Optional adjustment applied to the processed measurement result */
Ross_o_halloran 35:cc01f0766fc2 210 .offsetAdjustment = -0.2,
Ross_o_halloran 35:cc01f0766fc2 211 /* Optional threshold limits applied to the processed measurement results */
Ross_o_halloran 36:7b89e52b48f6 212 .lowThreshold = -10.5,
Ross_o_halloran 36:7b89e52b48f6 213 .highThreshold = 10.5,
Ross_o_halloran 35:cc01f0766fc2 214 },
Ross_o_halloran 35:cc01f0766fc2 215 },
Ross_o_halloran 35:cc01f0766fc2 216 },
Ross_o_halloran 35:cc01f0766fc2 217 };