Vybhav Kadaba
/
EV-PRO-MW1001_Development_updateFW
Bumped Mbed FW version to 01.20.0080
inc/admw_api.h@6:9d393a9677f4, 2019-06-15 (annotated)
- Committer:
- Vkadaba
- Date:
- Sat Jun 15 14:30:49 2019 +0000
- Revision:
- 6:9d393a9677f4
- Parent:
- 5:0728bde67bdb
- Child:
- 13:97cb32670539
Register map is updated and sensor config files are modified
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ADIJake | 0:85855ecd3257 | 1 | /* |
Vkadaba | 6:9d393a9677f4 | 2 | Copyright 2019 (c) Analog Devices, Inc. |
ADIJake | 0:85855ecd3257 | 3 | |
ADIJake | 0:85855ecd3257 | 4 | All rights reserved. |
ADIJake | 0:85855ecd3257 | 5 | |
ADIJake | 0:85855ecd3257 | 6 | Redistribution and use in source and binary forms, with or without |
ADIJake | 0:85855ecd3257 | 7 | modification, are permitted provided that the following conditions are met: |
ADIJake | 0:85855ecd3257 | 8 | - Redistributions of source code must retain the above copyright |
ADIJake | 0:85855ecd3257 | 9 | notice, this list of conditions and the following disclaimer. |
ADIJake | 0:85855ecd3257 | 10 | - Redistributions in binary form must reproduce the above copyright |
ADIJake | 0:85855ecd3257 | 11 | notice, this list of conditions and the following disclaimer in |
ADIJake | 0:85855ecd3257 | 12 | the documentation and/or other materials provided with the |
ADIJake | 0:85855ecd3257 | 13 | distribution. |
ADIJake | 0:85855ecd3257 | 14 | - Neither the name of Analog Devices, Inc. nor the names of its |
ADIJake | 0:85855ecd3257 | 15 | contributors may be used to endorse or promote products derived |
ADIJake | 0:85855ecd3257 | 16 | from this software without specific prior written permission. |
ADIJake | 0:85855ecd3257 | 17 | - The use of this software may or may not infringe the patent rights |
ADIJake | 0:85855ecd3257 | 18 | of one or more patent holders. This license does not release you |
ADIJake | 0:85855ecd3257 | 19 | from the requirement that you obtain separate licenses from these |
ADIJake | 0:85855ecd3257 | 20 | patent holders to use this software. |
ADIJake | 0:85855ecd3257 | 21 | - Use of the software either in source or binary form, must be run |
ADIJake | 0:85855ecd3257 | 22 | on or directly connected to an Analog Devices Inc. component. |
ADIJake | 0:85855ecd3257 | 23 | |
ADIJake | 0:85855ecd3257 | 24 | THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR |
ADIJake | 0:85855ecd3257 | 25 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, |
ADIJake | 0:85855ecd3257 | 26 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
ADIJake | 0:85855ecd3257 | 27 | IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, |
ADIJake | 0:85855ecd3257 | 28 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
ADIJake | 0:85855ecd3257 | 29 | LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR |
ADIJake | 0:85855ecd3257 | 30 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
ADIJake | 0:85855ecd3257 | 31 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
ADIJake | 0:85855ecd3257 | 32 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
ADIJake | 0:85855ecd3257 | 33 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
ADIJake | 0:85855ecd3257 | 34 | */ |
ADIJake | 0:85855ecd3257 | 35 | |
Vkadaba | 6:9d393a9677f4 | 36 | /*! |
ADIJake | 0:85855ecd3257 | 37 | ****************************************************************************** |
Vkadaba | 5:0728bde67bdb | 38 | * @file: admw_api.h |
Vkadaba | 5:0728bde67bdb | 39 | * @brief: ADMW Host Library Application Programming Interface (API) |
ADIJake | 0:85855ecd3257 | 40 | *----------------------------------------------------------------------------- |
ADIJake | 0:85855ecd3257 | 41 | */ |
ADIJake | 0:85855ecd3257 | 42 | |
Vkadaba | 6:9d393a9677f4 | 43 | #ifndef _ADMW_API_H__ |
Vkadaba | 6:9d393a9677f4 | 44 | #define _ADMW_API_H__ |
ADIJake | 0:85855ecd3257 | 45 | |
Vkadaba | 5:0728bde67bdb | 46 | #include "inc/admw_types.h" |
Vkadaba | 5:0728bde67bdb | 47 | #include "inc/admw_config_types.h" |
Vkadaba | 5:0728bde67bdb | 48 | #include "inc/admw_platform.h" |
Vkadaba | 5:0728bde67bdb | 49 | #include "inc/admw_gpio.h" |
Vkadaba | 5:0728bde67bdb | 50 | #include "inc/admw_spi.h" |
Vkadaba | 5:0728bde67bdb | 51 | #include "inc/admw_log.h" |
Vkadaba | 5:0728bde67bdb | 52 | #include "inc/admw_time.h" |
ADIJake | 0:85855ecd3257 | 53 | |
Vkadaba | 5:0728bde67bdb | 54 | /*! @defgroup ADMW_Api ADMW Host Library API |
Vkadaba | 5:0728bde67bdb | 55 | * Host library API common to the ADMW product family. |
ADIJake | 0:85855ecd3257 | 56 | * @{ |
ADIJake | 0:85855ecd3257 | 57 | */ |
ADIJake | 0:85855ecd3257 | 58 | |
ADIJake | 0:85855ecd3257 | 59 | #ifdef __cplusplus |
ADIJake | 0:85855ecd3257 | 60 | extern "C" { |
ADIJake | 0:85855ecd3257 | 61 | #endif |
ADIJake | 0:85855ecd3257 | 62 | |
ADIJake | 0:85855ecd3257 | 63 | /*! The maximum number of channels supported by this API |
Vkadaba | 5:0728bde67bdb | 64 | * @note Specific ADMW products may implement a lower number of channels */ |
Vkadaba | 5:0728bde67bdb | 65 | #define ADMW_MAX_CHANNELS 16 |
ADIJake | 0:85855ecd3257 | 66 | |
Vkadaba | 5:0728bde67bdb | 67 | /*! A handle used in all API functions to identify the ADMW device. */ |
Vkadaba | 5:0728bde67bdb | 68 | typedef void* ADMW_DEVICE_HANDLE; |
ADIJake | 0:85855ecd3257 | 69 | |
Vkadaba | 5:0728bde67bdb | 70 | /*! Supported connection types for communication with the ADMW device. */ |
ADIJake | 0:85855ecd3257 | 71 | typedef enum { |
Vkadaba | 5:0728bde67bdb | 72 | ADMW_CONNECTION_TYPE_SPI = 1, |
ADIJake | 0:85855ecd3257 | 73 | /*!< Serial Peripheral Interface (SPI) connection type */ |
Vkadaba | 5:0728bde67bdb | 74 | } ADMW_CONNECTION_TYPE; |
ADIJake | 0:85855ecd3257 | 75 | |
Vkadaba | 5:0728bde67bdb | 76 | /*! Connection details for communication with a ADMW device instance. */ |
ADIJake | 0:85855ecd3257 | 77 | typedef struct { |
Vkadaba | 5:0728bde67bdb | 78 | ADMW_CONNECTION_TYPE type; |
ADIJake | 0:85855ecd3257 | 79 | /*!< Connection type selection */ |
Vkadaba | 5:0728bde67bdb | 80 | ADMW_PLATFORM_SPI_CONFIG spi; |
ADIJake | 0:85855ecd3257 | 81 | /*!< SPI connection parameters, required if SPI connection type is used */ |
Vkadaba | 5:0728bde67bdb | 82 | ADMW_PLATFORM_GPIO_CONFIG gpio; |
ADIJake | 0:85855ecd3257 | 83 | /*!< GPIO connection parameters, for device reset and status I/O signals */ |
Vkadaba | 5:0728bde67bdb | 84 | ADMW_PLATFORM_LOG_CONFIG log; |
ADIJake | 0:85855ecd3257 | 85 | /*!< Log interface connection parameters, for display/routing of log messages */ |
Vkadaba | 5:0728bde67bdb | 86 | } ADMW_CONNECTION; |
ADIJake | 0:85855ecd3257 | 87 | |
ADIJake | 0:85855ecd3257 | 88 | /*! Bit masks (flags) for the different device status indicators. */ |
ADIJake | 0:85855ecd3257 | 89 | typedef enum { |
Vkadaba | 5:0728bde67bdb | 90 | ADMW_DEVICE_STATUS_BUSY = (1 << 0), |
ADIJake | 0:85855ecd3257 | 91 | /*!< Indicates that a command is currently running on the device */ |
Vkadaba | 5:0728bde67bdb | 92 | ADMW_DEVICE_STATUS_DATAREADY = (1 << 1), |
ADIJake | 0:85855ecd3257 | 93 | /*!< Indicates the availability of measurement data for retrieval */ |
Vkadaba | 5:0728bde67bdb | 94 | ADMW_DEVICE_STATUS_ERROR = (1 << 2), |
ADIJake | 0:85855ecd3257 | 95 | /*!< Indicates that an error condition has been detected by the device */ |
Vkadaba | 5:0728bde67bdb | 96 | ADMW_DEVICE_STATUS_ALERT = (1 << 3), |
ADIJake | 0:85855ecd3257 | 97 | /*!< Indicates that an alert condition has been detected by the device */ |
Vkadaba | 5:0728bde67bdb | 98 | ADMW_DEVICE_STATUS_FIFO_ERROR = (1 << 4), |
ADIJake | 0:85855ecd3257 | 99 | /*!< Indicates that a FIFO error condition has been detected by the device */ |
Vkadaba | 5:0728bde67bdb | 100 | ADMW_DEVICE_STATUS_CONFIG_ERROR = (1 << 5), |
ADIJake | 0:85855ecd3257 | 101 | /*!< Indicates that a configuration error condition has been detected by the device */ |
Vkadaba | 5:0728bde67bdb | 102 | ADMW_DEVICE_STATUS_LUT_ERROR = (1 << 6), |
ADIJake | 0:85855ecd3257 | 103 | /*!< Indicates that a look-up table error condition has been detected by the device */ |
Vkadaba | 5:0728bde67bdb | 104 | } ADMW_DEVICE_STATUS_FLAGS; |
ADIJake | 0:85855ecd3257 | 105 | |
ADIJake | 0:85855ecd3257 | 106 | /*! Bit masks (flags) for the different diagnostics status indicators. */ |
ADIJake | 0:85855ecd3257 | 107 | typedef enum { |
Vkadaba | 5:0728bde67bdb | 108 | ADMW_DIAGNOSTICS_STATUS_CHECKSUM_ERROR = (1 << 0), |
ADIJake | 0:85855ecd3257 | 109 | /*!< Indicates Error on Internal Checksum Calculations */ |
Vkadaba | 5:0728bde67bdb | 110 | ADMW_DIAGNOSTICS_STATUS_CONVERSION_ERROR = (1 << 8), |
ADIJake | 0:85855ecd3257 | 111 | /*!< Indicates Error During Internal ADC Conversions */ |
Vkadaba | 5:0728bde67bdb | 112 | ADMW_DIAGNOSTICS_STATUS_CALIBRATION_ERROR = (1 << 9), |
ADIJake | 0:85855ecd3257 | 113 | /*!< Indicates Error During Internal Device Calibrations */ |
Vkadaba | 5:0728bde67bdb | 114 | } ADMW_DIAGNOSTICS_STATUS_FLAGS; |
ADIJake | 0:85855ecd3257 | 115 | |
ADIJake | 0:85855ecd3257 | 116 | /*! Bit masks (flags) for the different channel alert indicators. */ |
ADIJake | 0:85855ecd3257 | 117 | typedef enum { |
Vkadaba | 5:0728bde67bdb | 118 | ADMW_CHANNEL_ALERT_TIMEOUT = (1 << 0), |
ADIJake | 0:85855ecd3257 | 119 | /*!< Indicates timeout condition detected on the channel */ |
Vkadaba | 5:0728bde67bdb | 120 | ADMW_CHANNEL_ALERT_UNDER_RANGE = (1 << 1), |
ADIJake | 0:85855ecd3257 | 121 | /*!< Indicates raw sample under valid input range, possibly clamped */ |
Vkadaba | 5:0728bde67bdb | 122 | ADMW_CHANNEL_ALERT_OVER_RANGE = (1 << 2), |
ADIJake | 0:85855ecd3257 | 123 | /*!< Indicates raw sample over valid input range, possibly clamped */ |
Vkadaba | 5:0728bde67bdb | 124 | ADMW_CHANNEL_ALERT_LOW_LIMIT = (1 << 3), |
ADIJake | 0:85855ecd3257 | 125 | /*!< Indicates measurement result was below configured minimum threshold */ |
Vkadaba | 5:0728bde67bdb | 126 | ADMW_CHANNEL_ALERT_HIGH_LIMIT = (1 << 4), |
ADIJake | 0:85855ecd3257 | 127 | /*!< Indicates measurement result was above configured maximum threshold */ |
Vkadaba | 5:0728bde67bdb | 128 | ADMW_CHANNEL_ALERT_SENSOR_OPEN = (1 << 5), |
ADIJake | 0:85855ecd3257 | 129 | /*!< Indicates open circuit or mis-wire condition detected on the channel */ |
Vkadaba | 5:0728bde67bdb | 130 | ADMW_CHANNEL_ALERT_REF_DETECT = (1 << 6), |
ADIJake | 0:85855ecd3257 | 131 | /*!< Indicates reference-detect error condition detected on the channel */ |
Vkadaba | 5:0728bde67bdb | 132 | ADMW_CHANNEL_ALERT_CONFIG_ERR = (1 << 7), |
ADIJake | 0:85855ecd3257 | 133 | /*!< Indicates configuration error condition detected on the channel */ |
Vkadaba | 5:0728bde67bdb | 134 | ADMW_CHANNEL_ALERT_LUT_ERR = (1 << 8), |
ADIJake | 0:85855ecd3257 | 135 | /*!< Indicates look-up table error condition detected on the channel */ |
Vkadaba | 5:0728bde67bdb | 136 | ADMW_CHANNEL_ALERT_SENSOR_NOT_READY = (1 << 9), |
ADIJake | 0:85855ecd3257 | 137 | /*!< Indicates digital sensor not-ready error condition detected on the channel */ |
Vkadaba | 5:0728bde67bdb | 138 | ADMW_CHANNEL_ALERT_COMP_NOT_READY = (1 << 10), |
ADIJake | 0:85855ecd3257 | 139 | /*!< Indicates compensation channel not-ready error condition detected on the channel */ |
Vkadaba | 5:0728bde67bdb | 140 | ADMW_CHANNEL_ALERT_LUT_UNDER_RANGE = (1 << 13), |
ADIJake | 0:85855ecd3257 | 141 | /*!< Indicates raw sample was under the available LUT/equation range */ |
Vkadaba | 5:0728bde67bdb | 142 | ADMW_CHANNEL_ALERT_LUT_OVER_RANGE = (1 << 14), |
ADIJake | 0:85855ecd3257 | 143 | /*!< Indicates raw sample was over the available LUT/equation range */ |
Vkadaba | 5:0728bde67bdb | 144 | } ADMW_CHANNEL_ALERT_FLAGS; |
ADIJake | 0:85855ecd3257 | 145 | |
Vkadaba | 5:0728bde67bdb | 146 | /*! Status details retreived from the ADMW device. */ |
ADIJake | 0:85855ecd3257 | 147 | typedef struct { |
Vkadaba | 5:0728bde67bdb | 148 | ADMW_DEVICE_STATUS_FLAGS deviceStatus; |
ADIJake | 0:85855ecd3257 | 149 | /*!< General summary status information from the device */ |
Vkadaba | 5:0728bde67bdb | 150 | ADMW_DIAGNOSTICS_STATUS_FLAGS diagnosticsStatus; |
ADIJake | 0:85855ecd3257 | 151 | /*!< Diagnostic error status information from the device */ |
Vkadaba | 5:0728bde67bdb | 152 | ADMW_CHANNEL_ALERT_FLAGS channelAlerts[ADMW_MAX_CHANNELS]; |
ADIJake | 0:85855ecd3257 | 153 | /*!< Per-channel alert status information from the device */ |
ADIJake | 0:85855ecd3257 | 154 | uint32_t errorCode; |
ADIJake | 0:85855ecd3257 | 155 | /*!< Code identifying the last error signalled by the device */ |
ADIJake | 0:85855ecd3257 | 156 | uint32_t alertCode; |
ADIJake | 0:85855ecd3257 | 157 | /*!< Code identifying the last alert signalled by the device */ |
ADIJake | 0:85855ecd3257 | 158 | uint32_t debugCode; |
ADIJake | 0:85855ecd3257 | 159 | /*!< Supplementary code related to the last error/alert */ |
Vkadaba | 5:0728bde67bdb | 160 | uint32_t channelAlertCodes[ADMW_MAX_CHANNELS]; |
ADIJake | 0:85855ecd3257 | 161 | /*!< Per-channel code identifying the last alert signalled for each channel */ |
Vkadaba | 5:0728bde67bdb | 162 | } ADMW_STATUS; |
ADIJake | 0:85855ecd3257 | 163 | |
Vkadaba | 5:0728bde67bdb | 164 | /*! Data sample details retreived from the ADMW device. */ |
ADIJake | 0:85855ecd3257 | 165 | typedef struct { |
Vkadaba | 5:0728bde67bdb | 166 | ADMW_DEVICE_STATUS_FLAGS status; |
ADIJake | 0:85855ecd3257 | 167 | /*!< Device summary status snapshot when the sample was recorded */ |
ADIJake | 0:85855ecd3257 | 168 | uint32_t channelId; |
ADIJake | 0:85855ecd3257 | 169 | /*!< The measurement channel from which this sample was obtained */ |
Vkadaba | 6:9d393a9677f4 | 170 | uint32_t rawValue; |
ADIJake | 0:85855ecd3257 | 171 | /*!< The raw (unprocessed) value obtained directly from the measurement |
ADIJake | 0:85855ecd3257 | 172 | * channel, if available |
ADIJake | 0:85855ecd3257 | 173 | */ |
ADIJake | 0:85855ecd3257 | 174 | float32_t processedValue; |
ADIJake | 0:85855ecd3257 | 175 | /*!< The processed value obtained from the measurement channel, as a final |
ADIJake | 0:85855ecd3257 | 176 | * measurement value, following calibration and linearisation correction, |
ADIJake | 0:85855ecd3257 | 177 | * and conversion into an appropriate unit of measurement. |
ADIJake | 0:85855ecd3257 | 178 | */ |
Vkadaba | 5:0728bde67bdb | 179 | } ADMW_DATA_SAMPLE; |
ADIJake | 0:85855ecd3257 | 180 | |
Vkadaba | 5:0728bde67bdb | 181 | /*! Measurement mode options for the ADMW device. |
Vkadaba | 5:0728bde67bdb | 182 | * @ref admw_StartMeasurement |
ADIJake | 0:85855ecd3257 | 183 | */ |
ADIJake | 0:85855ecd3257 | 184 | typedef enum { |
Vkadaba | 6:9d393a9677f4 | 185 | ADMW_MEASUREMENT_MODE_NORMAL = 0, |
ADIJake | 0:85855ecd3257 | 186 | /*!< In this mode, normal measurement cycle(s) are executed and data samples |
ADIJake | 0:85855ecd3257 | 187 | * are returned with raw measurement values included. */ |
Vkadaba | 5:0728bde67bdb | 188 | ADMW_MEASUREMENT_MODE_OMIT_RAW, |
ADIJake | 0:85855ecd3257 | 189 | /*!< In this mode, normal measurement cycle(s) are executed and data samples |
ADIJake | 0:85855ecd3257 | 190 | * are returned with raw measurement values omitted for efficiency. */ |
Vkadaba | 5:0728bde67bdb | 191 | } ADMW_MEASUREMENT_MODE; |
ADIJake | 0:85855ecd3257 | 192 | |
ADIJake | 0:85855ecd3257 | 193 | /*! Identifiers for the user configuration slots in persistent memory. */ |
ADIJake | 0:85855ecd3257 | 194 | typedef enum { |
Vkadaba | 5:0728bde67bdb | 195 | ADMW_FLASH_CONFIG_1, |
Vkadaba | 5:0728bde67bdb | 196 | } ADMW_USER_CONFIG_SLOT; |
ADIJake | 0:85855ecd3257 | 197 | |
ADIJake | 0:85855ecd3257 | 198 | |
ADIJake | 0:85855ecd3257 | 199 | /****************************************************************************** |
Vkadaba | 5:0728bde67bdb | 200 | * ADMW High-Level API function prototypes |
ADIJake | 0:85855ecd3257 | 201 | *****************************************************************************/ |
ADIJake | 0:85855ecd3257 | 202 | |
ADIJake | 0:85855ecd3257 | 203 | /*! |
Vkadaba | 5:0728bde67bdb | 204 | * @brief Open ADMW device handle and set up communication interface. |
ADIJake | 0:85855ecd3257 | 205 | * |
ADIJake | 0:85855ecd3257 | 206 | * @param[in] nDeviceIndex Zero-based index number identifying this device |
ADIJake | 0:85855ecd3257 | 207 | * instance. Note that this will be used to |
ADIJake | 0:85855ecd3257 | 208 | * retrieve a specific device configuration for |
Vkadaba | 5:0728bde67bdb | 209 | * this device (see @ref admw_SetConfig |
Vkadaba | 5:0728bde67bdb | 210 | * and @ref ADMW_CONFIG) |
ADIJake | 0:85855ecd3257 | 211 | * @param[in] pConnectionInfo Host-specific connection details (e.g. SPI, GPIO) |
Vkadaba | 5:0728bde67bdb | 212 | * @param[out] phDevice Pointer to return an ADMW device handle |
ADIJake | 0:85855ecd3257 | 213 | * |
ADIJake | 0:85855ecd3257 | 214 | * @return Status |
Vkadaba | 5:0728bde67bdb | 215 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 216 | * - #ADMW_NO_MEM Failed to allocate memory resources. |
Vkadaba | 5:0728bde67bdb | 217 | * - #ADMW_INVALID_DEVICE_NUM Invalid device index specified |
ADIJake | 0:85855ecd3257 | 218 | * |
ADIJake | 0:85855ecd3257 | 219 | * @details Configure and initialise the Log interface and the SPI/GPIO |
Vkadaba | 6:9d393a9677f4 | 220 | * communication interface to the ADISense module. |
ADIJake | 0:85855ecd3257 | 221 | */ |
Vkadaba | 5:0728bde67bdb | 222 | ADMW_RESULT admw_Open( |
ADIJake | 0:85855ecd3257 | 223 | unsigned const nDeviceIndex, |
Vkadaba | 5:0728bde67bdb | 224 | ADMW_CONNECTION * const pConnectionInfo, |
Vkadaba | 5:0728bde67bdb | 225 | ADMW_DEVICE_HANDLE * const phDevice); |
ADIJake | 0:85855ecd3257 | 226 | |
ADIJake | 0:85855ecd3257 | 227 | /*! |
Vkadaba | 5:0728bde67bdb | 228 | * @brief Close ADMW device context and free resources. |
ADIJake | 0:85855ecd3257 | 229 | * |
Vkadaba | 5:0728bde67bdb | 230 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 231 | * |
ADIJake | 0:85855ecd3257 | 232 | * @return Status |
Vkadaba | 5:0728bde67bdb | 233 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 234 | */ |
Vkadaba | 5:0728bde67bdb | 235 | ADMW_RESULT admw_Close( |
Vkadaba | 5:0728bde67bdb | 236 | ADMW_DEVICE_HANDLE const hDevice); |
ADIJake | 0:85855ecd3257 | 237 | |
ADIJake | 0:85855ecd3257 | 238 | /*! |
ADIJake | 0:85855ecd3257 | 239 | * @brief Get the current state of the specified GPIO input signal. |
ADIJake | 0:85855ecd3257 | 240 | * |
Vkadaba | 5:0728bde67bdb | 241 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 242 | * @param[in] ePinId GPIO pin to query |
ADIJake | 0:85855ecd3257 | 243 | * @param[out] pbAsserted Pointer to return the state of the status signal GPIO pin |
ADIJake | 0:85855ecd3257 | 244 | * |
ADIJake | 0:85855ecd3257 | 245 | * @return Status |
Vkadaba | 5:0728bde67bdb | 246 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 247 | * - #ADMW_INVALID_DEVICE_NUM Invalid GPIO pin specified. |
ADIJake | 0:85855ecd3257 | 248 | * |
ADIJake | 0:85855ecd3257 | 249 | * @details Sets *pbAsserted to true if the status signal is asserted, or false |
ADIJake | 0:85855ecd3257 | 250 | * otherwise. |
ADIJake | 0:85855ecd3257 | 251 | */ |
Vkadaba | 5:0728bde67bdb | 252 | ADMW_RESULT admw_GetGpioState( |
Vkadaba | 5:0728bde67bdb | 253 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 5:0728bde67bdb | 254 | ADMW_GPIO_PIN const ePinId, |
ADIJake | 0:85855ecd3257 | 255 | bool * const pbAsserted); |
ADIJake | 0:85855ecd3257 | 256 | |
ADIJake | 0:85855ecd3257 | 257 | /*! |
ADIJake | 0:85855ecd3257 | 258 | * @brief Register an application-defined callback function for GPIO interrupts |
ADIJake | 0:85855ecd3257 | 259 | * |
Vkadaba | 5:0728bde67bdb | 260 | * @param[in] hDevice ADMW context handle (@ref admw_Open) |
ADIJake | 0:85855ecd3257 | 261 | * @param[in] ePinId GPIO pin on which to enable/disable interrupts |
ADIJake | 0:85855ecd3257 | 262 | * @param[in] callbackFunction Function to be called when an interrupt occurs. |
ADIJake | 0:85855ecd3257 | 263 | * Specify NULL here to disable interrupts. |
ADIJake | 0:85855ecd3257 | 264 | * @param[in] pCallbackParam Optional opaque parameter passed to the callback |
ADIJake | 0:85855ecd3257 | 265 | * |
ADIJake | 0:85855ecd3257 | 266 | * @return Status |
Vkadaba | 5:0728bde67bdb | 267 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 268 | * - #ADMW_INVALID_DEVICE_NUM Invalid GPIO pin specified. |
ADIJake | 0:85855ecd3257 | 269 | */ |
Vkadaba | 5:0728bde67bdb | 270 | ADMW_RESULT admw_RegisterGpioCallback( |
Vkadaba | 5:0728bde67bdb | 271 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 5:0728bde67bdb | 272 | ADMW_GPIO_PIN const ePinId, |
Vkadaba | 5:0728bde67bdb | 273 | ADMW_GPIO_CALLBACK const callbackFunction, |
ADIJake | 0:85855ecd3257 | 274 | void * const pCallbackParam); |
ADIJake | 0:85855ecd3257 | 275 | |
ADIJake | 0:85855ecd3257 | 276 | /*! |
ADIJake | 0:85855ecd3257 | 277 | * @brief Trigger a shut down of the device. |
ADIJake | 0:85855ecd3257 | 278 | * |
Vkadaba | 5:0728bde67bdb | 279 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 280 | * |
ADIJake | 0:85855ecd3257 | 281 | * @return Status |
Vkadaba | 5:0728bde67bdb | 282 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 283 | * |
Vkadaba | 5:0728bde67bdb | 284 | * @details Instructs the ADMW device to initiate a shut down, |
ADIJake | 0:85855ecd3257 | 285 | * typically used to conserve power when the device is not |
ADIJake | 0:85855ecd3257 | 286 | * in use. The device may be restarted by calling |
Vkadaba | 5:0728bde67bdb | 287 | * @ref admw_Reset(). Note that active configuration |
ADIJake | 0:85855ecd3257 | 288 | * settings are not preserved during shutdown and must be |
ADIJake | 0:85855ecd3257 | 289 | * reloaded after the device has become ready again. |
ADIJake | 0:85855ecd3257 | 290 | * |
ADIJake | 0:85855ecd3257 | 291 | * @note No other command must be running when this is called. |
ADIJake | 0:85855ecd3257 | 292 | */ |
Vkadaba | 5:0728bde67bdb | 293 | ADMW_RESULT admw_Shutdown( |
Vkadaba | 5:0728bde67bdb | 294 | ADMW_DEVICE_HANDLE const hDevice); |
ADIJake | 0:85855ecd3257 | 295 | |
ADIJake | 0:85855ecd3257 | 296 | /*! |
Vkadaba | 5:0728bde67bdb | 297 | * @brief Reset the ADMW device. |
ADIJake | 0:85855ecd3257 | 298 | * |
Vkadaba | 5:0728bde67bdb | 299 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 300 | * |
ADIJake | 0:85855ecd3257 | 301 | * @return Status |
Vkadaba | 5:0728bde67bdb | 302 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 303 | * |
Vkadaba | 5:0728bde67bdb | 304 | * @details Trigger a hardware-reset of the ADMW device. |
ADIJake | 0:85855ecd3257 | 305 | * |
ADIJake | 0:85855ecd3257 | 306 | * @note The device may require several seconds before it is ready for use |
Vkadaba | 5:0728bde67bdb | 307 | * again. @ref admw_GetDeviceReadyState may be used to check if |
ADIJake | 0:85855ecd3257 | 308 | * the device is ready. |
ADIJake | 0:85855ecd3257 | 309 | */ |
Vkadaba | 5:0728bde67bdb | 310 | ADMW_RESULT admw_Reset( |
Vkadaba | 5:0728bde67bdb | 311 | ADMW_DEVICE_HANDLE const hDevice); |
ADIJake | 0:85855ecd3257 | 312 | |
ADIJake | 0:85855ecd3257 | 313 | /*! |
ADIJake | 0:85855ecd3257 | 314 | * @brief Check if the device is ready, following power-up or a reset. |
ADIJake | 0:85855ecd3257 | 315 | * |
Vkadaba | 5:0728bde67bdb | 316 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 317 | * @param[out] pbReady Pointer to return true if the device is ready, or false |
ADIJake | 0:85855ecd3257 | 318 | * otherwise |
ADIJake | 0:85855ecd3257 | 319 | * |
ADIJake | 0:85855ecd3257 | 320 | * @return Status |
Vkadaba | 5:0728bde67bdb | 321 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 322 | * |
ADIJake | 0:85855ecd3257 | 323 | * @details This function attempts to read a fixed-value device register via |
ADIJake | 0:85855ecd3257 | 324 | * the communication interface. |
ADIJake | 0:85855ecd3257 | 325 | */ |
Vkadaba | 5:0728bde67bdb | 326 | ADMW_RESULT admw_GetDeviceReadyState( |
Vkadaba | 5:0728bde67bdb | 327 | ADMW_DEVICE_HANDLE const hDevice, |
ADIJake | 0:85855ecd3257 | 328 | bool * const pbReady); |
ADIJake | 0:85855ecd3257 | 329 | |
ADIJake | 0:85855ecd3257 | 330 | /*! |
ADIJake | 0:85855ecd3257 | 331 | * @brief Obtain the product ID from the device. |
ADIJake | 0:85855ecd3257 | 332 | * |
Vkadaba | 5:0728bde67bdb | 333 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 334 | * @param[out] pProductId Pointer to return the product ID value |
ADIJake | 0:85855ecd3257 | 335 | * |
ADIJake | 0:85855ecd3257 | 336 | * @return Status |
Vkadaba | 5:0728bde67bdb | 337 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 338 | * |
ADIJake | 0:85855ecd3257 | 339 | * @details Reads the product ID registers on the device and returns the value. |
ADIJake | 0:85855ecd3257 | 340 | */ |
Vkadaba | 5:0728bde67bdb | 341 | ADMW_RESULT admw_GetProductID( |
Vkadaba | 5:0728bde67bdb | 342 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 5:0728bde67bdb | 343 | ADMW_PRODUCT_ID * const pProductId); |
ADIJake | 0:85855ecd3257 | 344 | |
ADIJake | 0:85855ecd3257 | 345 | /*! |
ADIJake | 0:85855ecd3257 | 346 | * @brief Write full configuration settings to the device registers. |
ADIJake | 0:85855ecd3257 | 347 | * |
Vkadaba | 5:0728bde67bdb | 348 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 349 | * @param[out] pConfig Pointer to the configuration data structure |
ADIJake | 0:85855ecd3257 | 350 | * |
ADIJake | 0:85855ecd3257 | 351 | * @return Status |
Vkadaba | 5:0728bde67bdb | 352 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 353 | * |
ADIJake | 0:85855ecd3257 | 354 | * @details Translates configuration details provided into device-specific |
ADIJake | 0:85855ecd3257 | 355 | * register settings and updates device configuration registers. |
ADIJake | 0:85855ecd3257 | 356 | * |
Vkadaba | 5:0728bde67bdb | 357 | * @note Settings are not applied until admw_ApplyConfigUpdates() is called |
ADIJake | 0:85855ecd3257 | 358 | */ |
Vkadaba | 5:0728bde67bdb | 359 | ADMW_RESULT admw_SetConfig( |
Vkadaba | 5:0728bde67bdb | 360 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 5:0728bde67bdb | 361 | ADMW_CONFIG * const pConfig); |
ADIJake | 0:85855ecd3257 | 362 | |
ADIJake | 0:85855ecd3257 | 363 | /*! |
ADIJake | 0:85855ecd3257 | 364 | * @brief Apply the configuration settings currently stored in device registers |
ADIJake | 0:85855ecd3257 | 365 | * |
Vkadaba | 5:0728bde67bdb | 366 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 367 | * |
ADIJake | 0:85855ecd3257 | 368 | * @return Status |
Vkadaba | 5:0728bde67bdb | 369 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 370 | * |
Vkadaba | 5:0728bde67bdb | 371 | * @details Instructs the ADMW device to reload and apply configuration |
ADIJake | 0:85855ecd3257 | 372 | * from the device configuration registers. Changes to configuration |
ADIJake | 0:85855ecd3257 | 373 | * registers are ignored by the device until this function is called. |
ADIJake | 0:85855ecd3257 | 374 | * |
ADIJake | 0:85855ecd3257 | 375 | * @note No other command must be running when this is called. |
ADIJake | 0:85855ecd3257 | 376 | */ |
Vkadaba | 5:0728bde67bdb | 377 | ADMW_RESULT admw_ApplyConfigUpdates( |
Vkadaba | 5:0728bde67bdb | 378 | ADMW_DEVICE_HANDLE const hDevice); |
ADIJake | 0:85855ecd3257 | 379 | |
ADIJake | 0:85855ecd3257 | 380 | /*! |
ADIJake | 0:85855ecd3257 | 381 | * @brief Store the configuration settings to persistent memory on the device. |
ADIJake | 0:85855ecd3257 | 382 | * |
Vkadaba | 5:0728bde67bdb | 383 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 384 | * @param[in] eSlotId User configuration slot in persistent memory |
ADIJake | 0:85855ecd3257 | 385 | * |
ADIJake | 0:85855ecd3257 | 386 | * @return Status |
Vkadaba | 5:0728bde67bdb | 387 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 388 | * |
Vkadaba | 5:0728bde67bdb | 389 | * @details Instructs the ADMW device to save the current contents of its |
ADIJake | 0:85855ecd3257 | 390 | * device configuration registers to non-volatile memory. |
ADIJake | 0:85855ecd3257 | 391 | * |
ADIJake | 0:85855ecd3257 | 392 | * @note No other command must be running when this is called. |
ADIJake | 0:85855ecd3257 | 393 | * @note Do not power down the device while this command is running. |
ADIJake | 0:85855ecd3257 | 394 | */ |
Vkadaba | 5:0728bde67bdb | 395 | ADMW_RESULT admw_SaveConfig( |
Vkadaba | 5:0728bde67bdb | 396 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 5:0728bde67bdb | 397 | ADMW_USER_CONFIG_SLOT const eSlotId); |
ADIJake | 0:85855ecd3257 | 398 | |
ADIJake | 0:85855ecd3257 | 399 | /*! |
ADIJake | 0:85855ecd3257 | 400 | * @brief Restore configuration settings from persistent memory on the device. |
ADIJake | 0:85855ecd3257 | 401 | * |
Vkadaba | 5:0728bde67bdb | 402 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 403 | * @param[in] eSlotId User configuration slot in persistent memory |
ADIJake | 0:85855ecd3257 | 404 | * |
ADIJake | 0:85855ecd3257 | 405 | * @return Status |
Vkadaba | 5:0728bde67bdb | 406 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 407 | * |
Vkadaba | 5:0728bde67bdb | 408 | * @details Instructs the ADMW device to restore the contents of its |
ADIJake | 0:85855ecd3257 | 409 | * device configuration registers from non-volatile memory. |
ADIJake | 0:85855ecd3257 | 410 | * |
ADIJake | 0:85855ecd3257 | 411 | * @note No other command must be running when this is called. |
ADIJake | 0:85855ecd3257 | 412 | */ |
Vkadaba | 5:0728bde67bdb | 413 | ADMW_RESULT admw_RestoreConfig( |
Vkadaba | 5:0728bde67bdb | 414 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 5:0728bde67bdb | 415 | ADMW_USER_CONFIG_SLOT const eSlotId); |
ADIJake | 0:85855ecd3257 | 416 | |
ADIJake | 0:85855ecd3257 | 417 | /*! |
ADIJake | 0:85855ecd3257 | 418 | * @brief Erases the external flash memory. |
ADIJake | 0:85855ecd3257 | 419 | * |
Vkadaba | 5:0728bde67bdb | 420 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 421 | * |
ADIJake | 0:85855ecd3257 | 422 | * @return Status |
Vkadaba | 5:0728bde67bdb | 423 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 424 | * |
ADIJake | 0:85855ecd3257 | 425 | * @details Sends the bulk erase instruction to the external flash |
ADIJake | 0:85855ecd3257 | 426 | * device. All stored samples are deleted. |
ADIJake | 0:85855ecd3257 | 427 | * It is a blocking operation and takes tens of seconds to |
ADIJake | 0:85855ecd3257 | 428 | * complete. |
ADIJake | 0:85855ecd3257 | 429 | * |
ADIJake | 0:85855ecd3257 | 430 | * @note No other command must be running when this is called. |
ADIJake | 0:85855ecd3257 | 431 | */ |
Vkadaba | 5:0728bde67bdb | 432 | ADMW_RESULT admw_EraseExternalFlash( |
Vkadaba | 5:0728bde67bdb | 433 | ADMW_DEVICE_HANDLE const hDevice); |
ADIJake | 0:85855ecd3257 | 434 | |
ADIJake | 0:85855ecd3257 | 435 | /*! |
ADIJake | 0:85855ecd3257 | 436 | * @brief Gets the number of samples stored in the external flash |
ADIJake | 0:85855ecd3257 | 437 | * memory. |
ADIJake | 0:85855ecd3257 | 438 | * |
Vkadaba | 5:0728bde67bdb | 439 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 440 | * @param[in] pSampleCount Address of the return value. |
ADIJake | 0:85855ecd3257 | 441 | * |
ADIJake | 0:85855ecd3257 | 442 | * @return Status |
Vkadaba | 5:0728bde67bdb | 443 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 444 | * |
ADIJake | 0:85855ecd3257 | 445 | * @note No other command must be running when this is called. |
ADIJake | 0:85855ecd3257 | 446 | */ |
Vkadaba | 5:0728bde67bdb | 447 | ADMW_RESULT admw_GetExternalFlashSampleCount( |
Vkadaba | 5:0728bde67bdb | 448 | ADMW_DEVICE_HANDLE const hDevice, |
ADIJake | 0:85855ecd3257 | 449 | uint32_t * nSampleCount); |
ADIJake | 0:85855ecd3257 | 450 | |
ADIJake | 0:85855ecd3257 | 451 | // DEBUG - TO BE DELETED |
Vkadaba | 5:0728bde67bdb | 452 | ADMW_RESULT admw_SetExternalFlashIndex( |
Vkadaba | 5:0728bde67bdb | 453 | ADMW_DEVICE_HANDLE const hDevice, |
ADIJake | 0:85855ecd3257 | 454 | uint32_t nStartIndex); |
ADIJake | 0:85855ecd3257 | 455 | |
ADIJake | 0:85855ecd3257 | 456 | /*! |
ADIJake | 0:85855ecd3257 | 457 | * @brief Read measurement samples stored in the the external flash memory. |
ADIJake | 0:85855ecd3257 | 458 | * |
Vkadaba | 5:0728bde67bdb | 459 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 460 | * @param[out] pSamples Pointer to return a set of requested data |
ADIJake | 0:85855ecd3257 | 461 | * samples. |
ADIJake | 0:85855ecd3257 | 462 | * @param[in] nStartIndex Index of first sample to retrieve. |
ADIJake | 0:85855ecd3257 | 463 | * @param[in] nBytesPerSample The size, in bytes, of each sample. |
ADIJake | 0:85855ecd3257 | 464 | * @param[in] nRequested Number of requested data samples. |
ADIJake | 0:85855ecd3257 | 465 | * @param[out] pnReturned Number of valid data samples successfully |
ADIJake | 0:85855ecd3257 | 466 | * retrieved. |
ADIJake | 0:85855ecd3257 | 467 | * |
ADIJake | 0:85855ecd3257 | 468 | * @return Status |
Vkadaba | 5:0728bde67bdb | 469 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 470 | * |
ADIJake | 0:85855ecd3257 | 471 | * @details Reads the status registers and extracts the relevant information |
ADIJake | 0:85855ecd3257 | 472 | * to return to the caller. |
ADIJake | 0:85855ecd3257 | 473 | * |
ADIJake | 0:85855ecd3257 | 474 | */ |
Vkadaba | 5:0728bde67bdb | 475 | ADMW_RESULT admw_GetExternalFlashData( |
Vkadaba | 5:0728bde67bdb | 476 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 5:0728bde67bdb | 477 | ADMW_DATA_SAMPLE * const pSamples, |
ADIJake | 0:85855ecd3257 | 478 | uint32_t const nIndex, |
ADIJake | 0:85855ecd3257 | 479 | uint32_t const nRequested, |
ADIJake | 0:85855ecd3257 | 480 | uint32_t * const pnReturned); |
ADIJake | 0:85855ecd3257 | 481 | |
ADIJake | 0:85855ecd3257 | 482 | /*! |
ADIJake | 0:85855ecd3257 | 483 | * @brief Store the LUT data to persistent memory on the device. |
ADIJake | 0:85855ecd3257 | 484 | * |
Vkadaba | 5:0728bde67bdb | 485 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 486 | * |
ADIJake | 0:85855ecd3257 | 487 | * @return Status |
Vkadaba | 5:0728bde67bdb | 488 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 489 | * |
Vkadaba | 5:0728bde67bdb | 490 | * @details Instructs the ADMW device to save the current contents of its |
Vkadaba | 5:0728bde67bdb | 491 | * LUT data buffer, set using @ref admw_SetLutData, to |
ADIJake | 0:85855ecd3257 | 492 | * non-volatile memory. |
ADIJake | 0:85855ecd3257 | 493 | * |
ADIJake | 0:85855ecd3257 | 494 | * @note No other command must be running when this is called. |
ADIJake | 0:85855ecd3257 | 495 | * @note Do not power down the device while this command is running. |
ADIJake | 0:85855ecd3257 | 496 | */ |
Vkadaba | 5:0728bde67bdb | 497 | ADMW_RESULT admw_SaveLutData( |
Vkadaba | 5:0728bde67bdb | 498 | ADMW_DEVICE_HANDLE const hDevice); |
ADIJake | 0:85855ecd3257 | 499 | |
ADIJake | 0:85855ecd3257 | 500 | /*! |
ADIJake | 0:85855ecd3257 | 501 | * @brief Restore LUT data from persistent memory on the device. |
ADIJake | 0:85855ecd3257 | 502 | * |
Vkadaba | 5:0728bde67bdb | 503 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 504 | * |
ADIJake | 0:85855ecd3257 | 505 | * @return Status |
Vkadaba | 5:0728bde67bdb | 506 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 507 | * |
Vkadaba | 5:0728bde67bdb | 508 | * @details Instructs the ADMW device to restore the contents of its |
Vkadaba | 5:0728bde67bdb | 509 | * LUT data, previously stored with @ref admw_SaveLutData, from |
ADIJake | 0:85855ecd3257 | 510 | * non-volatile memory. |
ADIJake | 0:85855ecd3257 | 511 | * |
ADIJake | 0:85855ecd3257 | 512 | * @note No other command must be running when this is called. |
ADIJake | 0:85855ecd3257 | 513 | */ |
Vkadaba | 5:0728bde67bdb | 514 | ADMW_RESULT admw_RestoreLutData( |
Vkadaba | 5:0728bde67bdb | 515 | ADMW_DEVICE_HANDLE const hDevice); |
ADIJake | 0:85855ecd3257 | 516 | |
ADIJake | 0:85855ecd3257 | 517 | /*! |
ADIJake | 0:85855ecd3257 | 518 | * @brief Start the measurement cycles on the device. |
ADIJake | 0:85855ecd3257 | 519 | * |
Vkadaba | 5:0728bde67bdb | 520 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 521 | * @param[in] eMeasurementMode Allows a choice of special modes for the |
Vkadaba | 5:0728bde67bdb | 522 | * measurement. See @ref ADMW_MEASUREMENT_MODE |
ADIJake | 0:85855ecd3257 | 523 | * for further information. |
ADIJake | 0:85855ecd3257 | 524 | * |
ADIJake | 0:85855ecd3257 | 525 | * @return Status |
Vkadaba | 5:0728bde67bdb | 526 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 527 | * |
Vkadaba | 5:0728bde67bdb | 528 | * @details Instructs the ADMW device to start executing measurement cycles |
ADIJake | 0:85855ecd3257 | 529 | * according to the current applied configuration settings. The |
ADIJake | 0:85855ecd3257 | 530 | * DATAREADY status signal will be asserted whenever new measurement |
ADIJake | 0:85855ecd3257 | 531 | * data is published, according to selected settings. |
ADIJake | 0:85855ecd3257 | 532 | * Measurement cycles may be stopped by calling @ref |
Vkadaba | 5:0728bde67bdb | 533 | * admw_StopMeasurement. |
ADIJake | 0:85855ecd3257 | 534 | * |
ADIJake | 0:85855ecd3257 | 535 | * @note No other command must be running when this is called. |
ADIJake | 0:85855ecd3257 | 536 | */ |
Vkadaba | 5:0728bde67bdb | 537 | ADMW_RESULT admw_StartMeasurement( |
Vkadaba | 5:0728bde67bdb | 538 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 5:0728bde67bdb | 539 | ADMW_MEASUREMENT_MODE const eMeasurementMode); |
ADIJake | 0:85855ecd3257 | 540 | |
ADIJake | 0:85855ecd3257 | 541 | /*! |
ADIJake | 0:85855ecd3257 | 542 | * @brief Stop the measurement cycles on the device. |
ADIJake | 0:85855ecd3257 | 543 | * |
Vkadaba | 5:0728bde67bdb | 544 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 545 | * |
ADIJake | 0:85855ecd3257 | 546 | * @return Status |
Vkadaba | 5:0728bde67bdb | 547 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 548 | * |
Vkadaba | 5:0728bde67bdb | 549 | * @details Instructs the ADMW device to stop executing measurement cycles. |
ADIJake | 0:85855ecd3257 | 550 | * The command may be delayed until the current conversion, if any, has |
ADIJake | 0:85855ecd3257 | 551 | * been completed and published. |
ADIJake | 0:85855ecd3257 | 552 | * |
ADIJake | 0:85855ecd3257 | 553 | * @note To be used only if a measurement command is currently running. |
ADIJake | 0:85855ecd3257 | 554 | */ |
Vkadaba | 5:0728bde67bdb | 555 | ADMW_RESULT admw_StopMeasurement( |
Vkadaba | 5:0728bde67bdb | 556 | ADMW_DEVICE_HANDLE const hDevice); |
ADIJake | 0:85855ecd3257 | 557 | |
ADIJake | 0:85855ecd3257 | 558 | /*! |
ADIJake | 0:85855ecd3257 | 559 | * @brief Run built-in diagnostic checks on the device. |
ADIJake | 0:85855ecd3257 | 560 | * |
Vkadaba | 5:0728bde67bdb | 561 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 562 | * |
ADIJake | 0:85855ecd3257 | 563 | * @return Status |
Vkadaba | 5:0728bde67bdb | 564 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 565 | * |
Vkadaba | 5:0728bde67bdb | 566 | * @details Instructs the ADMW device to execute its built-in diagnostic |
ADIJake | 0:85855ecd3257 | 567 | * tests, on any enabled measurement channels, according to the current |
ADIJake | 0:85855ecd3257 | 568 | * applied configuration settings. Device status registers will be |
ADIJake | 0:85855ecd3257 | 569 | * updated to indicate if any errors were detected by the diagnostics. |
ADIJake | 0:85855ecd3257 | 570 | * |
ADIJake | 0:85855ecd3257 | 571 | * @note No other command must be running when this is called. |
ADIJake | 0:85855ecd3257 | 572 | */ |
Vkadaba | 5:0728bde67bdb | 573 | ADMW_RESULT admw_RunDiagnostics( |
Vkadaba | 5:0728bde67bdb | 574 | ADMW_DEVICE_HANDLE const hDevice); |
ADIJake | 0:85855ecd3257 | 575 | |
ADIJake | 0:85855ecd3257 | 576 | /*! |
ADIJake | 0:85855ecd3257 | 577 | * @brief Run built-in calibration on the device. |
ADIJake | 0:85855ecd3257 | 578 | * |
Vkadaba | 5:0728bde67bdb | 579 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 580 | * |
ADIJake | 0:85855ecd3257 | 581 | * @return Status |
Vkadaba | 5:0728bde67bdb | 582 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 583 | * |
Vkadaba | 5:0728bde67bdb | 584 | * @details Instructs the ADMW device to execute its self-calibration |
ADIJake | 0:85855ecd3257 | 585 | * routines, on any enabled measurement channels, according to the |
ADIJake | 0:85855ecd3257 | 586 | * current applied configuration settings. Device status registers |
ADIJake | 0:85855ecd3257 | 587 | * will be updated to indicate if any errors were detected. |
ADIJake | 0:85855ecd3257 | 588 | * |
ADIJake | 0:85855ecd3257 | 589 | * @note No other command must be running when this is called. |
ADIJake | 0:85855ecd3257 | 590 | */ |
Vkadaba | 5:0728bde67bdb | 591 | ADMW_RESULT admw_RunCalibration( |
Vkadaba | 5:0728bde67bdb | 592 | ADMW_DEVICE_HANDLE const hDevice); |
ADIJake | 0:85855ecd3257 | 593 | |
ADIJake | 0:85855ecd3257 | 594 | /*! |
ADIJake | 0:85855ecd3257 | 595 | * @brief Run built-in digital calibration on the device. |
ADIJake | 0:85855ecd3257 | 596 | * |
Vkadaba | 5:0728bde67bdb | 597 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 598 | * |
ADIJake | 0:85855ecd3257 | 599 | * @return Status |
Vkadaba | 5:0728bde67bdb | 600 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 601 | * |
Vkadaba | 5:0728bde67bdb | 602 | * @details Instructs the ADMW device to execute its calibration |
ADIJake | 0:85855ecd3257 | 603 | * routines, on any enabled digital channels, according to the |
ADIJake | 0:85855ecd3257 | 604 | * current applied configuration settings. Device status registers |
ADIJake | 0:85855ecd3257 | 605 | * will be updated to indicate if any errors were detected. |
ADIJake | 0:85855ecd3257 | 606 | * |
ADIJake | 0:85855ecd3257 | 607 | * @note No other command must be running when this is called. |
ADIJake | 0:85855ecd3257 | 608 | */ |
Vkadaba | 5:0728bde67bdb | 609 | ADMW_RESULT admw_RunDigitalCalibration( |
Vkadaba | 5:0728bde67bdb | 610 | ADMW_DEVICE_HANDLE const hDevice); |
ADIJake | 0:85855ecd3257 | 611 | |
ADIJake | 0:85855ecd3257 | 612 | /*! |
ADIJake | 0:85855ecd3257 | 613 | * @brief Read the current status from the device registers. |
ADIJake | 0:85855ecd3257 | 614 | * |
Vkadaba | 5:0728bde67bdb | 615 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 616 | * @param[out] pStatus Pointer to return the status summary obtained from the |
ADIJake | 0:85855ecd3257 | 617 | * device. |
ADIJake | 0:85855ecd3257 | 618 | * |
ADIJake | 0:85855ecd3257 | 619 | * @return Status |
Vkadaba | 5:0728bde67bdb | 620 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 621 | * |
ADIJake | 0:85855ecd3257 | 622 | * @details Reads the status registers and extracts the relevant information |
ADIJake | 0:85855ecd3257 | 623 | * to return to the caller. |
ADIJake | 0:85855ecd3257 | 624 | * |
ADIJake | 0:85855ecd3257 | 625 | * @note This may be called at any time, assuming the device is ready. |
ADIJake | 0:85855ecd3257 | 626 | */ |
Vkadaba | 5:0728bde67bdb | 627 | ADMW_RESULT admw_GetStatus( |
Vkadaba | 5:0728bde67bdb | 628 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 5:0728bde67bdb | 629 | ADMW_STATUS * const pStatus); |
ADIJake | 0:85855ecd3257 | 630 | |
ADIJake | 0:85855ecd3257 | 631 | /*! |
ADIJake | 0:85855ecd3257 | 632 | * @brief Read measurement data samples from the device registers. |
ADIJake | 0:85855ecd3257 | 633 | * |
Vkadaba | 5:0728bde67bdb | 634 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 635 | * @param[in] eMeasurementMode Must be set to the same value used for @ref |
Vkadaba | 5:0728bde67bdb | 636 | * admw_StartMeasurement(). |
ADIJake | 0:85855ecd3257 | 637 | * @param[out] pSamples Pointer to return a set of requested data samples. |
ADIJake | 0:85855ecd3257 | 638 | * @param[in] nBytesPerSample The size, in bytes, of each sample. |
ADIJake | 0:85855ecd3257 | 639 | * @param[in] nRequested Number of requested data samples. |
ADIJake | 0:85855ecd3257 | 640 | * @param[out] pnReturned Number of valid data samples successfully retrieved. |
ADIJake | 0:85855ecd3257 | 641 | * |
ADIJake | 0:85855ecd3257 | 642 | * @return Status |
Vkadaba | 5:0728bde67bdb | 643 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 644 | * |
ADIJake | 0:85855ecd3257 | 645 | * @details Reads the status registers and extracts the relevant information |
ADIJake | 0:85855ecd3257 | 646 | * to return to the caller. |
ADIJake | 0:85855ecd3257 | 647 | * |
ADIJake | 0:85855ecd3257 | 648 | * @note This is intended to be called only when the DATAREADY status signal |
ADIJake | 0:85855ecd3257 | 649 | * is asserted. |
ADIJake | 0:85855ecd3257 | 650 | */ |
Vkadaba | 5:0728bde67bdb | 651 | ADMW_RESULT admw_GetData( |
Vkadaba | 5:0728bde67bdb | 652 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 5:0728bde67bdb | 653 | ADMW_MEASUREMENT_MODE const eMeasurementMode, |
Vkadaba | 5:0728bde67bdb | 654 | ADMW_DATA_SAMPLE * const pSamples, |
ADIJake | 0:85855ecd3257 | 655 | uint8_t const nBytesPerSample, |
ADIJake | 0:85855ecd3257 | 656 | uint32_t const nRequested, |
ADIJake | 0:85855ecd3257 | 657 | uint32_t * const pnReturned); |
ADIJake | 0:85855ecd3257 | 658 | |
ADIJake | 0:85855ecd3257 | 659 | /*! |
ADIJake | 0:85855ecd3257 | 660 | * @brief Check if a command is currently running on the device. |
ADIJake | 0:85855ecd3257 | 661 | * |
Vkadaba | 5:0728bde67bdb | 662 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 663 | * @param[out] pbCommandRunning Pointer to return the command running status |
ADIJake | 0:85855ecd3257 | 664 | * |
ADIJake | 0:85855ecd3257 | 665 | * @return Status |
Vkadaba | 5:0728bde67bdb | 666 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 667 | * |
ADIJake | 0:85855ecd3257 | 668 | * @details Reads the device status register to check if a command is running. |
ADIJake | 0:85855ecd3257 | 669 | */ |
Vkadaba | 5:0728bde67bdb | 670 | ADMW_RESULT admw_GetCommandRunningState( |
Vkadaba | 5:0728bde67bdb | 671 | ADMW_DEVICE_HANDLE hDevice, |
ADIJake | 0:85855ecd3257 | 672 | bool *pbCommandRunning); |
ADIJake | 0:85855ecd3257 | 673 | |
ADIJake | 0:85855ecd3257 | 674 | #ifdef __cplusplus |
ADIJake | 0:85855ecd3257 | 675 | } |
ADIJake | 0:85855ecd3257 | 676 | #endif |
ADIJake | 0:85855ecd3257 | 677 | |
ADIJake | 0:85855ecd3257 | 678 | /*! |
ADIJake | 0:85855ecd3257 | 679 | * @} |
ADIJake | 0:85855ecd3257 | 680 | */ |
ADIJake | 0:85855ecd3257 | 681 | |
Vkadaba | 6:9d393a9677f4 | 682 | #endif /* _ADMW_API_H__ */ |