From 5e44a119697af71c0a220cb059a5244fc7ad5cc0 Mon Sep 17 00:00:00 2001 From: baggio63446333 Date: Mon, 4 Sep 2023 14:10:34 +0900 Subject: [PATCH] Add support for SONY SPRESENSE board - Set 40MHz as the default SPI frequency - Spresense board must use SPI_MODE3 not SPI_MODE0. --- Adafruit_ILI9341.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Adafruit_ILI9341.cpp b/Adafruit_ILI9341.cpp index eda9b4a..0bf6e0c 100755 --- a/Adafruit_ILI9341.cpp +++ b/Adafruit_ILI9341.cpp @@ -65,6 +65,8 @@ #define SPI_DEFAULT_FREQ 8000000 #elif defined(ESP8266) || defined(ESP32) #define SPI_DEFAULT_FREQ 40000000 +#elif defined(ARDUINO_ARCH_SPRESENSE) +#define SPI_DEFAULT_FREQ 40000000 #elif defined(RASPI) #define SPI_DEFAULT_FREQ 80000000 #elif defined(ARDUINO_ARCH_STM32F1) @@ -188,7 +190,11 @@ void Adafruit_ILI9341::begin(uint32_t freq) { if (!freq) freq = SPI_DEFAULT_FREQ; +#if defined(ARDUINO_ARCH_SPRESENSE) + initSPI(freq, SPI_MODE3); +#else initSPI(freq); +#endif if (_rst < 0) { // If no hardware reset pin... sendCommand(ILI9341_SWRESET); // Engage software reset