Command Line Tool#
The main command-line tool is adrv9002-iio-cli. This tool is used to generate profiles and streams without having to write any code. The tool is provided in the libadrv9002-iio package and is installed with the library. Note that it is not included with the wheel packages.
Usage#
Here is the help output for the tool:
CLI version: 0.1.0
Profile generator API: 68.8.1
Libiio version: 0.25-b6028fd
Usage:
adrv9002-iio-cli --config [arg] --uri [arg] --device [arg]
Generate profile and stream from the specified config file and write it to the iio device.
(Only available if build with libiio)
adrv9002-iio-cli --config [arg] --stream [arg]
Generate stream from the specified config save it to a file.
adrv9002-iio-cli --config [arg] --profile [arg]
Generate profile from the specified config save it to a file.
Options:
-h, --help
Show help.
-v, --version
Show software versions.
-c, --config [arg]
Specify config file containing a adrv9002_config structure in libini format.
-u, --uri [arg]
Set the iio device's uri.
eg: 'ip:192.168.2.1'
(Only available if build with libiio)
-d, --device [arg]
Set the name of the device you will write the stream and profile to.
eg: 'adrv9002-phy'
(Only available if build with libiio)
-s, --stream [arg]
Specify the file which the generated stream will be written on.
-p, --profile [arg]
Specify the file which the generated profile will be written on.
Input configuration#
The tool requires a configuration file to be provided. This file is a JSON file that contains the same parameterization as the C and python functions in the library. Please see the C or Python API doc for valid configurations. The file is used to generate the profile and stream. Below is an example configuration file:
{
"radio_cfg": {
"ssi_lanes": 2,
"ddr": 1,
"short_strobe": 1,
"lvds": 1,
"adc_rate_mode": 3,
"fdd": 0,
"rx_config": [{
"enabled": 1,
"adc_high_performance_mode": 1,
"frequency_offset_correction_enable": 0,
"analog_filter_power_mode": 2,
"analog_filter_biquad": 0,
"analog_filter_bandwidth_hz": 0,
"channel_bandwidth_hz": 38000000,
"sample_rate_hz": 61440000,
"nco_enable": 0,
"nco_frequency_hz": 0,
"rf_port": 0
}, {
"enabled": 1,
"adc_high_performance_mode": 1,
"frequency_offset_correction_enable": 0,
"analog_filter_power_mode": 2,
"analog_filter_biquad": 0,
"analog_filter_bandwidth_hz": 0,
"channel_bandwidth_hz": 38000000,
"sample_rate_hz": 61440000,
"nco_enable": 0,
"nco_frequency_hz": 0,
"rf_port": 0
}],
"tx_config": [{
"enabled": 1,
"sample_rate_hz": 61440000,
"frequency_offset_correction_enable": 0,
"analog_filter_power_mode": 2,
"channel_bandwidth_hz": 38000000,
"orx_enabled": 0,
"elb_type": 2
}, {
"enabled": 1,
"sample_rate_hz": 61440000,
"frequency_offset_correction_enable": 0,
"analog_filter_power_mode": 2,
"channel_bandwidth_hz": 38000000,
"orx_enabled": 0,
"elb_type": 2
}]
},
"clk_cfg": {
"device_clock_frequency_khz": 38400,
"device_clock_output_enable": 0,
"device_clock_output_divider": 0,
"clock_pll_high_performance_enable": 1,
"clock_pll_power_mode": 2,
"processor_clock_divider": 1
}
}
EOF