aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/rfnoc/radio_control_python.hpp
blob: f16f0b6e9dabc04d162059d04113e3835dd1fe32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
//
// Copyright 2020 Ettus Research, a National Instruments Brand
//
// SPDX-License-Identifier: GPL-3.0-or-later
//

#pragma once

#include <uhd/rfnoc/radio_control.hpp>
#include "block_controller_factory_python.hpp"

using namespace uhd::rfnoc;

void export_radio_control(py::module& m)
{
    py::class_<radio_control, noc_block_base, radio_control::sptr>(m, "radio_control")
        .def(py::init(&block_controller_factory<radio_control>::make_from))
        .def("set_rate", &radio_control::set_rate)
        .def("get_rate", &radio_control::get_rate)
        .def("get_rate_range", &radio_control::get_rate_range)
        .def("get_tx_antenna", &radio_control::get_tx_antenna)
        .def("get_tx_antennas", &radio_control::get_tx_antennas)
        .def("set_tx_antenna", &radio_control::set_tx_antenna)
        .def("get_rx_antenna", &radio_control::get_rx_antenna)
        .def("get_rx_antennas", &radio_control::get_rx_antennas)
        .def("set_rx_antenna", &radio_control::set_rx_antenna)
        .def("get_tx_frequency", &radio_control::get_tx_frequency)
        .def("set_tx_frequency", &radio_control::set_tx_frequency)
        .def("set_tx_tune_args", &radio_control::set_tx_tune_args)
        .def("get_tx_frequency_range", &radio_control::get_tx_frequency_range)
        .def("get_rx_frequency", &radio_control::get_rx_frequency)
        .def("set_rx_frequency", &radio_control::set_rx_frequency)
        .def("set_rx_tune_args", &radio_control::set_rx_tune_args)
        .def("get_rx_frequency_range", &radio_control::get_rx_frequency_range)
        .def("get_tx_gain_names", &radio_control::get_tx_gain_names)
        .def("get_tx_gain_range",
            py::overload_cast<const size_t>(
                &radio_control::get_tx_gain_range, py::const_),
            py::arg("chan"))
        .def("get_tx_gain_range",
            py::overload_cast<const std::string&, const size_t>(
                &radio_control::get_tx_gain_range, py::const_),
            py::arg("name"),
            py::arg("chan"))
        .def("get_tx_gain",
            py::overload_cast<const size_t>(&radio_control::get_tx_gain),
            py::arg("chan"))
        .def("get_tx_gain",
            py::overload_cast<const std::string&, const size_t>(
                &radio_control::get_tx_gain),
            py::arg("name"),
            py::arg("chan"))
        .def("set_tx_gain",
            py::overload_cast<const double, const size_t>(&radio_control::set_tx_gain),
            py::arg("gain"),
            py::arg("chan"))
        .def("set_tx_gain",
            py::overload_cast<const double, const std::string&, const size_t>(
                &radio_control::set_tx_gain),
            py::arg("gain"),
            py::arg("name"),
            py::arg("chan"))
        .def("has_tx_power_reference", &radio_control::has_tx_power_reference)
        .def("set_tx_power_reference", &radio_control::set_tx_power_reference)
        .def("get_tx_power_reference", &radio_control::get_tx_power_reference)
        .def("get_tx_power_ref_keys",
            &radio_control::get_tx_power_ref_keys,
            py::arg("chan") = 0)
        .def("get_rx_gain_names", &radio_control::get_rx_gain_names)
        .def("get_rx_gain_range",
            py::overload_cast<const size_t>(
                &radio_control::get_rx_gain_range, py::const_),
            py::arg("chan"))
        .def("get_rx_gain_range",
            py::overload_cast<const std::string&, const size_t>(
                &radio_control::get_rx_gain_range, py::const_),
            py::arg("name"),
            py::arg("chan"))
        .def("get_rx_gain",
            py::overload_cast<const size_t>(&radio_control::get_rx_gain),
            py::arg("chan"))
        .def("get_rx_gain",
            py::overload_cast<const std::string&, const size_t>(
                &radio_control::get_rx_gain),
            py::arg("name"),
            py::arg("chan"))
        .def("set_rx_gain",
            py::overload_cast<const double, const size_t>(&radio_control::set_rx_gain),
            py::arg("gain"),
            py::arg("chan"))
        .def("set_rx_gain",
            py::overload_cast<const double, const std::string&, const size_t>(
                &radio_control::set_rx_gain),
            py::arg("gain"),
            py::arg("name"),
            py::arg("chan"))
        .def("set_rx_agc", &radio_control::set_rx_agc)
        .def("has_rx_power_reference", &radio_control::has_rx_power_reference)
        .def("set_rx_power_reference", &radio_control::set_rx_power_reference)
        .def("get_rx_power_reference", &radio_control::get_rx_power_reference)
        .def("get_rx_power_ref_keys",
            &radio_control::get_rx_power_ref_keys,
            py::arg("chan") = 0)
        .def("get_tx_gain_profile_names", &radio_control::get_tx_gain_profile_names)
        .def("get_rx_gain_profile_names", &radio_control::get_rx_gain_profile_names)
        .def("set_tx_gain_profile", &radio_control::set_tx_gain_profile)
        .def("set_rx_gain_profile", &radio_control::set_rx_gain_profile)
        .def("get_tx_gain_profile", &radio_control::get_tx_gain_profile)
        .def("get_rx_gain_profile", &radio_control::get_rx_gain_profile)
        .def("get_tx_bandwidth_range", &radio_control::get_tx_bandwidth_range)
        .def("get_tx_bandwidth", &radio_control::get_tx_bandwidth)
        .def("set_tx_bandwidth", &radio_control::set_tx_bandwidth)
        .def("get_rx_bandwidth_range", &radio_control::get_rx_bandwidth_range)
        .def("get_rx_bandwidth", &radio_control::get_rx_bandwidth)
        .def("set_rx_bandwidth", &radio_control::set_rx_bandwidth)
        .def("get_rx_lo_names", &radio_control::get_rx_lo_names)
        .def("get_rx_lo_sources", &radio_control::get_rx_lo_sources)
        .def("get_rx_lo_freq_range", &radio_control::get_rx_lo_freq_range)
        .def("set_rx_lo_source", &radio_control::set_rx_lo_source)
        .def("get_rx_lo_source", &radio_control::get_rx_lo_source)
        .def("set_rx_lo_export_enabled", &radio_control::set_rx_lo_export_enabled)
        .def("get_rx_lo_export_enabled", &radio_control::get_rx_lo_export_enabled)
        .def("set_rx_lo_freq", &radio_control::set_rx_lo_freq)
        .def("get_rx_lo_freq", &radio_control::get_rx_lo_freq)
        .def("get_tx_lo_names", &radio_control::get_tx_lo_names)
        .def("get_tx_lo_sources", &radio_control::get_tx_lo_sources)
        .def("get_tx_lo_freq_range", &radio_control::get_tx_lo_freq_range)
        .def("set_tx_lo_source", &radio_control::set_tx_lo_source)
        .def("get_tx_lo_source", &radio_control::get_tx_lo_source)
        .def("set_tx_lo_export_enabled", &radio_control::set_tx_lo_export_enabled)
        .def("get_tx_lo_export_enabled", &radio_control::get_tx_lo_export_enabled)
        .def("set_tx_lo_freq", &radio_control::set_tx_lo_freq)
        .def("get_tx_lo_freq", &radio_control::get_tx_lo_freq)
        .def("set_tx_dc_offset", &radio_control::set_tx_dc_offset)
        .def("get_tx_dc_offset_range", &radio_control::get_tx_dc_offset_range)
        .def("set_tx_iq_balance", &radio_control::set_tx_iq_balance)
        .def("set_rx_dc_offset",
            py::overload_cast<const bool, size_t>(&radio_control::set_rx_dc_offset),
            py::arg("enb"),
            py::arg("chan") = radio_control::ALL_CHANS)
        .def("set_rx_dc_offset",
            py::overload_cast<const std::complex<double>&, size_t>(
                &radio_control::set_rx_dc_offset),
            py::arg("offset"),
            py::arg("chan"))
        .def("get_rx_dc_offset_range", &radio_control::get_rx_dc_offset_range)
        .def("set_rx_iq_balance",
            py::overload_cast<const bool, size_t>(&radio_control::set_rx_iq_balance),
            py::arg("enb"),
            py::arg("chan"))
        .def("set_rx_iq_balance",
            py::overload_cast<const std::complex<double>&, size_t>(
                &radio_control::set_rx_iq_balance),
            py::arg("correction"),
            py::arg("chan"))
        .def("get_gpio_banks", &radio_control::get_gpio_banks)
        .def("set_gpio_attr", &radio_control::set_gpio_attr)
        .def("get_gpio_attr", &radio_control::get_gpio_attr)
        .def("get_rx_sensor_names", &radio_control::get_rx_sensor_names)
        .def("get_rx_sensor", &radio_control::get_rx_sensor)
        .def("get_tx_sensor_names", &radio_control::get_tx_sensor_names)
        .def("get_tx_sensor", &radio_control::get_tx_sensor)
        .def("issue_stream_cmd", &radio_control::issue_stream_cmd)
        .def("enable_rx_timestamps", &radio_control::enable_rx_timestamps)
        .def("get_slot_name", &radio_control::get_slot_name)
        .def("get_chan_from_dboard_fe", &radio_control::get_chan_from_dboard_fe)
        .def("get_dboard_fe_from_chan", &radio_control::get_dboard_fe_from_chan)
        .def("get_fe_name", &radio_control::get_fe_name)
        .def("set_db_eeprom", &radio_control::set_db_eeprom)
        .def("get_db_eeprom", &radio_control::get_db_eeprom);
}