Support pseudo 16 bit

See #299
This commit is contained in:
Bodmer
2021-03-27 22:27:09 +00:00
parent 4cc57699fa
commit 1c36c2c933
2 changed files with 18 additions and 7 deletions

View File

@@ -476,7 +476,11 @@ void TFT_eSPI::pushBlock(uint16_t color, uint32_t len){
#if defined (SSD1963_DRIVER) #if defined (SSD1963_DRIVER)
while (--len) {WR_L; WR_H; WR_L; WR_H; WR_L; WR_H;} while (--len) {WR_L; WR_H; WR_L; WR_H; WR_L; WR_H;}
#else #else
while (--len) {WR_L; WR_H; WR_L; WR_H;} #ifdef PSEUDO_16_BIT
while (--len) {WR_L; WR_H;}
#else
while (--len) {WR_L; WR_H; WR_L; WR_H;}
#endif
#endif #endif
} }
else while (len--) {tft_Write_16(color);} else while (len--) {tft_Write_16(color);}

View File

@@ -319,13 +319,20 @@
#else #else
// Write 16 bits to TFT #ifdef PSEUDO_16_BIT
#define tft_Write_16(C) GPIO.out_w1tc = clr_mask; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 8)); WR_H; \ // One write strobe for both bytes
GPIO.out_w1tc = clr_mask; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 0)); WR_H #define tft_Write_16(C) GPIO.out_w1tc = clr_mask; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 0)); WR_H
#define tft_Write_16S(C) GPIO.out_w1tc = clr_mask; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 8)); WR_H
#else
// Write 16 bits to TFT
#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
// 16 bit write with swapped bytes
#define tft_Write_16S(C) 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) >> 8)); WR_H
#endif
// 16 bit write with swapped bytes
#define tft_Write_16S(C) 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) >> 8)); WR_H
#endif #endif
// Write 32 bits to TFT // Write 32 bits to TFT