1 //
2 // Copyright 2020 Ettus Research, a National Instruments Brand
3 //
4 // SPDX-License-Identifier: GPL-3.0-or-later
5 //
6
7 #pragma once
8
9 #include "block_controller_factory_python.hpp"
10 #include <uhd/rfnoc/fosphor_block_control.hpp>
11
12 using namespace uhd::rfnoc;
13
export_fosphor_block_control(py::module & m)14 void export_fosphor_block_control(py::module& m)
15 {
16 py::enum_<fosphor_waterfall_mode>(m, "fosphor_waterfall_mode")
17 .value("MAX_HOLD", fosphor_waterfall_mode::MAX_HOLD)
18 .value("AVERAGE", fosphor_waterfall_mode::AVERAGE)
19 .export_values();
20
21 py::enum_<fosphor_waterfall_predivision_ratio>(
22 m, "fosphor_waterfall_predivision_ratio")
23 .value("RATIO_1_1", fosphor_waterfall_predivision_ratio::RATIO_1_1)
24 .value("RATIO_1_8", fosphor_waterfall_predivision_ratio::RATIO_1_8)
25 .value("RATIO_1_64", fosphor_waterfall_predivision_ratio::RATIO_1_64)
26 .value("RATIO_1_256", fosphor_waterfall_predivision_ratio::RATIO_1_256)
27 .export_values();
28
29 py::class_<fosphor_block_control, noc_block_base, fosphor_block_control::sptr>(
30 m, "fosphor_block_control")
31 .def(py::init(&block_controller_factory<fosphor_block_control>::make_from))
32 .def("set_enable_histogram", &fosphor_block_control::set_enable_histogram)
33 .def("get_enable_histogram", &fosphor_block_control::get_enable_histogram)
34 .def("set_enable_waterfall", &fosphor_block_control::set_enable_waterfall)
35 .def("get_enable_waterfall", &fosphor_block_control::get_enable_waterfall)
36 .def("clear_history", &fosphor_block_control::clear_history)
37 .def("set_enable_dither", &fosphor_block_control::set_enable_dither)
38 .def("get_enable_dither", &fosphor_block_control::get_enable_dither)
39 .def("set_enable_noise", &fosphor_block_control::set_enable_noise)
40 .def("get_enable_noise", &fosphor_block_control::get_enable_noise)
41 .def("set_histogram_decimation", &fosphor_block_control::set_histogram_decimation)
42 .def("get_histogram_decimation", &fosphor_block_control::get_histogram_decimation)
43 .def("set_histogram_offset", &fosphor_block_control::set_histogram_offset)
44 .def("get_histogram_offset", &fosphor_block_control::get_histogram_offset)
45 .def("set_histogram_scale", &fosphor_block_control::set_histogram_scale)
46 .def("get_histogram_scale", &fosphor_block_control::get_histogram_scale)
47 .def("set_histogram_rise_rate", &fosphor_block_control::set_histogram_rise_rate)
48 .def("get_histogram_rise_rate", &fosphor_block_control::get_histogram_rise_rate)
49 .def("set_histogram_decay_rate", &fosphor_block_control::set_histogram_decay_rate)
50 .def("get_histogram_decay_rate", &fosphor_block_control::get_histogram_decay_rate)
51 .def("set_spectrum_alpha", &fosphor_block_control::set_spectrum_alpha)
52 .def("get_spectrum_alpha", &fosphor_block_control::get_spectrum_alpha)
53 .def("set_spectrum_max_hold_decay",
54 &fosphor_block_control::set_spectrum_max_hold_decay)
55 .def("get_spectrum_max_hold_decay",
56 &fosphor_block_control::get_spectrum_max_hold_decay)
57 .def("set_waterfall_predivision",
58 &fosphor_block_control::set_waterfall_predivision)
59 .def("get_waterfall_predivision",
60 &fosphor_block_control::get_waterfall_predivision)
61 .def("set_waterfall_mode", &fosphor_block_control::set_waterfall_mode)
62 .def("get_waterfall_mode", &fosphor_block_control::get_waterfall_mode)
63 .def("set_waterfall_decimation", &fosphor_block_control::set_waterfall_decimation)
64 .def(
65 "get_waterfall_decimation", &fosphor_block_control::get_waterfall_decimation);
66 }
67