From fcf8715eab6d3d06526e1ef1398e0e684711daad Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Sat, 29 Apr 2017 18:56:22 -0700 Subject: mpm: Exposed spi regs iface factory to Python --- mpm/lib/spi/spi_regs_iface.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'mpm/lib/spi/spi_regs_iface.cpp') 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_iface_sptr, + addr_shift, + data_shift, + read_flags, + write_flags + ); +} -- cgit v1.2.3