aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/pyusrp_periphs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mpm/python/pyusrp_periphs.cpp')
-rw-r--r--mpm/python/pyusrp_periphs.cpp53
1 files changed, 44 insertions, 9 deletions
diff --git a/mpm/python/pyusrp_periphs.cpp b/mpm/python/pyusrp_periphs.cpp
index 5a49398c4..348e19c5c 100644
--- a/mpm/python/pyusrp_periphs.cpp
+++ b/mpm/python/pyusrp_periphs.cpp
@@ -1,8 +1,39 @@
-#include "n310_periphs.hpp"
-// #include "tests_periphs.hpp"
-#include "lib_periphs.hpp"
-#include <mpm/print_foo.hpp>
+//
+// Copyright 2017 Ettus Research (National Instruments)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+
+// include hackery to only include boost python and define the macro here
#include <boost/python.hpp>
+#define LIBMPM_PYTHON
+#define LIBMPM_BOOST_PREAMBLE(module) \
+ /* Register submodule types */ \
+ namespace bp = boost::python; \
+ bp::object py_module(bp::handle<>(bp::borrowed(PyImport_AddModule("libpyusrp_periphs." module)))); \
+ bp::scope().attr(module) = py_module; \
+ bp::scope io_scope = py_module;
+
+//#include "types.hpp"
+#include "converters.hpp"
+#include "net_helper.hpp"
+#include "xbar_iface.hpp"
+#include "udev_helper.hpp"
+#include "mykonos/ad937x_ctrl.hpp"
+#include "lmk/lmk04828_spi_iface.hpp"
+//#include "lib_periphs.hpp"
+//#include "dboards.hpp"
#include <boost/noncopyable.hpp>
namespace bp = boost::python;
@@ -11,9 +42,13 @@ BOOST_PYTHON_MODULE(libpyusrp_periphs)
{
bp::object package = bp::scope();
package.attr("__path__") = "libpyusrp_periphs";
- bp::def("print_foo", &mpm::print_foo);
- export_spi();
- // export_tests();
- export_lmk();
- export_n3xx();
+ export_converter();
+ export_net_iface();
+ //export_types();
+ export_udev_helper();
+ //export_spi();
+ //export_lmk();
+ export_mykonos();
+ export_xbar();
+ //export_dboards();
}