aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/include
diff options
context:
space:
mode:
authorMark Meserve <mark.meserve@ni.com>2017-09-01 15:11:50 -0700
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:04:01 -0800
commit01ddd50e55fae3382c1300616747fc9aebb39523 (patch)
treef3fc5e98d7b38e47ae70256b310ac2e1d776045b /mpm/include
parent2472134af0ead2472d441a71343348a03fc96808 (diff)
downloaduhd-01ddd50e55fae3382c1300616747fc9aebb39523.tar.gz
uhd-01ddd50e55fae3382c1300616747fc9aebb39523.tar.bz2
uhd-01ddd50e55fae3382c1300616747fc9aebb39523.zip
mpm: spi: Added 16-bit SPI transactions
- Adds convenience method to read 16-bit SPI transactions - Fixes peek16 in spi_regs_iface to actually use 16-bit transactions
Diffstat (limited to 'mpm/include')
-rw-r--r--mpm/include/mpm/spi/spi_iface.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/mpm/include/mpm/spi/spi_iface.hpp b/mpm/include/mpm/spi/spi_iface.hpp
index d3f387ff3..1fc5f828c 100644
--- a/mpm/include/mpm/spi/spi_iface.hpp
+++ b/mpm/include/mpm/spi/spi_iface.hpp
@@ -39,6 +39,16 @@ namespace mpm { namespace spi {
const uint32_t data
) = 0;
+ /*! Convenience function: SPI xfer is 24 bits write, 16 bits read.
+ *
+ * \param data The write data for this xfer
+ *
+ * \return 16 bits worth of the return xfer
+ */
+ virtual uint32_t transfer24_16(
+ const uint32_t data
+ ) = 0;
+
/*!
* \param device The path to the spidev used (e.g. "/dev/spidev0.0")
* \param speed_hz Transaction speed in Hz