2017-05-02 18:10:05 +00:00
|
|
|
//
|
|
|
|
|
// Copyright 2017-2018 Ettus Research, a National Instruments Company
|
2019-02-04 15:00:16 +00:00
|
|
|
// Copyright 2019 Ettus Research, a National Instruments Brand
|
2017-05-02 18:10:05 +00:00
|
|
|
//
|
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#ifndef INCLUDED_UHD_USRP_MULTI_USRP_PYTHON_HPP
|
|
|
|
|
#define INCLUDED_UHD_USRP_MULTI_USRP_PYTHON_HPP
|
|
|
|
|
|
2018-11-20 20:02:43 +00:00
|
|
|
#include <uhd/types/device_addr.hpp>
|
2017-05-02 18:10:05 +00:00
|
|
|
#include <uhd/usrp/multi_usrp.hpp>
|
|
|
|
|
|
2019-02-04 15:00:16 +00:00
|
|
|
void export_multi_usrp(py::module& m)
|
2017-05-02 18:10:05 +00:00
|
|
|
{
|
2020-03-02 23:25:13 +00:00
|
|
|
using multi_usrp = uhd::usrp::multi_usrp;
|
2017-05-02 18:10:05 +00:00
|
|
|
|
2019-02-04 15:00:16 +00:00
|
|
|
const auto ALL_MBOARDS = multi_usrp::ALL_MBOARDS;
|
2020-03-02 23:25:13 +00:00
|
|
|
const auto ALL_CHANS = multi_usrp::ALL_CHANS;
|
|
|
|
|
const auto ALL_LOS = multi_usrp::ALL_LOS;
|
2017-05-02 18:10:05 +00:00
|
|
|
|
2020-02-19 20:38:30 +00:00
|
|
|
// clang-format off
|
2019-02-04 15:00:16 +00:00
|
|
|
py::class_<multi_usrp, multi_usrp::sptr>(m, "multi_usrp")
|
2017-05-02 18:10:05 +00:00
|
|
|
|
2019-02-04 15:00:16 +00:00
|
|
|
// Factory
|
|
|
|
|
.def(py::init(&multi_usrp::make))
|
2017-05-02 18:10:05 +00:00
|
|
|
|
x300: add front-panel GPIO source control
Adds a ZPU register to control the FP GPIO source. These are 2bits
per GPIO pin, totalling 24 bits. 0 corresponds to RF-A, 1 corresponds
to RF-B. The following Python code will control the upper 6 bits of the
front-panel GPIO from the B-side radio on an X300:
>>> import uhd
>>> U = uhd.usrp.MultiUSRP("type=x300")
>>> U.get_gpio_src_banks()
['FP0']
>>> U.get_gpio_src("FP0")
['RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA',
'RFA', 'RFA']
>>> U.set_gpio_src("FP0", ['RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA',
'RFB', 'RFB', 'RFB', 'RFB', 'RFB', 'RFB'])
>>> U.get_gpio_src("FP0")
['RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFB', 'RFB', 'RFB', 'RFB',
'RFB', 'RFB']
>>> # Make all GPIOs outputs:
>>> U.set_gpio_attr("FP0A", "DDR", 0xFFF)
>>> U.set_gpio_attr("FP0B", "DDR", 0xFFF)
>>> # Control all GPIOs from software (not ATR):
>>> U.set_gpio_attr("FP0A", "CTRL", 0x000)
>>> U.set_gpio_attr("FP0B", "CTRL", 0x000)
>>> # Bottom 3 pins go high from radio A
>>> U.set_gpio_attr("FP0A", "OUT", 0x007)
>>> # Top 3 pins go high from radio B
>>> U.set_gpio_attr("FP0B", "OUT", 0xE00)
Amends the gpio.cpp example to allow switching the source.
Co-authored-by: Brent Stapleton <brent.stapleton@ettus.com>
2020-01-24 02:47:28 +00:00
|
|
|
// clang-format off
|
2017-05-02 18:10:05 +00:00
|
|
|
// General USRP methods
|
2019-02-04 15:00:16 +00:00
|
|
|
.def("get_rx_freq" , &multi_usrp::get_rx_freq, py::arg("chan") = 0)
|
2017-05-02 18:10:05 +00:00
|
|
|
.def("get_rx_num_channels" , &multi_usrp::get_rx_num_channels)
|
2019-02-04 15:00:16 +00:00
|
|
|
.def("get_rx_rate" , &multi_usrp::get_rx_rate, py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_stream" , &multi_usrp::get_rx_stream)
|
|
|
|
|
.def("set_rx_freq" , &multi_usrp::set_rx_freq, py::arg("tune_request"), py::arg("chan") = 0)
|
|
|
|
|
.def("set_rx_gain" , (void (multi_usrp::*)(double, const std::string&, size_t)) &multi_usrp::set_rx_gain, py::arg("gain"), py::arg("name"), py::arg("chan") = 0)
|
|
|
|
|
.def("set_rx_gain" , (void (multi_usrp::*)(double, size_t)) &multi_usrp::set_rx_gain, py::arg("gain"), py::arg("chan") = 0)
|
|
|
|
|
.def("set_rx_rate" , &multi_usrp::set_rx_rate, py::arg("rate"), py::arg("chan") = ALL_CHANS)
|
|
|
|
|
.def("get_tx_freq" , &multi_usrp::get_tx_freq, py::arg("chan") = 0)
|
2017-05-02 18:10:05 +00:00
|
|
|
.def("get_tx_num_channels" , &multi_usrp::get_tx_num_channels)
|
2019-02-04 15:00:16 +00:00
|
|
|
.def("get_tx_rate" , &multi_usrp::get_tx_rate, py::arg("chan") = 0)
|
2017-05-02 18:10:05 +00:00
|
|
|
.def("get_tx_stream" , &multi_usrp::get_tx_stream)
|
2019-02-04 15:00:16 +00:00
|
|
|
.def("set_tx_freq" , &multi_usrp::set_tx_freq, py::arg("tune_request"), py::arg("chan") = 0)
|
|
|
|
|
.def("set_tx_gain" , (void (multi_usrp::*)(double, const std::string&, size_t)) &multi_usrp::set_tx_gain, py::arg("gain"), py::arg("name"), py::arg("chan") = 0)
|
|
|
|
|
.def("set_tx_gain" , (void (multi_usrp::*)(double, size_t)) &multi_usrp::set_tx_gain, py::arg("gain"), py::arg("chan") = 0)
|
|
|
|
|
.def("set_tx_rate" , &multi_usrp::set_tx_rate, py::arg("rate"), py::arg("chan") = ALL_CHANS)
|
2019-11-01 21:53:16 +00:00
|
|
|
.def("get_usrp_rx_info",
|
|
|
|
|
[](multi_usrp& self, const size_t chan = 0) {
|
|
|
|
|
return static_cast<std::map<std::string, std::string>>(
|
|
|
|
|
self.get_usrp_rx_info(chan));
|
|
|
|
|
},
|
|
|
|
|
py::arg("chan") = 0)
|
|
|
|
|
.def("get_usrp_tx_info",
|
|
|
|
|
[](multi_usrp& self, const size_t chan = 0) {
|
|
|
|
|
return static_cast<std::map<std::string, std::string>>(
|
|
|
|
|
self.get_usrp_tx_info(chan));
|
|
|
|
|
},
|
|
|
|
|
py::arg("chan") = 0)
|
2019-02-04 15:00:16 +00:00
|
|
|
.def("set_master_clock_rate" , &multi_usrp::set_master_clock_rate, py::arg("rate"), py::arg("mboard") = ALL_MBOARDS)
|
|
|
|
|
.def("get_master_clock_rate" , &multi_usrp::get_master_clock_rate, py::arg("mboard") = 0)
|
|
|
|
|
.def("get_master_clock_rate_range", &multi_usrp::get_master_clock_rate_range, py::arg("mboard") = ALL_MBOARDS)
|
2017-05-02 18:10:05 +00:00
|
|
|
.def("get_pp_string" , &multi_usrp::get_pp_string)
|
2019-02-04 15:00:16 +00:00
|
|
|
.def("get_mboard_name" , &multi_usrp::get_mboard_name, py::arg("mboard") = 0)
|
|
|
|
|
.def("get_time_now" , &multi_usrp::get_time_now, py::arg("mboard") = 0)
|
|
|
|
|
.def("get_time_last_pps" , &multi_usrp::get_time_last_pps, py::arg("mboard") = 0)
|
|
|
|
|
.def("set_time_now" , &multi_usrp::set_time_now, py::arg("time_spec"), py::arg("mboard") = ALL_MBOARDS)
|
|
|
|
|
.def("set_time_next_pps" , &multi_usrp::set_time_next_pps, py::arg("time_spec"), py::arg("mboard") = ALL_MBOARDS)
|
2017-05-02 18:10:05 +00:00
|
|
|
.def("set_time_unknown_pps" , &multi_usrp::set_time_unknown_pps)
|
|
|
|
|
.def("get_time_synchronized" , &multi_usrp::get_time_synchronized)
|
2019-10-03 14:48:48 +00:00
|
|
|
.def("set_command_time" , &multi_usrp::set_command_time, py::arg("time_spec"), py::arg("mboard") = ALL_MBOARDS)
|
2019-02-04 15:00:16 +00:00
|
|
|
.def("clear_command_time" , &multi_usrp::clear_command_time, py::arg("mboard") = ALL_MBOARDS)
|
|
|
|
|
.def("issue_stream_cmd" , &multi_usrp::issue_stream_cmd, py::arg("rate"), py::arg("chan") = ALL_CHANS)
|
|
|
|
|
.def("set_time_source" , &multi_usrp::set_time_source, py::arg("source"), py::arg("mboard") = ALL_MBOARDS)
|
2017-05-02 18:10:05 +00:00
|
|
|
.def("get_time_source" , &multi_usrp::get_time_source)
|
|
|
|
|
.def("get_time_sources" , &multi_usrp::get_time_sources)
|
2019-02-04 15:00:16 +00:00
|
|
|
.def("set_clock_source" , &multi_usrp::set_clock_source, py::arg("source"), py::arg("mboard") = ALL_MBOARDS)
|
2017-05-02 18:10:05 +00:00
|
|
|
.def("get_clock_source" , &multi_usrp::get_clock_source)
|
|
|
|
|
.def("get_clock_sources" , &multi_usrp::get_clock_sources)
|
2019-02-04 15:00:16 +00:00
|
|
|
.def("set_sync_source" , (void (multi_usrp::*)(const std::string&, const std::string&, size_t)) &multi_usrp::set_sync_source, py::arg("clock_source"), py::arg("time_source"), py::arg("mboard") = ALL_MBOARDS)
|
|
|
|
|
.def("set_sync_source" , (void (multi_usrp::*)(const uhd::device_addr_t&, size_t)) &multi_usrp::set_sync_source, py::arg("sync_source"), py::arg("mboard") = ALL_MBOARDS)
|
2018-11-20 20:02:43 +00:00
|
|
|
.def("get_sync_source" , &multi_usrp::get_sync_source)
|
|
|
|
|
.def("get_sync_sources" , &multi_usrp::get_sync_sources)
|
2019-02-04 15:00:16 +00:00
|
|
|
.def("set_clock_source_out" , &multi_usrp::set_clock_source_out, py::arg("enb"), py::arg("mboard") = ALL_MBOARDS)
|
|
|
|
|
.def("set_time_source_out" , &multi_usrp::set_time_source_out, py::arg("enb"), py::arg("mboard") = ALL_MBOARDS)
|
2017-05-02 18:10:05 +00:00
|
|
|
.def("get_num_mboards" , &multi_usrp::get_num_mboards)
|
2019-02-04 15:00:16 +00:00
|
|
|
.def("get_mboard_sensor" , &multi_usrp::get_mboard_sensor, py::arg("name"), py::arg("mboard") = 0)
|
|
|
|
|
.def("get_mboard_sensor_names" , &multi_usrp::get_mboard_sensor_names, py::arg("mboard") = 0)
|
|
|
|
|
.def("set_user_register" , &multi_usrp::set_user_register, py::arg("addr"), py::arg("data"), py::arg("mboard") = ALL_MBOARDS)
|
2020-07-02 14:22:57 +00:00
|
|
|
.def("get_radio_control" , &multi_usrp::get_radio_control, py::arg("chan") = 0)
|
2020-09-21 22:17:39 +00:00
|
|
|
.def("get_mb_controller" , &multi_usrp::get_mb_controller, py::arg("mboard") = 0)
|
2017-05-02 18:10:05 +00:00
|
|
|
|
|
|
|
|
// RX methods
|
2019-02-04 15:00:16 +00:00
|
|
|
.def("set_rx_subdev_spec" , &multi_usrp::set_rx_subdev_spec, py::arg("spec"), py::arg("mboard") = ALL_MBOARDS)
|
|
|
|
|
.def("get_rx_subdev_spec" , &multi_usrp::get_rx_subdev_spec, py::arg("mboard") = 0)
|
|
|
|
|
.def("get_rx_subdev_name" , &multi_usrp::get_rx_subdev_name, py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_rates" , &multi_usrp::get_rx_rates, py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_freq_range" , &multi_usrp::get_rx_freq_range, py::arg("chan") = 0)
|
|
|
|
|
.def("get_fe_rx_freq_range" , &multi_usrp::get_fe_rx_freq_range, py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_lo_names" , &multi_usrp::get_rx_lo_names, py::arg("chan") = 0)
|
|
|
|
|
.def("set_rx_lo_source" , &multi_usrp::set_rx_lo_source, py::arg("src"), py::arg("name") = ALL_LOS, py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_lo_source" , &multi_usrp::get_rx_lo_source, py::arg("name") = ALL_LOS, py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_lo_sources" , &multi_usrp::get_rx_lo_sources, py::arg("name") = ALL_LOS, py::arg("chan") = 0)
|
|
|
|
|
.def("set_rx_lo_export_enabled", &multi_usrp::set_rx_lo_export_enabled, py::arg("enb"), py::arg("name") = ALL_LOS, py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_lo_export_enabled", &multi_usrp::get_rx_lo_export_enabled, py::arg("name") = ALL_LOS, py::arg("chan") = 0)
|
|
|
|
|
.def("set_rx_lo_freq" , &multi_usrp::set_rx_lo_freq, py::arg("freq"), py::arg("name"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_lo_freq" , &multi_usrp::get_rx_lo_freq, py::arg("name"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_lo_freq_range" , &multi_usrp::get_rx_lo_freq_range, py::arg("name"), py::arg("chan") = 0)
|
|
|
|
|
.def("set_normalized_rx_gain" , &multi_usrp::set_normalized_rx_gain, py::arg("gain"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_normalized_rx_gain" , &multi_usrp::get_normalized_rx_gain, py::arg("chan") = 0)
|
|
|
|
|
.def("set_rx_agc" , &multi_usrp::set_rx_agc, py::arg("enable"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_gain" , (double (multi_usrp::*)(const std::string&, size_t)) &multi_usrp::get_rx_gain, py::arg("name"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_gain" , (double (multi_usrp::*)(size_t)) &multi_usrp::get_rx_gain, py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_gain_range" , (uhd::gain_range_t (multi_usrp::*)(const std::string&, size_t)) &multi_usrp::get_rx_gain_range, py::arg("name"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_gain_range" , (uhd::gain_range_t (multi_usrp::*)(size_t)) &multi_usrp::get_rx_gain_range, py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_gain_names" , &multi_usrp::get_rx_gain_names, py::arg("chan") = 0)
|
|
|
|
|
.def("set_rx_antenna" , &multi_usrp::set_rx_antenna, py::arg("ant"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_antenna" , &multi_usrp::get_rx_antenna, py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_antennas" , &multi_usrp::get_rx_antennas, py::arg("chan") = 0)
|
|
|
|
|
.def("set_rx_bandwidth" , &multi_usrp::set_rx_bandwidth, py::arg("bandwidth"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_bandwidth" , &multi_usrp::get_rx_bandwidth, py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_bandwidth_range" , &multi_usrp::get_rx_bandwidth_range, py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_dboard_iface" , &multi_usrp::get_rx_dboard_iface, py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_sensor" , &multi_usrp::get_rx_sensor, py::arg("name"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_sensor_names" , &multi_usrp::get_rx_sensor_names, py::arg("chan") = 0)
|
|
|
|
|
.def("set_rx_dc_offset" , (void (multi_usrp::*)(const std::complex<double>&, size_t)) &multi_usrp::set_rx_dc_offset, py::arg("offset"), py::arg("chan") = 0)
|
|
|
|
|
.def("set_rx_dc_offset" , (void (multi_usrp::*)(bool, size_t)) &multi_usrp::set_rx_dc_offset, py::arg("enb"), py::arg("chan") = 0)
|
|
|
|
|
.def("set_rx_iq_balance" , (void (multi_usrp::*)(const std::complex<double>&, size_t)) &multi_usrp::set_rx_iq_balance, py::arg("correction"), py::arg("chan") = 0)
|
|
|
|
|
.def("set_rx_iq_balance" , (void (multi_usrp::*)(bool, size_t)) &multi_usrp::set_rx_dc_offset, py::arg("enb"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_gain_profile" , &multi_usrp::get_rx_gain_profile, py::arg("chan") = 0)
|
|
|
|
|
.def("set_rx_gain_profile" , &multi_usrp::set_rx_gain_profile, py::arg("profile"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_gain_profile_names", &multi_usrp::get_rx_gain_profile_names, py::arg("chan") = 0)
|
2020-05-06 19:32:49 +00:00
|
|
|
.def("has_rx_power_reference" , &multi_usrp::has_rx_power_reference, py::arg("chan") = 0)
|
2020-02-19 20:38:30 +00:00
|
|
|
.def("set_rx_power_reference" , &multi_usrp::set_rx_power_reference, py::arg("power_dbm"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_rx_power_reference" , &multi_usrp::get_rx_power_reference, py::arg("chan") = 0)
|
2020-08-06 18:55:35 +00:00
|
|
|
.def("get_rx_power_range" , &multi_usrp::get_rx_power_range, py::arg("chan") = 0)
|
2017-05-02 18:10:05 +00:00
|
|
|
|
|
|
|
|
// TX methods
|
2019-02-04 15:00:16 +00:00
|
|
|
.def("set_tx_subdev_spec" , &multi_usrp::set_tx_subdev_spec, py::arg("spec"), py::arg("mboard") = ALL_MBOARDS)
|
|
|
|
|
.def("get_tx_subdev_spec" , &multi_usrp::get_tx_subdev_spec, py::arg("mboard") = 0)
|
|
|
|
|
.def("get_tx_subdev_name" , &multi_usrp::get_tx_subdev_name, py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_rates" , &multi_usrp::get_tx_rates, py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_freq_range" , &multi_usrp::get_tx_freq_range, py::arg("chan") = 0)
|
|
|
|
|
.def("get_fe_tx_freq_range" , &multi_usrp::get_fe_tx_freq_range, py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_lo_names" , &multi_usrp::get_tx_lo_names, py::arg("chan") = 0)
|
|
|
|
|
.def("set_tx_lo_source" , &multi_usrp::set_tx_lo_source, py::arg("src"), py::arg("name") = ALL_LOS, py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_lo_source" , &multi_usrp::get_tx_lo_source, py::arg("name") = ALL_LOS, py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_lo_sources" , &multi_usrp::get_tx_lo_sources, py::arg("name") = ALL_LOS, py::arg("chan") = 0)
|
|
|
|
|
.def("set_tx_lo_export_enabled", &multi_usrp::set_tx_lo_export_enabled, py::arg("enb"), py::arg("name") = ALL_LOS, py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_lo_export_enabled", &multi_usrp::get_tx_lo_export_enabled, py::arg("name") = ALL_LOS, py::arg("chan") = 0)
|
|
|
|
|
.def("set_tx_lo_freq" , &multi_usrp::set_tx_lo_freq, py::arg("freq"), py::arg("name"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_lo_freq" , &multi_usrp::get_tx_lo_freq, py::arg("name"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_lo_freq_range" , &multi_usrp::get_tx_lo_freq_range, py::arg("name"), py::arg("chan") = 0)
|
|
|
|
|
.def("set_normalized_tx_gain" , &multi_usrp::set_normalized_tx_gain, py::arg("gain"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_normalized_tx_gain" , &multi_usrp::get_normalized_tx_gain, py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_gain" , (double (multi_usrp::*)(const std::string&, size_t)) &multi_usrp::get_tx_gain, py::arg("name"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_gain" , (double (multi_usrp::*)(size_t)) &multi_usrp::get_tx_gain, py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_gain_range" , (uhd::gain_range_t (multi_usrp::*)(const std::string&, size_t)) &multi_usrp::get_tx_gain_range, py::arg("name"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_gain_range" , (uhd::gain_range_t (multi_usrp::*)(size_t)) &multi_usrp::get_tx_gain_range, py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_gain_names" , &multi_usrp::get_tx_gain_names, py::arg("chan") = 0)
|
|
|
|
|
.def("set_tx_antenna" , &multi_usrp::set_tx_antenna, py::arg("ant"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_antenna" , &multi_usrp::get_tx_antenna, py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_antennas" , &multi_usrp::get_tx_antennas, py::arg("chan") = 0)
|
|
|
|
|
.def("set_tx_bandwidth" , &multi_usrp::set_tx_bandwidth, py::arg("bandwidth"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_bandwidth" , &multi_usrp::get_tx_bandwidth, py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_bandwidth_range" , &multi_usrp::get_tx_bandwidth_range, py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_dboard_iface" , &multi_usrp::get_tx_dboard_iface, py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_sensor" , &multi_usrp::get_tx_sensor, py::arg("name"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_sensor_names" , &multi_usrp::get_tx_sensor_names, py::arg("chan") = 0)
|
|
|
|
|
.def("set_tx_dc_offset" , (void (multi_usrp::*)(const std::complex<double>&, size_t)) &multi_usrp::set_tx_dc_offset, py::arg("offset"), py::arg("chan") = 0)
|
|
|
|
|
.def("set_tx_iq_balance" , (void (multi_usrp::*)(const std::complex<double>&, size_t)) &multi_usrp::set_tx_iq_balance, py::arg("correction"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_gain_profile" , &multi_usrp::get_tx_gain_profile, py::arg("chan") = 0)
|
|
|
|
|
.def("set_tx_gain_profile" , &multi_usrp::set_tx_gain_profile, py::arg("profile"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_gain_profile_names", &multi_usrp::get_tx_gain_profile_names, py::arg("chan") = 0)
|
2020-05-06 19:32:49 +00:00
|
|
|
.def("has_tx_power_reference" , &multi_usrp::has_tx_power_reference, py::arg("chan") = 0)
|
2020-02-19 20:38:30 +00:00
|
|
|
.def("set_tx_power_reference" , &multi_usrp::set_tx_power_reference, py::arg("power_dbm"), py::arg("chan") = 0)
|
|
|
|
|
.def("get_tx_power_reference" , &multi_usrp::get_tx_power_reference, py::arg("chan") = 0)
|
2020-08-06 18:55:35 +00:00
|
|
|
.def("get_tx_power_range" , &multi_usrp::get_tx_power_range, py::arg("chan") = 0)
|
2017-05-02 18:10:05 +00:00
|
|
|
|
|
|
|
|
// GPIO methods
|
|
|
|
|
.def("get_gpio_banks" , &multi_usrp::get_gpio_banks)
|
2019-02-04 15:00:16 +00:00
|
|
|
.def("set_gpio_attr" , (void (multi_usrp::*)(const std::string&, const std::string&, const uint32_t, const uint32_t, const size_t)) &multi_usrp::set_gpio_attr, py::arg("bank"), py::arg("attr"), py::arg("value"), py::arg("mask") = 0xffffffff, py::arg("mboard") = 0)
|
|
|
|
|
.def("get_gpio_attr" , &multi_usrp::get_gpio_attr, py::arg("bank"), py::arg("attr"), py::arg("mboard") = 0)
|
rfnoc: Add multi_usrp_rfnoc, modify multi_usrp
This adds a separate version of multi_usrp for RFNoC devices. It is
compatible with RFNoC devices only, and prefers C++ APIs over property
tree usage. The factory of multi_usrp is modified such that it picks the
correct version, users of multi_usrp don't care about this change.
This also introduces some API changes:
- Removing redundant GPIO functions. Now all GPIO control, setting, and
readback is done with uint32_t's.
- Adding getter/setter for GPIO source. This was done to simplify the
other GPIO settings, as the source for each pin is not always a
binary. The CTRL mode, for example, can either be ATR or GPIO.
However, the source can be controlled by various radios or "PS" or
some other source.
- Removing the mask from the RFNoC radio controllers' set_gpio_attr().
- Adding state caching to gpio_atr_3000, and a getter for it. Whenever
an attribute is set, that value is cached, and can now be retreieved.
- Remove low-level register API. Since UHD 3.10, there is no USRP that
implements that API.
Modifying the filter API in the following ways:
- Splitting filter API getter/setter/list into separate RX and TX
functions
- Adding channel numbers as an argument
- The filter name will no longer be a property tree path, but rather a
filter name. For RFNoC devices, this will take the form
`BLOCK_ID:FILTER_NAME`. For non-RFNoC devices, this will just be the
filter name (e.g. `HB_1`)
- Removing search mask from listing function. Users can do their own
searching
Co-Authored-By: Martin Braun <martin.braun@ettus.com>
2019-06-07 20:22:05 +00:00
|
|
|
.def("get_gpio_srcs" , &multi_usrp::get_gpio_srcs, py::arg("bank"), py::arg("mboard") = 0)
|
|
|
|
|
.def("get_gpio_src" , &multi_usrp::get_gpio_src, py::arg("bank"), py::arg("mboard") = 0)
|
|
|
|
|
.def("set_gpio_src" , &multi_usrp::set_gpio_src, py::arg("bank"), py::arg("src"), py::arg("mboard") = 0)
|
x300: add front-panel GPIO source control
Adds a ZPU register to control the FP GPIO source. These are 2bits
per GPIO pin, totalling 24 bits. 0 corresponds to RF-A, 1 corresponds
to RF-B. The following Python code will control the upper 6 bits of the
front-panel GPIO from the B-side radio on an X300:
>>> import uhd
>>> U = uhd.usrp.MultiUSRP("type=x300")
>>> U.get_gpio_src_banks()
['FP0']
>>> U.get_gpio_src("FP0")
['RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA',
'RFA', 'RFA']
>>> U.set_gpio_src("FP0", ['RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA',
'RFB', 'RFB', 'RFB', 'RFB', 'RFB', 'RFB'])
>>> U.get_gpio_src("FP0")
['RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFB', 'RFB', 'RFB', 'RFB',
'RFB', 'RFB']
>>> # Make all GPIOs outputs:
>>> U.set_gpio_attr("FP0A", "DDR", 0xFFF)
>>> U.set_gpio_attr("FP0B", "DDR", 0xFFF)
>>> # Control all GPIOs from software (not ATR):
>>> U.set_gpio_attr("FP0A", "CTRL", 0x000)
>>> U.set_gpio_attr("FP0B", "CTRL", 0x000)
>>> # Bottom 3 pins go high from radio A
>>> U.set_gpio_attr("FP0A", "OUT", 0x007)
>>> # Top 3 pins go high from radio B
>>> U.set_gpio_attr("FP0B", "OUT", 0xE00)
Amends the gpio.cpp example to allow switching the source.
Co-authored-by: Brent Stapleton <brent.stapleton@ettus.com>
2020-01-24 02:47:28 +00:00
|
|
|
.def("get_gpio_src_banks" , &multi_usrp::get_gpio_src_banks, py::arg("mboard") = 0)
|
2017-05-02 18:10:05 +00:00
|
|
|
|
|
|
|
|
// Filter API methods
|
rfnoc: Add multi_usrp_rfnoc, modify multi_usrp
This adds a separate version of multi_usrp for RFNoC devices. It is
compatible with RFNoC devices only, and prefers C++ APIs over property
tree usage. The factory of multi_usrp is modified such that it picks the
correct version, users of multi_usrp don't care about this change.
This also introduces some API changes:
- Removing redundant GPIO functions. Now all GPIO control, setting, and
readback is done with uint32_t's.
- Adding getter/setter for GPIO source. This was done to simplify the
other GPIO settings, as the source for each pin is not always a
binary. The CTRL mode, for example, can either be ATR or GPIO.
However, the source can be controlled by various radios or "PS" or
some other source.
- Removing the mask from the RFNoC radio controllers' set_gpio_attr().
- Adding state caching to gpio_atr_3000, and a getter for it. Whenever
an attribute is set, that value is cached, and can now be retreieved.
- Remove low-level register API. Since UHD 3.10, there is no USRP that
implements that API.
Modifying the filter API in the following ways:
- Splitting filter API getter/setter/list into separate RX and TX
functions
- Adding channel numbers as an argument
- The filter name will no longer be a property tree path, but rather a
filter name. For RFNoC devices, this will take the form
`BLOCK_ID:FILTER_NAME`. For non-RFNoC devices, this will just be the
filter name (e.g. `HB_1`)
- Removing search mask from listing function. Users can do their own
searching
Co-Authored-By: Martin Braun <martin.braun@ettus.com>
2019-06-07 20:22:05 +00:00
|
|
|
.def("get_rx_filter_names" , &multi_usrp::get_rx_filter_names)
|
|
|
|
|
.def("get_rx_filter" , &multi_usrp::get_rx_filter)
|
|
|
|
|
.def("set_rx_filter" , &multi_usrp::set_rx_filter)
|
|
|
|
|
.def("get_tx_filter_names" , &multi_usrp::get_tx_filter_names)
|
|
|
|
|
.def("get_tx_filter" , &multi_usrp::get_tx_filter)
|
|
|
|
|
.def("set_tx_filter" , &multi_usrp::set_tx_filter)
|
x300: add front-panel GPIO source control
Adds a ZPU register to control the FP GPIO source. These are 2bits
per GPIO pin, totalling 24 bits. 0 corresponds to RF-A, 1 corresponds
to RF-B. The following Python code will control the upper 6 bits of the
front-panel GPIO from the B-side radio on an X300:
>>> import uhd
>>> U = uhd.usrp.MultiUSRP("type=x300")
>>> U.get_gpio_src_banks()
['FP0']
>>> U.get_gpio_src("FP0")
['RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA',
'RFA', 'RFA']
>>> U.set_gpio_src("FP0", ['RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA',
'RFB', 'RFB', 'RFB', 'RFB', 'RFB', 'RFB'])
>>> U.get_gpio_src("FP0")
['RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFB', 'RFB', 'RFB', 'RFB',
'RFB', 'RFB']
>>> # Make all GPIOs outputs:
>>> U.set_gpio_attr("FP0A", "DDR", 0xFFF)
>>> U.set_gpio_attr("FP0B", "DDR", 0xFFF)
>>> # Control all GPIOs from software (not ATR):
>>> U.set_gpio_attr("FP0A", "CTRL", 0x000)
>>> U.set_gpio_attr("FP0B", "CTRL", 0x000)
>>> # Bottom 3 pins go high from radio A
>>> U.set_gpio_attr("FP0A", "OUT", 0x007)
>>> # Top 3 pins go high from radio B
>>> U.set_gpio_attr("FP0B", "OUT", 0xE00)
Amends the gpio.cpp example to allow switching the source.
Co-authored-by: Brent Stapleton <brent.stapleton@ettus.com>
2020-01-24 02:47:28 +00:00
|
|
|
// clang-format off
|
2017-05-02 18:10:05 +00:00
|
|
|
;
|
2020-02-19 20:38:30 +00:00
|
|
|
// clang-format on
|
2017-05-02 18:10:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif /* INCLUDED_UHD_USRP_MULTI_USRP_PYTHON_HPP */
|