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
|
//
// Copyright 2018 Ettus Research, a National Instruments Company
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
#pragma once
// Relative to uhd/host/lib/usrp/common/ad9361_driver/
#include "../../../include/uhdlib/usrp/common/ad9361_ctrl.hpp"
#include <boost/make_shared.hpp>
#include <boost/noncopyable.hpp>
#include <functional>
#include <string>
#include <vector>
namespace mpm { namespace chips {
using uhd::usrp::ad9361_ctrl;
}};
//TODO: pull in filter_info_base
#ifdef LIBMPM_PYTHON
void export_catalina(){
LIBMPM_BOOST_PREAMBLE("ad9361")
using namespace mpm::chips;
bp::class_<ad9361_ctrl, boost::noncopyable, boost::shared_ptr<ad9361_ctrl>>("ad9361_ctrl", bp::no_init)
.def("get_gain_names", &ad9361_ctrl::get_gain_names)
.staticmethod("get_gain_names")
// Make this "Python private" because the return value can't be serialized
.def("_get_gain_range", &ad9361_ctrl::get_gain_range)
.staticmethod("_get_gain_range")
.def("get_rf_freq_range", &ad9361_ctrl::get_rf_freq_range)
.staticmethod("get_rf_freq_range")
.def("get_bw_filter_range", &ad9361_ctrl::get_bw_filter_range)
.staticmethod("get_bw_filter_range")
.def("get_clock_rate_range", &ad9361_ctrl::get_clock_rate_range)
.staticmethod("get_clock_rate_range")
.def("set_bw_filter", &ad9361_ctrl::set_bw_filter)
.def("set_gain", &ad9361_ctrl::set_gain)
.def("set_agc", &ad9361_ctrl::set_agc)
.def("set_agc_mode", &ad9361_ctrl::set_agc_mode)
.def("set_clock_rate", &ad9361_ctrl::set_clock_rate)
.def("set_active_chains", &ad9361_ctrl::set_active_chains)
.def("set_timing_mode", &ad9361_ctrl::set_timing_mode)
.def("tune", &ad9361_ctrl::tune)
.def("set_dc_offset", &ad9361_ctrl::set_dc_offset)
.def("set_dc_offset_auto", &ad9361_ctrl::set_dc_offset_auto)
.def("set_iq_balance", &ad9361_ctrl::set_iq_balance)
.def("set_iq_balance_auto", &ad9361_ctrl::set_iq_balance_auto)
.def("get_freq", &ad9361_ctrl::get_freq)
.def("data_port_loopback", &ad9361_ctrl::data_port_loopback)
.def("get_rssi", +[](ad9361_ctrl& self, std::string which) {
return self.get_rssi(which).to_real();
})
.def("get_temperature", +[](ad9361_ctrl& self) {
return self.get_temperature().to_real();
})
.def("get_filter_names", &ad9361_ctrl::get_filter_names)
// Make this "Python private" because the return value can't be serialized.
.def("_get_filter", &ad9361_ctrl::get_filter)
.def("set_filter", &ad9361_ctrl::set_filter)
.def("output_digital_test_tone", &ad9361_ctrl::output_digital_test_tone)
;
}
#endif
|