mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2025-08-02 20:24:41 +02:00
Work around for D4 IDE bug
A condition can exist where pin D4 is allocated a value of 0 The workaround is to define and use pin numbers in the PIN_Dx format
This commit is contained in:
@@ -21,9 +21,9 @@
|
|||||||
|
|
||||||
#include <pgmspace.h>
|
#include <pgmspace.h>
|
||||||
|
|
||||||
#include <limits.h>
|
//#include <limits.h>
|
||||||
#include "pins_arduino.h"
|
//#include "pins_arduino.h"
|
||||||
#include "wiring_private.h"
|
//#include "wiring_private.h"
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
|
|
||||||
// If it is a 16bit serial display we must transfer 16 bits every time
|
// If it is a 16bit serial display we must transfer 16 bits every time
|
||||||
|
17
User_Setup.h
17
User_Setup.h
@@ -75,13 +75,14 @@
|
|||||||
|
|
||||||
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
|
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
|
||||||
|
|
||||||
// ModeMCU
|
// ModeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation
|
||||||
#define TFT_CS D8 // Chip select control pin D8
|
|
||||||
#define TFT_DC D3 // Data Command control pin
|
#define TFT_CS PIN_D8 // Chip select control pin D8
|
||||||
#define TFT_RST D4 // Reset pin (could connect to NodeMCU RST, see next line)
|
#define TFT_DC PIN_D3 // Data Command control pin
|
||||||
|
#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
|
||||||
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
|
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
|
||||||
|
|
||||||
//#define TFT_WR D2 // Write strobe for modified Raspberry Pi TFT only
|
//#define TFT_WR PIN_D2 // Write strobe for modified Raspberry Pi TFT only
|
||||||
|
|
||||||
// ESP32 Dev board (planned, not supported yet)
|
// ESP32 Dev board (planned, not supported yet)
|
||||||
//#define TFT_CS 5 // Chip select control pin
|
//#define TFT_CS 5 // Chip select control pin
|
||||||
@@ -125,14 +126,10 @@
|
|||||||
|
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
//
|
//
|
||||||
// Section 4. Define Dx pin allocations if needed
|
// Section 4. Not used
|
||||||
//
|
//
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
|
|
||||||
// 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
|
|
||||||
|
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
//
|
//
|
||||||
|
@@ -50,17 +50,15 @@
|
|||||||
#include <TFT_Drivers/RPI_ILI9486_Defines.h>
|
#include <TFT_Drivers/RPI_ILI9486_Defines.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Define the pins if needed (See Section 4 of User_Setup.h)
|
// These are the pins for all ESP8266 boards
|
||||||
#ifdef DEFINE_DX_PINS
|
#define PIN_D0 16
|
||||||
#define D0 16
|
#define PIN_D1 5
|
||||||
#define D1 5
|
#define PIN_D2 4
|
||||||
#define D2 4
|
#define PIN_D3 0
|
||||||
#define D3 0
|
#define PIN_D4 2
|
||||||
#define D4 2
|
#define PIN_D5 14
|
||||||
#define D5 14
|
#define PIN_D6 12
|
||||||
#define D6 12
|
#define PIN_D7 13
|
||||||
#define D7 13
|
#define PIN_D8 15
|
||||||
#define D8 15
|
#define PIN_D9 3
|
||||||
#define D9 3
|
#define PIN_D10 1
|
||||||
#define D10 1
|
|
||||||
#endif
|
|
||||||
|
@@ -67,9 +67,9 @@
|
|||||||
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
|
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
|
||||||
|
|
||||||
// ModeMCU
|
// ModeMCU
|
||||||
#define TFT_CS D8 // Chip select control pin D8
|
#define TFT_CS PIN_D8 // Chip select control pin D8
|
||||||
#define TFT_DC D3 // Data Command control pin
|
#define TFT_DC PIN_D3 // Data Command control pin
|
||||||
#define TFT_RST D4 // Reset pin (could connect to NodeMCU RST, see next line)
|
#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
|
||||||
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
|
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
|
||||||
|
|
||||||
// ESP32 Dev board (planned, not supported yet)
|
// ESP32 Dev board (planned, not supported yet)
|
||||||
@@ -114,14 +114,10 @@
|
|||||||
|
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
//
|
//
|
||||||
// Section 4. Define Dx pin allocations if needed
|
// Section 4. Not used
|
||||||
//
|
//
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
|
|
||||||
// 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
|
|
||||||
|
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
//
|
//
|
||||||
|
@@ -73,9 +73,9 @@
|
|||||||
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
|
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
|
||||||
|
|
||||||
// ModeMCU
|
// ModeMCU
|
||||||
#define TFT_CS D8 // Chip select control pin D8
|
#define TFT_CS PIN_D8 // Chip select control pin D8
|
||||||
#define TFT_DC D3 // Data Command control pin
|
#define TFT_DC PIN_D3 // Data Command control pin
|
||||||
#define TFT_RST D4 // Reset pin (could connect to NodeMCU RST, see next line)
|
#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
|
||||||
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
|
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
|
||||||
|
|
||||||
// ESP32 Dev board (planned, not test/supported yet)
|
// ESP32 Dev board (planned, not test/supported yet)
|
||||||
@@ -120,14 +120,10 @@
|
|||||||
|
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
//
|
//
|
||||||
// Section 4. Define Dx pin allocations if needed
|
// Section 4. Not used
|
||||||
//
|
//
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
|
|
||||||
// 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
|
|
||||||
|
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
//
|
//
|
||||||
|
@@ -56,9 +56,9 @@
|
|||||||
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
|
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
|
||||||
|
|
||||||
// ModeMCU
|
// ModeMCU
|
||||||
#define TFT_CS D8 // Chip select control pin D8
|
#define TFT_CS PIN_D8 // Chip select control pin D8
|
||||||
#define TFT_DC D3 // Data Command control pin
|
#define TFT_DC PIN_D3 // Data Command control pin
|
||||||
#define TFT_RST D4 // Reset pin (could connect to NodeMCU RST, see next line)
|
#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
|
||||||
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
|
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
|
||||||
|
|
||||||
// ESP32 Dev board (planned, not supported yet)
|
// ESP32 Dev board (planned, not supported yet)
|
||||||
@@ -103,14 +103,10 @@
|
|||||||
|
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
//
|
//
|
||||||
// Section 4. Define Dx pin allocations if needed
|
// Section 4. Not used
|
||||||
//
|
//
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
|
|
||||||
// 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
|
|
||||||
|
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
//
|
//
|
||||||
|
@@ -56,9 +56,9 @@
|
|||||||
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
|
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
|
||||||
|
|
||||||
// ModeMCU
|
// ModeMCU
|
||||||
#define TFT_CS D8 // Chip select control pin D8
|
#define TFT_CS PIN_D8 // Chip select control pin D8
|
||||||
#define TFT_DC D3 // Data Command control pin
|
#define TFT_DC PIN_D3 // Data Command control pin
|
||||||
#define TFT_RST D4 // Reset pin (could connect to NodeMCU RST, see next line)
|
#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
|
||||||
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
|
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
|
||||||
|
|
||||||
// ESP32 Dev board (planned, not supported yet)
|
// ESP32 Dev board (planned, not supported yet)
|
||||||
@@ -103,14 +103,10 @@
|
|||||||
|
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
//
|
//
|
||||||
// Section 4. Define Dx pin allocations if needed
|
// Section 4. Not used
|
||||||
//
|
//
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
|
|
||||||
// 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
|
|
||||||
|
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
//
|
//
|
||||||
|
@@ -76,12 +76,12 @@
|
|||||||
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
|
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
|
||||||
|
|
||||||
// ModeMCU
|
// ModeMCU
|
||||||
#define TFT_CS D8 // Chip select control pin D8
|
#define TFT_CS PIN_D8 // Chip select control pin D8
|
||||||
#define TFT_DC D3 // Data Command control pin
|
#define TFT_DC PIN_D3 // Data Command control pin
|
||||||
#define TFT_RST D4 // Reset pin (could connect to NodeMCU RST, see next line)
|
#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
|
||||||
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
|
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
|
||||||
|
|
||||||
//#define TFT_WR D2 // Write strobe for modified Raspberry Pi TFT only
|
//#define TFT_WR PIN_D2 // Write strobe for modified Raspberry Pi TFT only
|
||||||
|
|
||||||
// ESP32 Dev board (planned, not supported yet)
|
// ESP32 Dev board (planned, not supported yet)
|
||||||
//#define TFT_CS 5 // Chip select control pin
|
//#define TFT_CS 5 // Chip select control pin
|
||||||
@@ -125,14 +125,10 @@
|
|||||||
|
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
//
|
//
|
||||||
// Section 4. Define Dx pin allocations if needed
|
// Section 4. Not used
|
||||||
//
|
//
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
|
|
||||||
// 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
|
|
||||||
|
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
//
|
//
|
||||||
|
@@ -76,12 +76,12 @@
|
|||||||
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
|
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
|
||||||
|
|
||||||
// ModeMCU
|
// ModeMCU
|
||||||
#define TFT_CS D8 // Chip select control pin D8
|
#define TFT_CS PIN_D8 // Chip select control pin D8
|
||||||
#define TFT_DC D3 // Data Command control pin
|
#define TFT_DC PIN_D3 // Data Command control pin
|
||||||
#define TFT_RST D4 // Reset pin (could connect to NodeMCU RST, see next line)
|
#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
|
||||||
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
|
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
|
||||||
|
|
||||||
#define TFT_WR D2 // Write strobe for modified Raspberry Pi TFT only
|
#define TFT_WR PIN_D2 // Write strobe for modified Raspberry Pi TFT only
|
||||||
|
|
||||||
// ESP32 Dev board (planned, not supported yet)
|
// ESP32 Dev board (planned, not supported yet)
|
||||||
//#define TFT_CS 5 // Chip select control pin
|
//#define TFT_CS 5 // Chip select control pin
|
||||||
@@ -125,14 +125,10 @@
|
|||||||
|
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
//
|
//
|
||||||
// Section 4. Define Dx pin allocations if needed
|
// Section 4. Not used
|
||||||
//
|
//
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
|
|
||||||
// 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
|
|
||||||
|
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
//
|
//
|
||||||
|
@@ -74,9 +74,9 @@
|
|||||||
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
|
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR SETUP ######
|
||||||
|
|
||||||
// ModeMCU
|
// ModeMCU
|
||||||
#define TFT_CS D8 // Chip select control pin D8
|
#define TFT_CS PIN_D8 // Chip select control pin D8
|
||||||
#define TFT_DC D3 // Data Command control pin
|
#define TFT_DC PIN_D3 // Data Command control pin
|
||||||
#define TFT_RST D4 // Reset pin (could connect to NodeMCU RST, see next line)
|
#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
|
||||||
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
|
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
|
||||||
|
|
||||||
// ESP32 Dev board (planned, not supported yet)
|
// ESP32 Dev board (planned, not supported yet)
|
||||||
@@ -121,14 +121,10 @@
|
|||||||
|
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
//
|
//
|
||||||
// Section 4. Define Dx pin allocations if needed
|
// Section 4. Not used
|
||||||
//
|
//
|
||||||
// ##################################################################################
|
// ##################################################################################
|
||||||
|
|
||||||
// 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",
|
"name": "TFT_eSPI",
|
||||||
"version": "0.16.2",
|
"version": "0.16.3",
|
||||||
"keywords": "ILI9341, ST7735, ESP8266, TFT",
|
"keywords": "ILI9341, ST7735, ESP8266, TFT",
|
||||||
"description": "A TFT SPI graphics library for ESP8266",
|
"description": "A TFT SPI graphics library for ESP8266",
|
||||||
"repository":
|
"repository":
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
name=TFT_eSPI
|
name=TFT_eSPI
|
||||||
version=0.16.2
|
version=0.16.3
|
||||||
author=Bodmer
|
author=Bodmer
|
||||||
maintainer=Bodmer
|
maintainer=Bodmer
|
||||||
sentence=A fast TFT library for ESP8266 processors and the Arduino IDE
|
sentence=A fast TFT library for ESP8266 processors and the Arduino IDE
|
||||||
|
Reference in New Issue
Block a user