diff options
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/rfnoc/siggen_block_control_python.hpp | 38 | ||||
-rw-r--r-- | host/python/pyuhd.cpp | 2 | ||||
-rw-r--r-- | host/python/uhd/rfnoc.py | 1 |
3 files changed, 41 insertions, 0 deletions
diff --git a/host/lib/rfnoc/siggen_block_control_python.hpp b/host/lib/rfnoc/siggen_block_control_python.hpp new file mode 100644 index 000000000..6031878c9 --- /dev/null +++ b/host/lib/rfnoc/siggen_block_control_python.hpp @@ -0,0 +1,38 @@ +// +// 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/siggen_block_control.hpp> + +using namespace uhd::rfnoc; + +void export_siggen_block_control(py::module& m) +{ + py::enum_<siggen_waveform>(m, "siggen_waveform") + .value("CONSTANT", siggen_waveform::CONSTANT) + .value("SINE_WAVE", siggen_waveform::SINE_WAVE) + .value("NOISE", siggen_waveform::NOISE) + .export_values(); + + py::class_<siggen_block_control, noc_block_base, siggen_block_control::sptr>( + m, "siggen_block_control") + .def(py::init(&block_controller_factory<siggen_block_control>::make_from)) + .def("set_enable", &siggen_block_control::set_enable) + .def("get_enable", &siggen_block_control::get_enable) + .def("set_waveform", &siggen_block_control::set_waveform) + .def("get_waveform", &siggen_block_control::get_waveform) + .def("set_amplitude", &siggen_block_control::set_amplitude) + .def("get_amplitude", &siggen_block_control::get_amplitude) + .def("set_constant", &siggen_block_control::set_constant) + .def("get_constant", &siggen_block_control::get_constant) + .def("set_sine_phase_increment", &siggen_block_control::set_sine_phase_increment) + .def("get_sine_phase_increment", &siggen_block_control::get_sine_phase_increment) + .def("set_sine_frequency", &siggen_block_control::set_sine_frequency) + .def("set_samples_per_packet", &siggen_block_control::set_samples_per_packet) + .def("get_samples_per_packet", &siggen_block_control::get_samples_per_packet); +} diff --git a/host/python/pyuhd.cpp b/host/python/pyuhd.cpp index 96d62614f..ccc974d9a 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/siggen_block_control_python.hpp" #include "rfnoc/switchboard_block_control_python.hpp" #include "rfnoc/vector_iir_block_control_python.hpp" #include "rfnoc/window_block_control_python.hpp" @@ -94,6 +95,7 @@ PYBIND11_MODULE(libpyuhd, m) export_moving_average_block_control(rfnoc_module); export_null_block_control(rfnoc_module); export_radio_control(rfnoc_module); + export_siggen_block_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 8dfc18960..cfd0ead2d 100644 --- a/host/python/uhd/rfnoc.py +++ b/host/python/uhd/rfnoc.py @@ -26,6 +26,7 @@ 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 +SiggenBlockControl = lib.rfnoc.siggen_block_control SwitchboardBlockControl = lib.rfnoc.switchboard_block_control VectorIirBlockControl = lib.rfnoc.vector_iir_block_control WindowBlockControl = lib.rfnoc.window_block_control |