AdiSense1000_V21 MBED API

Fork of AdiSense1000 by PoC_Team

Committer:
Dan O'Donovan
Date:
Mon Mar 26 20:28:05 2018 +0100
Branch:
v2.0
Revision:
27:567abf893938
Child:
29:57edca10d78c
Adding host library and example code for v1.1 release

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Dan O'Donovan 27:567abf893938 1 /*
Dan O'Donovan 27:567abf893938 2 CONFIDENTIAL AND PROPRIETARY INFORMATION
Dan O'Donovan 27:567abf893938 3
Dan O'Donovan 27:567abf893938 4 Copyright (c) 2018 Emutex Ltd. All rights reserved.
Dan O'Donovan 27:567abf893938 5 This software and documentation contain confidential and
Dan O'Donovan 27:567abf893938 6 proprietary information that is the property of
Dan O'Donovan 27:567abf893938 7 Emutex Ltd. The software and documentation are
Dan O'Donovan 27:567abf893938 8 furnished under a license agreement and may be used
Dan O'Donovan 27:567abf893938 9 or copied only in accordance with the terms of the license
Dan O'Donovan 27:567abf893938 10 agreement. No part of the software and documentation
Dan O'Donovan 27:567abf893938 11 may be reproduced, transmitted, or translated, in any
Dan O'Donovan 27:567abf893938 12 form or by any means, electronic, mechanical, manual,
Dan O'Donovan 27:567abf893938 13 optical, or otherwise, without prior written permission
Dan O'Donovan 27:567abf893938 14 of Emutex Ltd., or as expressly provided by the license agreement.
Dan O'Donovan 27:567abf893938 15 Reverse engineering is prohibited, and reproduction,
Dan O'Donovan 27:567abf893938 16 disclosure or use without specific written authorization
Dan O'Donovan 27:567abf893938 17 of Emutex Ltd. is strictly forbidden.
Dan O'Donovan 27:567abf893938 18 *
Dan O'Donovan 27:567abf893938 19 Copyright 2017 (c) Analog Devices, Inc.
Dan O'Donovan 27:567abf893938 20
Dan O'Donovan 27:567abf893938 21 All rights reserved.
Dan O'Donovan 27:567abf893938 22
Dan O'Donovan 27:567abf893938 23 Redistribution and use in source and binary forms, with or without
Dan O'Donovan 27:567abf893938 24 modification, are permitted provided that the following conditions are met:
Dan O'Donovan 27:567abf893938 25 - Redistributions of source code must retain the above copyright
Dan O'Donovan 27:567abf893938 26 notice, this list of conditions and the following disclaimer.
Dan O'Donovan 27:567abf893938 27 - Redistributions in binary form must reproduce the above copyright
Dan O'Donovan 27:567abf893938 28 notice, this list of conditions and the following disclaimer in
Dan O'Donovan 27:567abf893938 29 the documentation and/or other materials provided with the
Dan O'Donovan 27:567abf893938 30 distribution.
Dan O'Donovan 27:567abf893938 31 - Neither the name of Analog Devices, Inc. nor the names of its
Dan O'Donovan 27:567abf893938 32 contributors may be used to endorse or promote products derived
Dan O'Donovan 27:567abf893938 33 from this software without specific prior written permission.
Dan O'Donovan 27:567abf893938 34 - The use of this software may or may not infringe the patent rights
Dan O'Donovan 27:567abf893938 35 of one or more patent holders. This license does not release you
Dan O'Donovan 27:567abf893938 36 from the requirement that you obtain separate licenses from these
Dan O'Donovan 27:567abf893938 37 patent holders to use this software.
Dan O'Donovan 27:567abf893938 38 - Use of the software either in source or binary form, must be run
Dan O'Donovan 27:567abf893938 39 on or directly connected to an Analog Devices Inc. component.
Dan O'Donovan 27:567abf893938 40
Dan O'Donovan 27:567abf893938 41 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
Dan O'Donovan 27:567abf893938 42 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
Dan O'Donovan 27:567abf893938 43 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
Dan O'Donovan 27:567abf893938 44 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
Dan O'Donovan 27:567abf893938 45 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
Dan O'Donovan 27:567abf893938 46 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
Dan O'Donovan 27:567abf893938 47 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Dan O'Donovan 27:567abf893938 48 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Dan O'Donovan 27:567abf893938 49 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Dan O'Donovan 27:567abf893938 50 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Dan O'Donovan 27:567abf893938 51 *
Dan O'Donovan 27:567abf893938 52 *****************************************************************************/
Dan O'Donovan 27:567abf893938 53
Dan O'Donovan 27:567abf893938 54 /*!
Dan O'Donovan 27:567abf893938 55 ******************************************************************************
Dan O'Donovan 27:567abf893938 56 * @file:
Dan O'Donovan 27:567abf893938 57 * @brief:
Dan O'Donovan 27:567abf893938 58 *-----------------------------------------------------------------------------
Dan O'Donovan 27:567abf893938 59 */
Dan O'Donovan 27:567abf893938 60 #include "inc/adi_sense_config_types.h"
Dan O'Donovan 27:567abf893938 61
Dan O'Donovan 27:567abf893938 62 ADI_SENSE_CONFIG spi0_adiAdxl355_config = {
Dan O'Donovan 27:567abf893938 63 .versionId = { .major = 1, .minor = 4 },
Dan O'Donovan 27:567abf893938 64 .productId = ADI_SENSE_PRODUCT_ID_ADSNS1000,
Dan O'Donovan 27:567abf893938 65 .adisense1000 = {
Dan O'Donovan 27:567abf893938 66 .power = {
Dan O'Donovan 27:567abf893938 67 .powerMode = ADI_SENSE_1000_POWER_MODE_FULL,
Dan O'Donovan 27:567abf893938 68 },
Dan O'Donovan 27:567abf893938 69 .measurement = {
Dan O'Donovan 27:567abf893938 70 .operatingMode = ADI_SENSE_1000_OPERATING_MODE_CONTINUOUS,
Dan O'Donovan 27:567abf893938 71 .dataReadyMode = ADI_SENSE_1000_DATAREADY_PER_CYCLE,
Dan O'Donovan 27:567abf893938 72 .cycleInterval = 1000000,
Dan O'Donovan 27:567abf893938 73 },
Dan O'Donovan 27:567abf893938 74 .channels = {
Dan O'Donovan 27:567abf893938 75 [ADI_SENSE_1000_CHANNEL_ID_CJC_0] = {
Dan O'Donovan 27:567abf893938 76 .enableChannel = false,
Dan O'Donovan 27:567abf893938 77 },
Dan O'Donovan 27:567abf893938 78 [ADI_SENSE_1000_CHANNEL_ID_CJC_1] = {
Dan O'Donovan 27:567abf893938 79 .enableChannel = false,
Dan O'Donovan 27:567abf893938 80 },
Dan O'Donovan 27:567abf893938 81 [ADI_SENSE_1000_CHANNEL_ID_SENSOR_0] = {
Dan O'Donovan 27:567abf893938 82 .enableChannel = false,
Dan O'Donovan 27:567abf893938 83 },
Dan O'Donovan 27:567abf893938 84 [ADI_SENSE_1000_CHANNEL_ID_SENSOR_1] = {
Dan O'Donovan 27:567abf893938 85 .enableChannel = false,
Dan O'Donovan 27:567abf893938 86 },
Dan O'Donovan 27:567abf893938 87 [ADI_SENSE_1000_CHANNEL_ID_SENSOR_2] = {
Dan O'Donovan 27:567abf893938 88 .enableChannel = false,
Dan O'Donovan 27:567abf893938 89 },
Dan O'Donovan 27:567abf893938 90 [ADI_SENSE_1000_CHANNEL_ID_SENSOR_3] = {
Dan O'Donovan 27:567abf893938 91 .enableChannel = false,
Dan O'Donovan 27:567abf893938 92 },
Dan O'Donovan 27:567abf893938 93 [ADI_SENSE_1000_CHANNEL_ID_VOLTAGE_0] = {
Dan O'Donovan 27:567abf893938 94 .enableChannel = false,
Dan O'Donovan 27:567abf893938 95 },
Dan O'Donovan 27:567abf893938 96 [ADI_SENSE_1000_CHANNEL_ID_CURRENT_0] = {
Dan O'Donovan 27:567abf893938 97 .enableChannel = false,
Dan O'Donovan 27:567abf893938 98 },
Dan O'Donovan 27:567abf893938 99 [ADI_SENSE_1000_CHANNEL_ID_I2C_0] = {
Dan O'Donovan 27:567abf893938 100 .enableChannel = false,
Dan O'Donovan 27:567abf893938 101 },
Dan O'Donovan 27:567abf893938 102 [ADI_SENSE_1000_CHANNEL_ID_I2C_1] = {
Dan O'Donovan 27:567abf893938 103 .enableChannel = false,
Dan O'Donovan 27:567abf893938 104 },
Dan O'Donovan 27:567abf893938 105 [ADI_SENSE_1000_CHANNEL_ID_SPI_0] = {
Dan O'Donovan 27:567abf893938 106 /* Accelerometer X-Axis (and common settings for physical channel) */
Dan O'Donovan 27:567abf893938 107 .enableChannel = true,
Dan O'Donovan 27:567abf893938 108 .disablePublishing = false,
Dan O'Donovan 27:567abf893938 109 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
Dan O'Donovan 27:567abf893938 110 .measurementsPerCycle = 10,
Dan O'Donovan 27:567abf893938 111 .extraSettlingTime = 1000,
Dan O'Donovan 27:567abf893938 112 .spiChannelConfig = {
Dan O'Donovan 27:567abf893938 113 .sensor = ADI_SENSE_1000_SPI_SENSOR_ACCELEROMETER_ADI_ADXL355,
Dan O'Donovan 27:567abf893938 114 .configurationCommand = {
Dan O'Donovan 27:567abf893938 115 .command = { 0x58, 0x83 }, /* +/-8G range */
Dan O'Donovan 27:567abf893938 116 .commandLength = 2,
Dan O'Donovan 27:567abf893938 117 },
Dan O'Donovan 27:567abf893938 118 },
Dan O'Donovan 27:567abf893938 119 },
Dan O'Donovan 27:567abf893938 120 [ADI_SENSE_1000_CHANNEL_ID_SPI_1] = {
Dan O'Donovan 27:567abf893938 121 /* Accelerometer Y-Axis (virtual channel) */
Dan O'Donovan 27:567abf893938 122 .enableChannel = true,
Dan O'Donovan 27:567abf893938 123 },
Dan O'Donovan 27:567abf893938 124 [ADI_SENSE_1000_CHANNEL_ID_SPI_2] = {
Dan O'Donovan 27:567abf893938 125 /* Accelerometer Z-Axis (virtual channel) */
Dan O'Donovan 27:567abf893938 126 .enableChannel = true,
Dan O'Donovan 27:567abf893938 127 },
Dan O'Donovan 27:567abf893938 128 },
Dan O'Donovan 27:567abf893938 129 },
Dan O'Donovan 27:567abf893938 130 };