AdiSense1000_V21 MBED API

Fork of AdiSense1000 by PoC_Team

Committer:
danodonovan
Date:
Mon Mar 26 14:50:05 2018 +0000
Revision:
26:12d0204be712
Child:
27:567abf893938
Adding files missed in previous commit for v1.0.2

Who changed what in which revision?

UserRevisionLine numberNew contents of line
danodonovan 26:12d0204be712 1 /*!
danodonovan 26:12d0204be712 2 ******************************************************************************
danodonovan 26:12d0204be712 3 * @file: adi_sense_api.h
danodonovan 26:12d0204be712 4 * @brief: ADSNS1000 Host Library Application Programming Interface (API)
danodonovan 26:12d0204be712 5 *-----------------------------------------------------------------------------
danodonovan 26:12d0204be712 6 */
danodonovan 26:12d0204be712 7
danodonovan 26:12d0204be712 8 /*
danodonovan 26:12d0204be712 9 Copyright 2017 (c) Analog Devices, Inc.
danodonovan 26:12d0204be712 10
danodonovan 26:12d0204be712 11 All rights reserved.
danodonovan 26:12d0204be712 12
danodonovan 26:12d0204be712 13 Redistribution and use in source and binary forms, with or without
danodonovan 26:12d0204be712 14 modification, are permitted provided that the following conditions are met:
danodonovan 26:12d0204be712 15 - Redistributions of source code must retain the above copyright
danodonovan 26:12d0204be712 16 notice, this list of conditions and the following disclaimer.
danodonovan 26:12d0204be712 17 - Redistributions in binary form must reproduce the above copyright
danodonovan 26:12d0204be712 18 notice, this list of conditions and the following disclaimer in
danodonovan 26:12d0204be712 19 the documentation and/or other materials provided with the
danodonovan 26:12d0204be712 20 distribution.
danodonovan 26:12d0204be712 21 - Neither the name of Analog Devices, Inc. nor the names of its
danodonovan 26:12d0204be712 22 contributors may be used to endorse or promote products derived
danodonovan 26:12d0204be712 23 from this software without specific prior written permission.
danodonovan 26:12d0204be712 24 - The use of this software may or may not infringe the patent rights
danodonovan 26:12d0204be712 25 of one or more patent holders. This license does not release you
danodonovan 26:12d0204be712 26 from the requirement that you obtain separate licenses from these
danodonovan 26:12d0204be712 27 patent holders to use this software.
danodonovan 26:12d0204be712 28 - Use of the software either in source or binary form, must be run
danodonovan 26:12d0204be712 29 on or directly connected to an Analog Devices Inc. component.
danodonovan 26:12d0204be712 30
danodonovan 26:12d0204be712 31 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
danodonovan 26:12d0204be712 32 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
danodonovan 26:12d0204be712 33 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
danodonovan 26:12d0204be712 34 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
danodonovan 26:12d0204be712 35 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
danodonovan 26:12d0204be712 36 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
danodonovan 26:12d0204be712 37 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
danodonovan 26:12d0204be712 38 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
danodonovan 26:12d0204be712 39 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
danodonovan 26:12d0204be712 40 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
danodonovan 26:12d0204be712 41 */
danodonovan 26:12d0204be712 42
danodonovan 26:12d0204be712 43 #ifndef __ADI_SENSE_1000_API_H__
danodonovan 26:12d0204be712 44 #define __ADI_SENSE_1000_API_H__
danodonovan 26:12d0204be712 45
danodonovan 26:12d0204be712 46 #include "inc/adi_sense_types.h"
danodonovan 26:12d0204be712 47 #include "inc/adi_sense_config_types.h"
danodonovan 26:12d0204be712 48 #include "inc/adi_sense_platform.h"
danodonovan 26:12d0204be712 49 #include "adi_sense_1000_config.h"
danodonovan 26:12d0204be712 50 #include "adi_sense_1000_lut_data.h"
danodonovan 26:12d0204be712 51
danodonovan 26:12d0204be712 52 /*! @ingroup ADISENSE_Api */
danodonovan 26:12d0204be712 53
danodonovan 26:12d0204be712 54 /*! @defgroup ADSNS1000_Api ADSNS1000 Host Library API
danodonovan 26:12d0204be712 55 * ADSNS1000 device-specific API function prototypes.
danodonovan 26:12d0204be712 56 * These are supplementary to the common ADISENSE Host Library API.
danodonovan 26:12d0204be712 57 * @{
danodonovan 26:12d0204be712 58 */
danodonovan 26:12d0204be712 59
danodonovan 26:12d0204be712 60 #ifdef __cplusplus
danodonovan 26:12d0204be712 61 extern "C" {
danodonovan 26:12d0204be712 62 #endif
danodonovan 26:12d0204be712 63
danodonovan 26:12d0204be712 64 /*!
danodonovan 26:12d0204be712 65 * @brief Read one or more device registers at the specified register address.
danodonovan 26:12d0204be712 66 *
danodonovan 26:12d0204be712 67 * @param[in] hDevice ADISENSE device context handle
danodonovan 26:12d0204be712 68 * @param[in] nAddress Register map address to read from
danodonovan 26:12d0204be712 69 * @param[out] pData Pointer to return the register map data
danodonovan 26:12d0204be712 70 * @param[in] nLength Number of bytes of data to read from the register map
danodonovan 26:12d0204be712 71 *
danodonovan 26:12d0204be712 72 * @return Status
danodonovan 26:12d0204be712 73 * - #ADI_SENSE_SUCCESS Call completed successfully.
danodonovan 26:12d0204be712 74 *
danodonovan 26:12d0204be712 75 * @details Provides direct byte-level read access to the device register map.
danodonovan 26:12d0204be712 76 * The size and format of the register(s) must be known.
danodonovan 26:12d0204be712 77 *
danodonovan 26:12d0204be712 78 * @note Reads from special "keyhole" or "FIFO" registers will be handled
danodonovan 26:12d0204be712 79 * according to documentation for those registers.
danodonovan 26:12d0204be712 80 */
danodonovan 26:12d0204be712 81 ADI_SENSE_RESULT adi_sense_1000_ReadRegister(
danodonovan 26:12d0204be712 82 ADI_SENSE_DEVICE_HANDLE const hDevice,
danodonovan 26:12d0204be712 83 uint16_t const nAddress,
danodonovan 26:12d0204be712 84 void * const pData,
danodonovan 26:12d0204be712 85 unsigned const nLength);
danodonovan 26:12d0204be712 86
danodonovan 26:12d0204be712 87 /*!
danodonovan 26:12d0204be712 88 * @brief Write one or more device registers at the specified register address.
danodonovan 26:12d0204be712 89 *
danodonovan 26:12d0204be712 90 * @param[in] hDevice ADISENSE device context handle
danodonovan 26:12d0204be712 91 * @param[in] nAddress Register map address to read from
danodonovan 26:12d0204be712 92 * @param[out] pData Pointer to return the register map data
danodonovan 26:12d0204be712 93 * @param[in] nLength Number of bytes of data to read from the register map
danodonovan 26:12d0204be712 94 *
danodonovan 26:12d0204be712 95 * @return Status
danodonovan 26:12d0204be712 96 * - #ADI_SENSE_SUCCESS Call completed successfully.
danodonovan 26:12d0204be712 97 *
danodonovan 26:12d0204be712 98 * @details Provides direct byte-level write access to the device register map.
danodonovan 26:12d0204be712 99 * The size and format of the register(s) must be known.
danodonovan 26:12d0204be712 100 *
danodonovan 26:12d0204be712 101 * @note Writes to read-only registers will be ignored by the device.
danodonovan 26:12d0204be712 102 * @note Writes to special "keyhole" registers will be handled according to
danodonovan 26:12d0204be712 103 * documentation for those registers.
danodonovan 26:12d0204be712 104 */
danodonovan 26:12d0204be712 105 ADI_SENSE_RESULT adi_sense_1000_WriteRegister(
danodonovan 26:12d0204be712 106 ADI_SENSE_DEVICE_HANDLE const hDevice,
danodonovan 26:12d0204be712 107 uint16_t const nAddress,
danodonovan 26:12d0204be712 108 void * const pData,
danodonovan 26:12d0204be712 109 unsigned const nLength);
danodonovan 26:12d0204be712 110
danodonovan 26:12d0204be712 111 /*!
danodonovan 26:12d0204be712 112 * @brief Update power configuration settings on the device.
danodonovan 26:12d0204be712 113 *
danodonovan 26:12d0204be712 114 * @param[in] hDevice ADISENSE device context handle
danodonovan 26:12d0204be712 115 * @param[in] pPowerConfig Power configuration details
danodonovan 26:12d0204be712 116 *
danodonovan 26:12d0204be712 117 * @return Status
danodonovan 26:12d0204be712 118 * - #ADI_SENSE_SUCCESS Call completed successfully.
danodonovan 26:12d0204be712 119 *
danodonovan 26:12d0204be712 120 * @details Translates configuration details provided into device-specific
danodonovan 26:12d0204be712 121 * register settings and updates device configuration registers.
danodonovan 26:12d0204be712 122 *
danodonovan 26:12d0204be712 123 * @note Settings are not applied until adi_sense_ApplyConfigUpdates() is called
danodonovan 26:12d0204be712 124 */
danodonovan 26:12d0204be712 125 ADI_SENSE_RESULT adi_sense_1000_SetPowerConfig(
danodonovan 26:12d0204be712 126 ADI_SENSE_DEVICE_HANDLE hDevice,
danodonovan 26:12d0204be712 127 ADI_SENSE_1000_POWER_CONFIG *pPowerConfig);
danodonovan 26:12d0204be712 128
danodonovan 26:12d0204be712 129 /*!
danodonovan 26:12d0204be712 130 * @brief Update measurement configuration settings on the device.
danodonovan 26:12d0204be712 131 *
danodonovan 26:12d0204be712 132 * @param[in] hDevice ADISENSE device context handle
danodonovan 26:12d0204be712 133 * @param[in] pMeasurementConfig Measurement configuration details
danodonovan 26:12d0204be712 134 *
danodonovan 26:12d0204be712 135 * @return Status
danodonovan 26:12d0204be712 136 * - #ADI_SENSE_SUCCESS Call completed successfully.
danodonovan 26:12d0204be712 137 *
danodonovan 26:12d0204be712 138 * @details Translates configuration details provided into device-specific
danodonovan 26:12d0204be712 139 * register settings and updates device configuration registers.
danodonovan 26:12d0204be712 140 *
danodonovan 26:12d0204be712 141 * @note Settings are not applied until adi_sense_ApplyConfigUpdates() is called
danodonovan 26:12d0204be712 142 */
danodonovan 26:12d0204be712 143 ADI_SENSE_RESULT adi_sense_1000_SetMeasurementConfig(
danodonovan 26:12d0204be712 144 ADI_SENSE_DEVICE_HANDLE hDevice,
danodonovan 26:12d0204be712 145 ADI_SENSE_1000_MEASUREMENT_CONFIG *pMeasurementConfig);
danodonovan 26:12d0204be712 146
danodonovan 26:12d0204be712 147 /*!
danodonovan 26:12d0204be712 148 * @brief Update diagnostics configuration settings on the device.
danodonovan 26:12d0204be712 149 *
danodonovan 26:12d0204be712 150 * @param[in] hDevice ADISENSE device context handle
danodonovan 26:12d0204be712 151 * @param[in] pDiagnosticsConfig Diagnostics configuration details
danodonovan 26:12d0204be712 152 *
danodonovan 26:12d0204be712 153 * @return Status
danodonovan 26:12d0204be712 154 * - #ADI_SENSE_SUCCESS Call completed successfully.
danodonovan 26:12d0204be712 155 *
danodonovan 26:12d0204be712 156 * @details Translates configuration details provided into device-specific
danodonovan 26:12d0204be712 157 * register settings and updates device configuration registers.
danodonovan 26:12d0204be712 158 *
danodonovan 26:12d0204be712 159 * @note Settings are not applied until adi_sense_ApplyConfigUpdates() is called
danodonovan 26:12d0204be712 160 */
danodonovan 26:12d0204be712 161 ADI_SENSE_RESULT adi_sense_1000_SetDiagnosticsConfig(
danodonovan 26:12d0204be712 162 ADI_SENSE_DEVICE_HANDLE hDevice,
danodonovan 26:12d0204be712 163 ADI_SENSE_1000_DIAGNOSTICS_CONFIG *pDiagnosticsConfig);
danodonovan 26:12d0204be712 164
danodonovan 26:12d0204be712 165 /*!
danodonovan 26:12d0204be712 166 * @brief Update channel configuration settings for a specific channel.
danodonovan 26:12d0204be712 167 *
danodonovan 26:12d0204be712 168 * @param[in] hDevice ADISENSE device context handle
danodonovan 26:12d0204be712 169 * @param[in] eChannelId Selects the channel to be updated
danodonovan 26:12d0204be712 170 * @param[in] pChannelConfig Channel configuration details
danodonovan 26:12d0204be712 171 *
danodonovan 26:12d0204be712 172 * @return Status
danodonovan 26:12d0204be712 173 * - #ADI_SENSE_SUCCESS Call completed successfully.
danodonovan 26:12d0204be712 174 *
danodonovan 26:12d0204be712 175 * @details Translates configuration details provided into device-specific
danodonovan 26:12d0204be712 176 * register settings and updates device configuration registers.
danodonovan 26:12d0204be712 177 * Allows individual channel configuration details to be dynamically
danodonovan 26:12d0204be712 178 * adjusted without rewriting the full device configuration.
danodonovan 26:12d0204be712 179 *
danodonovan 26:12d0204be712 180 * @note Settings are not applied until adi_sense_ApplyConfigUpdates() is called
danodonovan 26:12d0204be712 181 */
danodonovan 26:12d0204be712 182 ADI_SENSE_RESULT adi_sense_1000_SetChannelConfig(
danodonovan 26:12d0204be712 183 ADI_SENSE_DEVICE_HANDLE hDevice,
danodonovan 26:12d0204be712 184 ADI_SENSE_1000_CHANNEL_ID eChannelId,
danodonovan 26:12d0204be712 185 ADI_SENSE_1000_CHANNEL_CONFIG *pChannelConfig);
danodonovan 26:12d0204be712 186
danodonovan 26:12d0204be712 187 /*!
danodonovan 26:12d0204be712 188 * @brief Update number of measurements-per-cycle for a specific channel.
danodonovan 26:12d0204be712 189 *
danodonovan 26:12d0204be712 190 * @param[in] hDevice ADISENSE device context handle
danodonovan 26:12d0204be712 191 * @param[in] eChannelId Selects the channel to be updated
danodonovan 26:12d0204be712 192 * @param[in] nMeasurementsPerCycle Specifies the number of measurements to be
danodonovan 26:12d0204be712 193 * obtained from this channel in each
danodonovan 26:12d0204be712 194 * measurement cycle. Set as 0 to disable the
danodonovan 26:12d0204be712 195 * channel (omit from measurement cycle).
danodonovan 26:12d0204be712 196 *
danodonovan 26:12d0204be712 197 * @return Status
danodonovan 26:12d0204be712 198 * - #ADI_SENSE_SUCCESS Call completed successfully.
danodonovan 26:12d0204be712 199 *
danodonovan 26:12d0204be712 200 * @details Translates configuration details provided into device-specific
danodonovan 26:12d0204be712 201 * register settings and updates device configuration registers.
danodonovan 26:12d0204be712 202 * Allows individual channels to be dynamically enabled/disabled, and
danodonovan 26:12d0204be712 203 * measurements-per-cycle to be adjusted.
danodonovan 26:12d0204be712 204 *
danodonovan 26:12d0204be712 205 * @note Settings are not applied until adi_sense_ApplyConfigUpdates() is called
danodonovan 26:12d0204be712 206 */
danodonovan 26:12d0204be712 207 ADI_SENSE_RESULT adi_sense_1000_SetChannelCount(
danodonovan 26:12d0204be712 208 ADI_SENSE_DEVICE_HANDLE hDevice,
danodonovan 26:12d0204be712 209 ADI_SENSE_1000_CHANNEL_ID eChannelId,
danodonovan 26:12d0204be712 210 uint32_t nMeasurementsPerCycle);
danodonovan 26:12d0204be712 211
danodonovan 26:12d0204be712 212 /*!
danodonovan 26:12d0204be712 213 * @brief Update the measurement threshold limits for a specified channel.
danodonovan 26:12d0204be712 214 *
danodonovan 26:12d0204be712 215 * @param[in] hDevice ADISENSE device context handle
danodonovan 26:12d0204be712 216 * @param[in] eChannelId Selects the channel to be updated
danodonovan 26:12d0204be712 217 * @param[in] fHighThresholdLimit Optional maximum threshold value for each
danodonovan 26:12d0204be712 218 * processed sample, to be checked prior to
danodonovan 26:12d0204be712 219 * publishing. A channel ALERT condition is
danodonovan 26:12d0204be712 220 * raised if the processed value is higher than
danodonovan 26:12d0204be712 221 * this threshold. Set to NaN if not required.
danodonovan 26:12d0204be712 222 * @param[in] fLowThresholdLimit Optional minimum threshold value for each
danodonovan 26:12d0204be712 223 * processed sample, to be checked prior to
danodonovan 26:12d0204be712 224 * publishing. A channel ALERT condition is
danodonovan 26:12d0204be712 225 * raised if the processed value is lower than
danodonovan 26:12d0204be712 226 * this threshold. Set to NaN if not required.
danodonovan 26:12d0204be712 227 *
danodonovan 26:12d0204be712 228 * @return Status
danodonovan 26:12d0204be712 229 * - #ADI_SENSE_SUCCESS Call completed successfully.
danodonovan 26:12d0204be712 230 *
danodonovan 26:12d0204be712 231 * @details Translates configuration details provided into device-specific
danodonovan 26:12d0204be712 232 * register settings and updates device configuration registers.
danodonovan 26:12d0204be712 233 * Allows individual channel thresholds to be dynamically adjusted.
danodonovan 26:12d0204be712 234 *
danodonovan 26:12d0204be712 235 * @note Settings are not applied until adi_sense_ApplyConfigUpdates() is called
danodonovan 26:12d0204be712 236 */
danodonovan 26:12d0204be712 237 ADI_SENSE_RESULT adi_sense_1000_SetChannelThresholdLimits(
danodonovan 26:12d0204be712 238 ADI_SENSE_DEVICE_HANDLE hDevice,
danodonovan 26:12d0204be712 239 ADI_SENSE_1000_CHANNEL_ID eChannelId,
danodonovan 26:12d0204be712 240 float32_t fHighThresholdLimit,
danodonovan 26:12d0204be712 241 float32_t fLowThresholdLimit);
danodonovan 26:12d0204be712 242
danodonovan 26:12d0204be712 243 /*!
danodonovan 26:12d0204be712 244 * @brief Update the extra settling time for a specified channel.
danodonovan 26:12d0204be712 245 *
danodonovan 26:12d0204be712 246 * @param[in] hDevice ADISENSE device context handle
danodonovan 26:12d0204be712 247 * @param[in] eChannelId Selects the channel to be updated
danodonovan 26:12d0204be712 248 * @param[in] nSettlingTime A minimum settling time is applied internally for
danodonovan 26:12d0204be712 249 * each channel, based on the sensor type. However,
danodonovan 26:12d0204be712 250 * additional settling time (microseconds) can
danodonovan 26:12d0204be712 251 * optionally be specified here. Set to 0 if not
danodonovan 26:12d0204be712 252 * required.
danodonovan 26:12d0204be712 253 *
danodonovan 26:12d0204be712 254 * @return Status
danodonovan 26:12d0204be712 255 * - #ADI_SENSE_SUCCESS Call completed successfully.
danodonovan 26:12d0204be712 256 *
danodonovan 26:12d0204be712 257 * @details Translates configuration details provided into device-specific
danodonovan 26:12d0204be712 258 * register settings and updates device configuration registers.
danodonovan 26:12d0204be712 259 * Allows individual channel settling times to be dynamically adjusted.
danodonovan 26:12d0204be712 260 *
danodonovan 26:12d0204be712 261 * @note Settings are not applied until adi_sense_ApplyConfigUpdates() is called
danodonovan 26:12d0204be712 262 */
danodonovan 26:12d0204be712 263 ADI_SENSE_RESULT adi_sense_1000_SetChannelSettlingTime(
danodonovan 26:12d0204be712 264 ADI_SENSE_DEVICE_HANDLE hDevice,
danodonovan 26:12d0204be712 265 ADI_SENSE_1000_CHANNEL_ID eChannelId,
danodonovan 26:12d0204be712 266 uint32_t nSettlingTime);
danodonovan 26:12d0204be712 267
danodonovan 26:12d0204be712 268 /*!
danodonovan 26:12d0204be712 269 * @brief Assemble a list of separate Look-Up Tables into a single buffer
danodonovan 26:12d0204be712 270 *
danodonovan 26:12d0204be712 271 * @param[out] pLutBuffer Pointer to the Look-Up Table data buffer where
danodonovan 26:12d0204be712 272 * the assembled Look-Up Table data will be placed
danodonovan 26:12d0204be712 273 * @param[in] nLutBufferSize Allocated size, in bytes, of the output data buffer
danodonovan 26:12d0204be712 274 * @param[in] nNumTables Number of tables to add to the Look-Up Table buffer
danodonovan 26:12d0204be712 275 * @param[in] ppDesc Array of pointers to the table descriptors to be added
danodonovan 26:12d0204be712 276 * @param[in] ppData Array of pointers to the table data to be added
danodonovan 26:12d0204be712 277 *
danodonovan 26:12d0204be712 278 * @return Status
danodonovan 26:12d0204be712 279 * - #ADI_SENSE_SUCCESS Call completed successfully.
danodonovan 26:12d0204be712 280 *
danodonovan 26:12d0204be712 281 * @details This utiliity function fills the Look-up Table header fields; then
danodonovan 26:12d0204be712 282 * walks through the array of individual table descriptor and data
danodonovan 26:12d0204be712 283 * pointers provided, appending (copying) each one to the Look-Up Table
danodonovan 26:12d0204be712 284 * data buffer. The length and crc16 fields of each table descriptor
danodonovan 26:12d0204be712 285 * will be calculated and filled by this function, but other fields in
danodonovan 26:12d0204be712 286 * the descriptor structure must be filled by the caller beforehand.
danodonovan 26:12d0204be712 287 *
danodonovan 26:12d0204be712 288 * @note The assembled LUT data buffer filled by this function can then be
danodonovan 26:12d0204be712 289 * written to the device memory using @ref adi_sense_1000_SetLutData.
danodonovan 26:12d0204be712 290 */
danodonovan 26:12d0204be712 291 ADI_SENSE_RESULT adi_sense_1000_AssembleLutData(
danodonovan 26:12d0204be712 292 ADI_SENSE_1000_LUT * pLutBuffer,
danodonovan 26:12d0204be712 293 unsigned nLutBufferSize,
danodonovan 26:12d0204be712 294 unsigned const nNumTables,
danodonovan 26:12d0204be712 295 ADI_SENSE_1000_LUT_DESCRIPTOR * const ppDesc[],
danodonovan 26:12d0204be712 296 ADI_SENSE_1000_LUT_TABLE_DATA * const ppData[]);
danodonovan 26:12d0204be712 297
danodonovan 26:12d0204be712 298 /*!
danodonovan 26:12d0204be712 299 * @brief Write Look-Up Table data to the device memory
danodonovan 26:12d0204be712 300 *
danodonovan 26:12d0204be712 301 * @param[in] hDevice ADISENSE device context handle
danodonovan 26:12d0204be712 302 * @param[out] pLutData Pointer to the Look-Up Table data structure
danodonovan 26:12d0204be712 303 *
danodonovan 26:12d0204be712 304 * @return Status
danodonovan 26:12d0204be712 305 * - #ADI_SENSE_SUCCESS Call completed successfully.
danodonovan 26:12d0204be712 306 *
danodonovan 26:12d0204be712 307 * @details Validates the Look-Up Table data format and loads it into
danodonovan 26:12d0204be712 308 * device memory via dedicated keyhole registers.
danodonovan 26:12d0204be712 309 *
danodonovan 26:12d0204be712 310 * @note Settings are not applied until adi_sense_ApplyConfigUpdates() is called
danodonovan 26:12d0204be712 311 */
danodonovan 26:12d0204be712 312 ADI_SENSE_RESULT adi_sense_1000_SetLutData(
danodonovan 26:12d0204be712 313 ADI_SENSE_DEVICE_HANDLE const hDevice,
danodonovan 26:12d0204be712 314 ADI_SENSE_1000_LUT * const pLutData);
danodonovan 26:12d0204be712 315
danodonovan 26:12d0204be712 316 /*!
danodonovan 26:12d0204be712 317 * @brief Write Look-Up Table raw data to the device memory
danodonovan 26:12d0204be712 318 *
danodonovan 26:12d0204be712 319 * @param[in] hDevice ADISENSE device context handle
danodonovan 26:12d0204be712 320 * @param[out] pLutData Pointer to the Look-Up Table raw data structure
danodonovan 26:12d0204be712 321 *
danodonovan 26:12d0204be712 322 * @return Status
danodonovan 26:12d0204be712 323 * - #ADI_SENSE_SUCCESS Call completed successfully.
danodonovan 26:12d0204be712 324 *
danodonovan 26:12d0204be712 325 * @details This can be used instead of @ref adi_sense_1000_SetLutData for
danodonovan 26:12d0204be712 326 * loading LUT data from the alternative raw data format. See
danodonovan 26:12d0204be712 327 * @ref adi_sense_1000_SetLutData for more information.
danodonovan 26:12d0204be712 328 *
danodonovan 26:12d0204be712 329 * @note Settings are not applied until adi_sense_ApplyConfigUpdates() is called
danodonovan 26:12d0204be712 330 */
danodonovan 26:12d0204be712 331 ADI_SENSE_RESULT adi_sense_1000_SetLutDataRaw(
danodonovan 26:12d0204be712 332 ADI_SENSE_DEVICE_HANDLE const hDevice,
danodonovan 26:12d0204be712 333 ADI_SENSE_1000_LUT_RAW * const pLutData);
danodonovan 26:12d0204be712 334
danodonovan 26:12d0204be712 335 /*!
danodonovan 26:12d0204be712 336 * @brief Get the number of samples available when DATAREADY status is asserted.
danodonovan 26:12d0204be712 337 *
danodonovan 26:12d0204be712 338 * @param[in] hDevice ADISENSE device context handle
danodonovan 26:12d0204be712 339 * @param[in] eMeasurementMode Must be set to the same value used for @ref
danodonovan 26:12d0204be712 340 * adi_sense_StartMeasurement().
danodonovan 26:12d0204be712 341 * @param[out] peOperatingMode Pointer to return the configured operating mode
danodonovan 26:12d0204be712 342 * @param[out] peDataReadyMode Pointer to return the configured data publishing mode
danodonovan 26:12d0204be712 343 * @param[out] pnSamplesPerDataready Pointer to return the calculated number of samples
danodonovan 26:12d0204be712 344 * available when DATAREADY is asserted
danodonovan 26:12d0204be712 345 * @param[out] pnSamplesPerCycle Pointer to return the calculated number of samples
danodonovan 26:12d0204be712 346 * produced per measurement cycle
danodonovan 26:12d0204be712 347 *
danodonovan 26:12d0204be712 348 * @return Status
danodonovan 26:12d0204be712 349 * - #ADI_SENSE_SUCCESS Call completed successfully.
danodonovan 26:12d0204be712 350 *
danodonovan 26:12d0204be712 351 * @details Examines the current configuration settings in the device registers
danodonovan 26:12d0204be712 352 * to calculate the number of samples available whenever the DATAREADY
danodonovan 26:12d0204be712 353 * signal is asserted, along with other related information. This may
danodonovan 26:12d0204be712 354 * be used to allocate buffers to store samples and to determine how
danodonovan 26:12d0204be712 355 * many samples to retrieve whenever the DATAREADY status is asserted.
danodonovan 26:12d0204be712 356 */
danodonovan 26:12d0204be712 357 ADI_SENSE_RESULT adi_sense_1000_GetDataReadyModeInfo(
danodonovan 26:12d0204be712 358 ADI_SENSE_DEVICE_HANDLE const hDevice,
danodonovan 26:12d0204be712 359 ADI_SENSE_MEASUREMENT_MODE const eMeasurementMode,
danodonovan 26:12d0204be712 360 ADI_SENSE_1000_OPERATING_MODE * const peOperatingMode,
danodonovan 26:12d0204be712 361 ADI_SENSE_1000_DATAREADY_MODE * const peDataReadyMode,
danodonovan 26:12d0204be712 362 uint32_t * const pnSamplesPerDataready,
danodonovan 26:12d0204be712 363 uint32_t * const pnSamplesPerCycle);
danodonovan 26:12d0204be712 364
danodonovan 26:12d0204be712 365 #ifdef __cplusplus
danodonovan 26:12d0204be712 366 }
danodonovan 26:12d0204be712 367 #endif
danodonovan 26:12d0204be712 368
danodonovan 26:12d0204be712 369 /*!
danodonovan 26:12d0204be712 370 * @}
danodonovan 26:12d0204be712 371 */
danodonovan 26:12d0204be712 372
danodonovan 26:12d0204be712 373 #endif /* __ADI_SENSE_1000_API_H__ */
danodonovan 26:12d0204be712 374