aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJesse Zhang <65556515+jessezhang-ni@users.noreply.github.com>2020-07-22 19:55:05 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2020-07-30 12:51:11 -0500
commitaca52b700282153760ae9331a791ddd41a2f4dd5 (patch)
tree0b93362fb169f2fe31258fe93b163ec8050e8dff /host
parent261197a18ffd36fafddf21158f92ed34a07abf77 (diff)
downloaduhd-aca52b700282153760ae9331a791ddd41a2f4dd5.tar.gz
uhd-aca52b700282153760ae9331a791ddd41a2f4dd5.tar.bz2
uhd-aca52b700282153760ae9331a791ddd41a2f4dd5.zip
python: Add Switchboard block python bindings
Diffstat (limited to 'host')
-rw-r--r--host/lib/rfnoc/switchboard_block_control_python.hpp21
-rw-r--r--host/python/pyuhd.cpp2
-rw-r--r--host/python/uhd/rfnoc.py1
3 files changed, 24 insertions, 0 deletions
diff --git a/host/lib/rfnoc/switchboard_block_control_python.hpp b/host/lib/rfnoc/switchboard_block_control_python.hpp
new file mode 100644
index 000000000..7715b05c0
--- /dev/null
+++ b/host/lib/rfnoc/switchboard_block_control_python.hpp
@@ -0,0 +1,21 @@
+//
+// Copyright 2020 Ettus Research, a National Instruments Brand
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+
+#pragma once
+
+#include "block_controller_factory_python.hpp"
+#include <uhd/rfnoc/switchboard_block_control.hpp>
+
+using namespace uhd::rfnoc;
+
+void export_switchboard_block_control(py::module& m)
+{
+ py::class_<switchboard_block_control,
+ noc_block_base,
+ switchboard_block_control::sptr>(m, "switchboard_block_control")
+ .def(py::init(&block_controller_factory<switchboard_block_control>::make_from))
+ .def("connect", &switchboard_block_control::connect);
+}
diff --git a/host/python/pyuhd.cpp b/host/python/pyuhd.cpp
index 6012ddfd5..96d62614f 100644
--- a/host/python/pyuhd.cpp
+++ b/host/python/pyuhd.cpp
@@ -23,6 +23,7 @@ namespace py = pybind11;
#include "rfnoc/null_block_control_python.hpp"
#include "rfnoc/radio_control_python.hpp"
#include "rfnoc/rfnoc_python.hpp"
+#include "rfnoc/switchboard_block_control_python.hpp"
#include "rfnoc/vector_iir_block_control_python.hpp"
#include "rfnoc/window_block_control_python.hpp"
#include "stream_python.hpp"
@@ -93,6 +94,7 @@ PYBIND11_MODULE(libpyuhd, m)
export_moving_average_block_control(rfnoc_module);
export_null_block_control(rfnoc_module);
export_radio_control(rfnoc_module);
+ export_switchboard_block_control(rfnoc_module);
export_vector_iir_block_control(rfnoc_module);
export_window_block_control(rfnoc_module);
diff --git a/host/python/uhd/rfnoc.py b/host/python/uhd/rfnoc.py
index 01f632a83..8dfc18960 100644
--- a/host/python/uhd/rfnoc.py
+++ b/host/python/uhd/rfnoc.py
@@ -26,5 +26,6 @@ FirFilterBlockControl = lib.rfnoc.fir_filter_block_control
MovingAverageBlockControl = lib.rfnoc.moving_average_block_control
NullBlockControl = lib.rfnoc.null_block_control
RadioControl = lib.rfnoc.radio_control
+SwitchboardBlockControl = lib.rfnoc.switchboard_block_control
VectorIirBlockControl = lib.rfnoc.vector_iir_block_control
WindowBlockControl = lib.rfnoc.window_block_control