Skip to content

Commit 0cbab38

Browse files
add ST7796 1.55" IPS LCD 320x360 display
1 parent 4bec691 commit 0cbab38

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

examples/PDQgraphicstest/Arduino_GFX_display.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ Arduino_GFX *gfx = new Arduino_ILI9341(bus, TFT_RST, 0 /* rotation */, false /*
156156
// Arduino_GFX *gfx = new Arduino_ST7789(bus, TFT_RST, 0 /* rotation */, true /* IPS */, 135 /* width */, 240 /* height */, 52 /* col offset 1 */, 40 /* row offset 1 */, 53 /* col offset 2 */, 40 /* row offset 2 */);
157157

158158
// ST7796 LCD
159+
// 1.55" IPS LCD 320x360
160+
// Arduino_GFX *gfx = new Arduino_ST7796(bus, TFT_RST, 3 /* rotation */, true /* IPS */, 320 /* width */, 360 /* height */, 0 /* col offset 1 */, 0 /* row offset 1 */, 0 /* col offset 2 */, 120 /* row offset 2 */);
159161
// 4" LCD 320x480
160162
// Arduino_GFX *gfx = new Arduino_ST7796(bus, TFT_RST, 0 /* rotation */);
161163
// 4" IPS LCD 320x480

src/display/Arduino_ST7796.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@ void Arduino_ST7796::setRotation(uint8_t r)
4646
case 3:
4747
r = ST7796_MADCTL_MY | ST7796_MADCTL_MV | ST7796_MADCTL_BGR;
4848
break;
49+
case 4:
50+
r = ST7796_MADCTL_MX | ST7796_MADCTL_BGR;
51+
break;
52+
case 5:
53+
r = ST7796_MADCTL_MX | ST7796_MADCTL_MY | ST7796_MADCTL_MV | ST7796_MADCTL_BGR;
54+
break;
55+
case 6:
56+
r = ST7796_MADCTL_MY | ST7796_MADCTL_BGR;
57+
break;
58+
case 7:
59+
r = ST7796_MADCTL_MV | ST7796_MADCTL_BGR;
60+
break;
4961
default: // case 0:
5062
r = ST7796_MADCTL_BGR;
5163
break;

0 commit comments

Comments
 (0)