aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mpm/include/lmk/lmk04828_spi_iface.hpp3
-rw-r--r--mpm/lib/lmk04828/lmk04828_spi_iface.cpp5
2 files changed, 8 insertions, 0 deletions
diff --git a/mpm/include/lmk/lmk04828_spi_iface.hpp b/mpm/include/lmk/lmk04828_spi_iface.hpp
index 3338bd6d1..013271af1 100644
--- a/mpm/include/lmk/lmk04828_spi_iface.hpp
+++ b/mpm/include/lmk/lmk04828_spi_iface.hpp
@@ -1,12 +1,15 @@
#include "lmk04828.hpp"
#include "uhd/types/serial.hpp"
+#include <boost/shared_ptr.hpp>
class lmk04828_spi_iface
{
public:
+ using sptr = boost::shared_ptr<lmk04828_spi_iface>;
lmk04828_spi_iface(uhd::spi_iface::sptr iface);
lmk04828_iface::write_fn_t get_write_fn();
lmk04828_iface::read_fn_t get_read_fn();
+ static sptr make(uhd::spi_iface::sptr iface);
private:
const int LMK_SPI_NUM_BITS = 24;
diff --git a/mpm/lib/lmk04828/lmk04828_spi_iface.cpp b/mpm/lib/lmk04828/lmk04828_spi_iface.cpp
index e281467e1..2e3b43a3c 100644
--- a/mpm/lib/lmk04828/lmk04828_spi_iface.cpp
+++ b/mpm/lib/lmk04828/lmk04828_spi_iface.cpp
@@ -1,6 +1,7 @@
#include "lmk/lmk04828_spi_iface.hpp"
#include "uhd/exception.hpp"
#include <boost/bind.hpp>
+#include <boost/make_shared.hpp>
lmk04828_spi_iface::lmk04828_spi_iface(uhd::spi_iface::sptr iface) : _spi_iface(iface)
{
@@ -41,3 +42,7 @@ uint8_t lmk04828_spi_iface::spi_read(uint32_t addr) {
return data & 0xFF;
}
+
+lmk04828_spi_iface::sptr lmk04828_spi_iface::make(uhd::spi_iface::sptr iface){
+ return boost::make_shared<lmk04828_spi_iface>(iface);
+}