diff options
author | mattprost <matt.prost@ni.com> | 2020-07-14 17:28:19 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-07-16 12:14:49 -0500 |
commit | 1ec7380cf708ab335b339f374d1f64826c700154 (patch) | |
tree | 221a076aa93bec2e33c95ddaab3c2c31a186cf03 /host | |
parent | 4c47653b32b419e5a89e3c222f8baa7dbdf6bc05 (diff) | |
download | uhd-1ec7380cf708ab335b339f374d1f64826c700154.tar.gz uhd-1ec7380cf708ab335b339f374d1f64826c700154.tar.bz2 uhd-1ec7380cf708ab335b339f374d1f64826c700154.zip |
python: Add moving average RFNoC block controller bindings
Signed-off-by: mattprost <matt.prost@ni.com>
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/rfnoc/moving_average_block_control_python.hpp | 24 | ||||
-rw-r--r-- | host/python/pyuhd.cpp | 2 | ||||
-rw-r--r-- | host/python/uhd/rfnoc.py | 1 |
3 files changed, 27 insertions, 0 deletions
diff --git a/host/lib/rfnoc/moving_average_block_control_python.hpp b/host/lib/rfnoc/moving_average_block_control_python.hpp new file mode 100644 index 000000000..67fd9b594 --- /dev/null +++ b/host/lib/rfnoc/moving_average_block_control_python.hpp @@ -0,0 +1,24 @@ +// +// 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/moving_average_block_control.hpp> + +using namespace uhd::rfnoc; + +void export_moving_average_block_control(py::module& m) +{ + py::class_<moving_average_block_control, + noc_block_base, + moving_average_block_control::sptr>(m, "moving_average_block_control") + .def(py::init(&block_controller_factory<moving_average_block_control>::make_from)) + .def("set_sum_len", &moving_average_block_control::set_sum_len) + .def("get_sum_len", &moving_average_block_control::get_sum_len) + .def("set_divisor", &moving_average_block_control::set_divisor) + .def("get_divisor", &moving_average_block_control::get_divisor); +} diff --git a/host/python/pyuhd.cpp b/host/python/pyuhd.cpp index 9f1a07c43..6012ddfd5 100644 --- a/host/python/pyuhd.cpp +++ b/host/python/pyuhd.cpp @@ -19,6 +19,7 @@ namespace py = pybind11; #include "rfnoc/fft_block_control_python.hpp" #include "rfnoc/fir_filter_block_control_python.hpp" #include "rfnoc/fosphor_block_control_python.hpp" +#include "rfnoc/moving_average_block_control_python.hpp" #include "rfnoc/null_block_control_python.hpp" #include "rfnoc/radio_control_python.hpp" #include "rfnoc/rfnoc_python.hpp" @@ -89,6 +90,7 @@ PYBIND11_MODULE(libpyuhd, m) export_fft_block_control(rfnoc_module); export_fosphor_block_control(rfnoc_module); export_fir_filter_block_control(rfnoc_module); + export_moving_average_block_control(rfnoc_module); export_null_block_control(rfnoc_module); export_radio_control(rfnoc_module); export_vector_iir_block_control(rfnoc_module); diff --git a/host/python/uhd/rfnoc.py b/host/python/uhd/rfnoc.py index 60699226e..01f632a83 100644 --- a/host/python/uhd/rfnoc.py +++ b/host/python/uhd/rfnoc.py @@ -23,6 +23,7 @@ DucBlockControl = lib.rfnoc.duc_block_control FftBlockControl = lib.rfnoc.fft_block_control FosphorBlockControl = lib.rfnoc.fosphor_block_control 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 VectorIirBlockControl = lib.rfnoc.vector_iir_block_control |