Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add init method for ST7735S (RGB, 80x160) #124

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions Adafruit_ST7735.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ void Adafruit_ST7735::initR(uint8_t options) {
displayInit(Rcmd2green144);
_colstart = 2;
_rowstart = 3; // For default rotation 0
} else if (options == INITR_MINI160x80) {
} else if ((options == INITR_MINI160x80) ||
(options == INITR_MINI160x80_RGB)) {
_height = ST7735_TFTWIDTH_80;
_width = ST7735_TFTHEIGHT_160;
displayInit(Rcmd2green160x80);
Expand Down Expand Up @@ -286,7 +287,8 @@ void Adafruit_ST7735::setRotation(uint8_t m) {
if (tabcolor == INITR_144GREENTAB) {
_height = ST7735_TFTHEIGHT_128;
_width = ST7735_TFTWIDTH_128;
} else if (tabcolor == INITR_MINI160x80) {
} else if ((tabcolor == INITR_MINI160x80) ||
(tabcolor == INITR_MINI160x80_RGB)) {
_height = ST7735_TFTHEIGHT_160;
_width = ST7735_TFTWIDTH_80;
} else {
Expand All @@ -306,7 +308,8 @@ void Adafruit_ST7735::setRotation(uint8_t m) {
if (tabcolor == INITR_144GREENTAB) {
_width = ST7735_TFTHEIGHT_128;
_height = ST7735_TFTWIDTH_128;
} else if (tabcolor == INITR_MINI160x80) {
} else if ((tabcolor == INITR_MINI160x80) ||
(tabcolor == INITR_MINI160x80_RGB)) {
_width = ST7735_TFTHEIGHT_160;
_height = ST7735_TFTWIDTH_80;
} else {
Expand All @@ -326,7 +329,8 @@ void Adafruit_ST7735::setRotation(uint8_t m) {
if (tabcolor == INITR_144GREENTAB) {
_height = ST7735_TFTHEIGHT_128;
_width = ST7735_TFTWIDTH_128;
} else if (tabcolor == INITR_MINI160x80) {
} else if ((tabcolor == INITR_MINI160x80) ||
(tabcolor == INITR_MINI160x80_RGB)) {
_height = ST7735_TFTHEIGHT_160;
_width = ST7735_TFTWIDTH_80;
} else {
Expand All @@ -346,7 +350,8 @@ void Adafruit_ST7735::setRotation(uint8_t m) {
if (tabcolor == INITR_144GREENTAB) {
_width = ST7735_TFTHEIGHT_128;
_height = ST7735_TFTWIDTH_128;
} else if (tabcolor == INITR_MINI160x80) {
} else if ((tabcolor == INITR_MINI160x80) ||
(tabcolor == INITR_MINI160x80_RGB)) {
_width = ST7735_TFTHEIGHT_160;
_height = ST7735_TFTWIDTH_80;
} else {
Expand Down
1 change: 1 addition & 0 deletions Adafruit_ST7735.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#define INITR_144GREENTAB 0x01
#define INITR_MINI160x80 0x04
#define INITR_HALLOWING 0x05
#define INITR_MINI160x80_RGB 0x06

// Some register settings
#define ST7735_MADCTL_BGR 0x08
Expand Down