diff options
author | mattprost <matt.prost@ni.com> | 2020-08-03 11:36:18 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-08-04 15:40:30 -0500 |
commit | 6d4c07d09ad54155df7ed374e7fbfebd9d40758b (patch) | |
tree | 04383a38191a96d9b4bdfc67e16b6476fcbd6c52 /host | |
parent | 73e6eb5ab8d8f745c60f875d2a906f37aea315ef (diff) | |
download | uhd-6d4c07d09ad54155df7ed374e7fbfebd9d40758b.tar.gz uhd-6d4c07d09ad54155df7ed374e7fbfebd9d40758b.tar.bz2 uhd-6d4c07d09ad54155df7ed374e7fbfebd9d40758b.zip |
python: Add replay RFNoC block controller bindings
Signed-off-by: mattprost <matt.prost@ni.com>
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/rfnoc/replay_block_control_python.hpp | 42 | ||||
-rw-r--r-- | host/python/pyuhd.cpp | 2 | ||||
-rw-r--r-- | host/python/uhd/rfnoc.py | 1 |
3 files changed, 45 insertions, 0 deletions
diff --git a/host/lib/rfnoc/replay_block_control_python.hpp b/host/lib/rfnoc/replay_block_control_python.hpp new file mode 100644 index 000000000..8f8741211 --- /dev/null +++ b/host/lib/rfnoc/replay_block_control_python.hpp @@ -0,0 +1,42 @@ +// +// 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/replay_block_control.hpp> + +using namespace uhd::rfnoc; + +void export_replay_block_control(py::module& m) +{ + py::class_<replay_block_control, noc_block_base, replay_block_control::sptr>( + m, "replay_block_control") + .def(py::init(&block_controller_factory<replay_block_control>::make_from)) + .def("record", &replay_block_control::record) + .def("record_restart", &replay_block_control::record_restart) + .def("play", &replay_block_control::play) + .def("stop", &replay_block_control::stop) + .def("get_mem_size", &replay_block_control::get_mem_size) + .def("get_word_size", &replay_block_control::get_word_size) + .def("get_record_offset", &replay_block_control::get_record_offset) + .def("get_record_size", &replay_block_control::get_record_size) + .def("get_record_fullness", &replay_block_control::get_record_fullness) + .def("get_record_type", &replay_block_control::get_record_type) + .def("get_record_item_size", &replay_block_control::get_record_item_size) + .def("get_play_offset", &replay_block_control::get_play_offset) + .def("get_play_size", &replay_block_control::get_play_size) + .def("get_max_items_per_packet", &replay_block_control::get_max_items_per_packet) + .def("get_max_packet_size", &replay_block_control::get_max_packet_size) + .def("get_play_type", &replay_block_control::get_play_type) + .def("get_play_item_size", &replay_block_control::get_play_item_size) + .def("set_record_type", &replay_block_control::set_record_type) + .def("config_play", &replay_block_control::config_play) + .def("set_play_type", &replay_block_control::set_play_type) + .def("set_max_items_per_packet", &replay_block_control::set_max_items_per_packet) + .def("set_max_packet_size", &replay_block_control::set_max_packet_size) + .def("issue_stream_cmd", &replay_block_control::issue_stream_cmd); +} diff --git a/host/python/pyuhd.cpp b/host/python/pyuhd.cpp index ccc974d9a..605f80b86 100644 --- a/host/python/pyuhd.cpp +++ b/host/python/pyuhd.cpp @@ -22,6 +22,7 @@ namespace py = pybind11; #include "rfnoc/moving_average_block_control_python.hpp" #include "rfnoc/null_block_control_python.hpp" #include "rfnoc/radio_control_python.hpp" +#include "rfnoc/replay_block_control_python.hpp" #include "rfnoc/rfnoc_python.hpp" #include "rfnoc/siggen_block_control_python.hpp" #include "rfnoc/switchboard_block_control_python.hpp" @@ -95,6 +96,7 @@ PYBIND11_MODULE(libpyuhd, m) export_moving_average_block_control(rfnoc_module); export_null_block_control(rfnoc_module); export_radio_control(rfnoc_module); + export_replay_block_control(rfnoc_module); export_siggen_block_control(rfnoc_module); export_switchboard_block_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 cfd0ead2d..05b356e29 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 +ReplayBlockControl = lib.rfnoc.replay_block_control SiggenBlockControl = lib.rfnoc.siggen_block_control SwitchboardBlockControl = lib.rfnoc.switchboard_block_control VectorIirBlockControl = lib.rfnoc.vector_iir_block_control |