This commit is contained in:
2026-02-12 07:13:04 +01:00
parent 7206746130
commit ec9957d5b1
593 changed files with 2016 additions and 476236 deletions

View File

@@ -1,3 +1,4 @@
// USER DEFINED SETTINGS
// Set driver type, fonts to be loaded, pins used and SPI control method etc
//
@@ -9,7 +10,7 @@
// Note that some sketches are designed for a particular TFT pixel width/height
// User defined information reported by "Read_User_Setup" test & diagnostics example
#define USER_SETUP_INFO "User_Setup CYD 2.8"
#define USER_SETUP_INFO "User_Setup"
// Define to disable all #warnings in library (can be put in User_Setup_Select.h)
//#define DISABLE_ALL_LIBRARY_WARNINGS
@@ -73,8 +74,8 @@
// For ST7735, ST7789 and ILI9341 ONLY, define the colour order IF the blue and red are swapped on your display
// Try ONE option at a time to find the correct colour order for your display
// #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
// #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
// #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
//#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
// For M5Stack ESP32 module with integrated ILI9341 display ONLY, remove // in line below
@@ -112,7 +113,7 @@
// If colours are inverted (white shows as black) then uncomment one of the next
// 2 lines try both options, one of the options should correct the inversion.
#define TFT_INVERSION_ON
// #define TFT_INVERSION_ON
// #define TFT_INVERSION_OFF
@@ -221,7 +222,7 @@
//#define TFT_RST 33 // Reset pin (could connect to Arduino RESET pin)
//#define TFT_BL 22 // LED back-light
#define TOUCH_CS 33 // Chip select pin (T_CS) of touch screen
//#define TOUCH_CS 21 // Chip select pin (T_CS) of touch screen
//#define TFT_WR 22 // Write strobe for modified Raspberry Pi TFT only
@@ -354,7 +355,7 @@
// #define SPI_FREQUENCY 5000000
// #define SPI_FREQUENCY 10000000
// #define SPI_FREQUENCY 20000000
// #define SPI_FREQUENCY 27000000
//#define SPI_FREQUENCY 27000000
// #define SPI_FREQUENCY 40000000
#define SPI_FREQUENCY 55000000 // STM32 SPI1 only (SPI2 maximum is 27MHz)
// #define SPI_FREQUENCY 80000000
@@ -368,7 +369,7 @@
// The ESP32 has 2 free SPI ports i.e. VSPI and HSPI, the VSPI is the default.
// If the VSPI port is in use and pins are not accessible (e.g. TTGO T-Beam)
// then uncomment the following line:
#define USE_HSPI_PORT
//#define USE_HSPI_PORT
// Comment out the following #define if "SPI Transactions" do not need to be
// supported. When commented out the code size will be smaller and sketches will
@@ -380,4 +381,4 @@
// Transactions are automatically enabled by the library for an ESP32 (to use HAL mutex)
// so changing it here has no effect
// #define SUPPORT_TRANSACTIONS
// #define SUPPORT_TRANSACTIONS

View File

