aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/include/uhdlib
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/include/uhdlib')
-rw-r--r--host/lib/include/uhdlib/usrp/cores/spi_core_3000.hpp13
1 files changed, 12 insertions, 1 deletions
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 <uhd/utils/noncopyable.hpp>
#include <uhd/types/wb_iface.hpp>
#include <boost/shared_ptr.hpp>
+#include <memory>
+#include <functional>
class spi_core_3000 : uhd::noncopyable, public uhd::spi_iface
{
public:
- typedef boost::shared_ptr<spi_core_3000> sptr;
+ using sptr = boost::shared_ptr<spi_core_3000>;
+ using poke32_fn_t = std::function<void(uint32_t, uint32_t)>;
+ using peek32_fn_t = std::function<uint32_t(uint32_t)>;
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;