aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/include
diff options
context:
space:
mode:
authorBrent Stapleton <brent.stapleton@ettus.com>2018-04-17 13:15:38 -0700
committerMartin Braun <martin.braun@ettus.com>2018-06-27 10:22:25 -0700
commit4f49b4a937c0f6724828fa6ecfa9b14cc0f23f34 (patch)
tree8d2db9a33b03123669f9b9446cf9547cf4da2baa /mpm/include
parent74c41781390ba0352431167d97ecec22c88e2336 (diff)
downloaduhd-4f49b4a937c0f6724828fa6ecfa9b14cc0f23f34.tar.gz
uhd-4f49b4a937c0f6724828fa6ecfa9b14cc0f23f34.tar.bz2
uhd-4f49b4a937c0f6724828fa6ecfa9b14cc0f23f34.zip
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.
Diffstat (limited to 'mpm/include')
-rw-r--r--mpm/include/mpm/spi/spi_iface.hpp4
-rw-r--r--mpm/include/mpm/spi/spi_python.hpp7
2 files changed, 10 insertions, 1 deletions
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 <mpm/types/regs_iface.hpp>
+#include <boost/noncopyable.hpp>
#include <memory>
#include <string>
@@ -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<spi_iface>;
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_<mpm::spi::spi_iface, boost::noncopyable, std::shared_ptr<mpm::spi::spi_iface> >("spi_iface", bp::no_init)
+ .def("transfer24_8", &mpm::spi::spi_iface::transfer24_8)
+ ;
+
}