Commit d6e573c2 authored by Bodmer's avatar Bodmer

Fix SPI ILI9481

ILI9481 with 8 bit parallel worked OK but SPI needs an 18 bit colour interface.
parent abe5a442
......@@ -173,7 +173,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len)
}
////////////////////////////////////////////////////////////////////////////////////////
#elif !defined (ILI9488_DRIVER) && !defined (TFT_PARALLEL_8_BIT) // Most displays
#elif !defined (ILI9481_DRIVER) && !defined (ILI9488_DRIVER) && !defined (TFT_PARALLEL_8_BIT) // Most displays
////////////////////////////////////////////////////////////////////////////////////////
/***************************************************************************************
......@@ -349,7 +349,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len){
}
////////////////////////////////////////////////////////////////////////////////////////
#elif defined (ILI9488_DRIVER) && !defined (TFT_PARALLEL_8_BIT)// Now code for ILI9488
#elif (defined (ILI9481_DRIVER) || defined (ILI9488_DRIVER)) && !defined (TFT_PARALLEL_8_BIT)// Now code for ILI9481/8
////////////////////////////////////////////////////////////////////////////////////////
/***************************************************************************************
......
......@@ -52,7 +52,7 @@
#endif
// Code to check if DMA is busy, used by SPI bus transaction transaction and endWrite functions
#if !defined(TFT_PARALLEL_8_BIT) && !defined(ILI9488_DRIVER) && !defined (RPI_DISPLAY_TYPE)
#if !defined(TFT_PARALLEL_8_BIT) && !defined(ILI9481_DRIVER) && !defined(ILI9488_DRIVER) && !defined (RPI_DISPLAY_TYPE) || (defined (RPI_DISPLAY_TYPE) && defined (ST7796_DRIVER))
#define ESP32_DMA
// Code to check if DMA is busy, used by SPI DMA + transaction + endWrite functions
#define DMA_BUSY_CHECK dmaWait()
......@@ -351,7 +351,7 @@
////////////////////////////////////////////////////////////////////////////////////////
// Macros to write commands/pixel colour data to an ILI9488 TFT
////////////////////////////////////////////////////////////////////////////////////////
#elif defined (ILI9488_DRIVER) // 16 bit colour converted to 3 bytes for 18 bit RGB
#elif defined (ILI9481_DRIVER) || defined (ILI9488_DRIVER)// 16 bit colour converted to 3 bytes for 18 bit RGB
// Write 8 bits to TFT
#define tft_Write_8(C) spi.transfer(C)
......
......@@ -109,7 +109,7 @@ void TFT_eSPI::pushSwapBytePixels(const void* data_in, uint32_t len){
}
////////////////////////////////////////////////////////////////////////////////////////
#elif defined (ILI9488_DRIVER)
#elif defined (ILI9481_DRIVER) || defined (ILI9488_DRIVER)
////////////////////////////////////////////////////////////////////////////////////////
/***************************************************************************************
......
......@@ -117,7 +117,7 @@
////////////////////////////////////////////////////////////////////////////////////////
// Macros to write commands/pixel colour data to an ILI9488 TFT
////////////////////////////////////////////////////////////////////////////////////////
#if defined (ILI9488_DRIVER) // 16 bit colour converted to 3 bytes for 18 bit RGB
#if defined (ILI9481_DRIVER) || defined (ILI9488_DRIVER) // 16 bit colour converted to 3 bytes for 18 bit RGB
// Write 8 bits to TFT
#define tft_Write_8(C) spi.transfer(C)
......
......@@ -168,7 +168,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len)
}
////////////////////////////////////////////////////////////////////////////////////////
#elif defined (ILI9488_DRIVER) // For 24 bit SPI colour TFT
#elif defined (ILI9481_DRIVER) || defined (ILI9488_DRIVER) // For 24 bit SPI colour TFT
////////////////////////////////////////////////////////////////////////////////////////
/***************************************************************************************
......
......@@ -94,7 +94,7 @@
////////////////////////////////////////////////////////////////////////////////////////
// Macros to write commands/pixel colour data to an ILI9488 TFT
////////////////////////////////////////////////////////////////////////////////////////
#if defined (ILI9488_DRIVER) // 16 bit colour converted to 3 bytes for 18 bit RGB
#if defined (ILI9481_DRIVER) || defined (ILI9488_DRIVER) // 16 bit colour converted to 3 bytes for 18 bit RGB
// Write 8 bits to TFT
#define tft_Write_8(C) spi.transfer(C)
......
......@@ -260,7 +260,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len)
}
////////////////////////////////////////////////////////////////////////////////////////
#elif defined (ILI9488_DRIVER) // For 24 bit colour TFT ############# UNTESTED ###################
#elif defined (ILI9481_DRIVER) || defined (ILI9488_DRIVER) // For 24 bit colour TFT ############# UNTESTED ###################
////////////////////////////////////////////////////////////////////////////////////////
/***************************************************************************************
......
......@@ -987,7 +987,7 @@
////////////////////////////////////////////////////////////////////////////////////////
// Macros to write commands/pixel colour data to a SPI ILI9488 TFT
////////////////////////////////////////////////////////////////////////////////////////
#elif defined (ILI9488_DRIVER) // 16 bit colour converted to 3 bytes for 18 bit RGB
#elif defined (ILI9481_DRIVER) || defined (ILI9488_DRIVER) // 16 bit colour converted to 3 bytes for 18 bit RGB
// Write 8 bits to TFT
#define tft_Write_8(C) \
......
......@@ -53,7 +53,15 @@
writedata(0x0A);
writecommand(0x3A);
writedata(0x55);
#ifdef TFT_PARALLEL_8_BIT
writedata(0x55); // 16 bit colour interface
#else
writedata(0x66); // 18 bit colour interface
#endif
#ifndef TFT_PARALLEL_8_BIT
writecommand(TFT_INVON);
#endif
writecommand(TFT_CASET);
writedata(0x00);
......
......@@ -16,7 +16,7 @@
#ifndef _TFT_eSPIH_
#define _TFT_eSPIH_
#define TFT_ESPI_VERSION "2.3.4"
#define TFT_ESPI_VERSION "2.3.41"
// Bit level feature flags
// Bit 0 set: viewport capability
......
{
"name": "TFT_eSPI",
"version": "2.3.4",
"version": "2.3.41",
"keywords": "Arduino, tft, ePaper, display, STM32, ESP8266, NodeMCU, ESP32, M5Stack, ILI9341, ST7735, ILI9163, S6D02A1, ILI9486, ST7789, RM68140",
"description": "A TFT and ePaper SPI graphics library with optimisation for ESP8266, ESP32 and STM32",
"repository":
......
name=TFT_eSPI
version=2.3.4
version=2.3.41
author=Bodmer
maintainer=Bodmer
sentence=TFT graphics library for Arduino processors with performance optimisation for STM32, ESP8266 and ESP32
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment