aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/fe_connection_python.hpp
diff options
context:
space:
mode:
authorPaul David <paul.david@ettus.com>2017-05-02 14:10:05 -0400
committerMartin Braun <martin.braun@ettus.com>2018-06-20 19:02:32 -0500
commite74cf7635ba3360b5b7002a2f7317941f65ffa16 (patch)
tree46b63039f31c5aedf26773b4b626b2a7932999db /host/lib/usrp/fe_connection_python.hpp
parent22e24497a510c174e6de7718ad918a423d1973dd (diff)
downloaduhd-e74cf7635ba3360b5b7002a2f7317941f65ffa16.tar.gz
uhd-e74cf7635ba3360b5b7002a2f7317941f65ffa16.tar.bz2
uhd-e74cf7635ba3360b5b7002a2f7317941f65ffa16.zip
python: Separating exposed Python data structures
- Separating exposed Python data structures into logical sections - Exposes all of the multi_usrp API - Adds a layer of Python for documentation and adding helper methods - Adds improvements and fixes to the MultiUSRP object - Includes additional exposed data structures (like time_spec_t, etc.) - Add code to release the Python GIL during long C++ calls
Diffstat (limited to 'host/lib/usrp/fe_connection_python.hpp')
-rw-r--r--host/lib/usrp/fe_connection_python.hpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/host/lib/usrp/fe_connection_python.hpp b/host/lib/usrp/fe_connection_python.hpp
new file mode 100644
index 000000000..29bba1746
--- /dev/null
+++ b/host/lib/usrp/fe_connection_python.hpp
@@ -0,0 +1,39 @@
+//
+// Copyright 2017-2018 Ettus Research, a National Instruments Company
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+
+#ifndef INCLUDED_UHD_USRP_FE_CONNECTION_PYTHON_HPP
+#define INCLUDED_UHD_USRP_FE_CONNECTION_PYTHON_HPP
+
+#include <uhd/usrp/fe_connection.hpp>
+
+void export_fe_connection()
+{
+ using fe_connection_t = uhd::usrp::fe_connection_t;
+ using sampling_t = fe_connection_t::sampling_t;
+
+ bp::enum_<sampling_t>("sampling")
+ .value("QUADRATURE", sampling_t::QUADRATURE)
+ .value("HETERODYNE", sampling_t::HETERODYNE)
+ .value("REAL" , sampling_t::REAL )
+ ;
+
+ bp::class_<fe_connection_t>
+ ("fe_connection", bp::init<sampling_t, bool, bool, bool, double>())
+
+ // Constructors
+ .def(bp::init<const std::string&, double>())
+
+ // Methods
+ .def("get_sampling_mode", &fe_connection_t::get_sampling_mode)
+ .def("is_iq_swapped" , &fe_connection_t::is_iq_swapped )
+ .def("is_i_inverted" , &fe_connection_t::is_i_inverted )
+ .def("is_q_inverted" , &fe_connection_t::is_q_inverted )
+ .def("get_if_freq" , &fe_connection_t::get_if_freq )
+ .def("set_if_freq" , &fe_connection_t::set_if_freq )
+ ;
+}
+
+#endif /* INCLUDED_UHD_USRP_FE_CONNECTION_PYTHON_HPP */