Skip to content

Commit

Permalink
Add support for SONY SPRESENSE board
Browse files Browse the repository at this point in the history
- Set 40MHz as the default SPI frequency
- Spresense board must use SPI_MODE3 not SPI_MODE0.
  • Loading branch information
baggio63446333 committed Sep 4, 2023
1 parent 0bfdfd5 commit d3576f1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Adafruit_ILI9341.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d3576f1

Please sign in to comment.