aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'mpm/lib')
-rw-r--r--mpm/lib/spi/spi_regs_iface.cpp20
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
+ );
+}