From d0bd9f174195f9baca4c383b4c98acef983f0f88 Mon Sep 17 00:00:00 2001 From: Lane Kolbly Date: Wed, 22 Dec 2021 15:40:24 -0600 Subject: host: Add divider constructor to spi_config_t --- host/lib/types/serial.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'host/lib') diff --git a/host/lib/types/serial.cpp b/host/lib/types/serial.cpp index 67272e62e..1c9c7bebe 100644 --- a/host/lib/types/serial.cpp +++ b/host/lib/types/serial.cpp @@ -33,6 +33,15 @@ spi_config_t::spi_config_t(edge_t edge) : mosi_edge(edge), miso_edge(edge) use_custom_divider = false; } +spi_config_t::spi_config_t(edge_t edge, size_t divider) : + mosi_edge(edge), + miso_edge(edge), + use_custom_divider(true), + divider(divider) +{ + // empty +} + void i2c_iface::write_eeprom(uint16_t addr, uint16_t offset, const byte_vector_t& bytes) { for (size_t i = 0; i < bytes.size(); i++) { -- cgit v1.2.3