diff options
author | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-06-01 14:56:16 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-06-09 07:09:34 -0500 |
commit | 1117ef6cf0622d9ab1748b54acf91f0dd2f7d6bb (patch) | |
tree | 8fea58dd4c1c16e59c1cfebdbca3e4bc911846e2 | |
parent | 5d861ec14f5fdbdaa709d560946a3b77499c7858 (diff) | |
download | uhd-1117ef6cf0622d9ab1748b54acf91f0dd2f7d6bb.tar.gz uhd-1117ef6cf0622d9ab1748b54acf91f0dd2f7d6bb.tar.bz2 uhd-1117ef6cf0622d9ab1748b54acf91f0dd2f7d6bb.zip |
python: Add Fosphor RFNoC block controller bindings
-rw-r--r-- | host/lib/rfnoc/fosphor_block_control_python.hpp | 66 | ||||
-rw-r--r-- | host/python/pyuhd.cpp | 2 | ||||
-rw-r--r-- | host/python/uhd/rfnoc.py | 1 |
3 files changed, 69 insertions, 0 deletions
diff --git a/host/lib/rfnoc/fosphor_block_control_python.hpp b/host/lib/rfnoc/fosphor_block_control_python.hpp new file mode 100644 index 000000000..49363ad93 --- /dev/null +++ b/host/lib/rfnoc/fosphor_block_control_python.hpp @@ -0,0 +1,66 @@ +// +// 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/fosphor_block_control.hpp> + +using namespace uhd::rfnoc; + +void export_fosphor_block_control(py::module& m) +{ + py::enum_<fosphor_waterfall_mode>(m, "fosphor_waterfall_mode") + .value("MAX_HOLD", fosphor_waterfall_mode::MAX_HOLD) + .value("AVERAGE", fosphor_waterfall_mode::AVERAGE) + .export_values(); + + py::enum_<fosphor_waterfall_predivision_ratio>( + m, "fosphor_waterfall_predivision_ratio") + .value("RATIO_1_1", fosphor_waterfall_predivision_ratio::RATIO_1_1) + .value("RATIO_1_8", fosphor_waterfall_predivision_ratio::RATIO_1_8) + .value("RATIO_1_64", fosphor_waterfall_predivision_ratio::RATIO_1_64) + .value("RATIO_1_256", fosphor_waterfall_predivision_ratio::RATIO_1_256) + .export_values(); + + py::class_<fosphor_block_control, noc_block_base, fosphor_block_control::sptr>( + m, "fosphor_block_control") + .def(py::init(&block_controller_factory<fosphor_block_control>::make_from)) + .def("set_enable_histogram", &fosphor_block_control::set_enable_histogram) + .def("get_enable_histogram", &fosphor_block_control::get_enable_histogram) + .def("set_enable_waterfall", &fosphor_block_control::set_enable_waterfall) + .def("get_enable_waterfall", &fosphor_block_control::get_enable_waterfall) + .def("clear_history", &fosphor_block_control::clear_history) + .def("set_enable_dither", &fosphor_block_control::set_enable_dither) + .def("get_enable_dither", &fosphor_block_control::get_enable_dither) + .def("set_enable_noise", &fosphor_block_control::set_enable_noise) + .def("get_enable_noise", &fosphor_block_control::get_enable_noise) + .def("set_histogram_decimation", &fosphor_block_control::set_histogram_decimation) + .def("get_histogram_decimation", &fosphor_block_control::get_histogram_decimation) + .def("set_histogram_offset", &fosphor_block_control::set_histogram_offset) + .def("get_histogram_offset", &fosphor_block_control::get_histogram_offset) + .def("set_histogram_scale", &fosphor_block_control::set_histogram_scale) + .def("get_histogram_scale", &fosphor_block_control::get_histogram_scale) + .def("set_histogram_rise_rate", &fosphor_block_control::set_histogram_rise_rate) + .def("get_histogram_rise_rate", &fosphor_block_control::get_histogram_rise_rate) + .def("set_histogram_decay_rate", &fosphor_block_control::set_histogram_decay_rate) + .def("get_histogram_decay_rate", &fosphor_block_control::get_histogram_decay_rate) + .def("set_spectrum_alpha", &fosphor_block_control::set_spectrum_alpha) + .def("get_spectrum_alpha", &fosphor_block_control::get_spectrum_alpha) + .def("set_spectrum_max_hold_decay", + &fosphor_block_control::set_spectrum_max_hold_decay) + .def("get_spectrum_max_hold_decay", + &fosphor_block_control::get_spectrum_max_hold_decay) + .def("set_waterfall_predivision", + &fosphor_block_control::set_waterfall_predivision) + .def("get_waterfall_predivision", + &fosphor_block_control::get_waterfall_predivision) + .def("set_waterfall_mode", &fosphor_block_control::set_waterfall_mode) + .def("get_waterfall_mode", &fosphor_block_control::get_waterfall_mode) + .def("set_waterfall_decimation", &fosphor_block_control::set_waterfall_decimation) + .def( + "get_waterfall_decimation", &fosphor_block_control::get_waterfall_decimation); +} diff --git a/host/python/pyuhd.cpp b/host/python/pyuhd.cpp index 2d807e4ea..dacf60acf 100644 --- a/host/python/pyuhd.cpp +++ b/host/python/pyuhd.cpp @@ -16,6 +16,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/fosphor_block_control_python.hpp" #include "rfnoc/rfnoc_python.hpp" #include "stream_python.hpp" #include "types/filters_python.hpp" @@ -78,6 +79,7 @@ PYBIND11_MODULE(libpyuhd, m) export_rfnoc(rfnoc_module); export_ddc_block_control(rfnoc_module); export_duc_block_control(rfnoc_module); + export_fosphor_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 cc57eb057..c121d65a8 100644 --- a/host/python/uhd/rfnoc.py +++ b/host/python/uhd/rfnoc.py @@ -20,4 +20,5 @@ Timekeeper = lib.rfnoc.timekeeper NocBlock = lib.rfnoc.noc_block_base DdcBlockControl = lib.rfnoc.ddc_block_control DucBlockControl = lib.rfnoc.duc_block_control +FosphorBlockControl = lib.rfnoc.fosphor_block_control |