aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--host/lib/usrp/cores/spi_core_3000.cpp19
-rw-r--r--host/lib/usrp/cores/spi_core_3000.hpp7
2 files changed, 23 insertions, 3 deletions
diff --git a/host/lib/usrp/cores/spi_core_3000.cpp b/host/lib/usrp/cores/spi_core_3000.cpp
index d33624b0d..01df71cec 100644
--- a/host/lib/usrp/cores/spi_core_3000.cpp
+++ b/host/lib/usrp/cores/spi_core_3000.cpp
@@ -20,9 +20,10 @@
#include <uhd/utils/msg.hpp>
#include <boost/thread/thread.hpp> //sleep
-#define SPI_DIV _base + 0
-#define SPI_CTRL _base + 4
-#define SPI_DATA _base + 8
+#define SPI_DIV _base + 0
+#define SPI_CTRL _base + 4
+#define SPI_DATA _base + 8
+#define SPI_SHUTDOWN _base + 12
using namespace uhd;
@@ -91,6 +92,17 @@ public:
return 0;
}
+ void set_shutdown(const bool shutdown)
+ {
+ _shutdown_cache = shutdown;
+ _iface->poke32(SPI_SHUTDOWN, _shutdown_cache);
+ }
+
+ bool get_shutdown()
+ {
+ return(_shutdown_cache);
+ }
+
void set_divider(const double div)
{
_div = size_t((div/2) - 0.5);
@@ -102,6 +114,7 @@ private:
const size_t _base;
const size_t _readback;
boost::uint32_t _ctrl_word_cache;
+ bool _shutdown_cache;
boost::mutex _mutex;
size_t _div;
size_t _divider_cache;
diff --git a/host/lib/usrp/cores/spi_core_3000.hpp b/host/lib/usrp/cores/spi_core_3000.hpp
index 6a439772e..8d5177196 100644
--- a/host/lib/usrp/cores/spi_core_3000.hpp
+++ b/host/lib/usrp/cores/spi_core_3000.hpp
@@ -36,6 +36,13 @@ public:
//! Set the spi clock divider to something usable
virtual void set_divider(const double div) = 0;
+
+ //! Place SPI core in shutdown mode. All attempted SPI transactions are dropped by
+ // the core.
+ virtual void set_shutdown(const bool shutdown) = 0;
+
+ //! Get state of shutdown register
+ virtual bool get_shutdown() = 0;
};
#endif /* INCLUDED_LIBUHD_USRP_SPI_CORE_3000_HPP */