diff options
author | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-08-05 07:37:38 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-08-05 07:47:22 -0500 |
commit | cf614ae5e053d06e55b50b45aa9fec65d1a2c481 (patch) | |
tree | 16338ee41c85c500d05f36a3a5453b5e8011c4b2 /host/lib | |
parent | 72e4cc81d2d3305b7e5b9d6f884b10120547700e (diff) | |
download | uhd-cf614ae5e053d06e55b50b45aa9fec65d1a2c481.tar.gz uhd-cf614ae5e053d06e55b50b45aa9fec65d1a2c481.tar.bz2 uhd-cf614ae5e053d06e55b50b45aa9fec65d1a2c481.zip |
python: Add Keep One in N block controller bindings
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/rfnoc/keep_one_in_n_block_control_python.hpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/host/lib/rfnoc/keep_one_in_n_block_control_python.hpp b/host/lib/rfnoc/keep_one_in_n_block_control_python.hpp new file mode 100644 index 000000000..35b9df8f2 --- /dev/null +++ b/host/lib/rfnoc/keep_one_in_n_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/keep_one_in_n_block_control.hpp> + +using namespace uhd::rfnoc; + +void export_keep_one_in_n_block_control(py::module& m) +{ + py::class_<keep_one_in_n_block_control, + noc_block_base, + keep_one_in_n_block_control::sptr>(m, "keep_one_in_n_block_control") + .def(py::init(&block_controller_factory<keep_one_in_n_block_control>::make_from)) + .def("get_max_n", &keep_one_in_n_block_control::get_max_n) + .def("get_n", &keep_one_in_n_block_control::get_n, + py::arg("chan") = 0) + .def("set_n", &keep_one_in_n_block_control::set_n, + py::arg("n"), + py::arg("chan") = 0) + .def("get_mode", &keep_one_in_n_block_control::get_mode, + py::arg("chan") = 0) + .def("set_mode", &keep_one_in_n_block_control::set_mode, + py::arg("mode"), + py::arg("chan") = 0); +} |