@@ -0,0 +1,50 @@
// Good colors for my TFT displays
// BGR565 color codes for your TFT
// Inverted BGR565: color = 0xFFFF - standard BGR565
// Color definitions for swapped red/blue (BGR instead of RGB)
// Inverted color definitions for your display
#define COLOR_BLACK 0xFFFF // black (inverted)
#define COLOR_WHITE 0x0000 // white (inverted)
#define COLOR_RED (0xFFFF - 0xF800) // red (inverted, now correct)
#define COLOR_GREEN (0xFFFF - 0x07E0) // green (inverted)
#define COLOR_BLUE (0xFFFF - 0x001F) // blue (inverted, now correct)
#define COLOR_YELLOW (0xFFFF - 0x07FF) // yellow (inverted)
#define COLOR_CYAN (0xFFFF - 0xFFE0) // cyan (inverted)
#define COLOR_MAGENTA (0xFFFF - 0xF81F) // magenta (inverted)
#define COLOR_PURPLE (0xFFFF - 0xF81F) // purple (inverted)
// Wrong colors for my TFT displays, but good for debugging
// Secondary colors (BGR565)
// Secondary colors (inverted)
// ...existing code for other colors...
// Other colors (BGR565, best effort)
// Other colors (inverted)
#define COLOR_DARKRED (0xFFFF - 0x0010)
#define COLOR_PINK (0xFFFF - 0xFC1F)
#define COLOR_NAVY (0xFFFF - 0x8000)
#define COLOR_AQUA (0xFFFF - 0xFD00)
#define COLOR_SKYBLUE (0xFFFF - 0xF6FB)
#define COLOR_GREENYELLOW (0xFFFF - 0xAFE5)
#define COLOR_DARKGREEN (0xFFFF - 0x03E0)
#define COLOR_DARKCYAN (0xFFFF - 0x03EF)
#define COLOR_GOLD (0xFFFF - 0x07FF)
#define COLOR_LIGHTGREY (0xFFFF - 0xC618)
#define COLOR_DARKGREY (0xFFFF - 0x7BEF)
#define COLOR_LIGHTBLACK (0xFFFF - 0x4208)
#define COLOR_SMOKYBLACK (0xFFFF - 0x2104)
#define COLOR_CHARCOAL (0xFFFF - 0x3186)
#define COLOR_VIOLET (0xFFFF - 0x9199)
#define COLOR_BROWN (0xFFFF - 0x8200)
#define COLOR_ORANGE (0xFFFF - 0xFD20)
#define COLOR_LIME (0xFFFF - 0x87E0)
#define COLOR_MAROON (0xFFFF - 0x7800)
#define COLOR_OLIVE (0xFFFF - 0x7BE0)
#define COLOR_SILVER (0xFFFF - 0xA510)
#define COLOR_CREAM (0xFFFF - 0xFFF9)
#define COLOR_GHOST_WHITE (0xFFFF - 0xF7BF)
#define COLOR_BACKGROUND 0xB5B6 // 0xB6B6B6
#define COLOR_TRANSPARENT TFT_TRANSPARENT

View File

@@ -43,41 +43,7 @@ ERROR_Please_enable_LOAD_GFXFF_in_User_Setup!
// Assign human-readable names to some common 16-bit color values: http://rinkydinkelectronics.com/calc_rgb565.php
// Examples: https://github.com/newdigate/rgb565_colors
#define COLOR_WHITE 0xFFFF
#define COLOR_BLACK 0x0000
#define COLOR_BLUE 0x001F
#define COLOR_NAVY 0x000F
#define COLOR_AQUA 0x5D1C
#define COLOR_SKYBLUE 0x867D
#define COLOR_RED 0xF882
#define COLOR_DARKRED 0x8800
#define COLOR_PINK 0xF97F
#define COLOR_MAGENTA 0xF81F
#define COLOR_GREEN 0x0780
#define COLOR_GREENYELLOW 0xAFE5
#define COLOR_DARKGREEN 0x03E0
#define COLOR_CYAN 0x07FF
#define COLOR_DARKCYAN 0x03EF
#define COLOR_YELLOW 0xFFE0
#define COLOR_GOLD 0xDD24
#define COLOR_LIGHTGREY 0xC618
#define COLOR_DARKGREY 0x7BEF
#define COLOR_LIGHTBLACK 0x4A49
#define COLOR_SMOKYBLACK 0x1061
#define COLOR_CHARCOAL 0x3A2A
#define COLOR_VIOLET 0x9199
#define COLOR_BROWN 0x8200
#define COLOR_ORANGE 0xFD20
#define COLOR_LIME 0x87E0
#define COLOR_MAROON 0x7800
#define COLOR_PURPLE 0x780F
#define COLOR_OLIVE 0x7BE0
#define COLOR_SILVER 0xA510
#define COLOR_CREAM 0xFFF9
#define COLOR_GHOST_WHITE 0xF7BF
#define COLOR_BACKGROUND 0xB5B6 // 0xB6B6B6
#define COLOR_TRANSPARENT TFT_TRANSPARENT
const uint16_t colorDraw[] = {COLOR_BLACK, COLOR_BLUE, COLOR_RED, COLOR_MAGENTA, COLOR_GREEN, COLOR_CYAN, COLOR_YELLOW, COLOR_WHITE,
COLOR_BACKGROUND, COLOR_TRANSPARENT, COLOR_GHOST_WHITE, COLOR_AQUA, COLOR_CREAM, COLOR_SMOKYBLACK, COLOR_SKYBLUE,