Vybhav Kadaba
/
EV-PRO-MW1001_Development_updateFW
Bumped Mbed FW version to 01.20.0080
inc/admw1001/admw1001_api.h@72:35ea0b4e725b, 2020-04-24 (annotated)
- Committer:
- Vkadaba
- Date:
- Fri Apr 24 06:37:01 2020 +0000
- Revision:
- 72:35ea0b4e725b
- Parent:
- 67:d36977cbfe90
Added admw_SetExtVrefBufferMode functionality:; updated the config files ; Bumped the FW version to 1.20.0080
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Vkadaba | 5:0728bde67bdb | 1 | /* |
Vkadaba | 6:9d393a9677f4 | 2 | Copyright 2019 (c) Analog Devices, Inc. |
Vkadaba | 6:9d393a9677f4 | 3 | |
Vkadaba | 6:9d393a9677f4 | 4 | All rights reserved. |
Vkadaba | 6:9d393a9677f4 | 5 | |
Vkadaba | 6:9d393a9677f4 | 6 | Redistribution and use in source and binary forms, with or without |
Vkadaba | 6:9d393a9677f4 | 7 | modification, are permitted provided that the following conditions are met: |
Vkadaba | 6:9d393a9677f4 | 8 | - Redistributions of source code must retain the above copyright |
Vkadaba | 6:9d393a9677f4 | 9 | notice, this list of conditions and the following disclaimer. |
Vkadaba | 6:9d393a9677f4 | 10 | - Redistributions in binary form must reproduce the above copyright |
Vkadaba | 6:9d393a9677f4 | 11 | notice, this list of conditions and the following disclaimer in |
Vkadaba | 6:9d393a9677f4 | 12 | the documentation and/or other materials provided with the |
Vkadaba | 6:9d393a9677f4 | 13 | distribution. |
Vkadaba | 6:9d393a9677f4 | 14 | - Neither the name of Analog Devices, Inc. nor the names of its |
Vkadaba | 6:9d393a9677f4 | 15 | contributors may be used to endorse or promote products derived |
Vkadaba | 6:9d393a9677f4 | 16 | from this software without specific prior written permission. |
Vkadaba | 6:9d393a9677f4 | 17 | - The use of this software may or may not infringe the patent rights |
Vkadaba | 6:9d393a9677f4 | 18 | of one or more patent holders. This license does not release you |
Vkadaba | 6:9d393a9677f4 | 19 | from the requirement that you obtain separate licenses from these |
Vkadaba | 6:9d393a9677f4 | 20 | patent holders to use this software. |
Vkadaba | 6:9d393a9677f4 | 21 | - Use of the software either in source or binary form, must be run |
Vkadaba | 6:9d393a9677f4 | 22 | on or directly connected to an Analog Devices Inc. component. |
Vkadaba | 6:9d393a9677f4 | 23 | |
Vkadaba | 6:9d393a9677f4 | 24 | THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR |
Vkadaba | 6:9d393a9677f4 | 25 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, |
Vkadaba | 6:9d393a9677f4 | 26 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
Vkadaba | 5:0728bde67bdb | 27 | IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, |
Vkadaba | 5:0728bde67bdb | 28 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
Vkadaba | 5:0728bde67bdb | 29 | LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR |
Vkadaba | 5:0728bde67bdb | 30 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
Vkadaba | 5:0728bde67bdb | 31 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
Vkadaba | 5:0728bde67bdb | 32 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
Vkadaba | 5:0728bde67bdb | 33 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Vkadaba | 6:9d393a9677f4 | 34 | */ |
Vkadaba | 5:0728bde67bdb | 35 | |
Vkadaba | 5:0728bde67bdb | 36 | /*! |
Vkadaba | 5:0728bde67bdb | 37 | ****************************************************************************** |
Vkadaba | 6:9d393a9677f4 | 38 | * @file: admw_1001_api.h |
Vkadaba | 6:9d393a9677f4 | 39 | * @brief: ADMW1001 Host Library Application Programming Interface (API) |
Vkadaba | 5:0728bde67bdb | 40 | *----------------------------------------------------------------------------- |
Vkadaba | 5:0728bde67bdb | 41 | */ |
Vkadaba | 5:0728bde67bdb | 42 | |
Vkadaba | 5:0728bde67bdb | 43 | #ifndef __ADMW1001_API_H__ |
Vkadaba | 5:0728bde67bdb | 44 | #define __ADMW1001_API_H__ |
Vkadaba | 5:0728bde67bdb | 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/admw1001/admw1001_config.h" |
Vkadaba | 5:0728bde67bdb | 50 | #include "inc/admw1001/admw1001_lut_data.h" |
Vkadaba | 5:0728bde67bdb | 51 | |
Vkadaba | 67:d36977cbfe90 | 52 | #define MAXIMUM_MEASUREMENTS_PER_CYCLE 170 |
Vkadaba | 5:0728bde67bdb | 53 | /*! @ingroup ADMW_Api */ |
Vkadaba | 5:0728bde67bdb | 54 | |
Vkadaba | 5:0728bde67bdb | 55 | /*! @defgroup ADMW1001_Api ADMW1001 Host Library API |
Vkadaba | 5:0728bde67bdb | 56 | * ADMW1001 device-specific API function prototypes. |
Vkadaba | 5:0728bde67bdb | 57 | * These are supplementary to the common ADMW Host Library API. |
Vkadaba | 5:0728bde67bdb | 58 | * @{ |
Vkadaba | 5:0728bde67bdb | 59 | */ |
Vkadaba | 5:0728bde67bdb | 60 | |
Vkadaba | 5:0728bde67bdb | 61 | #ifdef __cplusplus |
Vkadaba | 5:0728bde67bdb | 62 | extern "C" { |
Vkadaba | 5:0728bde67bdb | 63 | #endif |
Vkadaba | 5:0728bde67bdb | 64 | |
Vkadaba | 5:0728bde67bdb | 65 | /*! |
Vkadaba | 5:0728bde67bdb | 66 | * @brief Read one or more device registers at the specified register address. |
Vkadaba | 5:0728bde67bdb | 67 | * |
Vkadaba | 5:0728bde67bdb | 68 | * @param[in] hDevice ADMW1001 device context handle |
Vkadaba | 5:0728bde67bdb | 69 | * @param[in] nAddress Register map address to read from |
Vkadaba | 5:0728bde67bdb | 70 | * @param[out] pData Pointer to return the register map data |
Vkadaba | 5:0728bde67bdb | 71 | * @param[in] nLength Number of bytes of data to read from the register map |
Vkadaba | 5:0728bde67bdb | 72 | * |
Vkadaba | 5:0728bde67bdb | 73 | * @return Status |
Vkadaba | 5:0728bde67bdb | 74 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 75 | * |
Vkadaba | 5:0728bde67bdb | 76 | * @details Provides direct byte-level read access to the device register map. |
Vkadaba | 5:0728bde67bdb | 77 | * The size and format of the register(s) must be known. |
Vkadaba | 5:0728bde67bdb | 78 | * |
Vkadaba | 5:0728bde67bdb | 79 | * @note Reads from special "keyhole" or "FIFO" registers will be handled |
Vkadaba | 5:0728bde67bdb | 80 | * according to documentation for those registers. |
Vkadaba | 5:0728bde67bdb | 81 | */ |
Vkadaba | 5:0728bde67bdb | 82 | ADMW_RESULT admw1001_ReadRegister( |
Vkadaba | 8:2f2775c34640 | 83 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 8:2f2775c34640 | 84 | uint16_t const nAddress, |
Vkadaba | 8:2f2775c34640 | 85 | void *const pData, |
Vkadaba | 8:2f2775c34640 | 86 | unsigned const nLength); |
Vkadaba | 6:9d393a9677f4 | 87 | /*! |
Vkadaba | 6:9d393a9677f4 | 88 | * @brief Read one or more device registers at the specified debug register address. |
Vkadaba | 6:9d393a9677f4 | 89 | * |
Vkadaba | 6:9d393a9677f4 | 90 | * @param[in] hDevice ADMW1001 device context handle |
Vkadaba | 6:9d393a9677f4 | 91 | * @param[in] nAddress Register map address to read from |
Vkadaba | 6:9d393a9677f4 | 92 | * @param[out] pData Pointer to return the register map data |
Vkadaba | 6:9d393a9677f4 | 93 | * @param[in] nLength Number of bytes of data to read from the register map |
Vkadaba | 6:9d393a9677f4 | 94 | * |
Vkadaba | 6:9d393a9677f4 | 95 | * @return Status |
Vkadaba | 6:9d393a9677f4 | 96 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 6:9d393a9677f4 | 97 | * |
Vkadaba | 6:9d393a9677f4 | 98 | * @details Provides direct byte-level read access to the device register map. |
Vkadaba | 6:9d393a9677f4 | 99 | * The size and format of the register(s) must be known. |
Vkadaba | 6:9d393a9677f4 | 100 | * |
Vkadaba | 6:9d393a9677f4 | 101 | * @note Reads from special "keyhole" or "FIFO" registers will be handled |
Vkadaba | 6:9d393a9677f4 | 102 | * according to documentation for those registers. |
Vkadaba | 6:9d393a9677f4 | 103 | */ |
Vkadaba | 6:9d393a9677f4 | 104 | ADMW_RESULT admw1001_Read_Debug_Register( |
Vkadaba | 8:2f2775c34640 | 105 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 8:2f2775c34640 | 106 | uint16_t const nAddress, |
Vkadaba | 8:2f2775c34640 | 107 | void *const pData, |
Vkadaba | 8:2f2775c34640 | 108 | unsigned const nLength); |
Vkadaba | 5:0728bde67bdb | 109 | |
Vkadaba | 5:0728bde67bdb | 110 | /*! |
Vkadaba | 5:0728bde67bdb | 111 | * @brief Write one or more device registers at the specified register address. |
Vkadaba | 5:0728bde67bdb | 112 | * |
Vkadaba | 6:9d393a9677f4 | 113 | * @param[in] hDevice ADMW1001 device context handle |
Vkadaba | 5:0728bde67bdb | 114 | * @param[in] nAddress Register map address to read from |
Vkadaba | 5:0728bde67bdb | 115 | * @param[out] pData Pointer to return the register map data |
Vkadaba | 5:0728bde67bdb | 116 | * @param[in] nLength Number of bytes of data to read from the register map |
Vkadaba | 5:0728bde67bdb | 117 | * |
Vkadaba | 5:0728bde67bdb | 118 | * @return Status |
Vkadaba | 5:0728bde67bdb | 119 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 120 | * |
Vkadaba | 5:0728bde67bdb | 121 | * @details Provides direct byte-level write access to the device register map. |
Vkadaba | 5:0728bde67bdb | 122 | * The size and format of the register(s) must be known. |
Vkadaba | 5:0728bde67bdb | 123 | * |
Vkadaba | 5:0728bde67bdb | 124 | * @note Writes to read-only registers will be ignored by the device. |
Vkadaba | 5:0728bde67bdb | 125 | * @note Writes to special "keyhole" registers will be handled according to |
Vkadaba | 5:0728bde67bdb | 126 | * documentation for those registers. |
Vkadaba | 5:0728bde67bdb | 127 | */ |
Vkadaba | 5:0728bde67bdb | 128 | ADMW_RESULT admw1001_WriteRegister( |
Vkadaba | 8:2f2775c34640 | 129 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 8:2f2775c34640 | 130 | uint16_t const nAddress, |
Vkadaba | 8:2f2775c34640 | 131 | void *const pData, |
Vkadaba | 8:2f2775c34640 | 132 | unsigned const nLength); |
Vkadaba | 5:0728bde67bdb | 133 | |
Vkadaba | 5:0728bde67bdb | 134 | /*! |
Vkadaba | 6:9d393a9677f4 | 135 | * @brief Write one or more device registers at the specified debug register address. |
Vkadaba | 6:9d393a9677f4 | 136 | * |
Vkadaba | 6:9d393a9677f4 | 137 | * @param[in] hDevice ADMW1001 device context handle |
Vkadaba | 6:9d393a9677f4 | 138 | * @param[in] nAddress Register map address to read from |
Vkadaba | 6:9d393a9677f4 | 139 | * @param[out] pData Pointer to return the register map data |
Vkadaba | 6:9d393a9677f4 | 140 | * @param[in] nLength Number of bytes of data to read from the register map |
Vkadaba | 6:9d393a9677f4 | 141 | * |
Vkadaba | 6:9d393a9677f4 | 142 | * @return Status |
Vkadaba | 6:9d393a9677f4 | 143 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 6:9d393a9677f4 | 144 | * |
Vkadaba | 6:9d393a9677f4 | 145 | * @details Provides direct byte-level write access to the device register map. |
Vkadaba | 6:9d393a9677f4 | 146 | * The size and format of the register(s) must be known. |
Vkadaba | 6:9d393a9677f4 | 147 | * |
Vkadaba | 6:9d393a9677f4 | 148 | */ |
Vkadaba | 6:9d393a9677f4 | 149 | ADMW_RESULT admw1001_Write_Debug_Register( |
Vkadaba | 8:2f2775c34640 | 150 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 8:2f2775c34640 | 151 | uint16_t const nAddress, |
Vkadaba | 8:2f2775c34640 | 152 | void *const pData, |
Vkadaba | 8:2f2775c34640 | 153 | unsigned const nLength); |
Vkadaba | 6:9d393a9677f4 | 154 | /* |
Vkadaba | 5:0728bde67bdb | 155 | * @brief Update power configuration settings on the device. |
Vkadaba | 5:0728bde67bdb | 156 | * |
Vkadaba | 6:9d393a9677f4 | 157 | * @param[in] hDevice ADMW1001 device context handle |
Vkadaba | 5:0728bde67bdb | 158 | * @param[in] pPowerConfig Power configuration details |
Vkadaba | 5:0728bde67bdb | 159 | * |
Vkadaba | 5:0728bde67bdb | 160 | * @return Status |
Vkadaba | 5:0728bde67bdb | 161 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 162 | * |
Vkadaba | 5:0728bde67bdb | 163 | * @details Translates configuration details provided into device-specific |
Vkadaba | 5:0728bde67bdb | 164 | * register settings and updates device configuration registers. |
Vkadaba | 5:0728bde67bdb | 165 | * |
Vkadaba | 6:9d393a9677f4 | 166 | * @note Settings are not applied until admw_ApplyConfigUpdates() is called |
Vkadaba | 5:0728bde67bdb | 167 | */ |
Vkadaba | 5:0728bde67bdb | 168 | ADMW_RESULT admw1001_SetPowerConfig( |
Vkadaba | 8:2f2775c34640 | 169 | ADMW_DEVICE_HANDLE hDevice, |
Vkadaba | 8:2f2775c34640 | 170 | ADMW1001_POWER_CONFIG *pPowerConfig); |
Vkadaba | 5:0728bde67bdb | 171 | |
Vkadaba | 5:0728bde67bdb | 172 | /*! |
Vkadaba | 5:0728bde67bdb | 173 | * @brief Update measurement configuration settings on the device. |
Vkadaba | 5:0728bde67bdb | 174 | * |
Vkadaba | 6:9d393a9677f4 | 175 | * @param[in] hDevice ADMW1001 device context handle |
Vkadaba | 5:0728bde67bdb | 176 | * @param[in] pMeasurementConfig Measurement configuration details |
Vkadaba | 5:0728bde67bdb | 177 | * |
Vkadaba | 5:0728bde67bdb | 178 | * @return Status |
Vkadaba | 5:0728bde67bdb | 179 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 180 | * |
Vkadaba | 5:0728bde67bdb | 181 | * @details Translates configuration details provided into device-specific |
Vkadaba | 5:0728bde67bdb | 182 | * register settings and updates device configuration registers. |
Vkadaba | 5:0728bde67bdb | 183 | * |
Vkadaba | 6:9d393a9677f4 | 184 | * @note Settings are not applied until admw_ApplyConfigUpdates() is called |
Vkadaba | 5:0728bde67bdb | 185 | */ |
Vkadaba | 5:0728bde67bdb | 186 | ADMW_RESULT admw1001_SetMeasurementConfig( |
Vkadaba | 8:2f2775c34640 | 187 | ADMW_DEVICE_HANDLE hDevice, |
Vkadaba | 5:0728bde67bdb | 188 | ADMW1001_MEASUREMENT_CONFIG *pMeasurementConfig); |
Vkadaba | 5:0728bde67bdb | 189 | |
Vkadaba | 5:0728bde67bdb | 190 | /*! |
Vkadaba | 5:0728bde67bdb | 191 | * @brief Update diagnostics configuration settings on the device. |
Vkadaba | 5:0728bde67bdb | 192 | * |
Vkadaba | 6:9d393a9677f4 | 193 | * @param[in] hDevice ADMW1001 device context handle |
Vkadaba | 5:0728bde67bdb | 194 | * @param[in] pDiagnosticsConfig Diagnostics configuration details |
Vkadaba | 5:0728bde67bdb | 195 | * |
Vkadaba | 5:0728bde67bdb | 196 | * @return Status |
Vkadaba | 5:0728bde67bdb | 197 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 198 | * |
Vkadaba | 5:0728bde67bdb | 199 | * @details Translates configuration details provided into device-specific |
Vkadaba | 5:0728bde67bdb | 200 | * register settings and updates device configuration registers. |
Vkadaba | 5:0728bde67bdb | 201 | * |
Vkadaba | 6:9d393a9677f4 | 202 | * @note Settings are not applied until admw_ApplyConfigUpdates() is called |
Vkadaba | 5:0728bde67bdb | 203 | */ |
Vkadaba | 5:0728bde67bdb | 204 | ADMW_RESULT admw1001_SetDiagnosticsConfig( |
Vkadaba | 8:2f2775c34640 | 205 | ADMW_DEVICE_HANDLE hDevice, |
Vkadaba | 5:0728bde67bdb | 206 | ADMW1001_DIAGNOSTICS_CONFIG *pDiagnosticsConfig); |
Vkadaba | 5:0728bde67bdb | 207 | |
Vkadaba | 5:0728bde67bdb | 208 | /*! |
Vkadaba | 5:0728bde67bdb | 209 | * @brief Update channel configuration settings for a specific channel. |
Vkadaba | 5:0728bde67bdb | 210 | * |
Vkadaba | 6:9d393a9677f4 | 211 | * @param[in] hDevice ADMW1001 device context handle |
Vkadaba | 5:0728bde67bdb | 212 | * @param[in] eChannelId Selects the channel to be updated |
Vkadaba | 5:0728bde67bdb | 213 | * @param[in] pChannelConfig Channel configuration details |
Vkadaba | 5:0728bde67bdb | 214 | * |
Vkadaba | 5:0728bde67bdb | 215 | * @return Status |
Vkadaba | 5:0728bde67bdb | 216 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 217 | * |
Vkadaba | 5:0728bde67bdb | 218 | * @details Translates configuration details provided into device-specific |
Vkadaba | 5:0728bde67bdb | 219 | * register settings and updates device configuration registers. |
Vkadaba | 5:0728bde67bdb | 220 | * Allows individual channel configuration details to be dynamically |
Vkadaba | 5:0728bde67bdb | 221 | * adjusted without rewriting the full device configuration. |
Vkadaba | 5:0728bde67bdb | 222 | * |
Vkadaba | 6:9d393a9677f4 | 223 | * @note Settings are not applied until admw_ApplyConfigUpdates() is called |
Vkadaba | 5:0728bde67bdb | 224 | */ |
Vkadaba | 5:0728bde67bdb | 225 | ADMW_RESULT admw1001_SetChannelConfig( |
Vkadaba | 8:2f2775c34640 | 226 | ADMW_DEVICE_HANDLE hDevice, |
Vkadaba | 8:2f2775c34640 | 227 | ADMW1001_CH_ID eChannelId, |
Vkadaba | 5:0728bde67bdb | 228 | ADMW1001_CHANNEL_CONFIG *pChannelConfig); |
Vkadaba | 5:0728bde67bdb | 229 | |
Vkadaba | 5:0728bde67bdb | 230 | /*! |
Vkadaba | 5:0728bde67bdb | 231 | * @brief Update number of measurements-per-cycle for a specific channel. |
Vkadaba | 5:0728bde67bdb | 232 | * |
Vkadaba | 6:9d393a9677f4 | 233 | * @param[in] hDevice ADMW1001 device context handle |
Vkadaba | 5:0728bde67bdb | 234 | * @param[in] eChannelId Selects the channel to be updated |
Vkadaba | 5:0728bde67bdb | 235 | * @param[in] nMeasurementsPerCycle Specifies the number of measurements to be |
Vkadaba | 5:0728bde67bdb | 236 | * obtained from this channel in each |
Vkadaba | 5:0728bde67bdb | 237 | * measurement cycle. Set as 0 to disable the |
Vkadaba | 5:0728bde67bdb | 238 | * channel (omit from measurement cycle). |
Vkadaba | 5:0728bde67bdb | 239 | * |
Vkadaba | 5:0728bde67bdb | 240 | * @return Status |
Vkadaba | 5:0728bde67bdb | 241 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 242 | * |
Vkadaba | 5:0728bde67bdb | 243 | * @details Translates configuration details provided into device-specific |
Vkadaba | 5:0728bde67bdb | 244 | * register settings and updates device configuration registers. |
Vkadaba | 5:0728bde67bdb | 245 | * Allows individual channels to be dynamically enabled/disabled, and |
Vkadaba | 5:0728bde67bdb | 246 | * measurements-per-cycle to be adjusted. |
Vkadaba | 5:0728bde67bdb | 247 | * |
Vkadaba | 6:9d393a9677f4 | 248 | * @note Settings are not applied until admw_ApplyConfigUpdates() is called |
Vkadaba | 5:0728bde67bdb | 249 | */ |
Vkadaba | 5:0728bde67bdb | 250 | ADMW_RESULT admw1001_SetChannelCount( |
Vkadaba | 8:2f2775c34640 | 251 | ADMW_DEVICE_HANDLE hDevice, |
Vkadaba | 8:2f2775c34640 | 252 | ADMW1001_CH_ID eChannelId, |
Vkadaba | 8:2f2775c34640 | 253 | uint32_t nMeasurementsPerCycle); |
Vkadaba | 5:0728bde67bdb | 254 | |
Vkadaba | 5:0728bde67bdb | 255 | /*! |
Vkadaba | 5:0728bde67bdb | 256 | * @brief Update priority level for a specific channel. |
Vkadaba | 5:0728bde67bdb | 257 | * |
Vkadaba | 6:9d393a9677f4 | 258 | * @param[in] hDevice ADMW1001 device context handle |
Vkadaba | 5:0728bde67bdb | 259 | * @param[in] eChannelId Selects the channel to be updated |
Vkadaba | 5:0728bde67bdb | 260 | * @param[in] ePriority Specifies the channel priority level |
Vkadaba | 5:0728bde67bdb | 261 | * |
Vkadaba | 5:0728bde67bdb | 262 | * @return Status |
Vkadaba | 5:0728bde67bdb | 263 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 264 | * |
Vkadaba | 5:0728bde67bdb | 265 | * @details Translates configuration details provided into device-specific |
Vkadaba | 5:0728bde67bdb | 266 | * register settings and updates device configuration registers. |
Vkadaba | 5:0728bde67bdb | 267 | * Allows individual channels to be dynamically re-prioritised. |
Vkadaba | 5:0728bde67bdb | 268 | * |
Vkadaba | 6:9d393a9677f4 | 269 | * @note Settings are not applied until admw_ApplyConfigUpdates() is called |
Vkadaba | 5:0728bde67bdb | 270 | */ |
Vkadaba | 5:0728bde67bdb | 271 | ADMW_RESULT admw1001_SetChannelPriority( |
Vkadaba | 8:2f2775c34640 | 272 | ADMW_DEVICE_HANDLE hDevice, |
Vkadaba | 8:2f2775c34640 | 273 | ADMW1001_CH_ID eChannelId, |
Vkadaba | 8:2f2775c34640 | 274 | ADMW1001_CHANNEL_PRIORITY ePriority); |
Vkadaba | 5:0728bde67bdb | 275 | |
Vkadaba | 5:0728bde67bdb | 276 | /*! |
Vkadaba | 5:0728bde67bdb | 277 | * @brief Update the measurement threshold limits for a specified channel. |
Vkadaba | 5:0728bde67bdb | 278 | * |
Vkadaba | 6:9d393a9677f4 | 279 | * @param[in] hDevice ADMW1001 device context handle |
Vkadaba | 5:0728bde67bdb | 280 | * @param[in] eChannelId Selects the channel to be updated |
Vkadaba | 5:0728bde67bdb | 281 | * @param[in] fHighThresholdLimit Optional maximum threshold value for each |
Vkadaba | 5:0728bde67bdb | 282 | * processed sample, to be checked prior to |
Vkadaba | 5:0728bde67bdb | 283 | * publishing. A channel ALERT condition is |
Vkadaba | 5:0728bde67bdb | 284 | * raised if the processed value is higher than |
Vkadaba | 5:0728bde67bdb | 285 | * this threshold. Set to NaN if not required. |
Vkadaba | 5:0728bde67bdb | 286 | * @param[in] fLowThresholdLimit Optional minimum threshold value for each |
Vkadaba | 5:0728bde67bdb | 287 | * processed sample, to be checked prior to |
Vkadaba | 5:0728bde67bdb | 288 | * publishing. A channel ALERT condition is |
Vkadaba | 5:0728bde67bdb | 289 | * raised if the processed value is lower than |
Vkadaba | 5:0728bde67bdb | 290 | * this threshold. Set to NaN if not required. |
Vkadaba | 5:0728bde67bdb | 291 | * |
Vkadaba | 5:0728bde67bdb | 292 | * @return Status |
Vkadaba | 5:0728bde67bdb | 293 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 294 | * |
Vkadaba | 5:0728bde67bdb | 295 | * @details Translates configuration details provided into device-specific |
Vkadaba | 5:0728bde67bdb | 296 | * register settings and updates device configuration registers. |
Vkadaba | 5:0728bde67bdb | 297 | * Allows individual channel thresholds to be dynamically adjusted. |
Vkadaba | 5:0728bde67bdb | 298 | * |
Vkadaba | 6:9d393a9677f4 | 299 | * @note Settings are not applied until admw_ApplyConfigUpdates() is called |
Vkadaba | 5:0728bde67bdb | 300 | */ |
Vkadaba | 5:0728bde67bdb | 301 | ADMW_RESULT admw1001_SetChannelThresholdLimits( |
Vkadaba | 8:2f2775c34640 | 302 | ADMW_DEVICE_HANDLE hDevice, |
Vkadaba | 8:2f2775c34640 | 303 | ADMW1001_CH_ID eChannelId, |
Vkadaba | 8:2f2775c34640 | 304 | float32_t fHighThresholdLimit, |
Vkadaba | 8:2f2775c34640 | 305 | float32_t fLowThresholdLimit); |
Vkadaba | 5:0728bde67bdb | 306 | |
Vkadaba | 5:0728bde67bdb | 307 | |
Vkadaba | 5:0728bde67bdb | 308 | /*! |
Vkadaba | 5:0728bde67bdb | 309 | * @brief Set a sensor specific parameter for a specified channel. |
Vkadaba | 5:0728bde67bdb | 310 | * |
Vkadaba | 6:9d393a9677f4 | 311 | * @param[in] hDevice ADMW1001 device context handle |
Vkadaba | 5:0728bde67bdb | 312 | * @param[in] eChannelId Selects the channel to be updated |
Vkadaba | 5:0728bde67bdb | 313 | * @param[in] fSensorParam Sensor specific parameter |
Vkadaba | 5:0728bde67bdb | 314 | * |
Vkadaba | 5:0728bde67bdb | 315 | * @return Status |
Vkadaba | 5:0728bde67bdb | 316 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 317 | * |
Vkadaba | 5:0728bde67bdb | 318 | * @details Translates configuration details provided into device-specific |
Vkadaba | 5:0728bde67bdb | 319 | * register settings and updates device configuration registers. |
Vkadaba | 5:0728bde67bdb | 320 | * Allows optional sensor-specific parameter to be specified |
Vkadaba | 5:0728bde67bdb | 321 | * |
Vkadaba | 6:9d393a9677f4 | 322 | * @note Settings are not applied until admw_ApplyConfigUpdates() is called |
Vkadaba | 5:0728bde67bdb | 323 | */ |
Vkadaba | 5:0728bde67bdb | 324 | ADMW_RESULT admw1001_SetSensorParameter( |
Vkadaba | 8:2f2775c34640 | 325 | ADMW_DEVICE_HANDLE hDevice, |
Vkadaba | 8:2f2775c34640 | 326 | ADMW1001_CH_ID eChannelId, |
Vkadaba | 8:2f2775c34640 | 327 | float32_t fSensorParam); |
Vkadaba | 5:0728bde67bdb | 328 | /*! |
Vkadaba | 5:0728bde67bdb | 329 | * @brief Update the extra settling time for a specified channel. |
Vkadaba | 5:0728bde67bdb | 330 | * |
Vkadaba | 6:9d393a9677f4 | 331 | * @param[in] hDevice ADMW1001 device context handle |
Vkadaba | 5:0728bde67bdb | 332 | * @param[in] eChannelId Selects the channel to be updated |
Vkadaba | 5:0728bde67bdb | 333 | * @param[in] nSettlingTime A minimum settling time is applied internally for |
Vkadaba | 5:0728bde67bdb | 334 | * each channel, based on the sensor type. However, |
Vkadaba | 5:0728bde67bdb | 335 | * additional settling time (microseconds) can |
Vkadaba | 5:0728bde67bdb | 336 | * optionally be specified here. Set to 0 if not |
Vkadaba | 5:0728bde67bdb | 337 | * required. |
Vkadaba | 5:0728bde67bdb | 338 | * |
Vkadaba | 5:0728bde67bdb | 339 | * @return Status |
Vkadaba | 5:0728bde67bdb | 340 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 341 | * |
Vkadaba | 5:0728bde67bdb | 342 | * @details Translates configuration details provided into device-specific |
Vkadaba | 5:0728bde67bdb | 343 | * register settings and updates device configuration registers. |
Vkadaba | 5:0728bde67bdb | 344 | * Allows individual channel settling times to be dynamically adjusted. |
Vkadaba | 5:0728bde67bdb | 345 | * |
Vkadaba | 6:9d393a9677f4 | 346 | * @note Settings are not applied until admw_ApplyConfigUpdates() is called |
Vkadaba | 5:0728bde67bdb | 347 | */ |
Vkadaba | 5:0728bde67bdb | 348 | ADMW_RESULT admw1001_SetChannelSettlingTime( |
Vkadaba | 8:2f2775c34640 | 349 | ADMW_DEVICE_HANDLE hDevice, |
Vkadaba | 8:2f2775c34640 | 350 | ADMW1001_CH_ID eChannelId, |
Vkadaba | 8:2f2775c34640 | 351 | uint32_t nSettlingTime); |
Vkadaba | 5:0728bde67bdb | 352 | |
Vkadaba | 5:0728bde67bdb | 353 | #ifdef __V2_3_CFG_FMT__ |
Vkadaba | 5:0728bde67bdb | 354 | /*! |
Vkadaba | 5:0728bde67bdb | 355 | * @brief Enable access to advanced sensor configuration options. |
Vkadaba | 5:0728bde67bdb | 356 | * |
Vkadaba | 6:9d393a9677f4 | 357 | * @param[in] hDevice ADMW1001 device context handle |
Vkadaba | 5:0728bde67bdb | 358 | * @param[in] key Key to unlock advanced access |
Vkadaba | 5:0728bde67bdb | 359 | * |
Vkadaba | 5:0728bde67bdb | 360 | * @return Status |
Vkadaba | 5:0728bde67bdb | 361 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 362 | * |
Vkadaba | 5:0728bde67bdb | 363 | * @details When the correct access key is provided, access to advanced sensor |
Vkadaba | 5:0728bde67bdb | 364 | * configuration options and use of advanced sensor types is enabled. |
Vkadaba | 5:0728bde67bdb | 365 | * |
Vkadaba | 6:9d393a9677f4 | 366 | * @note Settings are not applied until admw_ApplyConfigUpdates() is called |
Vkadaba | 5:0728bde67bdb | 367 | */ |
Vkadaba | 5:0728bde67bdb | 368 | ADMW_RESULT admw1001_SetAdvancedAccess( |
Vkadaba | 8:2f2775c34640 | 369 | ADMW_DEVICE_HANDLE hDevice, |
Vkadaba | 8:2f2775c34640 | 370 | ADMW1001_ADVANCED_ACCESS_KEY key); |
Vkadaba | 5:0728bde67bdb | 371 | #endif |
Vkadaba | 5:0728bde67bdb | 372 | |
Vkadaba | 5:0728bde67bdb | 373 | /*! |
Vkadaba | 5:0728bde67bdb | 374 | * @brief Assemble a list of separate Look-Up Tables into a single buffer |
Vkadaba | 5:0728bde67bdb | 375 | * |
Vkadaba | 5:0728bde67bdb | 376 | * @param[out] pLutBuffer Pointer to the Look-Up Table data buffer where |
Vkadaba | 5:0728bde67bdb | 377 | * the assembled Look-Up Table data will be placed |
Vkadaba | 5:0728bde67bdb | 378 | * @param[in] nLutBufferSize Allocated size, in bytes, of the output data buffer |
Vkadaba | 5:0728bde67bdb | 379 | * @param[in] nNumTables Number of tables to add to the Look-Up Table buffer |
Vkadaba | 5:0728bde67bdb | 380 | * @param[in] ppDesc Array of pointers to the table descriptors to be added |
Vkadaba | 5:0728bde67bdb | 381 | * @param[in] ppData Array of pointers to the table data to be added |
Vkadaba | 5:0728bde67bdb | 382 | * |
Vkadaba | 5:0728bde67bdb | 383 | * @return Status |
Vkadaba | 5:0728bde67bdb | 384 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 385 | * |
Vkadaba | 5:0728bde67bdb | 386 | * @details This utiliity function fills the Look-up Table header fields; then |
Vkadaba | 5:0728bde67bdb | 387 | * walks through the array of individual table descriptor and data |
Vkadaba | 5:0728bde67bdb | 388 | * pointers provided, appending (copying) each one to the Look-Up Table |
Vkadaba | 5:0728bde67bdb | 389 | * data buffer. The length and crc16 fields of each table descriptor |
Vkadaba | 5:0728bde67bdb | 390 | * will be calculated and filled by this function, but other fields in |
Vkadaba | 5:0728bde67bdb | 391 | * the descriptor structure must be filled by the caller beforehand. |
Vkadaba | 5:0728bde67bdb | 392 | * |
Vkadaba | 5:0728bde67bdb | 393 | * @note The assembled LUT data buffer filled by this function can then be |
Vkadaba | 5:0728bde67bdb | 394 | * written to the device memory using @ref admw1001_SetLutData. |
Vkadaba | 5:0728bde67bdb | 395 | */ |
Vkadaba | 5:0728bde67bdb | 396 | ADMW_RESULT admw1001_AssembleLutData( |
Vkadaba | 8:2f2775c34640 | 397 | ADMW1001_LUT *pLutBuffer, |
Vkadaba | 8:2f2775c34640 | 398 | unsigned nLutBufferSize, |
Vkadaba | 8:2f2775c34640 | 399 | unsigned const nNumTables, |
Vkadaba | 8:2f2775c34640 | 400 | ADMW1001_LUT_DESCRIPTOR *const ppDesc[], |
Vkadaba | 8:2f2775c34640 | 401 | ADMW1001_LUT_TABLE_DATA *const ppData[]); |
Vkadaba | 5:0728bde67bdb | 402 | |
Vkadaba | 5:0728bde67bdb | 403 | /*! |
Vkadaba | 5:0728bde67bdb | 404 | * @brief Write Look-Up Table data to the device memory |
Vkadaba | 5:0728bde67bdb | 405 | * |
Vkadaba | 6:9d393a9677f4 | 406 | * @param[in] hDevice ADMW1001 device context handle |
Vkadaba | 5:0728bde67bdb | 407 | * @param[out] pLutData Pointer to the Look-Up Table data structure |
Vkadaba | 5:0728bde67bdb | 408 | * |
Vkadaba | 5:0728bde67bdb | 409 | * @return Status |
Vkadaba | 5:0728bde67bdb | 410 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 411 | * |
Vkadaba | 5:0728bde67bdb | 412 | * @details Validates the Look-Up Table data format and loads it into |
Vkadaba | 5:0728bde67bdb | 413 | * device memory via dedicated keyhole registers. |
Vkadaba | 5:0728bde67bdb | 414 | * |
Vkadaba | 6:9d393a9677f4 | 415 | * @note Settings are not applied until admw_ApplyConfigUpdates() is called |
Vkadaba | 5:0728bde67bdb | 416 | */ |
Vkadaba | 5:0728bde67bdb | 417 | ADMW_RESULT admw1001_SetLutData( |
Vkadaba | 8:2f2775c34640 | 418 | ADMW_DEVICE_HANDLE hDevice, |
Vkadaba | 8:2f2775c34640 | 419 | ADMW1001_LUT *const pLutData); |
Vkadaba | 5:0728bde67bdb | 420 | |
Vkadaba | 5:0728bde67bdb | 421 | /*! |
Vkadaba | 5:0728bde67bdb | 422 | * @brief Write Look-Up Table raw data to the device memory |
Vkadaba | 5:0728bde67bdb | 423 | * |
Vkadaba | 6:9d393a9677f4 | 424 | * @param[in] hDevice ADMW device context handle |
Vkadaba | 5:0728bde67bdb | 425 | * @param[out] pLutData Pointer to the Look-Up Table raw data structure |
Vkadaba | 5:0728bde67bdb | 426 | * |
Vkadaba | 5:0728bde67bdb | 427 | * @return Status |
Vkadaba | 5:0728bde67bdb | 428 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 429 | * |
Vkadaba | 5:0728bde67bdb | 430 | * @details This can be used instead of @ref admw1001_SetLutData for |
Vkadaba | 5:0728bde67bdb | 431 | * loading LUT data from the alternative raw data format. See |
Vkadaba | 5:0728bde67bdb | 432 | * @ref admw1001_SetLutData for more information. |
Vkadaba | 5:0728bde67bdb | 433 | * |
Vkadaba | 6:9d393a9677f4 | 434 | * @note Settings are not applied until admw_ApplyConfigUpdates() is called |
Vkadaba | 5:0728bde67bdb | 435 | */ |
Vkadaba | 5:0728bde67bdb | 436 | ADMW_RESULT admw1001_SetLutDataRaw( |
Vkadaba | 8:2f2775c34640 | 437 | ADMW_DEVICE_HANDLE hDevice, |
Vkadaba | 8:2f2775c34640 | 438 | ADMW1001_LUT_RAW *const pLutData); |
Vkadaba | 5:0728bde67bdb | 439 | |
Vkadaba | 5:0728bde67bdb | 440 | /*! |
Vkadaba | 5:0728bde67bdb | 441 | * @brief Get the number of samples available when DATAREADY status is asserted. |
Vkadaba | 5:0728bde67bdb | 442 | * |
Vkadaba | 6:9d393a9677f4 | 443 | * @param[in] hDevice ADMW device context handle |
Vkadaba | 5:0728bde67bdb | 444 | * @param[in] eMeasurementMode Must be set to the same value used for @ref |
Vkadaba | 6:9d393a9677f4 | 445 | * admw_StartMeasurement(). |
Vkadaba | 5:0728bde67bdb | 446 | * @param[out] peOperatingMode Pointer to return the configured operating mode |
Vkadaba | 5:0728bde67bdb | 447 | * @param[out] peDataReadyMode Pointer to return the configured data publishing mode |
Vkadaba | 5:0728bde67bdb | 448 | * @param[out] pnSamplesPerDataready Pointer to return the calculated number of samples |
Vkadaba | 5:0728bde67bdb | 449 | * available when DATAREADY is asserted |
Vkadaba | 5:0728bde67bdb | 450 | * @param[out] pnSamplesPerCycle Pointer to return the calculated number of samples |
Vkadaba | 5:0728bde67bdb | 451 | * produced per measurement cycle |
Vkadaba | 5:0728bde67bdb | 452 | * @param[out] pnBytesPerSample Pointer to return the size, in bytes, of each sample |
Vkadaba | 5:0728bde67bdb | 453 | * |
Vkadaba | 5:0728bde67bdb | 454 | * @return Status |
Vkadaba | 5:0728bde67bdb | 455 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 456 | * |
Vkadaba | 5:0728bde67bdb | 457 | * @details Examines the current configuration settings in the device registers |
Vkadaba | 5:0728bde67bdb | 458 | * to calculate the number of samples available whenever the DATAREADY |
Vkadaba | 5:0728bde67bdb | 459 | * signal is asserted, along with other related information. This may |
Vkadaba | 5:0728bde67bdb | 460 | * be used to allocate buffers to store samples and to determine how |
Vkadaba | 5:0728bde67bdb | 461 | * many samples to retrieve whenever the DATAREADY status is asserted. |
Vkadaba | 5:0728bde67bdb | 462 | */ |
Vkadaba | 5:0728bde67bdb | 463 | ADMW_RESULT admw1001_GetDataReadyModeInfo( |
Vkadaba | 8:2f2775c34640 | 464 | ADMW_DEVICE_HANDLE const hDevice, |
Vkadaba | 8:2f2775c34640 | 465 | ADMW_MEASUREMENT_MODE const eMeasurementMode, |
Vkadaba | 8:2f2775c34640 | 466 | ADMW1001_OPERATING_MODE *const peOperatingMode, |
Vkadaba | 8:2f2775c34640 | 467 | ADMW1001_DATAREADY_MODE *const peDataReadyMode, |
Vkadaba | 8:2f2775c34640 | 468 | uint32_t *const pnSamplesPerDataready, |
Vkadaba | 8:2f2775c34640 | 469 | uint32_t *const pnSamplesPerCycle, |
Vkadaba | 8:2f2775c34640 | 470 | uint8_t *const pnBytesPerSample); |
Vkadaba | 5:0728bde67bdb | 471 | |
Vkadaba | 5:0728bde67bdb | 472 | #ifdef __cplusplus |
Vkadaba | 5:0728bde67bdb | 473 | } |
Vkadaba | 5:0728bde67bdb | 474 | #endif |
Vkadaba | 5:0728bde67bdb | 475 | |
Vkadaba | 5:0728bde67bdb | 476 | /*! |
Vkadaba | 5:0728bde67bdb | 477 | * @} |
Vkadaba | 5:0728bde67bdb | 478 | */ |
Vkadaba | 5:0728bde67bdb | 479 | |
Vkadaba | 8:2f2775c34640 | 480 | #endif /* __ADMW1001_API_H__ */ |