diff options
author | Andrej Rode <andrej.rode@ettus.com> | 2017-03-21 19:46:50 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:03:44 -0800 |
commit | ef6326a174e6880be5e2eaeac26a2c5de0768807 (patch) | |
tree | c949545e02390745c3a373e657bcf2404e62e191 /mpm/python/pyusrp_periphs.cpp | |
parent | b29246a9e2d7ed1e03e44cfc6804615fcfa5a5d8 (diff) | |
download | uhd-ef6326a174e6880be5e2eaeac26a2c5de0768807.tar.gz uhd-ef6326a174e6880be5e2eaeac26a2c5de0768807.tar.bz2 uhd-ef6326a174e6880be5e2eaeac26a2c5de0768807.zip |
mpm: python refactoring
Diffstat (limited to 'mpm/python/pyusrp_periphs.cpp')
-rw-r--r-- | mpm/python/pyusrp_periphs.cpp | 53 |
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(); } |