mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2025-08-07 14:44:43 +02:00
Allow ESP32 pin numbers greater than 31 for CS and DC
This commit is contained in:
12
TFT_eSPI.h
12
TFT_eSPI.h
@@ -99,14 +99,19 @@
|
||||
#define DC_D digitalWrite(TFT_DC, HIGH)
|
||||
#elif defined (ESP32)
|
||||
#if defined (ESP32_PARALLEL)
|
||||
#define DC_C GPIO.out_w1tc = (1 << TFT_DC) // Too fast for ST7735
|
||||
#define DC_C GPIO.out_w1tc = (1 << TFT_DC)
|
||||
#define DC_D GPIO.out_w1ts = (1 << TFT_DC)
|
||||
//#define DC_C digitalWrite(TFT_DC, LOW)
|
||||
//#define DC_D digitalWrite(TFT_DC, HIGH)
|
||||
#else
|
||||
#if TFT_DC >= 32 || TFT_DC <= -1
|
||||
#define DC_C digitalWrite(TFT_DC, LOW)
|
||||
#define DC_D digitalWrite(TFT_DC, HIGH)
|
||||
#else
|
||||
#define DC_C GPIO.out_w1ts = (1 << TFT_DC); GPIO.out_w1tc = (1 << TFT_DC)
|
||||
#define DC_D GPIO.out_w1tc = (1 << TFT_DC); GPIO.out_w1ts = (1 << TFT_DC)
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#define DC_C GPOC=dcpinmask
|
||||
#define DC_D GPOS=dcpinmask
|
||||
@@ -128,10 +133,15 @@
|
||||
#if defined (ESP32_PARALLEL)
|
||||
#define CS_L // The TFT CS is set permanently low during init()
|
||||
#define CS_H
|
||||
#else
|
||||
#if TFT_CS >= 32 || TFT_CS <= -1
|
||||
#define CS_L digitalWrite(TFT_DC, LOW)
|
||||
#define CS_H digitalWrite(TFT_DC, HIGH)
|
||||
#else
|
||||
#define CS_L GPIO.out_w1ts = (1 << TFT_CS);GPIO.out_w1tc = (1 << TFT_CS)
|
||||
#define CS_H GPIO.out_w1tc = (1 << TFT_CS);GPIO.out_w1ts = (1 << TFT_CS)
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#define CS_L GPOC=cspinmask
|
||||
#define CS_H GPOS=cspinmask
|
||||
|
Reference in New Issue
Block a user