mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2025-08-06 22:24:44 +02:00
Update ILI9486 driver for SPI
This commit is contained in:
@@ -173,7 +173,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
#elif !defined (ILI9481_DRIVER) && !defined (ILI9488_DRIVER) && !defined (TFT_PARALLEL_8_BIT) // Most displays
|
#elif !defined (SPI_18BIT_DRIVER) && !defined (TFT_PARALLEL_8_BIT) // Most SPI displays
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/***************************************************************************************
|
/***************************************************************************************
|
||||||
@@ -349,7 +349,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len){
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
#elif (defined (ILI9481_DRIVER) || defined (ILI9488_DRIVER)) && !defined (TFT_PARALLEL_8_BIT)// Now code for ILI9481/8
|
#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/***************************************************************************************
|
/***************************************************************************************
|
||||||
|
@@ -52,7 +52,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Code to check if DMA is busy, used by SPI bus transaction transaction and endWrite functions
|
// Code to check if DMA is busy, used by SPI bus transaction transaction and endWrite functions
|
||||||
#if !defined(TFT_PARALLEL_8_BIT) && !defined(ILI9481_DRIVER) && !defined(ILI9488_DRIVER) && !defined (RPI_DISPLAY_TYPE) || (defined (RPI_DISPLAY_TYPE) && defined (ST7796_DRIVER))
|
#if !defined(TFT_PARALLEL_8_BIT) && !defined(SPI_18BIT_DRIVER) && !defined (RPI_DISPLAY_TYPE) || (defined (RPI_DISPLAY_TYPE) && defined (ST7796_DRIVER))
|
||||||
#define ESP32_DMA
|
#define ESP32_DMA
|
||||||
// Code to check if DMA is busy, used by SPI DMA + transaction + endWrite functions
|
// Code to check if DMA is busy, used by SPI DMA + transaction + endWrite functions
|
||||||
#define DMA_BUSY_CHECK dmaWait()
|
#define DMA_BUSY_CHECK dmaWait()
|
||||||
@@ -349,9 +349,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Macros to write commands/pixel colour data to an ILI9488 TFT
|
// Macros to write commands/pixel colour data to a SPI ILI948x TFT
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
#elif defined (ILI9481_DRIVER) || defined (ILI9488_DRIVER)// 16 bit colour converted to 3 bytes for 18 bit RGB
|
#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||||
|
|
||||||
// Write 8 bits to TFT
|
// Write 8 bits to TFT
|
||||||
#define tft_Write_8(C) spi.transfer(C)
|
#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 (ILI9481_DRIVER) || defined (ILI9488_DRIVER)
|
#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/***************************************************************************************
|
/***************************************************************************************
|
||||||
|
@@ -115,9 +115,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Macros to write commands/pixel colour data to an ILI9488 TFT
|
// Macros to write commands/pixel colour data to a SPI ILI948x TFT
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
#if defined (ILI9481_DRIVER) || defined (ILI9488_DRIVER) // 16 bit colour converted to 3 bytes for 18 bit RGB
|
#if defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||||
|
|
||||||
// Write 8 bits to TFT
|
// Write 8 bits to TFT
|
||||||
#define tft_Write_8(C) spi.transfer(C)
|
#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 (ILI9481_DRIVER) || defined (ILI9488_DRIVER) // For 24 bit SPI colour TFT
|
#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/***************************************************************************************
|
/***************************************************************************************
|
||||||
|
@@ -92,9 +92,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Macros to write commands/pixel colour data to an ILI9488 TFT
|
// Macros to write commands/pixel colour data to a SPI ILI948x TFT
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
#if defined (ILI9481_DRIVER) || defined (ILI9488_DRIVER) // 16 bit colour converted to 3 bytes for 18 bit RGB
|
#if defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||||
|
|
||||||
// Write 8 bits to TFT
|
// Write 8 bits to TFT
|
||||||
#define tft_Write_8(C) spi.transfer(C)
|
#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 (ILI9481_DRIVER) || defined (ILI9488_DRIVER) // For 24 bit colour TFT ############# UNTESTED ###################
|
#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/***************************************************************************************
|
/***************************************************************************************
|
||||||
|
@@ -985,9 +985,9 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Macros to write commands/pixel colour data to a SPI ILI9488 TFT
|
// Macros to write commands/pixel colour data to a SPI ILI948x TFT
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
#elif defined (ILI9481_DRIVER) || defined (ILI9488_DRIVER) // 16 bit colour converted to 3 bytes for 18 bit RGB
|
#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||||
|
|
||||||
// Write 8 bits to TFT
|
// Write 8 bits to TFT
|
||||||
#define tft_Write_8(C) \
|
#define tft_Write_8(C) \
|
||||||
|
@@ -15,8 +15,12 @@
|
|||||||
delay(120);
|
delay(120);
|
||||||
|
|
||||||
writecommand(0x3A);
|
writecommand(0x3A);
|
||||||
writedata(0x55);
|
#ifdef TFT_PARALLEL_8_BIT
|
||||||
|
writedata(0x55); // 16 bit colour interface
|
||||||
|
#else
|
||||||
|
writedata(0x66); // 18 bit colour interface
|
||||||
|
#endif
|
||||||
|
|
||||||
writecommand(0xC2);
|
writecommand(0xC2);
|
||||||
writedata(0x44);
|
writedata(0x44);
|
||||||
|
|
||||||
@@ -60,8 +64,12 @@
|
|||||||
writedata(0x20);
|
writedata(0x20);
|
||||||
writedata(0x00);
|
writedata(0x00);
|
||||||
|
|
||||||
writecommand(0x20); // display inversion OFF
|
#ifdef TFT_PARALLEL_8_BIT
|
||||||
|
writecommand(TFT_INVOFF);
|
||||||
|
#else
|
||||||
|
writecommand(TFT_INVON);
|
||||||
|
#endif
|
||||||
|
|
||||||
writecommand(0x36);
|
writecommand(0x36);
|
||||||
writedata(0x48);
|
writedata(0x48);
|
||||||
|
|
||||||
|
@@ -115,6 +115,11 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Invoke 18 bit colour for selected displays
|
||||||
|
#if (defined (ILI9481_DRIVER) || defined (ILI9486_DRIVER) || defined (ILI9488_DRIVER)) && !defined (TFT_PARALLEL_8_BIT)
|
||||||
|
#define SPI_18BIT_DRIVER
|
||||||
|
#endif
|
||||||
|
|
||||||
// Load the right driver definition - do not tinker here !
|
// Load the right driver definition - do not tinker here !
|
||||||
#if defined (ILI9341_DRIVER)
|
#if defined (ILI9341_DRIVER)
|
||||||
#include <TFT_Drivers/ILI9341_Defines.h>
|
#include <TFT_Drivers/ILI9341_Defines.h>
|
||||||
@@ -185,7 +190,6 @@
|
|||||||
#define TFT_DRIVER 0x0000
|
#define TFT_DRIVER 0x0000
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// These are the pins for ESP8266 boards
|
// These are the pins for ESP8266 boards
|
||||||
// Name GPIO NodeMCU Function
|
// Name GPIO NodeMCU Function
|
||||||
#define PIN_D0 16 // GPIO16 WAKE
|
#define PIN_D0 16 // GPIO16 WAKE
|
||||||
|
Reference in New Issue
Block a user