SDMP_IOT / Mbed OS AdiSense1000_SmartBabySeat

Fork of Babyseat_NewFirmware_copy_sean by Ross O'Halloran

Committer:
Ross_o_halloran
Date:
Fri Aug 17 15:46:16 2018 +0000
Revision:
35:cc01f0766fc2
Child:
36:7b89e52b48f6
Sean

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 35:cc01f0766fc2 55 .cycleInterval = 1000000,
Ross_o_halloran 35:cc01f0766fc2 56 },
Ross_o_halloran 35:cc01f0766fc2 57 .channels = {
Ross_o_halloran 35:cc01f0766fc2 58 [ADI_SENSE_1000_CHANNEL_ID_SENSOR_0] = {
Ross_o_halloran 35:cc01f0766fc2 59 .enableChannel = true,
Ross_o_halloran 35:cc01f0766fc2 60 .disablePublishing = false,
Ross_o_halloran 35:cc01f0766fc2 61 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
Ross_o_halloran 35:cc01f0766fc2 62 .measurementsPerCycle = 1,
Ross_o_halloran 35:cc01f0766fc2 63 .extraSettlingTime = 25000,
Ross_o_halloran 35:cc01f0766fc2 64 .adcChannelConfig = {
Ross_o_halloran 35:cc01f0766fc2 65 .sensor = ADI_SENSE_1000_ADC_SENSOR_BRIDGE_4WIRE_1_DEF_L2,
Ross_o_halloran 35:cc01f0766fc2 66 .gain = ADI_SENSE_1000_ADC_GAIN_32X,
Ross_o_halloran 35:cc01f0766fc2 67 .filter = {
Ross_o_halloran 35:cc01f0766fc2 68 .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
Ross_o_halloran 35:cc01f0766fc2 69 },
Ross_o_halloran 35:cc01f0766fc2 70 .reference = {
Ross_o_halloran 35:cc01f0766fc2 71 .type = ADI_SENSE_1000_ADC_REFERENCE_BRIDGE_EXCITATION,
Ross_o_halloran 35:cc01f0766fc2 72 .disableBuffer = false,
Ross_o_halloran 35:cc01f0766fc2 73 },
Ross_o_halloran 35:cc01f0766fc2 74 .enableVbias = false,
Ross_o_halloran 35:cc01f0766fc2 75 },
Ross_o_halloran 35:cc01f0766fc2 76 },
Ross_o_halloran 35:cc01f0766fc2 77 [ADI_SENSE_1000_CHANNEL_ID_SENSOR_1] = {
Ross_o_halloran 35:cc01f0766fc2 78 .enableChannel = false,
Ross_o_halloran 35:cc01f0766fc2 79 .disablePublishing = false,
Ross_o_halloran 35:cc01f0766fc2 80 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
Ross_o_halloran 35:cc01f0766fc2 81 .measurementsPerCycle = 1,
Ross_o_halloran 35:cc01f0766fc2 82 .extraSettlingTime = 25000,
Ross_o_halloran 35:cc01f0766fc2 83 .adcChannelConfig = {
Ross_o_halloran 35:cc01f0766fc2 84 .sensor = ADI_SENSE_1000_ADC_SENSOR_BRIDGE_4WIRE_2_DEF_L2,
Ross_o_halloran 35:cc01f0766fc2 85 .gain = ADI_SENSE_1000_ADC_GAIN_1X,
Ross_o_halloran 35:cc01f0766fc2 86 .filter = {
Ross_o_halloran 35:cc01f0766fc2 87 .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
Ross_o_halloran 35:cc01f0766fc2 88 },
Ross_o_halloran 35:cc01f0766fc2 89 .reference = {
Ross_o_halloran 35:cc01f0766fc2 90 .type = ADI_SENSE_1000_ADC_REFERENCE_BRIDGE_EXCITATION,
Ross_o_halloran 35:cc01f0766fc2 91 .disableBuffer = false,
Ross_o_halloran 35:cc01f0766fc2 92 },
Ross_o_halloran 35:cc01f0766fc2 93 .enableVbias = false,
Ross_o_halloran 35:cc01f0766fc2 94 },
Ross_o_halloran 35:cc01f0766fc2 95 },
Ross_o_halloran 35:cc01f0766fc2 96 [ADI_SENSE_1000_CHANNEL_ID_SENSOR_2] = {
Ross_o_halloran 35:cc01f0766fc2 97 .enableChannel = false,
Ross_o_halloran 35:cc01f0766fc2 98 .disablePublishing = false,
Ross_o_halloran 35:cc01f0766fc2 99 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
Ross_o_halloran 35:cc01f0766fc2 100 .measurementsPerCycle = 1,
Ross_o_halloran 35:cc01f0766fc2 101 .extraSettlingTime = 25000,
Ross_o_halloran 35:cc01f0766fc2 102 .adcChannelConfig = {
Ross_o_halloran 35:cc01f0766fc2 103 .sensor = ADI_SENSE_1000_ADC_SENSOR_BRIDGE_4WIRE_3_DEF_L2,
Ross_o_halloran 35:cc01f0766fc2 104 .gain = ADI_SENSE_1000_ADC_GAIN_32X,
Ross_o_halloran 35:cc01f0766fc2 105 .filter = {
Ross_o_halloran 35:cc01f0766fc2 106 .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
Ross_o_halloran 35:cc01f0766fc2 107 },
Ross_o_halloran 35:cc01f0766fc2 108 .reference = {
Ross_o_halloran 35:cc01f0766fc2 109 .type = ADI_SENSE_1000_ADC_REFERENCE_BRIDGE_EXCITATION,
Ross_o_halloran 35:cc01f0766fc2 110 .disableBuffer = false,
Ross_o_halloran 35:cc01f0766fc2 111 },
Ross_o_halloran 35:cc01f0766fc2 112 .enableVbias = false,
Ross_o_halloran 35:cc01f0766fc2 113 },
Ross_o_halloran 35:cc01f0766fc2 114 },
Ross_o_halloran 35:cc01f0766fc2 115 [ADI_SENSE_1000_CHANNEL_ID_SENSOR_3] = {
Ross_o_halloran 35:cc01f0766fc2 116 .enableChannel = false,
Ross_o_halloran 35:cc01f0766fc2 117 .disablePublishing = false,
Ross_o_halloran 35:cc01f0766fc2 118 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
Ross_o_halloran 35:cc01f0766fc2 119 .measurementsPerCycle = 1,
Ross_o_halloran 35:cc01f0766fc2 120 .extraSettlingTime = 25000,
Ross_o_halloran 35:cc01f0766fc2 121 .adcChannelConfig = {
Ross_o_halloran 35:cc01f0766fc2 122 .sensor = ADI_SENSE_1000_ADC_SENSOR_BRIDGE_4WIRE_4_DEF_L2,
Ross_o_halloran 35:cc01f0766fc2 123 .gain = ADI_SENSE_1000_ADC_GAIN_1X,
Ross_o_halloran 35:cc01f0766fc2 124 .filter = {
Ross_o_halloran 35:cc01f0766fc2 125 .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
Ross_o_halloran 35:cc01f0766fc2 126 },
Ross_o_halloran 35:cc01f0766fc2 127 .reference = {
Ross_o_halloran 35:cc01f0766fc2 128 .type = ADI_SENSE_1000_ADC_REFERENCE_BRIDGE_EXCITATION,
Ross_o_halloran 35:cc01f0766fc2 129 .disableBuffer = false,
Ross_o_halloran 35:cc01f0766fc2 130 },
Ross_o_halloran 35:cc01f0766fc2 131 .enableVbias = false,
Ross_o_halloran 35:cc01f0766fc2 132 },
Ross_o_halloran 35:cc01f0766fc2 133 },
Ross_o_halloran 35:cc01f0766fc2 134 [ADI_SENSE_1000_CHANNEL_ID_I2C_0] = {
Ross_o_halloran 35:cc01f0766fc2 135 .enableChannel = false,
Ross_o_halloran 35:cc01f0766fc2 136 .disablePublishing = false,
Ross_o_halloran 35:cc01f0766fc2 137 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
Ross_o_halloran 35:cc01f0766fc2 138 .measurementsPerCycle = 1,
Ross_o_halloran 35:cc01f0766fc2 139 .extraSettlingTime = 15000,
Ross_o_halloran 35:cc01f0766fc2 140 .i2cChannelConfig = {
Ross_o_halloran 35:cc01f0766fc2 141 .sensor = ADI_SENSE_1000_I2C_SENSOR_HUMIDITY_B_DEF_L1,
Ross_o_halloran 35:cc01f0766fc2 142 .deviceAddress = 0x44,
Ross_o_halloran 35:cc01f0766fc2 143 },
Ross_o_halloran 35:cc01f0766fc2 144 },
Ross_o_halloran 35:cc01f0766fc2 145 [ADI_SENSE_1000_CHANNEL_ID_SPI_0] = {
Ross_o_halloran 35:cc01f0766fc2 146 /* Accelerometer X-Axis (and common settings for physical channel) */
Ross_o_halloran 35:cc01f0766fc2 147 .enableChannel = false,
Ross_o_halloran 35:cc01f0766fc2 148 .disablePublishing = false,
Ross_o_halloran 35:cc01f0766fc2 149 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
Ross_o_halloran 35:cc01f0766fc2 150 .measurementsPerCycle = 1,
Ross_o_halloran 35:cc01f0766fc2 151 .extraSettlingTime = 10000,
Ross_o_halloran 35:cc01f0766fc2 152 /* Optional threshold limits applied to the processed measurement results */
Ross_o_halloran 35:cc01f0766fc2 153 .lowThreshold = -6.0,
Ross_o_halloran 35:cc01f0766fc2 154 .highThreshold = 6.0,
Ross_o_halloran 35:cc01f0766fc2 155 .spiChannelConfig = {
Ross_o_halloran 35:cc01f0766fc2 156 .sensor = ADI_SENSE_1000_SPI_SENSOR_ACCELEROMETER_A_DEF_L1,
Ross_o_halloran 35:cc01f0766fc2 157 },
Ross_o_halloran 35:cc01f0766fc2 158 },
Ross_o_halloran 35:cc01f0766fc2 159 [ADI_SENSE_1000_CHANNEL_ID_SPI_1] = {
Ross_o_halloran 35:cc01f0766fc2 160 /* Accelerometer Y-Axis (virtual channel) */
Ross_o_halloran 35:cc01f0766fc2 161 .enableChannel = false,
Ross_o_halloran 35:cc01f0766fc2 162 /* Optional threshold limits applied to the processed measurement results */
Ross_o_halloran 35:cc01f0766fc2 163 .lowThreshold = -6.0,
Ross_o_halloran 35:cc01f0766fc2 164 .highThreshold = 6.0,
Ross_o_halloran 35:cc01f0766fc2 165 },
Ross_o_halloran 35:cc01f0766fc2 166 [ADI_SENSE_1000_CHANNEL_ID_SPI_2] = {
Ross_o_halloran 35:cc01f0766fc2 167 /* Accelerometer Z-Axis (virtual channel) */
Ross_o_halloran 35:cc01f0766fc2 168 .enableChannel = false,
Ross_o_halloran 35:cc01f0766fc2 169 /* Optional adjustment applied to the processed measurement result */
Ross_o_halloran 35:cc01f0766fc2 170 .offsetAdjustment = -0.2,
Ross_o_halloran 35:cc01f0766fc2 171 /* Optional threshold limits applied to the processed measurement results */
Ross_o_halloran 35:cc01f0766fc2 172 .lowThreshold = -1.5,
Ross_o_halloran 35:cc01f0766fc2 173 .highThreshold = 1.5,
Ross_o_halloran 35:cc01f0766fc2 174 },
Ross_o_halloran 35:cc01f0766fc2 175 },
Ross_o_halloran 35:cc01f0766fc2 176 },
Ross_o_halloran 35:cc01f0766fc2 177 };