Skip to content

Commit 3faaa32

Browse files
authored
Merge pull request #179 from tablatronix/160x80_BGR
160x80 bgr
2 parents 3d5ff73 + d868484 commit 3faaa32

File tree

5 files changed

+40
-8
lines changed

5 files changed

+40
-8
lines changed

TFT_Drivers/ST7735_Defines.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#define INITR_GREENTAB2 0x3 // Use if you get random pixels on two edges of green tab display
1616
#define INITR_GREENTAB3 0x4 // Use if you get random pixels on edge(s) of 128x128 screen
1717
#define INITR_GREENTAB128 0x5 // Use if you only get part of 128x128 screen in rotation 0 & 1
18+
#define INITR_GREENTAB160x80 0x6 // Use if you only get part of 128x128 screen in rotation 0 & 1
1819
#define INITB 0xB
1920

2021

@@ -38,6 +39,10 @@
3839
#define TAB_COLOUR INITR_GREENTAB128
3940
#define CGRAM_OFFSET
4041

42+
#elif defined (ST7735_GREENTAB160x80)
43+
#define TAB_COLOUR INITR_GREENTAB160x80
44+
#define CGRAM_OFFSET
45+
4146
#elif defined (ST7735_REDTAB)
4247
#define TAB_COLOUR INITR_REDTAB
4348

TFT_Drivers/ST7735_Init.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,13 @@
173173
colstart = 0;
174174
rowstart = 32;
175175
}
176+
else if (tabcolor == INITR_GREENTAB160x80)
177+
{
178+
commandList(Rcmd2green);
179+
writecommand(TFT_INVON);
180+
colstart = 26;
181+
rowstart = 1;
182+
}
176183
else if (tabcolor == INITR_REDTAB)
177184
{
178185
commandList(Rcmd2red);

TFT_Drivers/ST7735_Rotation.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_MH | TFT_MAD_BGR);
2121
colstart = 0;
2222
rowstart = 32;
23+
} else if(tabcolor == INITR_GREENTAB160x80) {
24+
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_MH | TFT_MAD_BGR);
25+
colstart = 26;
26+
rowstart = 1;
2327
} else if(tabcolor == INITB) {
2428
writedata(TFT_MAD_MX | TFT_MAD_RGB);
2529
} else {
@@ -43,6 +47,10 @@
4347
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_BGR);
4448
colstart = 32;
4549
rowstart = 0;
50+
} else if(tabcolor == INITR_GREENTAB160x80) {
51+
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_BGR);
52+
colstart = 1;
53+
rowstart = 26;
4654
} else if(tabcolor == INITB) {
4755
writedata(TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_RGB);
4856
} else {
@@ -66,6 +74,10 @@
6674
writedata(TFT_MAD_BGR);
6775
colstart = 0;
6876
rowstart = 0;
77+
} else if(tabcolor == INITR_GREENTAB160x80) {
78+
writedata(TFT_MAD_BGR);
79+
colstart = 0;
80+
rowstart = 0;
6981
} else if(tabcolor == INITB) {
7082
writedata(TFT_MAD_MY | TFT_MAD_RGB);
7183
} else {
@@ -89,6 +101,10 @@
89101
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_BGR);
90102
colstart = 0;
91103
rowstart = 0;
104+
} else if(tabcolor == INITR_GREENTAB160x80) {
105+
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_BGR);
106+
colstart = 1;
107+
rowstart = 26;
92108
} else if(tabcolor == INITB) {
93109
writedata(TFT_MAD_MV | TFT_MAD_RGB);
94110
} else {

User_Setup.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030
//#define M5STACK
3131

3232
// For ST7735 and ILI9163 ONLY, define the pixel width and height in portrait orientation
33-
//#define TFT_WIDTH 128
34-
//#define TFT_HEIGHT 160
33+
// #define TFT_WIDTH 80
34+
// #define TFT_WIDTH 128
35+
// #define TFT_HEIGHT 160
3536
//#define TFT_HEIGHT 128
3637

3738
// For ST7735 ONLY, define the type of display, originally this was based on the
@@ -41,12 +42,13 @@
4142
// Comment out ALL BUT ONE of these options for a ST7735 display driver, save this
4243
// this User_Setup file, then rebuild and upload the sketch to the board again:
4344

44-
//#define ST7735_INITB
45-
//#define ST7735_GREENTAB
46-
//#define ST7735_GREENTAB2
47-
//#define ST7735_GREENTAB3
48-
//#define ST7735_GREENTAB128 // For 128 x 128 display
49-
//#define ST7735_REDTAB
45+
// #define ST7735_INITB
46+
// #define ST7735_GREENTAB
47+
// #define ST7735_GREENTAB2
48+
// #define ST7735_GREENTAB3
49+
// #define ST7735_GREENTAB128 // For 128 x 128 display
50+
// #define ST7735_GREENTAB160x80 // For 160 x 80 display (BGR, inverted, 26 offset)
51+
// #define ST7735_REDTAB
5052
//#define ST7735_BLACKTAB
5153

5254
// ##################################################################################

User_Setups/SetupX_Template.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
//#define M5STACK
2525

2626
// For ST7735 and ILI9163 ONLY, define the pixel width and height in portrait orientation
27+
//#define TFT_WIDTH 80
2728
//#define TFT_WIDTH 128
2829
//#define TFT_HEIGHT 160
2930
//#define TFT_HEIGHT 128
@@ -40,6 +41,7 @@
4041
//#define ST7735_GREENTAB2
4142
//#define ST7735_GREENTAB3
4243
//#define ST7735_GREENTAB128 // For 128 x 128 display
44+
//#define ST7735_GREENTAB160x80 // For 160 x 80 display (BGR, inverted, 26 offset)
4345
//#define ST7735_REDTAB
4446
//#define ST7735_BLACKTAB
4547

0 commit comments

Comments
 (0)