Vybhav Kadaba
/
EV-PRO-MW1001_Development_code_cleaup
Removed unwanted enums and unused functions
inc/admw_api.h@64:d89d9728ba95, 2020-04-09 (annotated)
- Committer:
- Vkadaba
- Date:
- Thu Apr 09 12:39:43 2020 +0000
- Revision:
- 64:d89d9728ba95
- Parent:
- 63:6d048b2f3f32
code clean up part-2
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" |
Vkadaba | 32:52445bef314d | 53 | #include "inc/admw1001/admw1001_sensor_types.h" |
Vkadaba | 54:31921ad29828 | 54 | #include "inc/admw1001/admw1001_lut_data.h" |
ADIJake | 0:85855ecd3257 | 55 | |
Vkadaba | 5:0728bde67bdb | 56 | /*! @defgroup ADMW_Api ADMW Host Library API |
Vkadaba | 5:0728bde67bdb | 57 | * Host library API common to the ADMW product family. |
ADIJake | 0:85855ecd3257 | 58 | * @{ |
ADIJake | 0:85855ecd3257 | 59 | */ |
ADIJake | 0:85855ecd3257 | 60 | |
ADIJake | 0:85855ecd3257 | 61 | #ifdef __cplusplus |
ADIJake | 0:85855ecd3257 | 62 | extern "C" { |
ADIJake | 0:85855ecd3257 | 63 | #endif |
ADIJake | 0:85855ecd3257 | 64 | |
Vkadaba | 5:0728bde67bdb | 65 | /*! A handle used in all API functions to identify the ADMW device. */ |
Vkadaba | 5:0728bde67bdb | 66 | typedef void* ADMW_DEVICE_HANDLE; |
Vkadaba | 14:266ab283b086 | 67 | |
Vkadaba | 13:97cb32670539 | 68 | #define SPI_BUFFER_SIZE 100u |
Vkadaba | 13:97cb32670539 | 69 | |
Vkadaba | 13:97cb32670539 | 70 | #define SFL_READ_STATUS_HDR_SIZE 14u |
Vkadaba | 13:97cb32670539 | 71 | |
Vkadaba | 13:97cb32670539 | 72 | #define SFL_READ_STATUS_RESPONSE_SIZE 42u |
ADIJake | 0:85855ecd3257 | 73 | |
Vkadaba | 5:0728bde67bdb | 74 | /*! Supported connection types for communication with the ADMW device. */ |
Vkadaba | 32:52445bef314d | 75 | typedef enum |
Vkadaba | 32:52445bef314d | 76 | { |
Vkadaba | 5:0728bde67bdb | 77 | ADMW_CONNECTION_TYPE_SPI = 1, |
ADIJake | 0:85855ecd3257 | 78 | /*!< Serial Peripheral Interface (SPI) connection type */ |
Vkadaba | 32:52445bef314d | 79 | |
Vkadaba | 32:52445bef314d | 80 | } ADMW_CONNECTION_TYPE; |
ADIJake | 0:85855ecd3257 | 81 | |
Vkadaba | 5:0728bde67bdb | 82 | /*! Connection details for communication with a ADMW device instance. */ |
Vkadaba | 32:52445bef314d | 83 | typedef struct |
Vkadaba | 32:52445bef314d | 84 | { |
Vkadaba | 5:0728bde67bdb | 85 | ADMW_CONNECTION_TYPE type; |
ADIJake | 0:85855ecd3257 | 86 | /*!< Connection type selection */ |
Vkadaba | 5:0728bde67bdb | 87 | ADMW_PLATFORM_SPI_CONFIG spi; |
ADIJake | 0:85855ecd3257 | 88 | /*!< SPI connection parameters, required if SPI connection type is used */ |
Vkadaba | 5:0728bde67bdb | 89 | ADMW_PLATFORM_GPIO_CONFIG gpio; |
ADIJake | 0:85855ecd3257 | 90 | /*!< GPIO connection parameters, for device reset and status I/O signals */ |
Vkadaba | 5:0728bde67bdb | 91 | ADMW_PLATFORM_LOG_CONFIG log; |
ADIJake | 0:85855ecd3257 | 92 | /*!< Log interface connection parameters, for display/routing of log messages */ |
Vkadaba | 32:52445bef314d | 93 | |
Vkadaba | 32:52445bef314d | 94 | } ADMW_CONNECTION; |
ADIJake | 0:85855ecd3257 | 95 | |
ADIJake | 0:85855ecd3257 | 96 | /*! Bit masks (flags) for the different device status indicators. */ |
Vkadaba | 32:52445bef314d | 97 | typedef enum |
Vkadaba | 32:52445bef314d | 98 | { |
Vkadaba | 5:0728bde67bdb | 99 | ADMW_DEVICE_STATUS_BUSY = (1 << 0), |
ADIJake | 0:85855ecd3257 | 100 | /*!< Indicates that a command is currently running on the device */ |
Vkadaba | 5:0728bde67bdb | 101 | ADMW_DEVICE_STATUS_DATAREADY = (1 << 1), |
ADIJake | 0:85855ecd3257 | 102 | /*!< Indicates the availability of measurement data for retrieval */ |
Vkadaba | 5:0728bde67bdb | 103 | ADMW_DEVICE_STATUS_ERROR = (1 << 2), |
ADIJake | 0:85855ecd3257 | 104 | /*!< Indicates that an error condition has been detected by the device */ |
Vkadaba | 5:0728bde67bdb | 105 | ADMW_DEVICE_STATUS_ALERT = (1 << 3), |
ADIJake | 0:85855ecd3257 | 106 | /*!< Indicates that an alert condition has been detected by the device */ |
Vkadaba | 5:0728bde67bdb | 107 | ADMW_DEVICE_STATUS_FIFO_ERROR = (1 << 4), |
ADIJake | 0:85855ecd3257 | 108 | /*!< Indicates that a FIFO error condition has been detected by the device */ |
Vkadaba | 5:0728bde67bdb | 109 | ADMW_DEVICE_STATUS_CONFIG_ERROR = (1 << 5), |
ADIJake | 0:85855ecd3257 | 110 | /*!< Indicates that a configuration error condition has been detected by the device */ |
Vkadaba | 5:0728bde67bdb | 111 | ADMW_DEVICE_STATUS_LUT_ERROR = (1 << 6), |
ADIJake | 0:85855ecd3257 | 112 | /*!< Indicates that a look-up table error condition has been detected by the device */ |
Vkadaba | 32:52445bef314d | 113 | |
Vkadaba | 32:52445bef314d | 114 | } ADMW_DEVICE_STATUS_FLAGS; |
ADIJake | 0:85855ecd3257 | 115 | |
ADIJake | 0:85855ecd3257 | 116 | |
ADIJake | 0:85855ecd3257 | 117 | /*! Bit masks (flags) for the different channel alert indicators. */ |
Vkadaba | 32:52445bef314d | 118 | typedef enum |
Vkadaba | 32:52445bef314d | 119 | { |
Vkadaba | 32:52445bef314d | 120 | ADMW_ALERT_DETAIL_CH_RESULT_VALID = (1 << 0), |
Vkadaba | 32:52445bef314d | 121 | /*!< Indicates valid result in the channel */ |
Vkadaba | 32:52445bef314d | 122 | ADMW_ALERT_DETAIL_CH_ADC_NEAR_OVERRANGE = (1 << 1), |
Vkadaba | 32:52445bef314d | 123 | /*!< Indicates ADC is near overrange in the channel */ |
Vkadaba | 32:52445bef314d | 124 | ADMW_ALERT_DETAIL_CH_SENSOR_UNDERRANGE = (1 << 2), |
Vkadaba | 32:52445bef314d | 125 | /*!< Indicates sensor underrange in the channel */ |
Vkadaba | 32:52445bef314d | 126 | ADMW_ALERT_DETAIL_CH_SENSOR_OVERRANGE = (1 << 3), |
Vkadaba | 32:52445bef314d | 127 | /*!< Indicates sensor overrange in the channel */ |
Vkadaba | 32:52445bef314d | 128 | ADMW_ALERT_DETAIL_CH_CJ_SOFT_FAULT = (1 << 4), |
Vkadaba | 32:52445bef314d | 129 | /*!< Indicates Cold Junction soft fault in the channel */ |
Vkadaba | 32:52445bef314d | 130 | ADMW_ALERT_DETAIL_CH_CJ_HARD_FAULT = (1 << 5), |
Vkadaba | 32:52445bef314d | 131 | /*!< Indicates Cold Junction Hard Fault in the channel */ |
Vkadaba | 32:52445bef314d | 132 | ADMW_ALERT_DETAIL_CH_ADC_INPUT_OVERRANGE = (1 << 6), |
Vkadaba | 32:52445bef314d | 133 | /*!< Indicates ADC Input overrange in the channel */ |
Vkadaba | 32:52445bef314d | 134 | ADMW_ALERT_DETAIL_CH_SENSOR_HARDFAULT = (1 << 7), |
Vkadaba | 32:52445bef314d | 135 | /*!< Indicates Hard Fault in the channel */ |
Vkadaba | 32:52445bef314d | 136 | } ADMW_CHANNEL_ALERT_FLAGS; |
ADIJake | 0:85855ecd3257 | 137 | |
Vkadaba | 5:0728bde67bdb | 138 | /*! Status details retreived from the ADMW device. */ |
Vkadaba | 32:52445bef314d | 139 | typedef struct |
Vkadaba | 32:52445bef314d | 140 | { |
Vkadaba | 5:0728bde67bdb | 141 | ADMW_DEVICE_STATUS_FLAGS deviceStatus; |
ADIJake | 0:85855ecd3257 | 142 | /*!< General summary status information from the device */ |
Vkadaba | 32:52445bef314d | 143 | ADMW_CHANNEL_ALERT_FLAGS channelAlerts[ADMW1001_MAX_CHANNELS]; |
ADIJake | 0:85855ecd3257 | 144 | /*!< Per-channel alert status information from the device */ |
Vkadaba | 32:52445bef314d | 145 | uint32_t errorCode; |
ADIJake | 0:85855ecd3257 | 146 | /*!< Code identifying the last error signalled by the device */ |
Vkadaba | 32:52445bef314d | 147 | uint32_t alertCode; |
ADIJake | 0:85855ecd3257 | 148 | /*!< Code identifying the last alert signalled by the device */ |
Vkadaba | 32:52445bef314d | 149 | uint32_t debugCode; |
ADIJake | 0:85855ecd3257 | 150 | /*!< Supplementary code related to the last error/alert */ |
Vkadaba | 32:52445bef314d | 151 | uint32_t channelAlertCodes[ADMW1001_MAX_CHANNELS]; |
ADIJake | 0:85855ecd3257 | 152 | /*!< Per-channel code identifying the last alert signalled for each channel */ |
Vkadaba | 32:52445bef314d | 153 | |
Vkadaba | 32:52445bef314d | 154 | } ADMW_STATUS; |
ADIJake | 0:85855ecd3257 | 155 | |
Vkadaba | 5:0728bde67bdb | 156 | /*! Data sample details retreived from the ADMW device. */ |
Vkadaba | 32:52445bef314d | 157 | typedef struct |
Vkadaba | 32:52445bef314d | 158 | { |
Vkadaba | 5:0728bde67bdb | 159 | ADMW_DEVICE_STATUS_FLAGS status; |
ADIJake | 0:85855ecd3257 | 160 | /*!< Device summary status snapshot when the sample was recorded */ |
Vkadaba | 32:52445bef314d | 161 | uint32_t channelId; |
ADIJake | 0:85855ecd3257 | 162 | /*!< The measurement channel from which this sample was obtained */ |
Vkadaba | 50:d84305e5e1c0 | 163 | uint8_t measurementStatus; |
Vkadaba | 50:d84305e5e1c0 | 164 | /*!< The measurement status from the DMZ layer */ |
Vkadaba | 56:38b36e947602 | 165 | float32_t rawValue; |
ADIJake | 0:85855ecd3257 | 166 | /*!< The raw (unprocessed) value obtained directly from the measurement |
ADIJake | 0:85855ecd3257 | 167 | * channel, if available |
ADIJake | 0:85855ecd3257 | 168 | */ |
Vkadaba | 32:52445bef314d | 169 | float32_t processedValue; |
ADIJake | 0:85855ecd3257 | 170 | /*!< The processed value obtained from the measurement channel, as a final |
ADIJake | 0:85855ecd3257 | 171 | * measurement value, following calibration and linearisation correction, |
ADIJake | 0:85855ecd3257 | 172 | * and conversion into an appropriate unit of measurement. |
ADIJake | 0:85855ecd3257 | 173 | */ |
Vkadaba | 32:52445bef314d | 174 | |
Vkadaba | 32:52445bef314d | 175 | } ADMW_DATA_SAMPLE; |
ADIJake | 0:85855ecd3257 | 176 | |
Vkadaba | 5:0728bde67bdb | 177 | /*! Measurement mode options for the ADMW device. |
Vkadaba | 5:0728bde67bdb | 178 | * @ref admw_StartMeasurement |
ADIJake | 0:85855ecd3257 | 179 | */ |
Vkadaba | 32:52445bef314d | 180 | typedef enum |
Vkadaba | 32:52445bef314d | 181 | { |
Vkadaba | 6:9d393a9677f4 | 182 | ADMW_MEASUREMENT_MODE_NORMAL = 0, |
ADIJake | 0:85855ecd3257 | 183 | /*!< In this mode, normal measurement cycle(s) are executed and data samples |
ADIJake | 0:85855ecd3257 | 184 | * are returned with raw measurement values included. */ |
Vkadaba | 5:0728bde67bdb | 185 | ADMW_MEASUREMENT_MODE_OMIT_RAW, |
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 omitted for efficiency. */ |
Vkadaba | 32:52445bef314d | 188 | |
Vkadaba | 32:52445bef314d | 189 | } ADMW_MEASUREMENT_MODE; |
ADIJake | 0:85855ecd3257 | 190 | |
ADIJake | 0:85855ecd3257 | 191 | /*! Identifiers for the user configuration slots in persistent memory. */ |
Vkadaba | 32:52445bef314d | 192 | typedef enum |
Vkadaba | 32:52445bef314d | 193 | { |
Vkadaba | 50:d84305e5e1c0 | 194 | ADMW_FLASH_LUT_CHANNEL_0=0, |
Vkadaba | 50:d84305e5e1c0 | 195 | ADMW_FLASH_LUT_CHANNEL_1, |
Vkadaba | 50:d84305e5e1c0 | 196 | ADMW_FLASH_LUT_CHANNEL_2, |
Vkadaba | 50:d84305e5e1c0 | 197 | ADMW_FLASH_LUT_CHANNEL_3, |
Vkadaba | 50:d84305e5e1c0 | 198 | |
Vkadaba | 32:52445bef314d | 199 | |
Vkadaba | 50:d84305e5e1c0 | 200 | } ADMW_USER_LUT_CONFIG_SLOT; |
ADIJake | 0:85855ecd3257 | 201 | |
Vkadaba | 63:6d048b2f3f32 | 202 | /*! Identifiers for the user configuration slots in persistent memory. */ |
Vkadaba | 63:6d048b2f3f32 | 203 | typedef enum |
Vkadaba | 63:6d048b2f3f32 | 204 | { |
Vkadaba | 63:6d048b2f3f32 | 205 | ADMW_FLASH_CONFIG_1, |
Vkadaba | 63:6d048b2f3f32 | 206 | |
Vkadaba | 63:6d048b2f3f32 | 207 | } ADMW_USER_CONFIG_SLOT; |
Vkadaba | 63:6d048b2f3f32 | 208 | |
Vkadaba | 32:52445bef314d | 209 | typedef struct |
Vkadaba | 32:52445bef314d | 210 | { |
Vkadaba | 32:52445bef314d | 211 | unsigned nDeviceIndex; |
Vkadaba | 32:52445bef314d | 212 | ADMW_SPI_HANDLE hSpi; |
Vkadaba | 32:52445bef314d | 213 | ADMW_GPIO_HANDLE hGpio; |
Vkadaba | 32:52445bef314d | 214 | } ADMW_DEVICE_CONTEXT; |
ADIJake | 0:85855ecd3257 | 215 | |
ADIJake | 0:85855ecd3257 | 216 | /****************************************************************************** |
Vkadaba | 5:0728bde67bdb | 217 | * ADMW High-Level API function prototypes |
ADIJake | 0:85855ecd3257 | 218 | *****************************************************************************/ |
ADIJake | 0:85855ecd3257 | 219 | |
ADIJake | 0:85855ecd3257 | 220 | /*! |
Vkadaba | 5:0728bde67bdb | 221 | * @brief Open ADMW device handle and set up communication interface. |
ADIJake | 0:85855ecd3257 | 222 | * |
ADIJake | 0:85855ecd3257 | 223 | * @param[in] nDeviceIndex Zero-based index number identifying this device |
ADIJake | 0:85855ecd3257 | 224 | * instance. Note that this will be used to |
ADIJake | 0:85855ecd3257 | 225 | * retrieve a specific device configuration for |
Vkadaba | 5:0728bde67bdb | 226 | * this device (see @ref admw_SetConfig |
Vkadaba | 5:0728bde67bdb | 227 | * and @ref ADMW_CONFIG) |
ADIJake | 0:85855ecd3257 | 228 | * @param[in] pConnectionInfo Host-specific connection details (e.g. SPI, GPIO) |
Vkadaba | 5:0728bde67bdb | 229 | * @param[out] phDevice Pointer to return an ADMW device handle |
ADIJake | 0:85855ecd3257 | 230 | * |
ADIJake | 0:85855ecd3257 | 231 | * @return Status |
Vkadaba | 5:0728bde67bdb | 232 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 233 | * - #ADMW_NO_MEM Failed to allocate memory resources. |
Vkadaba | 5:0728bde67bdb | 234 | * - #ADMW_INVALID_DEVICE_NUM Invalid device index specified |
ADIJake | 0:85855ecd3257 | 235 | * |
ADIJake | 0:85855ecd3257 | 236 | * @details Configure and initialise the Log interface and the SPI/GPIO |
Vkadaba | 32:52445bef314d | 237 | * communication interface to the ADISense module. |
ADIJake | 0:85855ecd3257 | 238 | */ |
Vkadaba | 5:0728bde67bdb | 239 | ADMW_RESULT admw_Open( |
ADIJake | 0:85855ecd3257 | 240 | unsigned const nDeviceIndex, |
Vkadaba | 5:0728bde67bdb | 241 | ADMW_CONNECTION * const pConnectionInfo, |
Vkadaba | 5:0728bde67bdb | 242 | ADMW_DEVICE_HANDLE * const phDevice); |
ADIJake | 0:85855ecd3257 | 243 | |
ADIJake | 0:85855ecd3257 | 244 | /*! |
Vkadaba | 5:0728bde67bdb | 245 | * @brief Close ADMW device context and free resources. |
ADIJake | 0:85855ecd3257 | 246 | * |
Vkadaba | 5:0728bde67bdb | 247 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 248 | * |
ADIJake | 0:85855ecd3257 | 249 | * @return Status |
Vkadaba | 5:0728bde67bdb | 250 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 251 | */ |
Vkadaba | 5:0728bde67bdb | 252 | ADMW_RESULT admw_Close( |
Vkadaba | 5:0728bde67bdb | 253 | ADMW_DEVICE_HANDLE const hDevice); |
ADIJake | 0:85855ecd3257 | 254 | |
ADIJake | 0:85855ecd3257 | 255 | /*! |
ADIJake | 0:85855ecd3257 | 256 | * @brief Get the current state of the specified GPIO input signal. |
ADIJake | 0:85855ecd3257 | 257 | * |
Vkadaba | 5:0728bde67bdb | 258 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 259 | * @param[in] ePinId GPIO pin to query |
ADIJake | 0:85855ecd3257 | 260 | * @param[out] pbAsserted Pointer to return the state of the status signal GPIO pin |
ADIJake | 0:85855ecd3257 | 261 | * |
ADIJake | 0:85855ecd3257 | 262 | * @return Status |
Vkadaba | 5:0728bde67bdb | 263 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 264 | * - #ADMW_INVALID_DEVICE_NUM Invalid GPIO pin specified. |
ADIJake | 0:85855ecd3257 | 265 | * |
ADIJake | 0:85855ecd3257 | 266 | * @details Sets *pbAsserted to true if the status signal is asserted, or false |
ADIJake | 0:85855ecd3257 | 267 | * otherwise. |
ADIJake | 0:85855ecd3257 | 268 | */ |
Vkadaba | 5:0728bde67bdb | 269 | ADMW_RESULT admw_GetGpioState( |
Vkadaba | 5:0728bde67bdb | 270 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 5:0728bde67bdb | 271 | ADMW_GPIO_PIN const ePinId, |
ADIJake | 0:85855ecd3257 | 272 | bool * const pbAsserted); |
ADIJake | 0:85855ecd3257 | 273 | |
ADIJake | 0:85855ecd3257 | 274 | /*! |
ADIJake | 0:85855ecd3257 | 275 | * @brief Register an application-defined callback function for GPIO interrupts |
ADIJake | 0:85855ecd3257 | 276 | * |
Vkadaba | 5:0728bde67bdb | 277 | * @param[in] hDevice ADMW context handle (@ref admw_Open) |
ADIJake | 0:85855ecd3257 | 278 | * @param[in] ePinId GPIO pin on which to enable/disable interrupts |
ADIJake | 0:85855ecd3257 | 279 | * @param[in] callbackFunction Function to be called when an interrupt occurs. |
ADIJake | 0:85855ecd3257 | 280 | * Specify NULL here to disable interrupts. |
ADIJake | 0:85855ecd3257 | 281 | * @param[in] pCallbackParam Optional opaque parameter passed to the callback |
ADIJake | 0:85855ecd3257 | 282 | * |
ADIJake | 0:85855ecd3257 | 283 | * @return Status |
Vkadaba | 5:0728bde67bdb | 284 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 285 | * - #ADMW_INVALID_DEVICE_NUM Invalid GPIO pin specified. |
ADIJake | 0:85855ecd3257 | 286 | */ |
Vkadaba | 5:0728bde67bdb | 287 | ADMW_RESULT admw_RegisterGpioCallback( |
Vkadaba | 5:0728bde67bdb | 288 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 5:0728bde67bdb | 289 | ADMW_GPIO_PIN const ePinId, |
Vkadaba | 5:0728bde67bdb | 290 | ADMW_GPIO_CALLBACK const callbackFunction, |
ADIJake | 0:85855ecd3257 | 291 | void * const pCallbackParam); |
ADIJake | 0:85855ecd3257 | 292 | |
ADIJake | 0:85855ecd3257 | 293 | /*! |
ADIJake | 0:85855ecd3257 | 294 | * @brief Trigger a shut down of the device. |
ADIJake | 0:85855ecd3257 | 295 | * |
Vkadaba | 5:0728bde67bdb | 296 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 297 | * |
ADIJake | 0:85855ecd3257 | 298 | * @return Status |
Vkadaba | 5:0728bde67bdb | 299 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 300 | * |
Vkadaba | 5:0728bde67bdb | 301 | * @details Instructs the ADMW device to initiate a shut down, |
ADIJake | 0:85855ecd3257 | 302 | * typically used to conserve power when the device is not |
ADIJake | 0:85855ecd3257 | 303 | * in use. The device may be restarted by calling |
Vkadaba | 5:0728bde67bdb | 304 | * @ref admw_Reset(). Note that active configuration |
ADIJake | 0:85855ecd3257 | 305 | * settings are not preserved during shutdown and must be |
ADIJake | 0:85855ecd3257 | 306 | * reloaded after the device has become ready again. |
ADIJake | 0:85855ecd3257 | 307 | * |
ADIJake | 0:85855ecd3257 | 308 | * @note No other command must be running when this is called. |
ADIJake | 0:85855ecd3257 | 309 | */ |
Vkadaba | 5:0728bde67bdb | 310 | ADMW_RESULT admw_Shutdown( |
Vkadaba | 5:0728bde67bdb | 311 | ADMW_DEVICE_HANDLE const hDevice); |
ADIJake | 0:85855ecd3257 | 312 | |
ADIJake | 0:85855ecd3257 | 313 | /*! |
Vkadaba | 5:0728bde67bdb | 314 | * @brief Reset the ADMW device. |
ADIJake | 0:85855ecd3257 | 315 | * |
Vkadaba | 5:0728bde67bdb | 316 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 317 | * |
ADIJake | 0:85855ecd3257 | 318 | * @return Status |
Vkadaba | 5:0728bde67bdb | 319 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 320 | * |
Vkadaba | 5:0728bde67bdb | 321 | * @details Trigger a hardware-reset of the ADMW device. |
ADIJake | 0:85855ecd3257 | 322 | * |
ADIJake | 0:85855ecd3257 | 323 | * @note The device may require several seconds before it is ready for use |
Vkadaba | 5:0728bde67bdb | 324 | * again. @ref admw_GetDeviceReadyState may be used to check if |
ADIJake | 0:85855ecd3257 | 325 | * the device is ready. |
ADIJake | 0:85855ecd3257 | 326 | */ |
Vkadaba | 5:0728bde67bdb | 327 | ADMW_RESULT admw_Reset( |
Vkadaba | 5:0728bde67bdb | 328 | ADMW_DEVICE_HANDLE const hDevice); |
ADIJake | 0:85855ecd3257 | 329 | |
ADIJake | 0:85855ecd3257 | 330 | /*! |
ADIJake | 0:85855ecd3257 | 331 | * @brief Check if the device is ready, following power-up or a reset. |
ADIJake | 0:85855ecd3257 | 332 | * |
Vkadaba | 5:0728bde67bdb | 333 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 334 | * @param[out] pbReady Pointer to return true if the device is ready, or false |
ADIJake | 0:85855ecd3257 | 335 | * otherwise |
ADIJake | 0:85855ecd3257 | 336 | * |
ADIJake | 0:85855ecd3257 | 337 | * @return Status |
Vkadaba | 5:0728bde67bdb | 338 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 339 | * |
ADIJake | 0:85855ecd3257 | 340 | * @details This function attempts to read a fixed-value device register via |
ADIJake | 0:85855ecd3257 | 341 | * the communication interface. |
ADIJake | 0:85855ecd3257 | 342 | */ |
Vkadaba | 5:0728bde67bdb | 343 | ADMW_RESULT admw_GetDeviceReadyState( |
Vkadaba | 5:0728bde67bdb | 344 | ADMW_DEVICE_HANDLE const hDevice, |
ADIJake | 0:85855ecd3257 | 345 | bool * const pbReady); |
ADIJake | 0:85855ecd3257 | 346 | |
ADIJake | 0:85855ecd3257 | 347 | /*! |
ADIJake | 0:85855ecd3257 | 348 | * @brief Obtain the product ID from the device. |
ADIJake | 0:85855ecd3257 | 349 | * |
Vkadaba | 5:0728bde67bdb | 350 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 351 | * @param[out] pProductId Pointer to return the product ID value |
ADIJake | 0:85855ecd3257 | 352 | * |
ADIJake | 0:85855ecd3257 | 353 | * @return Status |
Vkadaba | 5:0728bde67bdb | 354 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 355 | * |
ADIJake | 0:85855ecd3257 | 356 | * @details Reads the product ID registers on the device and returns the value. |
ADIJake | 0:85855ecd3257 | 357 | */ |
Vkadaba | 5:0728bde67bdb | 358 | ADMW_RESULT admw_GetProductID( |
Vkadaba | 5:0728bde67bdb | 359 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 5:0728bde67bdb | 360 | ADMW_PRODUCT_ID * const pProductId); |
ADIJake | 0:85855ecd3257 | 361 | |
ADIJake | 0:85855ecd3257 | 362 | /*! |
ADIJake | 0:85855ecd3257 | 363 | * @brief Write full configuration settings to the device registers. |
ADIJake | 0:85855ecd3257 | 364 | * |
Vkadaba | 5:0728bde67bdb | 365 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 366 | * @param[out] pConfig Pointer to the configuration data structure |
ADIJake | 0:85855ecd3257 | 367 | * |
ADIJake | 0:85855ecd3257 | 368 | * @return Status |
Vkadaba | 5:0728bde67bdb | 369 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 370 | * |
ADIJake | 0:85855ecd3257 | 371 | * @details Translates configuration details provided into device-specific |
ADIJake | 0:85855ecd3257 | 372 | * register settings and updates device configuration registers. |
ADIJake | 0:85855ecd3257 | 373 | * |
Vkadaba | 5:0728bde67bdb | 374 | * @note Settings are not applied until admw_ApplyConfigUpdates() is called |
ADIJake | 0:85855ecd3257 | 375 | */ |
Vkadaba | 5:0728bde67bdb | 376 | ADMW_RESULT admw_SetConfig( |
Vkadaba | 5:0728bde67bdb | 377 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 5:0728bde67bdb | 378 | ADMW_CONFIG * const pConfig); |
ADIJake | 0:85855ecd3257 | 379 | |
ADIJake | 0:85855ecd3257 | 380 | /*! |
ADIJake | 0:85855ecd3257 | 381 | * @brief Apply the configuration settings currently stored in device registers |
ADIJake | 0:85855ecd3257 | 382 | * |
Vkadaba | 5:0728bde67bdb | 383 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 384 | * |
ADIJake | 0:85855ecd3257 | 385 | * @return Status |
Vkadaba | 5:0728bde67bdb | 386 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 387 | * |
Vkadaba | 5:0728bde67bdb | 388 | * @details Instructs the ADMW device to reload and apply configuration |
ADIJake | 0:85855ecd3257 | 389 | * from the device configuration registers. Changes to configuration |
ADIJake | 0:85855ecd3257 | 390 | * registers are ignored by the device until this function is called. |
ADIJake | 0:85855ecd3257 | 391 | * |
ADIJake | 0:85855ecd3257 | 392 | * @note No other command must be running when this is called. |
ADIJake | 0:85855ecd3257 | 393 | */ |
Vkadaba | 5:0728bde67bdb | 394 | ADMW_RESULT admw_ApplyConfigUpdates( |
Vkadaba | 5:0728bde67bdb | 395 | ADMW_DEVICE_HANDLE const hDevice); |
ADIJake | 0:85855ecd3257 | 396 | |
ADIJake | 0:85855ecd3257 | 397 | /*! |
ADIJake | 0:85855ecd3257 | 398 | * @brief Store the configuration settings to persistent memory on the device. |
ADIJake | 0:85855ecd3257 | 399 | * |
Vkadaba | 5:0728bde67bdb | 400 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 401 | * @param[in] eSlotId User configuration slot in persistent memory |
ADIJake | 0:85855ecd3257 | 402 | * |
ADIJake | 0:85855ecd3257 | 403 | * @return Status |
Vkadaba | 5:0728bde67bdb | 404 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 405 | * |
Vkadaba | 5:0728bde67bdb | 406 | * @details Instructs the ADMW device to save the current contents of its |
ADIJake | 0:85855ecd3257 | 407 | * device configuration registers to non-volatile memory. |
ADIJake | 0:85855ecd3257 | 408 | * |
ADIJake | 0:85855ecd3257 | 409 | * @note No other command must be running when this is called. |
ADIJake | 0:85855ecd3257 | 410 | * @note Do not power down the device while this command is running. |
ADIJake | 0:85855ecd3257 | 411 | */ |
Vkadaba | 5:0728bde67bdb | 412 | ADMW_RESULT admw_SaveConfig( |
Vkadaba | 5:0728bde67bdb | 413 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 5:0728bde67bdb | 414 | ADMW_USER_CONFIG_SLOT const eSlotId); |
ADIJake | 0:85855ecd3257 | 415 | |
ADIJake | 0:85855ecd3257 | 416 | /*! |
ADIJake | 0:85855ecd3257 | 417 | * @brief Restore configuration settings from persistent memory on the device. |
ADIJake | 0:85855ecd3257 | 418 | * |
Vkadaba | 5:0728bde67bdb | 419 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 420 | * @param[in] eSlotId User configuration slot in persistent memory |
ADIJake | 0:85855ecd3257 | 421 | * |
ADIJake | 0:85855ecd3257 | 422 | * @return Status |
Vkadaba | 5:0728bde67bdb | 423 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 424 | * |
Vkadaba | 5:0728bde67bdb | 425 | * @details Instructs the ADMW device to restore the contents of its |
ADIJake | 0:85855ecd3257 | 426 | * device configuration registers from non-volatile memory. |
ADIJake | 0:85855ecd3257 | 427 | * |
ADIJake | 0:85855ecd3257 | 428 | * @note No other command must be running when this is called. |
ADIJake | 0:85855ecd3257 | 429 | */ |
Vkadaba | 5:0728bde67bdb | 430 | ADMW_RESULT admw_RestoreConfig( |
Vkadaba | 5:0728bde67bdb | 431 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 5:0728bde67bdb | 432 | ADMW_USER_CONFIG_SLOT const eSlotId); |
ADIJake | 0:85855ecd3257 | 433 | |
ADIJake | 0:85855ecd3257 | 434 | /*! |
ADIJake | 0:85855ecd3257 | 435 | * @brief Erases the external flash memory. |
ADIJake | 0:85855ecd3257 | 436 | * |
Vkadaba | 5:0728bde67bdb | 437 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 438 | * |
ADIJake | 0:85855ecd3257 | 439 | * @return Status |
Vkadaba | 5:0728bde67bdb | 440 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 441 | * |
ADIJake | 0:85855ecd3257 | 442 | * @details Sends the bulk erase instruction to the external flash |
ADIJake | 0:85855ecd3257 | 443 | * device. All stored samples are deleted. |
ADIJake | 0:85855ecd3257 | 444 | * It is a blocking operation and takes tens of seconds to |
ADIJake | 0:85855ecd3257 | 445 | * complete. |
ADIJake | 0:85855ecd3257 | 446 | * |
ADIJake | 0:85855ecd3257 | 447 | * @note No other command must be running when this is called. |
ADIJake | 0:85855ecd3257 | 448 | */ |
ADIJake | 0:85855ecd3257 | 449 | |
Vkadaba | 5:0728bde67bdb | 450 | ADMW_RESULT admw_SaveLutData( |
Vkadaba | 5:0728bde67bdb | 451 | ADMW_DEVICE_HANDLE const hDevice); |
ADIJake | 0:85855ecd3257 | 452 | |
ADIJake | 0:85855ecd3257 | 453 | /*! |
ADIJake | 0:85855ecd3257 | 454 | * @brief Restore LUT data from persistent memory on the device. |
ADIJake | 0:85855ecd3257 | 455 | * |
Vkadaba | 5:0728bde67bdb | 456 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 457 | * |
ADIJake | 0:85855ecd3257 | 458 | * @return Status |
Vkadaba | 5:0728bde67bdb | 459 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 460 | * |
Vkadaba | 5:0728bde67bdb | 461 | * @details Instructs the ADMW device to restore the contents of its |
Vkadaba | 5:0728bde67bdb | 462 | * LUT data, previously stored with @ref admw_SaveLutData, from |
ADIJake | 0:85855ecd3257 | 463 | * non-volatile memory. |
ADIJake | 0:85855ecd3257 | 464 | * |
ADIJake | 0:85855ecd3257 | 465 | * @note No other command must be running when this is called. |
ADIJake | 0:85855ecd3257 | 466 | */ |
Vkadaba | 5:0728bde67bdb | 467 | ADMW_RESULT admw_RestoreLutData( |
Vkadaba | 5:0728bde67bdb | 468 | ADMW_DEVICE_HANDLE const hDevice); |
ADIJake | 0:85855ecd3257 | 469 | |
ADIJake | 0:85855ecd3257 | 470 | /*! |
ADIJake | 0:85855ecd3257 | 471 | * @brief Start the measurement cycles on the device. |
ADIJake | 0:85855ecd3257 | 472 | * |
Vkadaba | 5:0728bde67bdb | 473 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 474 | * @param[in] eMeasurementMode Allows a choice of special modes for the |
Vkadaba | 5:0728bde67bdb | 475 | * measurement. See @ref ADMW_MEASUREMENT_MODE |
ADIJake | 0:85855ecd3257 | 476 | * for further information. |
ADIJake | 0:85855ecd3257 | 477 | * |
ADIJake | 0:85855ecd3257 | 478 | * @return Status |
Vkadaba | 5:0728bde67bdb | 479 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 480 | * |
Vkadaba | 5:0728bde67bdb | 481 | * @details Instructs the ADMW device to start executing measurement cycles |
ADIJake | 0:85855ecd3257 | 482 | * according to the current applied configuration settings. The |
ADIJake | 0:85855ecd3257 | 483 | * DATAREADY status signal will be asserted whenever new measurement |
ADIJake | 0:85855ecd3257 | 484 | * data is published, according to selected settings. |
ADIJake | 0:85855ecd3257 | 485 | * Measurement cycles may be stopped by calling @ref |
Vkadaba | 5:0728bde67bdb | 486 | * admw_StopMeasurement. |
ADIJake | 0:85855ecd3257 | 487 | * |
ADIJake | 0:85855ecd3257 | 488 | * @note No other command must be running when this is called. |
ADIJake | 0:85855ecd3257 | 489 | */ |
Vkadaba | 5:0728bde67bdb | 490 | ADMW_RESULT admw_StartMeasurement( |
Vkadaba | 5:0728bde67bdb | 491 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 5:0728bde67bdb | 492 | ADMW_MEASUREMENT_MODE const eMeasurementMode); |
ADIJake | 0:85855ecd3257 | 493 | |
ADIJake | 0:85855ecd3257 | 494 | /*! |
ADIJake | 0:85855ecd3257 | 495 | * @brief Stop the measurement cycles on the device. |
ADIJake | 0:85855ecd3257 | 496 | * |
Vkadaba | 5:0728bde67bdb | 497 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 498 | * |
ADIJake | 0:85855ecd3257 | 499 | * @return Status |
Vkadaba | 5:0728bde67bdb | 500 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 501 | * |
Vkadaba | 5:0728bde67bdb | 502 | * @details Instructs the ADMW device to stop executing measurement cycles. |
ADIJake | 0:85855ecd3257 | 503 | * The command may be delayed until the current conversion, if any, has |
ADIJake | 0:85855ecd3257 | 504 | * been completed and published. |
ADIJake | 0:85855ecd3257 | 505 | * |
ADIJake | 0:85855ecd3257 | 506 | * @note To be used only if a measurement command is currently running. |
ADIJake | 0:85855ecd3257 | 507 | */ |
Vkadaba | 5:0728bde67bdb | 508 | ADMW_RESULT admw_StopMeasurement( |
Vkadaba | 5:0728bde67bdb | 509 | ADMW_DEVICE_HANDLE const hDevice); |
Vkadaba | 63:6d048b2f3f32 | 510 | |
ADIJake | 0:85855ecd3257 | 511 | |
Vkadaba | 5:0728bde67bdb | 512 | ADMW_RESULT admw_GetStatus( |
Vkadaba | 5:0728bde67bdb | 513 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 5:0728bde67bdb | 514 | ADMW_STATUS * const pStatus); |
ADIJake | 0:85855ecd3257 | 515 | |
ADIJake | 0:85855ecd3257 | 516 | /*! |
Vkadaba | 54:31921ad29828 | 517 | * @brief Assemble a list of separate Look-Up Tables into a single buffer |
Vkadaba | 54:31921ad29828 | 518 | * |
Vkadaba | 54:31921ad29828 | 519 | * @param[out] pLutBuffer Pointer to the Look-Up Table data buffer where |
Vkadaba | 54:31921ad29828 | 520 | * the assembled Look-Up Table data will be placed |
Vkadaba | 54:31921ad29828 | 521 | * @param[in] nLutBufferSize Allocated size, in bytes, of the output data buffer |
Vkadaba | 54:31921ad29828 | 522 | * @param[in] nNumTables Number of tables to add to the Look-Up Table buffer |
Vkadaba | 54:31921ad29828 | 523 | * @param[in] ppDesc Array of pointers to the table descriptors to be added |
Vkadaba | 54:31921ad29828 | 524 | * @param[in] ppData Array of pointers to the table data to be added |
Vkadaba | 54:31921ad29828 | 525 | * |
Vkadaba | 54:31921ad29828 | 526 | * @return Status |
Vkadaba | 54:31921ad29828 | 527 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 54:31921ad29828 | 528 | * |
Vkadaba | 54:31921ad29828 | 529 | * @details This utiliity function fills the Look-up Table header fields; then |
Vkadaba | 54:31921ad29828 | 530 | * walks through the array of individual table descriptor and data |
Vkadaba | 54:31921ad29828 | 531 | * pointers provided, appending (copying) each one to the Look-Up Table |
Vkadaba | 54:31921ad29828 | 532 | * data buffer. The length and crc16 fields of each table descriptor |
Vkadaba | 54:31921ad29828 | 533 | * will be calculated and filled by this function, but other fields in |
Vkadaba | 54:31921ad29828 | 534 | * the descriptor structure must be filled by the caller beforehand. |
Vkadaba | 54:31921ad29828 | 535 | * |
Vkadaba | 54:31921ad29828 | 536 | * @note The assembled LUT data buffer filled by this function can then be |
Vkadaba | 54:31921ad29828 | 537 | * written to the device memory using @ref admw1001_SetLutData. |
Vkadaba | 54:31921ad29828 | 538 | */ |
Vkadaba | 54:31921ad29828 | 539 | ADMW_RESULT admw1001_AssembleLutData( |
Vkadaba | 54:31921ad29828 | 540 | ADMW1001_LUT *pLutBuffer, |
Vkadaba | 54:31921ad29828 | 541 | unsigned nLutBufferSize, |
Vkadaba | 54:31921ad29828 | 542 | unsigned const nNumTables, |
Vkadaba | 54:31921ad29828 | 543 | ADMW1001_LUT_DESCRIPTOR *const ppDesc[], |
Vkadaba | 54:31921ad29828 | 544 | ADMW1001_LUT_TABLE_DATA *const ppData[]); |
Vkadaba | 54:31921ad29828 | 545 | |
Vkadaba | 54:31921ad29828 | 546 | /*! |
Vkadaba | 54:31921ad29828 | 547 | * @brief Write Look-Up Table data to the device memory |
Vkadaba | 54:31921ad29828 | 548 | * |
Vkadaba | 54:31921ad29828 | 549 | * @param[in] hDevice ADMW1001 device context handle |
Vkadaba | 54:31921ad29828 | 550 | * @param[out] pLutData Pointer to the Look-Up Table data structure |
Vkadaba | 54:31921ad29828 | 551 | * |
Vkadaba | 54:31921ad29828 | 552 | * @return Status |
Vkadaba | 54:31921ad29828 | 553 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 54:31921ad29828 | 554 | * |
Vkadaba | 54:31921ad29828 | 555 | * @details Validates the Look-Up Table data format and loads it into |
Vkadaba | 54:31921ad29828 | 556 | * device memory via dedicated keyhole registers. |
Vkadaba | 54:31921ad29828 | 557 | * |
Vkadaba | 54:31921ad29828 | 558 | * @note Settings are not applied until admw_ApplyConfigUpdates() is called |
Vkadaba | 54:31921ad29828 | 559 | */ |
Vkadaba | 54:31921ad29828 | 560 | ADMW_RESULT admw1001_SetLutData( |
Vkadaba | 54:31921ad29828 | 561 | ADMW_DEVICE_HANDLE hDevice, |
Vkadaba | 54:31921ad29828 | 562 | ADMW1001_LUT *const pLutData); |
Vkadaba | 54:31921ad29828 | 563 | |
Vkadaba | 54:31921ad29828 | 564 | /*! |
Vkadaba | 54:31921ad29828 | 565 | * @brief Write Look-Up Table raw data to the device memory |
Vkadaba | 54:31921ad29828 | 566 | * |
Vkadaba | 54:31921ad29828 | 567 | * @param[in] hDevice ADMW device context handle |
Vkadaba | 54:31921ad29828 | 568 | * @param[out] pLutData Pointer to the Look-Up Table raw data structure |
Vkadaba | 54:31921ad29828 | 569 | * |
Vkadaba | 54:31921ad29828 | 570 | * @return Status |
Vkadaba | 54:31921ad29828 | 571 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 54:31921ad29828 | 572 | * |
Vkadaba | 54:31921ad29828 | 573 | * @details This can be used instead of @ref admw1001_SetLutData for |
Vkadaba | 54:31921ad29828 | 574 | * loading LUT data from the alternative raw data format. See |
Vkadaba | 54:31921ad29828 | 575 | * @ref admw1001_SetLutData for more information. |
Vkadaba | 54:31921ad29828 | 576 | * |
Vkadaba | 54:31921ad29828 | 577 | * @note Settings are not applied until admw_ApplyConfigUpdates() is called |
Vkadaba | 54:31921ad29828 | 578 | */ |
Vkadaba | 54:31921ad29828 | 579 | ADMW_RESULT admw1001_SetLutDataRaw( |
Vkadaba | 54:31921ad29828 | 580 | ADMW_DEVICE_HANDLE hDevice, |
Vkadaba | 54:31921ad29828 | 581 | ADMW1001_LUT_RAW *const pLutData); |
Vkadaba | 54:31921ad29828 | 582 | /*! |
ADIJake | 0:85855ecd3257 | 583 | * @brief Read measurement data samples from the device registers. |
ADIJake | 0:85855ecd3257 | 584 | * |
Vkadaba | 5:0728bde67bdb | 585 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 586 | * @param[in] eMeasurementMode Must be set to the same value used for @ref |
Vkadaba | 5:0728bde67bdb | 587 | * admw_StartMeasurement(). |
ADIJake | 0:85855ecd3257 | 588 | * @param[out] pSamples Pointer to return a set of requested data samples. |
ADIJake | 0:85855ecd3257 | 589 | * @param[in] nBytesPerSample The size, in bytes, of each sample. |
ADIJake | 0:85855ecd3257 | 590 | * @param[in] nRequested Number of requested data samples. |
ADIJake | 0:85855ecd3257 | 591 | * @param[out] pnReturned Number of valid data samples successfully retrieved. |
ADIJake | 0:85855ecd3257 | 592 | * |
ADIJake | 0:85855ecd3257 | 593 | * @return Status |
Vkadaba | 5:0728bde67bdb | 594 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 595 | * |
ADIJake | 0:85855ecd3257 | 596 | * @details Reads the status registers and extracts the relevant information |
ADIJake | 0:85855ecd3257 | 597 | * to return to the caller. |
ADIJake | 0:85855ecd3257 | 598 | * |
ADIJake | 0:85855ecd3257 | 599 | * @note This is intended to be called only when the DATAREADY status signal |
ADIJake | 0:85855ecd3257 | 600 | * is asserted. |
ADIJake | 0:85855ecd3257 | 601 | */ |
Vkadaba | 5:0728bde67bdb | 602 | ADMW_RESULT admw_GetData( |
Vkadaba | 5:0728bde67bdb | 603 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 5:0728bde67bdb | 604 | ADMW_MEASUREMENT_MODE const eMeasurementMode, |
Vkadaba | 5:0728bde67bdb | 605 | ADMW_DATA_SAMPLE * const pSamples, |
ADIJake | 0:85855ecd3257 | 606 | uint8_t const nBytesPerSample, |
ADIJake | 0:85855ecd3257 | 607 | uint32_t const nRequested, |
ADIJake | 0:85855ecd3257 | 608 | uint32_t * const pnReturned); |
ADIJake | 0:85855ecd3257 | 609 | |
ADIJake | 0:85855ecd3257 | 610 | /*! |
ADIJake | 0:85855ecd3257 | 611 | * @brief Check if a command is currently running on the device. |
ADIJake | 0:85855ecd3257 | 612 | * |
Vkadaba | 5:0728bde67bdb | 613 | * @param[in] hDevice ADMW device context handle |
ADIJake | 0:85855ecd3257 | 614 | * @param[out] pbCommandRunning Pointer to return the command running status |
ADIJake | 0:85855ecd3257 | 615 | * |
ADIJake | 0:85855ecd3257 | 616 | * @return Status |
Vkadaba | 5:0728bde67bdb | 617 | * - #ADMW_SUCCESS Call completed successfully. |
ADIJake | 0:85855ecd3257 | 618 | * |
ADIJake | 0:85855ecd3257 | 619 | * @details Reads the device status register to check if a command is running. |
ADIJake | 0:85855ecd3257 | 620 | */ |
Vkadaba | 5:0728bde67bdb | 621 | ADMW_RESULT admw_GetCommandRunningState( |
Vkadaba | 5:0728bde67bdb | 622 | ADMW_DEVICE_HANDLE hDevice, |
ADIJake | 0:85855ecd3257 | 623 | bool *pbCommandRunning); |
ADIJake | 0:85855ecd3257 | 624 | |
Vkadaba | 32:52445bef314d | 625 | ADMW_RESULT admw1001_sendRun( ADMW_DEVICE_HANDLE const hDevice); |
Vkadaba | 50:d84305e5e1c0 | 626 | ADMW_RESULT admw_deviceInformation(ADMW_DEVICE_HANDLE hDevice); |
Vkadaba | 53:644c5f6300da | 627 | |
ADIJake | 0:85855ecd3257 | 628 | #ifdef __cplusplus |
ADIJake | 0:85855ecd3257 | 629 | } |
ADIJake | 0:85855ecd3257 | 630 | #endif |
ADIJake | 0:85855ecd3257 | 631 | |
ADIJake | 0:85855ecd3257 | 632 | /*! |
ADIJake | 0:85855ecd3257 | 633 | * @} |
ADIJake | 0:85855ecd3257 | 634 | */ |
ADIJake | 0:85855ecd3257 | 635 | |
Vkadaba | 6:9d393a9677f4 | 636 | #endif /* _ADMW_API_H__ */ |