Commit e0aa312d authored by Bodmer's avatar Bodmer

Slow down the RPi strobes but keep fast for other displays

parent fa808ed8
...@@ -132,16 +132,26 @@ ...@@ -132,16 +132,26 @@
#else #else
#if TFT_DC >= 32 #if TFT_DC >= 32
#define DC_C GPIO.out1_w1tc.val = (1 << (TFT_DC - 32)); //\ #ifdef RPI_ILI9486_DRIVER // RPi display needs a slower DC change
//GPIO.out1_w1tc.val = (1 << (TFT_DC - 32)) #define DC_C GPIO.out1_w1ts.val = (1 << (TFT_DC - 32)); \
#define DC_D GPIO.out1_w1ts.val = (1 << (TFT_DC - 32)); //\ GPIO.out1_w1tc.val = (1 << (TFT_DC - 32))
//GPIO.out1_w1ts.val = (1 << (TFT_DC - 32)) #define DC_D GPIO.out1_w1tc.val = (1 << (TFT_DC - 32)); \
GPIO.out1_w1ts.val = (1 << (TFT_DC - 32))
#else
#define DC_C GPIO.out1_w1tc.val = (1 << (TFT_DC - 32))
#define DC_D GPIO.out1_w1ts.val = (1 << (TFT_DC - 32))
#endif
#else #else
#if TFT_DC >= 0 #if TFT_DC >= 0
#define DC_C GPIO.out_w1tc = (1 << TFT_DC); //\ #ifdef RPI_ILI9486_DRIVER // RPi display needs a slower DC change
//GPIO.out_w1tc = (1 << TFT_DC) #define DC_C GPIO.out_w1ts = (1 << TFT_DC); \
#define DC_D GPIO.out_w1ts = (1 << TFT_DC); //\ GPIO.out_w1tc = (1 << TFT_DC)
//GPIO.out_w1ts = (1 << TFT_DC) #define DC_D GPIO.out_w1tc = (1 << TFT_DC); \
GPIO.out_w1ts = (1 << TFT_DC)
#else
#define DC_C GPIO.out_w1tc = (1 << TFT_DC)
#define DC_D GPIO.out_w1ts = (1 << TFT_DC)
#endif
#else #else
#define DC_C #define DC_C
#define DC_D #define DC_D
...@@ -171,14 +181,24 @@ ...@@ -171,14 +181,24 @@
#define CS_H #define CS_H
#else #else
#if TFT_CS >= 32 #if TFT_CS >= 32
#define CS_L GPIO.out1_w1tc.val = (1 << (TFT_CS - 32)); //\ #ifdef RPI_ILI9486_DRIVER // RPi display needs a slower CS change
//GPIO.out1_w1tc.val = (1 << (TFT_CS - 32)) #define CS_L GPIO.out1_w1ts.val = (1 << (TFT_CS - 32)); \
#define CS_H GPIO.out1_w1ts.val = (1 << (TFT_CS - 32)); //\ GPIO.out1_w1tc.val = (1 << (TFT_CS - 32))
//GPIO.out1_w1ts.val = (1 << (TFT_CS - 32)) #define CS_H GPIO.out1_w1tc.val = (1 << (TFT_CS - 32)); \
GPIO.out1_w1ts.val = (1 << (TFT_CS - 32))
#else
#define CS_L GPIO.out1_w1tc.val = (1 << (TFT_CS - 32))
#define CS_H GPIO.out1_w1ts.val = (1 << (TFT_CS - 32))
#endif
#else #else
#if TFT_CS >= 0 #if TFT_CS >= 0
#define CS_L GPIO.out_w1tc = (1 << TFT_CS); //GPIO.out_w1tc = (1 << TFT_CS) #ifdef RPI_ILI9486_DRIVER // RPi display needs a slower CS change
#define CS_H GPIO.out_w1ts = (1 << TFT_CS); //GPIO.out_w1ts = (1 << TFT_CS) #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)
#else
#define CS_L GPIO.out_w1tc = (1 << TFT_CS)
#define CS_H GPIO.out_w1ts = (1 << TFT_CS)
#endif
#else #else
#define CS_L #define CS_L
#define CS_H #define CS_H
...@@ -194,8 +214,12 @@ ...@@ -194,8 +214,12 @@
// Use single register write for CS_L and DC_C if pins are both in range 0-31 // Use single register write for CS_L and DC_C if pins are both in range 0-31
#ifdef ESP32 #ifdef ESP32
#if (TFT_CS >= 0) && (TFT_CS < 32) && (TFT_DC >= 0) && (TFT_DC < 32) #if (TFT_CS >= 0) && (TFT_CS < 32) && (TFT_DC >= 0) && (TFT_DC < 32)
#define CS_L_DC_C GPIO.out_w1tc = ((1 << TFT_CS) | (1 << TFT_DC)); //\ #ifdef RPI_ILI9486_DRIVER // RPi display needs a slower CD and DC change
//GPIO.out_w1tc = ((1 << TFT_CS) | (1 << TFT_DC)) #define CS_L_DC_C GPIO.out_w1tc = ((1 << TFT_CS) | (1 << TFT_DC)); \
GPIO.out_w1tc = ((1 << TFT_CS) | (1 << TFT_DC))
#else
#define CS_L_DC_C GPIO.out_w1tc = ((1 << TFT_CS) | (1 << TFT_DC))
#endif
#else #else
#define CS_L_DC_C CS_L; DC_C #define CS_L_DC_C CS_L; DC_C
#endif #endif
...@@ -261,7 +285,7 @@ ...@@ -261,7 +285,7 @@
#define tft_Write_16(C) WR_L;GPIO.out_w1tc = clr_mask; GPIO.out_w1ts = set_mask((uint8_t)(C >> 0)); WR_H #define tft_Write_16(C) WR_L;GPIO.out_w1tc = clr_mask; GPIO.out_w1ts = set_mask((uint8_t)(C >> 0)); WR_H
#else #else
#define tft_Write_16(C) GPIO.out_w1tc = clr_mask; GPIO.out_w1ts = set_mask((uint8_t)(C >> 8)); WR_H; \ #define tft_Write_16(C) GPIO.out_w1tc = clr_mask; GPIO.out_w1ts = set_mask((uint8_t)(C >> 8)); WR_H; \
GPIO.out_w1tc = clr_mask; GPIO.out_w1ts = set_mask((uint8_t)(C >> 0)); WR_H GPIO.out_w1tc = clr_mask; GPIO.out_w1ts = set_mask((uint8_t)(C >> 0)); WR_H
#endif #endif
// 16 bit write with swapped bytes // 16 bit write with swapped bytes
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment