diff options
-rw-r--r-- | host/lib/rfnoc/duc_block_control_python.hpp | 31 | ||||
-rw-r--r-- | host/python/pyuhd.cpp | 2 | ||||
-rw-r--r-- | host/python/uhd/rfnoc.py | 1 |
3 files changed, 34 insertions, 0 deletions
diff --git a/host/lib/rfnoc/duc_block_control_python.hpp b/host/lib/rfnoc/duc_block_control_python.hpp new file mode 100644 index 000000000..b34b06227 --- /dev/null +++ b/host/lib/rfnoc/duc_block_control_python.hpp @@ -0,0 +1,31 @@ +// +// 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/duc_block_control.hpp> + +using namespace uhd::rfnoc; + +void export_duc_block_control(py::module& m) +{ + py::class_<duc_block_control, noc_block_base, duc_block_control::sptr>( + m, "duc_block_control") + .def(py::init(&block_controller_factory<duc_block_control>::make_from)) + .def("set_freq", + &duc_block_control::set_freq, + py::arg("freq"), + py::arg("chan"), + py::arg("time") = boost::optional<uhd::time_spec_t>()) + .def("get_freq", &duc_block_control::get_freq) + .def("get_frequency_range", &duc_block_control::get_frequency_range) + .def("get_input_rate", &duc_block_control::get_input_rate) + .def("get_output_rate", &duc_block_control::get_output_rate) + .def("set_output_rate", &duc_block_control::set_output_rate) + .def("get_input_rates", &duc_block_control::get_input_rates) + .def("set_input_rate", &duc_block_control::set_input_rate); +} diff --git a/host/python/pyuhd.cpp b/host/python/pyuhd.cpp index 149a53bba..2d807e4ea 100644 --- a/host/python/pyuhd.cpp +++ b/host/python/pyuhd.cpp @@ -15,6 +15,7 @@ namespace py = pybind11; #include "cal/cal_python.hpp" #include "rfnoc/ddc_block_control_python.hpp" +#include "rfnoc/duc_block_control_python.hpp" #include "rfnoc/rfnoc_python.hpp" #include "stream_python.hpp" #include "types/filters_python.hpp" @@ -76,6 +77,7 @@ PYBIND11_MODULE(libpyuhd, m) auto rfnoc_module = m.def_submodule("rfnoc", "RFNoC Objects"); export_rfnoc(rfnoc_module); export_ddc_block_control(rfnoc_module); + export_duc_block_control(rfnoc_module); // Register calibration submodule auto cal_module = m.def_submodule("cal", "Calibration Objects"); diff --git a/host/python/uhd/rfnoc.py b/host/python/uhd/rfnoc.py index 464013d62..cc57eb057 100644 --- a/host/python/uhd/rfnoc.py +++ b/host/python/uhd/rfnoc.py @@ -19,4 +19,5 @@ MBController = lib.rfnoc.mb_controller Timekeeper = lib.rfnoc.timekeeper NocBlock = lib.rfnoc.noc_block_base DdcBlockControl = lib.rfnoc.ddc_block_control +DucBlockControl = lib.rfnoc.duc_block_control |