From 7fb8523c935cbcda7fd0dbcbad0ac8c2e6dd1fc7 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 4 Jun 2019 22:54:25 -0700 Subject: lib: cores: Adapt spi_core_3000 for use with register_iface Removes the requirement for a wb_iface, and also the requirement for regs to be 4 addresses apart. --- host/lib/include/uhdlib/usrp/cores/spi_core_3000.hpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'host/lib/include/uhdlib/usrp') diff --git a/host/lib/include/uhdlib/usrp/cores/spi_core_3000.hpp b/host/lib/include/uhdlib/usrp/cores/spi_core_3000.hpp index 81ea05a37..36486b5a1 100644 --- a/host/lib/include/uhdlib/usrp/cores/spi_core_3000.hpp +++ b/host/lib/include/uhdlib/usrp/cores/spi_core_3000.hpp @@ -13,17 +13,28 @@ #include #include #include +#include +#include class spi_core_3000 : uhd::noncopyable, public uhd::spi_iface { public: - typedef boost::shared_ptr sptr; + using sptr = boost::shared_ptr; + using poke32_fn_t = std::function; + using peek32_fn_t = std::function; virtual ~spi_core_3000(void) = 0; //! makes a new spi core from iface and slave base static sptr make(uhd::wb_iface::sptr iface, const size_t base, const size_t readback); + //! makes a new spi core from register iface and slave base + static sptr make(poke32_fn_t&& poke32_fn, + peek32_fn_t&& peek32_fn, + const size_t base, + const size_t reg_offset, + const size_t readback); + //! Set the spi clock divider to something usable virtual void set_divider(const double div) = 0; -- cgit v1.2.3