From e781dc78a81b3f3fe92d4c49a86e9d59c375a850 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Thu, 23 Nov 2023 17:14:04 +0100 Subject: [PATCH] feat(spi): add SPISettings constructor with uint8_t for backward compatibility. Example with Adafruit GFX Library library. Signed-off-by: Frederic Pillon --- libraries/SPI/src/SPI.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/SPI/src/SPI.h b/libraries/SPI/src/SPI.h index d293d3ac46..1c8bbc11cd 100644 --- a/libraries/SPI/src/SPI.h +++ b/libraries/SPI/src/SPI.h @@ -48,6 +48,11 @@ extern "C" { class SPISettings { public: + constexpr SPISettings(uint32_t clock, BitOrder bitOrder, uint8_t dataMode) + : clockFreq(clock), + bitOrder(bitOrder), + dataMode((SPIMode)dataMode) + { } constexpr SPISettings(uint32_t clock, BitOrder bitOrder, SPIMode dataMode) : clockFreq(clock), bitOrder(bitOrder),