mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2024-09-21 10:27:11 +00:00
Format and code tidy - fixes for compatibility issues
This commit is contained in:
parent
e65f4cb1fe
commit
d31cbc3dbd
@ -29,7 +29,6 @@
|
||||
|
||||
// Delay between some initialisation commands
|
||||
#define TFT_INIT_DELAY 0x80
|
||||
#define DELAY 0x80
|
||||
|
||||
|
||||
// Generic commands used by TFT_eSPI.cpp
|
||||
|
@ -11,8 +11,8 @@
|
||||
static const uint8_t ILI9163_cmds[] PROGMEM =
|
||||
{
|
||||
17, // 17 commands follow
|
||||
0x01, 0, // Software reset
|
||||
0x11, 0, // Exit sleep mode
|
||||
0x01, 0 + TFT_INIT_DELAY, 120, // Software reset
|
||||
//0x11, 0, // Exit sleep mode
|
||||
0x3A, 1, 0x05, // Set pixel format
|
||||
0x26, 1, 0x04, // Set Gamma curve
|
||||
0xF2, 1, 0x01, // Gamma adjustment enabled
|
||||
@ -26,8 +26,8 @@
|
||||
0xC1, 1, 0x02, // Power control 2
|
||||
0xC5, 2, 0x50, 0x5B, // Vcom control 1
|
||||
0xC7, 1, 0x40, // Vcom offset
|
||||
0x2A, 4+DELAY, 0x00, 0x00, 0x00, 0x7F, 250, // Set column address
|
||||
0x2B, 4, 0x00, 0x00, 0x00, 0x9F, // Set page address
|
||||
0x2A, 4, 0x00, 0x00, 0x00, 0x7F, // Set column address
|
||||
0x2B, 4 + TFT_INIT_DELAY, 0x00, 0x00, 0x00, 0x9F, 250, // Set page address
|
||||
0x36, 1, 0xC8, // Set address mode
|
||||
0x29, 0, // Set display on
|
||||
};
|
||||
|
@ -29,7 +29,6 @@
|
||||
|
||||
// Delay between some initialisation commands
|
||||
#define TFT_INIT_DELAY 0x80
|
||||
#define DELAY 0x80
|
||||
|
||||
|
||||
// Generic commands used by TFT_eSPI.cpp
|
||||
|
@ -24,20 +24,20 @@
|
||||
0xf8, 1, 0x11, // Gate control
|
||||
0xf7, 4, 0xc8, 0x20, 0x00, 0x00, // Interface control
|
||||
0xf3, 2, 0x00, 0x00, // Power sequence control
|
||||
0x11, DELAY, 50, // Wake
|
||||
0xf3, 2+DELAY, 0x00, 0x01, 50, // Power sequence control
|
||||
0xf3, 2+DELAY, 0x00, 0x03, 50, // Power sequence control
|
||||
0xf3, 2+DELAY, 0x00, 0x07, 50, // Power sequence control
|
||||
0xf3, 2+DELAY, 0x00, 0x0f, 50, // Power sequence control
|
||||
0xf4, 15+DELAY, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x07, 0x00, 0x3C, 0x36, 0x00, 0x3C, 0x36, 0x00, 50, // Power control
|
||||
0xf3, 2+DELAY, 0x00, 0x1f, 50, // Power sequence control
|
||||
0xf3, 2+DELAY, 0x00, 0x7f, 50, // Power sequence control
|
||||
0xf3, 2+DELAY, 0x00, 0xff, 50, // Power sequence control
|
||||
0x11, TFT_INIT_DELAY, 50, // Wake
|
||||
0xf3, 2+TFT_INIT_DELAY, 0x00, 0x01, 50, // Power sequence control
|
||||
0xf3, 2+TFT_INIT_DELAY, 0x00, 0x03, 50, // Power sequence control
|
||||
0xf3, 2+TFT_INIT_DELAY, 0x00, 0x07, 50, // Power sequence control
|
||||
0xf3, 2+TFT_INIT_DELAY, 0x00, 0x0f, 50, // Power sequence control
|
||||
0xf4, 15+TFT_INIT_DELAY, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x07, 0x00, 0x3C, 0x36, 0x00, 0x3C, 0x36, 0x00, 50, // Power control
|
||||
0xf3, 2+TFT_INIT_DELAY, 0x00, 0x1f, 50, // Power sequence control
|
||||
0xf3, 2+TFT_INIT_DELAY, 0x00, 0x7f, 50, // Power sequence control
|
||||
0xf3, 2+TFT_INIT_DELAY, 0x00, 0xff, 50, // Power sequence control
|
||||
0xfd, 11, 0x00, 0x00, 0x00, 0x17, 0x10, 0x00, 0x00, 0x01, 0x00, 0x16, 0x16, // Analog parameter control
|
||||
0xf4, 15, 0x00, 0x09, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x07, 0x00, 0x3C, 0x36, 0x00, 0x3C, 0x36, 0x00, // Power control
|
||||
0x36, 1, 0xC8, // Memory access data control
|
||||
0x35, 1, 0x00, // Tearing effect line on
|
||||
0x3a, 1+DELAY, 0x05, 150, // Interface pixel control
|
||||
0x3a, 1+TFT_INIT_DELAY, 0x05, 150, // Interface pixel control
|
||||
0x29, 0, // Display on
|
||||
0x2c, 0 // Memory write
|
||||
};
|
||||
|
@ -66,7 +66,6 @@
|
||||
|
||||
// Delay between some initialisation commands
|
||||
#define TFT_INIT_DELAY 0x80
|
||||
#define DELAY 0x80
|
||||
|
||||
|
||||
// Generic commands used by TFT_eSPI.cpp
|
||||
|
@ -11,14 +11,14 @@
|
||||
static const uint8_t PROGMEM
|
||||
Bcmd[] = { // Initialization commands for 7735B screens
|
||||
18, // 18 commands in list:
|
||||
ST7735_SWRESET, DELAY, // 1: Software reset, no args, w/delay
|
||||
ST7735_SWRESET, TFT_INIT_DELAY, // 1: Software reset, no args, w/delay
|
||||
50, // 50 ms delay
|
||||
ST7735_SLPOUT , DELAY, // 2: Out of sleep mode, no args, w/delay
|
||||
ST7735_SLPOUT , TFT_INIT_DELAY, // 2: Out of sleep mode, no args, w/delay
|
||||
255, // 255 = 500 ms delay
|
||||
ST7735_COLMOD , 1+DELAY, // 3: Set color mode, 1 arg + delay:
|
||||
ST7735_COLMOD , 1+TFT_INIT_DELAY, // 3: Set color mode, 1 arg + delay:
|
||||
0x05, // 16-bit color
|
||||
10, // 10 ms delay
|
||||
ST7735_FRMCTR1, 3+DELAY, // 4: Frame rate control, 3 args + delay:
|
||||
ST7735_FRMCTR1, 3+TFT_INIT_DELAY, // 4: Frame rate control, 3 args + delay:
|
||||
0x00, // fastest refresh
|
||||
0x06, // 6 lines front porch
|
||||
0x03, // 3 lines back porch
|
||||
@ -31,7 +31,7 @@
|
||||
0x02, // Fix on VTL
|
||||
ST7735_INVCTR , 1 , // 7: Display inversion control, 1 arg:
|
||||
0x0, // Line inversion
|
||||
ST7735_PWCTR1 , 2+DELAY, // 8: Power control, 2 args + delay:
|
||||
ST7735_PWCTR1 , 2+TFT_INIT_DELAY, // 8: Power control, 2 args + delay:
|
||||
0x02, // GVDD = 4.7V
|
||||
0x70, // 1.0uA
|
||||
10, // 10 ms delay
|
||||
@ -40,7 +40,7 @@
|
||||
ST7735_PWCTR3 , 2 , // 10: Power control, 2 args, no delay:
|
||||
0x01, // Opamp current small
|
||||
0x02, // Boost frequency
|
||||
ST7735_VMCTR1 , 2+DELAY, // 11: Power control, 2 args + delay:
|
||||
ST7735_VMCTR1 , 2+TFT_INIT_DELAY, // 11: Power control, 2 args + delay:
|
||||
0x3C, // VCOMH = 4V
|
||||
0x38, // VCOML = -1.1V
|
||||
10, // 10 ms delay
|
||||
@ -51,7 +51,7 @@
|
||||
0x21, 0x1B, 0x13, 0x19, // these config values represent)
|
||||
0x17, 0x15, 0x1E, 0x2B,
|
||||
0x04, 0x05, 0x02, 0x0E,
|
||||
ST7735_GMCTRN1,16+DELAY, // 14: Sparkles and rainbows, 16 args + delay:
|
||||
ST7735_GMCTRN1,16+TFT_INIT_DELAY, // 14: Sparkles and rainbows, 16 args + delay:
|
||||
0x0B, 0x14, 0x08, 0x1E, // (ditto)
|
||||
0x22, 0x1D, 0x18, 0x1E,
|
||||
0x1B, 0x1A, 0x24, 0x2B,
|
||||
@ -63,16 +63,16 @@
|
||||
ST7735_RASET , 4 , // 16: Row addr set, 4 args, no delay:
|
||||
0x00, 0x02, // XSTART = 1
|
||||
0x00, 0x81, // XEND = 160
|
||||
ST7735_NORON , DELAY, // 17: Normal display on, no args, w/delay
|
||||
ST7735_NORON , TFT_INIT_DELAY, // 17: Normal display on, no args, w/delay
|
||||
10, // 10 ms delay
|
||||
ST7735_DISPON , DELAY, // 18: Main screen turn on, no args, w/delay
|
||||
ST7735_DISPON , TFT_INIT_DELAY, // 18: Main screen turn on, no args, w/delay
|
||||
255 }, // 255 = 500 ms delay
|
||||
|
||||
Rcmd1[] = { // Init for 7735R, part 1 (red or green tab)
|
||||
15, // 15 commands in list:
|
||||
ST7735_SWRESET, DELAY, // 1: Software reset, 0 args, w/delay
|
||||
ST7735_SWRESET, TFT_INIT_DELAY, // 1: Software reset, 0 args, w/delay
|
||||
150, // 150 ms delay
|
||||
ST7735_SLPOUT , DELAY, // 2: Out of sleep mode, 0 args, w/delay
|
||||
ST7735_SLPOUT , TFT_INIT_DELAY, // 2: Out of sleep mode, 0 args, w/delay
|
||||
255, // 500 ms delay
|
||||
ST7735_FRMCTR1, 3 , // 3: Frame rate ctrl - normal mode, 3 args:
|
||||
0x01, 0x2C, 0x2D, // Rate = fosc/(1x2+40) * (LINE+2C+2D)
|
||||
@ -135,9 +135,9 @@
|
||||
0x2E, 0x2C, 0x29, 0x2D,
|
||||
0x2E, 0x2E, 0x37, 0x3F,
|
||||
0x00, 0x00, 0x02, 0x10,
|
||||
ST7735_NORON , DELAY, // 3: Normal display on, no args, w/delay
|
||||
ST7735_NORON , TFT_INIT_DELAY, // 3: Normal display on, no args, w/delay
|
||||
10, // 10 ms delay
|
||||
ST7735_DISPON , DELAY, // 4: Main screen turn on, no args w/delay
|
||||
ST7735_DISPON , TFT_INIT_DELAY, // 4: Main screen turn on, no args w/delay
|
||||
100 }; // 100 ms delay
|
||||
|
||||
tabcolor = TAB_COLOUR;
|
||||
|
685
TFT_eSPI.cpp
685
TFT_eSPI.cpp
File diff suppressed because it is too large
Load Diff
@ -125,10 +125,14 @@
|
||||
|
||||
// ##################################################################################
|
||||
//
|
||||
// Section 4. Not used section
|
||||
// Section 4. Define Dx pin allocations if needed
|
||||
//
|
||||
// ##################################################################################
|
||||
|
||||
// Some board selections do not include the Dx format of the NodeMCU so
|
||||
// uncomment the next line to ensure they are defined.
|
||||
|
||||
// #define DEFINE_DX_PINS
|
||||
|
||||
// ##################################################################################
|
||||
//
|
||||
|
@ -29,8 +29,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// DON'T TINKER WITH ANY OF THE FOLLOWING LINES, THESE ADD THE TFT DRIVERS //
|
||||
@ -38,6 +36,7 @@
|
||||
// //
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// Load the right driver definition - do not tinker here !
|
||||
#if defined (ILI9341_DRIVER)
|
||||
#include <TFT_Drivers/ILI9341_Defines.h>
|
||||
@ -50,3 +49,18 @@
|
||||
#elif defined (RPI_ILI9486_DRIVER)
|
||||
#include <TFT_Drivers/RPI_ILI9486_Defines.h>
|
||||
#endif
|
||||
|
||||
// Define the pins if needed (See Section 4 of User_Setup.h)
|
||||
#ifdef DEFINE_DX_PINS
|
||||
#define D0 16
|
||||
#define D1 5
|
||||
#define D2 4
|
||||
#define D3 0
|
||||
#define D4 2
|
||||
#define D5 14
|
||||
#define D6 12
|
||||
#define D7 13
|
||||
#define D8 15
|
||||
#define D9 3
|
||||
#define D10 1
|
||||
#endif
|
||||
|
@ -114,13 +114,14 @@
|
||||
|
||||
// ##################################################################################
|
||||
//
|
||||
// Section 4. Define the character to be used to detemine the text bounding box for datum changes
|
||||
// Section 4. Define Dx pin allocations if needed
|
||||
//
|
||||
// ##################################################################################
|
||||
|
||||
#define FF_HEIGHT '/' // '/' character used to set free font height above the baseline
|
||||
#define FF_BOTTOM 'y' // 'y' character used to set free font height below baseline
|
||||
// Some board selections do not include the Dx format of the NodeMCU so
|
||||
// uncomment the next line to ensure they are defined.
|
||||
|
||||
// #define DEFINE_DX_PINS
|
||||
|
||||
// ##################################################################################
|
||||
//
|
||||
|
@ -120,13 +120,14 @@
|
||||
|
||||
// ##################################################################################
|
||||
//
|
||||
// Section 4. Define the character to be used to detemine the text bounding box for datum changes
|
||||
// Section 4. Define Dx pin allocations if needed
|
||||
//
|
||||
// ##################################################################################
|
||||
|
||||
#define FF_HEIGHT '/' // '/' character used to set free font height above the baseline
|
||||
#define FF_BOTTOM 'y' // 'y' character used to set free font height below baseline
|
||||
// Some board selections do not include the Dx format of the NodeMCU so
|
||||
// uncomment the next line to ensure they are defined.
|
||||
|
||||
// #define DEFINE_DX_PINS
|
||||
|
||||
// ##################################################################################
|
||||
//
|
||||
|
@ -103,13 +103,14 @@
|
||||
|
||||
// ##################################################################################
|
||||
//
|
||||
// Section 4. Define the character to be used to detemine the text bounding box for datum changes
|
||||
// Section 4. Define Dx pin allocations if needed
|
||||
//
|
||||
// ##################################################################################
|
||||
|
||||
#define FF_HEIGHT '/' // '/' character used to set free font height above the baseline
|
||||
#define FF_BOTTOM 'y' // 'y' character used to set free font height below baseline
|
||||
// Some board selections do not include the Dx format of the NodeMCU so
|
||||
// uncomment the next line to ensure they are defined.
|
||||
|
||||
// #define DEFINE_DX_PINS
|
||||
|
||||
// ##################################################################################
|
||||
//
|
||||
|
@ -103,13 +103,14 @@
|
||||
|
||||
// ##################################################################################
|
||||
//
|
||||
// Section 4. Define the character to be used to detemine the text bounding box for datum changes
|
||||
// Section 4. Define Dx pin allocations if needed
|
||||
//
|
||||
// ##################################################################################
|
||||
|
||||
#define FF_HEIGHT '/' // '/' character used to set free font height above the baseline
|
||||
#define FF_BOTTOM 'y' // 'y' character used to set free font height below baseline
|
||||
// Some board selections do not include the Dx format of the NodeMCU so
|
||||
// uncomment the next line to ensure they are defined.
|
||||
|
||||
// #define DEFINE_DX_PINS
|
||||
|
||||
// ##################################################################################
|
||||
//
|
||||
|
@ -125,13 +125,14 @@
|
||||
|
||||
// ##################################################################################
|
||||
//
|
||||
// Section 4. Define the character to be used to detemine the text bounding box for datum changes
|
||||
// Section 4. Define Dx pin allocations if needed
|
||||
//
|
||||
// ##################################################################################
|
||||
|
||||
#define FF_HEIGHT '/' // '/' character used to set free font height above the baseline
|
||||
#define FF_BOTTOM 'y' // 'y' character used to set free font height below baseline
|
||||
// Some board selections do not include the Dx format of the NodeMCU so
|
||||
// uncomment the next line to ensure they are defined.
|
||||
|
||||
// #define DEFINE_DX_PINS
|
||||
|
||||
// ##################################################################################
|
||||
//
|
||||
|
@ -125,13 +125,14 @@
|
||||
|
||||
// ##################################################################################
|
||||
//
|
||||
// Section 4. Define the character to be used to detemine the text bounding box for datum changes
|
||||
// Section 4. Define Dx pin allocations if needed
|
||||
//
|
||||
// ##################################################################################
|
||||
|
||||
#define FF_HEIGHT '/' // '/' character used to set free font height above the baseline
|
||||
#define FF_BOTTOM 'y' // 'y' character used to set free font height below baseline
|
||||
// Some board selections do not include the Dx format of the NodeMCU so
|
||||
// uncomment the next line to ensure they are defined.
|
||||
|
||||
// #define DEFINE_DX_PINS
|
||||
|
||||
// ##################################################################################
|
||||
//
|
||||
|
@ -121,13 +121,14 @@
|
||||
|
||||
// ##################################################################################
|
||||
//
|
||||
// Section 4. Define the character to be used to detemine the text bounding box for datum changes
|
||||
// Section 4. Define Dx pin allocations if needed
|
||||
//
|
||||
// ##################################################################################
|
||||
|
||||
#define FF_HEIGHT '/' // '/' character used to set free font height above the baseline
|
||||
#define FF_BOTTOM 'y' // 'y' character used to set free font height below baseline
|
||||
// Some board selections do not include the Dx format of the NodeMCU so
|
||||
// uncomment the next line to ensure they are defined.
|
||||
|
||||
// #define DEFINE_DX_PINS
|
||||
|
||||
// ##################################################################################
|
||||
//
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "TFT_eSPI",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"keywords": "ILI9341, ST7735, ESP8266, TFT",
|
||||
"description": "A TFT SPI graphics library for ESP8266",
|
||||
"repository":
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=TFT_eSPI
|
||||
version=0.16.1
|
||||
version=0.16.2
|
||||
author=Bodmer
|
||||
maintainer=Bodmer
|
||||
sentence=A fast TFT library for ESP8266 processors and the Arduino IDE
|
||||
|
Loading…
Reference in New Issue
Block a user