From 4f49b4a937c0f6724828fa6ecfa9b14cc0f23f34 Mon Sep 17 00:00:00 2001 From: Brent Stapleton Date: Tue, 17 Apr 2018 13:15:38 -0700 Subject: mpm: adding adf400x support to chips Adding ADF400X driver to MPM. This uses the Boost.Python bound spidev, and is largely a translation from the C++ driver in UHD. --- mpm/include/mpm/spi/spi_iface.hpp | 4 +++- mpm/include/mpm/spi/spi_python.hpp | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'mpm/include') diff --git a/mpm/include/mpm/spi/spi_iface.hpp b/mpm/include/mpm/spi/spi_iface.hpp index 2cc5d740f..c3e17c0f3 100644 --- a/mpm/include/mpm/spi/spi_iface.hpp +++ b/mpm/include/mpm/spi/spi_iface.hpp @@ -6,6 +6,8 @@ #pragma once +#include +#include #include #include @@ -13,7 +15,7 @@ namespace mpm { namespace spi { /*! Implementation of a uhd::spi_iface that uses Linux' spidev underneath. */ - class spi_iface + class spi_iface : public boost::noncopyable { public: using sptr = std::shared_ptr; diff --git a/mpm/include/mpm/spi/spi_python.hpp b/mpm/include/mpm/spi/spi_python.hpp index 49c34b0b6..ab6a7a232 100644 --- a/mpm/include/mpm/spi/spi_python.hpp +++ b/mpm/include/mpm/spi/spi_python.hpp @@ -7,10 +7,17 @@ #pragma once #include "spi_regs_iface.hpp" +#include "spi_iface.hpp" void export_spi() { LIBMPM_BOOST_PREAMBLE("spi") bp::def("make_spidev_regs_iface", &mpm::spi::make_spidev_regs_iface); + bp::def("make_spidev", &mpm::spi::spi_iface::make_spidev); + + bp::class_ >("spi_iface", bp::no_init) + .def("transfer24_8", &mpm::spi::spi_iface::transfer24_8) + ; + } -- cgit v1.2.3