C/C++ API Reference
The C API provides direct access to the profile generation engine through a set of configuration structures and functions. Link against libadrv9002-iio and include adrv9002_iio.h to use these interfaces.
Structures
-
struct rx_radio_channel_config
RX channel configuration.
A structure containing the configuration for a single RX channel
Public Members
-
uint8_t analog_filter_power_mode
Power mode of front-end analog filter Options are: 0 - Low power 1 - Medium power 2 - High power
-
bool analog_filter_biquad
Use second order (Biquad) analog filter, otherwise first order TIA is used
-
uint8_t analog_filter_power_mode
-
struct tx_radio_channel_config
TX channel configuration.
A structure containing the configuration for a single TX channel
-
struct radio_config
Device configuration.
A structure containing the configuration for the top-level device
Public Members
-
rx_radio_channel_config rx_config[2]
Channel configurations for RX1 and RX2
-
tx_radio_channel_config tx_config[2]
Channel configurations for TX1 and TX2
-
rx_radio_channel_config rx_config[2]
Functions
-
int adrv9002_generate_profile(adrv9002_config *cfg, char **profile, size_t *profile_num_bytes, char **stream_image, size_t *stream_image_num_bytes)
Generate profile from configuration.
- Parameters:
cfg – Nested struct of device configuration for shared and individual channels
profile – Resulting json profile
profile_num_bytes – Number of bytes in profile array
stream_image – Stream image for ARM stream processor
stream_image_num_bytes – Number of bytes in stream image array
- Returns:
On success, 0 is returned
- Returns:
On error, a negative errno code is returned
-
int adrv9002_generate_load_profile_iio(adrv9002_config *ac, struct iio_device *dev)
Generate profile from configuration and load it to device with IIO driver.
- Parameters:
ac – Nested struct of device configuration for shared and individual channels
dev – A pointer to the iio_device structure of the adrv9002-phy
- Returns:
On success, 0 is returned
- Returns:
On error, a negative errno code is returned
-
char *get_message_from_error_code(int error_code)
Get error message from error codes. This also includes profile specific codes.
- Parameters:
error_code – Error code to lookup and return message for
- Returns:
On code found, message is returned
- Returns:
On code not found, an empty string is returned
-
int adrv9002_get_interface_mode_iio(struct iio_device *dev, char *mode)
Get the interface mode of the device.
- Parameters:
dev – A pointer to the iio_device structure of the adrv9002-phy
mode – 4 character string containing the interface mode. (Malloc before passing)
- Returns:
On success, 0 is returned
- Returns:
On error, a negative errno code is returned