Skip to content

Commit

Permalink
Merge pull request #179 from tablatronix/160x80_BGR
Browse files Browse the repository at this point in the history
160x80 bgr
  • Loading branch information
Bodmer authored Oct 29, 2018
2 parents 3d5ff73 + d868484 commit 3faaa32
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 8 deletions.
5 changes: 5 additions & 0 deletions TFT_Drivers/ST7735_Defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define INITR_GREENTAB2 0x3 // Use if you get random pixels on two edges of green tab display
#define INITR_GREENTAB3 0x4 // Use if you get random pixels on edge(s) of 128x128 screen
#define INITR_GREENTAB128 0x5 // Use if you only get part of 128x128 screen in rotation 0 & 1
#define INITR_GREENTAB160x80 0x6 // Use if you only get part of 128x128 screen in rotation 0 & 1
#define INITB 0xB


Expand All @@ -38,6 +39,10 @@
#define TAB_COLOUR INITR_GREENTAB128
#define CGRAM_OFFSET

#elif defined (ST7735_GREENTAB160x80)
#define TAB_COLOUR INITR_GREENTAB160x80
#define CGRAM_OFFSET

#elif defined (ST7735_REDTAB)
#define TAB_COLOUR INITR_REDTAB

Expand Down
7 changes: 7 additions & 0 deletions TFT_Drivers/ST7735_Init.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@
colstart = 0;
rowstart = 32;
}
else if (tabcolor == INITR_GREENTAB160x80)
{
commandList(Rcmd2green);
writecommand(TFT_INVON);
colstart = 26;
rowstart = 1;
}
else if (tabcolor == INITR_REDTAB)
{
commandList(Rcmd2red);
Expand Down
16 changes: 16 additions & 0 deletions TFT_Drivers/ST7735_Rotation.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_MH | TFT_MAD_BGR);
colstart = 0;
rowstart = 32;
} else if(tabcolor == INITR_GREENTAB160x80) {
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_MH | TFT_MAD_BGR);
colstart = 26;
rowstart = 1;
} else if(tabcolor == INITB) {
writedata(TFT_MAD_MX | TFT_MAD_RGB);
} else {
Expand All @@ -43,6 +47,10 @@
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_BGR);
colstart = 32;
rowstart = 0;
} else if(tabcolor == INITR_GREENTAB160x80) {
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_BGR);
colstart = 1;
rowstart = 26;
} else if(tabcolor == INITB) {
writedata(TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_RGB);
} else {
Expand All @@ -66,6 +74,10 @@
writedata(TFT_MAD_BGR);
colstart = 0;
rowstart = 0;
} else if(tabcolor == INITR_GREENTAB160x80) {
writedata(TFT_MAD_BGR);
colstart = 0;
rowstart = 0;
} else if(tabcolor == INITB) {
writedata(TFT_MAD_MY | TFT_MAD_RGB);
} else {
Expand All @@ -89,6 +101,10 @@
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_BGR);
colstart = 0;
rowstart = 0;
} else if(tabcolor == INITR_GREENTAB160x80) {
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_BGR);
colstart = 1;
rowstart = 26;
} else if(tabcolor == INITB) {
writedata(TFT_MAD_MV | TFT_MAD_RGB);
} else {
Expand Down
18 changes: 10 additions & 8 deletions User_Setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
//#define M5STACK

// For ST7735 and ILI9163 ONLY, define the pixel width and height in portrait orientation
//#define TFT_WIDTH 128
//#define TFT_HEIGHT 160
// #define TFT_WIDTH 80
// #define TFT_WIDTH 128
// #define TFT_HEIGHT 160
//#define TFT_HEIGHT 128

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

//#define ST7735_INITB
//#define ST7735_GREENTAB
//#define ST7735_GREENTAB2
//#define ST7735_GREENTAB3
//#define ST7735_GREENTAB128 // For 128 x 128 display
//#define ST7735_REDTAB
// #define ST7735_INITB
// #define ST7735_GREENTAB
// #define ST7735_GREENTAB2
// #define ST7735_GREENTAB3
// #define ST7735_GREENTAB128 // For 128 x 128 display
// #define ST7735_GREENTAB160x80 // For 160 x 80 display (BGR, inverted, 26 offset)
// #define ST7735_REDTAB
//#define ST7735_BLACKTAB

// ##################################################################################
Expand Down
2 changes: 2 additions & 0 deletions User_Setups/SetupX_Template.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
//#define M5STACK

// For ST7735 and ILI9163 ONLY, define the pixel width and height in portrait orientation
//#define TFT_WIDTH 80
//#define TFT_WIDTH 128
//#define TFT_HEIGHT 160
//#define TFT_HEIGHT 128
Expand All @@ -40,6 +41,7 @@
//#define ST7735_GREENTAB2
//#define ST7735_GREENTAB3
//#define ST7735_GREENTAB128 // For 128 x 128 display
//#define ST7735_GREENTAB160x80 // For 160 x 80 display (BGR, inverted, 26 offset)
//#define ST7735_REDTAB
//#define ST7735_BLACKTAB

Expand Down

0 comments on commit 3faaa32

Please sign in to comment.