![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Host API Example for the ADMW1001
ADMW1001 Host Library API
[ADMW Host Library API]
Detailed Description
ADMW1001 device-specific API function prototypes. These are supplementary to the common ADMW Host Library API.
Enumeration Type Documentation
ADMW1001 analog sensor excitation current output level options
- Note:
- applicable only to ADC analog sensor channels, and specific sensor types
- Enumerator:
Definition at line 237 of file admw1001_config.h.
ADMW1001 analog sensor excitation current ratios used for diode sensor
- Note:
- applicable only to a diode sensor
- Enumerator:
Definition at line 260 of file admw1001_config.h.
ADMW1001 analog sensor excitation state options
- Note:
- applicable only to ADC analog sensor channels, and specific sensor types
- Enumerator:
Definition at line 221 of file admw1001_config.h.
ADMW1001 analog filter selection options
- Note:
- applicable only to ADC analog sensor channels
- Enumerator:
ADMW1001_ADC_FILTER_SINC4 SINC4 - 4th order sinc response filter
ADMW1001_ADC_FILTER_SINC3 SINC3 - 3rd order sinc response filter
Definition at line 333 of file admw1001_config.h.
enum ADMW1001_ADC_GAIN |
ADMW1001 analog input signal amplification gain options
- Note:
- applicable only to ADC analog sensor channels
- Enumerator:
Definition at line 195 of file admw1001_config.h.
enum ADMW1001_ADC_GND_SW |
ADMW1001 ADC Reference configuration
- Note:
- applicable only to ADC analog sensor channels
- Enumerator:
ADMW1001_ADC_GND_SW_OPEN Ground switch not enabled for measurement.
ADMW1001_ADC_GND_SW_CLOSED Ground switch enabled for measurement.
Definition at line 303 of file admw1001_config.h.
ADMW1001 analog reference selection options
- Note:
- applicable only to ADC analog sensor channels, and specific sensor types
- Enumerator:
Definition at line 286 of file admw1001_config.h.
ADMW1001 analog input signal amplification gain options
- Note:
- applicable only to ADC analog sensor channels
- Enumerator:
Definition at line 179 of file admw1001_config.h.
ADMW1001 analog sensor type options
Select the sensor type that is connected to an ADC analog measurement channel.
- Note:
- Some channels may only support a subset of the available sensor types below.
- Enumerator:
Definition at line 103 of file admw1001_sensor_types.h.
enum ADMW1001_CH_ID |
ADMW1001 measurement channel identifiers
- Enumerator:
Definition at line 55 of file admw1001_sensor_types.h.
ADMW1001 channel priority options
Definition at line 61 of file admw1001_config.h.
enum ADMW1001_CHOP_MD |
ADMW1001 analog filter chop mode
- Note:
- applicable only to ADC analog sensor channels
- Enumerator:
Definition at line 316 of file admw1001_config.h.
ADMW1001 data ready mode options
- Enumerator:
ADMW1001_DATAREADY_PER_CONVERSION The DATAREADY signal is asserted after completion of each conversion
- a single data sample only from the latest completed conversion is stored in this mode
ADMW1001_DATAREADY_PER_CYCLE The DATAREADY signal is asserted after completion of each measurement cycle
- data samples only from the lastest completed measurement cycle are stored in this mode
ADMW1001_DATAREADY_PER_FIFO_FILL The DATAREADY signal is asserted after each fill of the data FIFO
- applicable only when ADMW1001_OPERATING_MODE_CONTINUOUS or ADMW1001_OPERATING_MODE_MULTICYCLE is also selected
Definition at line 95 of file admw1001_config.h.
ADMW1001 I2C clock speed options
- Note:
- applicable only for I2C sensors
- Enumerator:
ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED_100K 100kHz I2C clock speed
ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED_400K 400kHz I2C clock speed
Definition at line 375 of file admw1001_config.h.
ADMW1001 SPI clock speed options
- Note:
- applicable only for SPI sensors
- Enumerator:
Definition at line 405 of file admw1001_config.h.
ADMW1001 SPI mode options
- Note:
- applicable only for SPI sensors
- Enumerator:
Definition at line 388 of file admw1001_config.h.
ADMW1001 digital sensor data encoding
- Note:
- applicable only to SPI and I2C digital sensor channels
- Enumerator:
Definition at line 587 of file admw1001_config.h.
ADMW1001 measurement analog filter settling options
- Enumerator:
Definition at line 127 of file admw1001_config.h.
ADMW1001 I2C digital sensor type options
Select the sensor type that is connected to an I2C digital measurement channel.
- Note:
- These are pre-defined sensors using built-in linearisation data
- Enumerator:
Definition at line 411 of file admw1001_sensor_types.h.
Linearisation data vector format
- Enumerator:
Definition at line 123 of file admw1001_lut_data.h.
Linearisation equation type
- Enumerator:
Definition at line 85 of file admw1001_lut_data.h.
Linearisation look-up table / co-efficient list geometry
- Enumerator:
Definition at line 69 of file admw1001_lut_data.h.
enum ADMW1001_LUT_SELECT |
ADMW1001 look-up table selection Select table used to linearise the measurement.
- Enumerator:
ADMW1001_LUT_DEFAULT Default LUT
ADMW1001_LUT_UNITY Unity LUT
ADMW1001_LUT_CUSTOM User defined custom LUT
ADMW1001_LUT_RESERVED Reserved for future use
Definition at line 570 of file admw1001_config.h.
- Enumerator:
Definition at line 112 of file admw1001_lut_data.h.
ADMW1001 measurement unit options
Optionally select a measurement unit for final conversion results. Currently applicable only to specific temperature sensor types.
- Enumerator:
Definition at line 141 of file admw1001_config.h.
ADMW1001 Open-Sensor Diagnostics frequency
Select the per-cycle frequency at which open-sensor diagnostic checks should be performed. Open-sensor diagnostic checks typically require specific or time-consuming processing which cannot be executed while a measurement cycle is running.
- Note:
- Open-sensor diagnostic checks, when performed, will add a delay to the start of the next measurement cycle.
- Enumerator:
Definition at line 162 of file admw1001_config.h.
ADMW1001 operating mode options
- Enumerator:
Definition at line 83 of file admw1001_config.h.
enum ADMW1001_POWER_MODE |
ADMW1001 power mode options
- Enumerator:
Definition at line 117 of file admw1001_config.h.
ADMW1001 Sinc Filter range (SF)
- Note:
- applicable only to ADC analog sensor channels
- SF must be set in conjunction with chop mode and sinc filter type to achieve the desired sampling rate.
- Enumerator:
Definition at line 348 of file admw1001_config.h.
ADMW1001 SPI digital sensor type options
Select the sensor type that is connected to an SPI digital measurement channel.
- Note:
- These are pre-defined sensors using built-in linearisation data
- Enumerator:
Definition at line 480 of file admw1001_sensor_types.h.
Function Documentation
struct __attribute__ | ( | (packed, aligned(4)) | ) | [read, write] |
Struct for a list of coefficients to be used in an equation
Struct for a 1-dimensional equally-spaced look-up table
Struct for a 1-dimensional not-equally-spaced look-up table
Struct for a 2-dimensional equally-spaced look-up table
Struct for a 2-dimensional not-equally-spaced look-up table
Struct for a 2-dimensional list of coefficients to be used in a bi-variate polynomial equation
Look-Up Table descriptor
Look-Up Table structure
LUT data format versions
LUT data header structure
LUT data top-level structure
Alternative top-level structure for raw LUT data representation
- Note:
- This is intended to be used for encapsulating the storage of static LUT data declarations in C files. The rawTableData can be cast to the ADMW_LUT type for further parsing/processing.
< number of coefficients
< look-up table range - minimum
< look-up table range - maximum
< C99 flexible array: sorted by ascending exponent in polynomials
< number of elements.
< initial input value, corresponding to first table element
< interval between successive input values
< C99 flexible array
< number of elements of each array.
< C99 flexible array, first X's array then Y's array
< number of elements for input X.
< number of elements for input Y.
< initial X input value
< interval between successive X input values
< initial Y input value
< interval between successive Y input values
< C99 flexible array, Z matrix[y][x]
< number of elements in array X.
< number of elements in array Y.
< C99 flexible array, Order: X's array, Y's array, Z matrix[y][x]
< number of coefficients
< look-up table range - minimum X input value
< look-up table range - maximum X input value
< look-up table range - minimum Y input value
< look-up table range - maximum Y input value
< C99 flexible array: sorted by ascending X degree then sorted by ascending Y exponent
< ADMW1001_LUT_GEOMETRY
< ADMW1001_LUT_EQUATION
< ADMW1001_LUT_TC_DIRECTION
< ADMW1001_ADC_SENSOR_TYPE
< ADMW1001_LUT_DATA_TYPE
< Length (bytes) of table data section (excl. this header)
< CRC-16-CCITT of the data
< Look-Up Table descriptor
< Look-Up Table data
< Major version number
< Minor version number
< Hard-coded signature value (ADMW_LUT_SIGNATURE)
< LUT data format version (ADMW_LUT_VERSION)
< Total number of tables
< Total length (in bytes) of all table descriptors and data (excluding this header) This, plus the header length, must not exceed ADMW_LUT_MAX_SIZE
< LUT data top-level header structure
< Variable-length array of one-or-more look-up table structures
< LUT data top-level header structure
< Variable-length byte array of look-up tables in raw binary format
Definition at line 133 of file admw1001_lut_data.h.
ADMW_RESULT admw1001_AssembleLutData | ( | ADMW1001_LUT * | pLutBuffer, |
unsigned | nLutBufferSize, | ||
unsigned const | nNumTables, | ||
ADMW1001_LUT_DESCRIPTOR *const | ppDesc[], | ||
ADMW1001_LUT_TABLE_DATA *const | ppData[] | ||
) |
Assemble a list of separate Look-Up Tables into a single buffer.
- Parameters:
-
[out] pLutBuffer Pointer to the Look-Up Table data buffer where the assembled Look-Up Table data will be placed [in] nLutBufferSize Allocated size, in bytes, of the output data buffer [in] nNumTables Number of tables to add to the Look-Up Table buffer [in] ppDesc Array of pointers to the table descriptors to be added [in] ppData Array of pointers to the table data to be added
- Returns:
- Status
- ADMW_SUCCESS Call completed successfully.
This utiliity function fills the Look-up Table header fields; then walks through the array of individual table descriptor and data pointers provided, appending (copying) each one to the Look-Up Table data buffer. The length and crc16 fields of each table descriptor will be calculated and filled by this function, but other fields in the descriptor structure must be filled by the caller beforehand.
- Note:
- The assembled LUT data buffer filled by this function can then be written to the device memory using admw1001_SetLutData.
Definition at line 2464 of file admw_1001.c.
ADMW_RESULT admw1001_GetDataReadyModeInfo | ( | ADMW_DEVICE_HANDLE const | hDevice, |
ADMW_MEASUREMENT_MODE const | eMeasurementMode, | ||
ADMW1001_OPERATING_MODE *const | peOperatingMode, | ||
ADMW1001_DATAREADY_MODE *const | peDataReadyMode, | ||
uint32_t *const | pnSamplesPerDataready, | ||
uint32_t *const | pnSamplesPerCycle, | ||
uint8_t *const | pnBytesPerSample | ||
) |
Get the number of samples available when DATAREADY status is asserted.
- Parameters:
-
[in] hDevice ADMW device context handle [in] eMeasurementMode Must be set to the same value used for admw_StartMeasurement(). [out] peOperatingMode Pointer to return the configured operating mode [out] peDataReadyMode Pointer to return the configured data publishing mode [out] pnSamplesPerDataready Pointer to return the calculated number of samples available when DATAREADY is asserted [out] pnSamplesPerCycle Pointer to return the calculated number of samples produced per measurement cycle [out] pnBytesPerSample Pointer to return the size, in bytes, of each sample
- Returns:
- Status
- ADMW_SUCCESS Call completed successfully.
Examines the current configuration settings in the device registers to calculate the number of samples available whenever the DATAREADY signal is asserted, along with other related information. This may be used to allocate buffers to store samples and to determine how many samples to retrieve whenever the DATAREADY status is asserted.
Definition at line 856 of file admw_1001.c.
ADMW_RESULT admw1001_Read_Debug_Register | ( | ADMW_DEVICE_HANDLE const | hDevice, |
uint16_t const | nAddress, | ||
void *const | pData, | ||
unsigned const | nLength | ||
) |
Read one or more device registers at the specified debug register address.
- Parameters:
-
[in] hDevice ADMW1001 device context handle [in] nAddress Register map address to read from [out] pData Pointer to return the register map data [in] nLength Number of bytes of data to read from the register map
- Returns:
- Status
- ADMW_SUCCESS Call completed successfully.
Provides direct byte-level read access to the device register map. The size and format of the register(s) must be known.
- Note:
- Reads from special "keyhole" or "FIFO" registers will be handled according to documentation for those registers.
Definition at line 803 of file admw_1001.c.
ADMW_RESULT admw1001_ReadRegister | ( | ADMW_DEVICE_HANDLE const | hDevice, |
uint16_t const | nAddress, | ||
void *const | pData, | ||
unsigned const | nLength | ||
) |
Read one or more device registers at the specified register address.
- Parameters:
-
[in] hDevice ADMW1001 device context handle [in] nAddress Register map address to read from [out] pData Pointer to return the register map data [in] nLength Number of bytes of data to read from the register map
- Returns:
- Status
- ADMW_SUCCESS Call completed successfully.
Provides direct byte-level read access to the device register map. The size and format of the register(s) must be known.
- Note:
- Reads from special "keyhole" or "FIFO" registers will be handled according to documentation for those registers.
Definition at line 762 of file admw_1001.c.
ADMW_RESULT admw1001_SetAdvancedAccess | ( | ADMW_DEVICE_HANDLE | hDevice, |
ADMW1001_ADVANCED_ACCESS_KEY | key | ||
) |
Enable access to advanced sensor configuration options.
- Parameters:
-
[in] hDevice ADMW1001 device context handle [in] key Key to unlock advanced access
- Returns:
- Status
- ADMW_SUCCESS Call completed successfully.
When the correct access key is provided, access to advanced sensor configuration options and use of advanced sensor types is enabled.
- Note:
- Settings are not applied until admw_ApplyConfigUpdates() is called
ADMW_RESULT admw1001_SetChannelConfig | ( | ADMW_DEVICE_HANDLE | hDevice, |
ADMW1001_CH_ID | eChannelId, | ||
ADMW1001_CHANNEL_CONFIG * | pChannelConfig | ||
) |
Update channel configuration settings for a specific channel.
- Parameters:
-
[in] hDevice ADMW1001 device context handle [in] eChannelId Selects the channel to be updated [in] pChannelConfig Channel configuration details
- Returns:
- Status
- ADMW_SUCCESS Call completed successfully.
Translates configuration details provided into device-specific register settings and updates device configuration registers. Allows individual channel configuration details to be dynamically adjusted without rewriting the full device configuration.
- Note:
- Settings are not applied until admw_ApplyConfigUpdates() is called
Definition at line 2163 of file admw_1001.c.
ADMW_RESULT admw1001_SetChannelCount | ( | ADMW_DEVICE_HANDLE | hDevice, |
ADMW1001_CH_ID | eChannelId, | ||
uint32_t | nMeasurementsPerCycle | ||
) |
Update number of measurements-per-cycle for a specific channel.
- Parameters:
-
[in] hDevice ADMW1001 device context handle [in] eChannelId Selects the channel to be updated [in] nMeasurementsPerCycle Specifies the number of measurements to be obtained from this channel in each measurement cycle. Set as 0 to disable the channel (omit from measurement cycle).
- Returns:
- Status
- ADMW_SUCCESS Call completed successfully.
Translates configuration details provided into device-specific register settings and updates device configuration registers. Allows individual channels to be dynamically enabled/disabled, and measurements-per-cycle to be adjusted.
- Note:
- Settings are not applied until admw_ApplyConfigUpdates() is called
Definition at line 1139 of file admw_1001.c.
ADMW_RESULT admw1001_SetChannelPriority | ( | ADMW_DEVICE_HANDLE | hDevice, |
ADMW1001_CH_ID | eChannelId, | ||
ADMW1001_CHANNEL_PRIORITY | ePriority | ||
) |
Update priority level for a specific channel.
- Parameters:
-
[in] hDevice ADMW1001 device context handle [in] eChannelId Selects the channel to be updated [in] ePriority Specifies the channel priority level
- Returns:
- Status
- ADMW_SUCCESS Call completed successfully.
Translates configuration details provided into device-specific register settings and updates device configuration registers. Allows individual channels to be dynamically re-prioritised.
- Note:
- Settings are not applied until admw_ApplyConfigUpdates() is called
ADMW_RESULT admw1001_SetChannelSettlingTime | ( | ADMW_DEVICE_HANDLE | hDevice, |
ADMW1001_CH_ID | eChannelId, | ||
uint32_t | nSettlingTime | ||
) |
Update the extra settling time for a specified channel.
- Parameters:
-
[in] hDevice ADMW1001 device context handle [in] eChannelId Selects the channel to be updated [in] nSettlingTime A minimum settling time is applied internally for each channel, based on the sensor type. However, additional settling time (microseconds) can optionally be specified here. Set to 0 if not required.
- Returns:
- Status
- ADMW_SUCCESS Call completed successfully.
Translates configuration details provided into device-specific register settings and updates device configuration registers. Allows individual channel settling times to be dynamically adjusted.
- Note:
- Settings are not applied until admw_ApplyConfigUpdates() is called
Definition at line 2138 of file admw_1001.c.
ADMW_RESULT admw1001_SetChannelThresholdLimits | ( | ADMW_DEVICE_HANDLE | hDevice, |
ADMW1001_CH_ID | eChannelId, | ||
float32_t | fHighThresholdLimit, | ||
float32_t | fLowThresholdLimit | ||
) |
Update the measurement threshold limits for a specified channel.
- Parameters:
-
[in] hDevice ADMW1001 device context handle [in] eChannelId Selects the channel to be updated [in] fHighThresholdLimit Optional maximum threshold value for each processed sample, to be checked prior to publishing. A channel ALERT condition is raised if the processed value is higher than this threshold. Set to NaN if not required. [in] fLowThresholdLimit Optional minimum threshold value for each processed sample, to be checked prior to publishing. A channel ALERT condition is raised if the processed value is lower than this threshold. Set to NaN if not required.
- Returns:
- Status
- ADMW_SUCCESS Call completed successfully.
Translates configuration details provided into device-specific register settings and updates device configuration registers. Allows individual channel thresholds to be dynamically adjusted.
- Note:
- Settings are not applied until admw_ApplyConfigUpdates() is called
Definition at line 2079 of file admw_1001.c.
ADMW_RESULT admw1001_SetDiagnosticsConfig | ( | ADMW_DEVICE_HANDLE | hDevice, |
ADMW1001_DIAGNOSTICS_CONFIG * | pDiagnosticsConfig | ||
) |
Update diagnostics configuration settings on the device.
- Parameters:
-
[in] hDevice ADMW1001 device context handle [in] pDiagnosticsConfig Diagnostics configuration details
- Returns:
- Status
- ADMW_SUCCESS Call completed successfully.
Translates configuration details provided into device-specific register settings and updates device configuration registers.
- Note:
- Settings are not applied until admw_ApplyConfigUpdates() is called
Definition at line 1097 of file admw_1001.c.
ADMW_RESULT admw1001_SetLutData | ( | ADMW_DEVICE_HANDLE | hDevice, |
ADMW1001_LUT *const | pLutData | ||
) |
Write Look-Up Table data to the device memory.
- Parameters:
-
[in] hDevice ADMW1001 device context handle [out] pLutData Pointer to the Look-Up Table data structure
- Returns:
- Status
- ADMW_SUCCESS Call completed successfully.
Validates the Look-Up Table data format and loads it into device memory via dedicated keyhole registers.
- Note:
- Settings are not applied until admw_ApplyConfigUpdates() is called
Definition at line 2329 of file admw_1001.c.
ADMW_RESULT admw1001_SetLutDataRaw | ( | ADMW_DEVICE_HANDLE | hDevice, |
ADMW1001_LUT_RAW *const | pLutData | ||
) |
Write Look-Up Table raw data to the device memory.
- Parameters:
-
[in] hDevice ADMW device context handle [out] pLutData Pointer to the Look-Up Table raw data structure
- Returns:
- Status
- ADMW_SUCCESS Call completed successfully.
This can be used instead of admw1001_SetLutData for loading LUT data from the alternative raw data format. See admw1001_SetLutData for more information.
- Note:
- Settings are not applied until admw_ApplyConfigUpdates() is called
Definition at line 2423 of file admw_1001.c.
ADMW_RESULT admw1001_SetMeasurementConfig | ( | ADMW_DEVICE_HANDLE | hDevice, |
ADMW1001_MEASUREMENT_CONFIG * | pMeasurementConfig | ||
) |
Update measurement configuration settings on the device.
- Parameters:
-
[in] hDevice ADMW1001 device context handle [in] pMeasurementConfig Measurement configuration details
- Returns:
- Status
- ADMW_SUCCESS Call completed successfully.
Translates configuration details provided into device-specific register settings and updates device configuration registers.
- Note:
- Settings are not applied until admw_ApplyConfigUpdates() is called
Definition at line 1063 of file admw_1001.c.
ADMW_RESULT admw1001_SetSensorParameter | ( | ADMW_DEVICE_HANDLE | hDevice, |
ADMW1001_CH_ID | eChannelId, | ||
float32_t | fSensorParam | ||
) |
Set a sensor specific parameter for a specified channel.
- Parameters:
-
[in] hDevice ADMW1001 device context handle [in] eChannelId Selects the channel to be updated [in] fSensorParam Sensor specific parameter
- Returns:
- Status
- ADMW_SUCCESS Call completed successfully.
Translates configuration details provided into device-specific register settings and updates device configuration registers. Allows optional sensor-specific parameter to be specified
- Note:
- Settings are not applied until admw_ApplyConfigUpdates() is called
Definition at line 2125 of file admw_1001.c.
ADMW_RESULT admw1001_Write_Debug_Register | ( | ADMW_DEVICE_HANDLE const | hDevice, |
uint16_t const | nAddress, | ||
void *const | pData, | ||
unsigned const | nLength | ||
) |
Write one or more device registers at the specified debug register address.
- Parameters:
-
[in] hDevice ADMW1001 device context handle [in] nAddress Register map address to read from [out] pData Pointer to return the register map data [in] nLength Number of bytes of data to read from the register map
- Returns:
- Status
- ADMW_SUCCESS Call completed successfully.
Provides direct byte-level write access to the device register map. The size and format of the register(s) must be known.
Definition at line 722 of file admw_1001.c.
ADMW_RESULT admw1001_WriteRegister | ( | ADMW_DEVICE_HANDLE const | hDevice, |
uint16_t const | nAddress, | ||
void *const | pData, | ||
unsigned const | nLength | ||
) |
Write one or more device registers at the specified register address.
- Parameters:
-
[in] hDevice ADMW1001 device context handle [in] nAddress Register map address to read from [out] pData Pointer to return the register map data [in] nLength Number of bytes of data to read from the register map
- Returns:
- Status
- ADMW_SUCCESS Call completed successfully.
Provides direct byte-level write access to the device register map. The size and format of the register(s) must be known.
- Note:
- Writes to read-only registers will be ignored by the device.
- Writes to special "keyhole" registers will be handled according to documentation for those registers.
Definition at line 681 of file admw_1001.c.
Generated on Wed Jul 13 2022 03:04:54 by
![doxygen](doxygen.png)