aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/include/lmk/lmk04828_spi_iface.hpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-03-08 09:28:55 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:03:44 -0800
commit1a4348038d0eb57d53475074dca49e8192aeb2d7 (patch)
tree04c8e87fa9c95d2702aac410f6fb271461acb9bb /mpm/include/lmk/lmk04828_spi_iface.hpp
parentfc8cd827f6b16b9c8c354a216889e6a9d7f37456 (diff)
downloaduhd-1a4348038d0eb57d53475074dca49e8192aeb2d7.tar.gz
uhd-1a4348038d0eb57d53475074dca49e8192aeb2d7.tar.bz2
uhd-1a4348038d0eb57d53475074dca49e8192aeb2d7.zip
Initial commit for N3xx development.
- Creates mpm/ subdirectory - First pass at hardware daemon/MPM - New code for LMK04828, AD9371 - spidev integration Contributions by: Martin Braun <martin.braun@ettus.com> Derek Kozel <derek.kozel@ettus.com> Mark Meserve <mark.meserve@ni.com> Andrej Rode <andrej.rode@ettus.com>
Diffstat (limited to 'mpm/include/lmk/lmk04828_spi_iface.hpp')
-rw-r--r--mpm/include/lmk/lmk04828_spi_iface.hpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/mpm/include/lmk/lmk04828_spi_iface.hpp b/mpm/include/lmk/lmk04828_spi_iface.hpp
new file mode 100644
index 000000000..3338bd6d1
--- /dev/null
+++ b/mpm/include/lmk/lmk04828_spi_iface.hpp
@@ -0,0 +1,24 @@
+#include "lmk04828.hpp"
+#include "uhd/types/serial.hpp"
+
+class lmk04828_spi_iface
+{
+public:
+ lmk04828_spi_iface(uhd::spi_iface::sptr iface);
+ lmk04828_iface::write_fn_t get_write_fn();
+ lmk04828_iface::read_fn_t get_read_fn();
+
+private:
+ const int LMK_SPI_NUM_BITS = 24;
+ const int LMK_SPI_READ_FLAG = 1;
+ const int LMK_SPI_READ_FLAG_OFFSET = 23;
+ const int LMK_SPI_READ_ADDR_OFFSET = 8;
+ const int LMK_SPI_RESERVED_FIELD_MASK = ~(0x3 << 21);
+ const int DEFAULT_SLAVE = 1;
+
+ uhd::spi_iface::sptr _spi_iface;
+ uhd::spi_config_t config;
+
+ void spi_write(std::vector<uint32_t> writes);
+ uint8_t spi_read(uint32_t addr);
+};