diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-04-29 18:56:22 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:03:52 -0800 |
commit | fcf8715eab6d3d06526e1ef1398e0e684711daad (patch) | |
tree | d2e762044506fbd456f8bd039fc1c99ff78ce90a /mpm/lib | |
parent | 0920bf97eace21fca3a88d5b7749849925c3ee29 (diff) | |
download | uhd-fcf8715eab6d3d06526e1ef1398e0e684711daad.tar.gz uhd-fcf8715eab6d3d06526e1ef1398e0e684711daad.tar.bz2 uhd-fcf8715eab6d3d06526e1ef1398e0e684711daad.zip |
mpm: Exposed spi regs iface factory to Python
Diffstat (limited to 'mpm/lib')
-rw-r--r-- | mpm/lib/spi/spi_regs_iface.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mpm/lib/spi/spi_regs_iface.cpp b/mpm/lib/spi/spi_regs_iface.cpp index eb6e229f9..a84a14997 100644 --- a/mpm/lib/spi/spi_regs_iface.cpp +++ b/mpm/lib/spi/spi_regs_iface.cpp @@ -98,3 +98,23 @@ regs_iface::sptr mpm::spi::make_spi_regs_iface( write_flags ); } + +mpm::types::regs_iface::sptr mpm::spi::make_spidev_regs_iface( + const std::string &device, + const int speed_hz, + uint32_t addr_shift, + uint32_t data_shift, + uint32_t read_flags, + uint32_t write_flags +) { + auto spi_iface_sptr = mpm::spi::spi_iface::make_spidev( + device, speed_hz + ); + return std::make_shared<spi_regs_iface_impl>( + spi_iface_sptr, + addr_shift, + data_shift, + read_flags, + write_flags + ); +} |