Skip to content

Commit 45fb4d1

Browse files
add WAVESHARE_ESP32_S3_LCD_2_8 Dev Device support
1 parent ce55b08 commit 45fb4d1

File tree

1 file changed

+75
-68
lines changed

1 file changed

+75
-68
lines changed

examples/PDQgraphicstest/Arduino_GFX_dev_device.h

Lines changed: 75 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
// #define XIAO_SAMD21_ROUND_DISPLAY
4747
// #define XIAO_ESP32C3_ROUND_DISPLAY
4848
// #define XIAO_ESP32S3_ROUND_DISPLAY
49+
// #define WAVESHARE_ESP32_S3_LCD_2_8
4950
// #define WAVESHARE_RP2040_LCD_0_96
5051
// #define WZ8048C050 // or called "Elecrow Wizee-ESP32"
5152
// #define ZX2D10GE10R_V4848
@@ -59,21 +60,21 @@
5960
#include <Wire.h>
6061
#include <Adafruit_AW9523.h>
6162
Adafruit_AW9523 aw;
62-
#define DEV_DEVICE_INIT() \
63-
{ \
64-
Wire.begin(6 /* SDA */, 5 /* SCL */); \
65-
aw.begin(0x59); \
66-
aw.pinMode(8, OUTPUT); /* LCD_LEDK */ \
67-
aw.pinMode(9, OUTPUT); /* LCD_LEDK */ \
68-
aw.pinMode(10, OUTPUT); /* LCD_LEDK */ \
69-
aw.pinMode(11, OUTPUT); /* LCD_LEDK */ \
70-
aw.pinMode(14, OUTPUT); /* LCD_RST */ \
71-
aw.digitalWrite(8, LOW); /* LCD_LEDK */ \
72-
aw.digitalWrite(9, LOW); /* LCD_LEDK */ \
73-
aw.digitalWrite(10, LOW); /* LCD_LEDK */ \
74-
aw.digitalWrite(11, LOW); /* LCD_LEDK */ \
75-
aw.digitalWrite(14, HIGH); /* LCD_RST */ \
76-
}
63+
#define DEV_DEVICE_INIT() \
64+
{ \
65+
Wire.begin(6 /* SDA */, 5 /* SCL */); \
66+
aw.begin(0x59); \
67+
aw.pinMode(8, OUTPUT); /* LCD_LEDK */ \
68+
aw.pinMode(9, OUTPUT); /* LCD_LEDK */ \
69+
aw.pinMode(10, OUTPUT); /* LCD_LEDK */ \
70+
aw.pinMode(11, OUTPUT); /* LCD_LEDK */ \
71+
aw.pinMode(14, OUTPUT); /* LCD_RST */ \
72+
aw.digitalWrite(8, LOW); /* LCD_LEDK */ \
73+
aw.digitalWrite(9, LOW); /* LCD_LEDK */ \
74+
aw.digitalWrite(10, LOW); /* LCD_LEDK */ \
75+
aw.digitalWrite(11, LOW); /* LCD_LEDK */ \
76+
aw.digitalWrite(14, HIGH); /* LCD_RST */ \
77+
}
7778
Arduino_DataBus *bus = new Arduino_ESP32LCD8(
7879
45 /* DC */, GFX_NOT_DEFINED /* CS */, 10 /* WR */, GFX_NOT_DEFINED /* RD */,
7980
9 /* D0 */, 4 /* D1 */, 3 /* D2 */, 8 /* D3 */, 18 /* D4 */, 17 /* D5 */, 16 /* D6 */, 15 /* D7 */);
@@ -293,13 +294,13 @@ Arduino_GFX *gfx = new Arduino_ILI9342(bus, GFX_NOT_DEFINED /* RST */, 0 /* rota
293294

294295
#elif defined(ESP32_S3_EYE)
295296
#define GFX_DEV_DEVICE ESP32_S3_EYE
296-
#define DEV_DEVICE_INIT() \
297-
{ \
298-
pinMode(3 /* camera indicator */, OUTPUT); \
299-
digitalWrite(3 /* camera indicator */, LOW); \
300-
pinMode(48 /* BACKLIGHT */, OUTPUT); \
301-
digitalWrite(48 /* BACKLIGHT */, LOW); \
302-
}
297+
#define DEV_DEVICE_INIT() \
298+
{ \
299+
pinMode(3 /* camera indicator */, OUTPUT); \
300+
digitalWrite(3 /* camera indicator */, LOW); \
301+
pinMode(48 /* BACKLIGHT */, OUTPUT); \
302+
digitalWrite(48 /* BACKLIGHT */, LOW); \
303+
}
303304
Arduino_DataBus *bus = new Arduino_ESP32SPI(43 /* DC */, 44 /* CS */, 21 /* SCK */, 47 /* MOSI */, GFX_NOT_DEFINED /* MISO */);
304305
Arduino_GFX *gfx = new Arduino_ST7789(bus, GFX_NOT_DEFINED /* RST */, 0 /* rotation */, true /* IPS */, 240 /* width */, 240 /* height */, 0 /* col offset 1 */, 0 /* row offset 1 */, 0 /* col offset 2 */, 80 /* row offset 2 */);
305306

@@ -441,12 +442,12 @@ Arduino_GFX *gfx = new Arduino_ST7789(bus, 12 /* RST */, 1 /* rotation */, true
441442
#define GFX_BL 23 // default backlight pin, you may replace DF_GFX_BL to actual backlight pin
442443
#define DSI_PANEL
443444
Arduino_ESP32DSIPanel *dsipanel = new Arduino_ESP32DSIPanel(
444-
40 /* hsync_pulse_width */, 160 /* hsync_back_porch */, 160 /* hsync_front_porch */,
445-
10 /* vsync_pulse_width */, 23 /*vsync_back_porch */, 12 /* vsync_front_porch */,
446-
48000000 /* prefer_speed */);
445+
40 /* hsync_pulse_width */, 160 /* hsync_back_porch */, 160 /* hsync_front_porch */,
446+
10 /* vsync_pulse_width */, 23 /*vsync_back_porch */, 12 /* vsync_front_porch */,
447+
48000000 /* prefer_speed */);
447448
Arduino_DSI_Display *gfx = new Arduino_DSI_Display(
448-
1024 /* width */, 600 /* height */, dsipanel, 0 /* rotation */, true /* auto_flush */,
449-
27 /* RST */, jd9165_init_operations, sizeof(jd9165_init_operations) / sizeof(lcd_init_cmd_t));
449+
1024 /* width */, 600 /* height */, dsipanel, 0 /* rotation */, true /* auto_flush */,
450+
27 /* RST */, jd9165_init_operations, sizeof(jd9165_init_operations) / sizeof(lcd_init_cmd_t));
450451

451452
#elif defined(JC3248W535)
452453
#define GFX_DEV_DEVICE JC3248W535
@@ -466,18 +467,18 @@ Arduino_GFX *gfx = new Arduino_ST77916(bus, 47 /* RST */, 0 /* rotation */, true
466467

467468
#elif defined(LILYGO_T_DECK)
468469
#define GFX_DEV_DEVICE LILYGO_T_DECK
469-
#define DEV_DEVICE_INIT() \
470-
{ \
471-
pinMode(9 /* TDECK_RADIO_CS */, OUTPUT); \
472-
digitalWrite(9 /* TDECK_RADIO_CS */, HIGH); \
473-
pinMode(12 /* TDECK_LCD_CS */, OUTPUT); \
474-
digitalWrite(12 /* TDECK_LCD_CS */, HIGH); \
475-
pinMode(39 /* TDECK_SDCARD_CS */, OUTPUT); \
476-
digitalWrite(39 /* TDECK_SDCARD_CS */, HIGH); \
477-
pinMode(10 /* TDECK_PERI_POWERON */, OUTPUT); \
478-
digitalWrite(10 /* TDECK_PERI_POWERON */, HIGH); \
479-
delay(500); \
480-
}
470+
#define DEV_DEVICE_INIT() \
471+
{ \
472+
pinMode(9 /* TDECK_RADIO_CS */, OUTPUT); \
473+
digitalWrite(9 /* TDECK_RADIO_CS */, HIGH); \
474+
pinMode(12 /* TDECK_LCD_CS */, OUTPUT); \
475+
digitalWrite(12 /* TDECK_LCD_CS */, HIGH); \
476+
pinMode(39 /* TDECK_SDCARD_CS */, OUTPUT); \
477+
digitalWrite(39 /* TDECK_SDCARD_CS */, HIGH); \
478+
pinMode(10 /* TDECK_PERI_POWERON */, OUTPUT); \
479+
digitalWrite(10 /* TDECK_PERI_POWERON */, HIGH); \
480+
delay(500); \
481+
}
481482
#define GFX_BL 42
482483
Arduino_DataBus *bus = new Arduino_ESP32SPI(11 /* DC */, 12 /* CS */, 40 /* SCK */, 41 /* MOSI */, 38 /* MISO */);
483484
Arduino_GFX *gfx = new Arduino_ST7789(bus, GFX_NOT_DEFINED /* RST */, 1 /* rotation */, false /* IPS */);
@@ -490,11 +491,11 @@ Arduino_GFX *gfx = new Arduino_ST7789(bus, 23 /* RST */, 0 /* rotation */, true
490491

491492
#elif defined(LILYGO_T_DISPLAY_S3)
492493
#define GFX_DEV_DEVICE LILYGO_T_DISPLAY_S3
493-
#define DEV_DEVICE_INIT() \
494-
{ \
495-
pinMode(15 /* PWD */, OUTPUT); \
496-
digitalWrite(15 /* PWD */, HIGH); \
497-
}
494+
#define DEV_DEVICE_INIT() \
495+
{ \
496+
pinMode(15 /* PWD */, OUTPUT); \
497+
digitalWrite(15 /* PWD */, HIGH); \
498+
}
498499
#define GFX_BL 38
499500
Arduino_DataBus *bus = new Arduino_ESP32PAR8Q(
500501
7 /* DC */, 6 /* CS */, 8 /* WR */, 9 /* RD */,
@@ -509,11 +510,11 @@ Arduino_GFX *gfx = new Arduino_RM67162(bus, 17 /* RST */, 0 /* rotation */);
509510

510511
#elif defined(LILYGO_T_Display_S3_AMOLED_1_64)
511512
#define GFX_DEV_DEVICE LILYGO_T_DISPLAY_S3_AMOLED_1_64
512-
#define DEV_DEVICE_INIT() \
513-
{ \
514-
pinMode(16 /* LCD_EN */, OUTPUT); \
515-
digitalWrite(16 /* LCD_EN */, HIGH); \
516-
}
513+
#define DEV_DEVICE_INIT() \
514+
{ \
515+
pinMode(16 /* LCD_EN */, OUTPUT); \
516+
digitalWrite(16 /* LCD_EN */, HIGH); \
517+
}
517518
Arduino_DataBus *bus = new Arduino_ESP32QSPI(
518519
10 /* CS */, 12 /* SCK */, 11 /* D0 */, 13 /* D1 */, 14 /* D2 */, 15 /* D3 */);
519520
Arduino_GFX *g = new Arduino_CO5300(bus, 17 /* RST */, 0 /* rotation */, false /* IPS */, 280, 456,
@@ -538,21 +539,21 @@ Arduino_GFX *gfx = new Arduino_ST7796(bus, 47 /* RST */, 0 /* rotation */, true
538539

539540
#elif defined(LILYGO_T_QT)
540541
#define GFX_DEV_DEVICE LILYGO_T_QT
541-
#define DEV_DEVICE_INIT() \
542-
{ \
543-
pinMode(10 /* BL */, OUTPUT); \
544-
digitalWrite(10 /* BL */, LOW); \
545-
}
542+
#define DEV_DEVICE_INIT() \
543+
{ \
544+
pinMode(10 /* BL */, OUTPUT); \
545+
digitalWrite(10 /* BL */, LOW); \
546+
}
546547
Arduino_DataBus *bus = new Arduino_ESP32SPI(6 /* DC */, 5 /* CS */, 3 /* SCK */, 2 /* MOSI */, GFX_NOT_DEFINED /* MISO */);
547548
Arduino_GFX *gfx = new Arduino_GC9107(bus, 1 /* RST */, 0 /* rotation */, true /* IPS */);
548549

549550
#elif defined(LILYGO_T_RGB)
550551
#define GFX_DEV_DEVICE LILYGO_T_RGB
551552
#include <Wire.h>
552-
#define DEV_DEVICE_INIT() \
553-
{ \
554-
Wire.begin(8 /* SDA */, 48 /* SCL */, 800000L /* speed */); \
555-
}
553+
#define DEV_DEVICE_INIT() \
554+
{ \
555+
Wire.begin(8 /* SDA */, 48 /* SCL */, 800000L /* speed */); \
556+
}
556557
#define GFX_BL 46
557558
Arduino_DataBus *bus = new Arduino_XL9535SWSPI(
558559
8 /* SDA */, 48 /* SCL */, 2 /* XL PWD */, 3 /* XL CS */, 5 /* XL SCK */, 4 /* XL MOSI */);
@@ -571,11 +572,11 @@ Arduino_RGB_Display *gfx = new Arduino_RGB_Display(
571572

572573
#elif defined(LILYGO_T_TRACK)
573574
#define GFX_DEV_DEVICE LILYGO_T_TRACK
574-
#define DEV_DEVICE_INIT() \
575-
{ \
576-
pinMode(4 /* POWER */, OUTPUT); \
577-
digitalWrite(4 /* POWER */, HIGH); \
578-
}
575+
#define DEV_DEVICE_INIT() \
576+
{ \
577+
pinMode(4 /* POWER */, OUTPUT); \
578+
digitalWrite(4 /* POWER */, HIGH); \
579+
}
579580
Arduino_DataBus *bus = new Arduino_ESP32SPIDMA(7 /* DC */, 9 /* CS */, 5 /* SCK */, 6 /* MOSI */, GFX_NOT_DEFINED /* MISO */);
580581
Arduino_G *g = new Arduino_JD9613(bus, 8 /* RST */);
581582
#define CANVAS
@@ -589,11 +590,11 @@ Arduino_GFX *gfx = new Arduino_GC9A01(bus, 27 /* RST */, 0 /* rotation */, true
589590

590591
#elif defined(LILYGO_T4_S3)
591592
#define GFX_DEV_DEVICE LILYGO_T4_S3
592-
#define DEV_DEVICE_INIT() \
593-
{ \
594-
pinMode(9 /* POWER */, OUTPUT); \
595-
digitalWrite(9 /* POWER */, HIGH); \
596-
}
593+
#define DEV_DEVICE_INIT() \
594+
{ \
595+
pinMode(9 /* POWER */, OUTPUT); \
596+
digitalWrite(9 /* POWER */, HIGH); \
597+
}
597598
Arduino_DataBus *bus = new Arduino_ESP32QSPI(
598599
11 /* CS */, 15 /* SCK */, 14 /* D0 */, 10 /* D1 */, 16 /* D2 */, 12 /* D3 */);
599600
Arduino_GFX *g = new Arduino_RM690B0(bus, 13 /* RST */, 0 /* rotation */, 450 /* width */, 600 /* height */, 16 /* col offset 1 */, 0 /* row offset 1 */, 16 /* col offset 2 */, 0 /* row offset 2 */);
@@ -658,6 +659,12 @@ Arduino_ESP32RGBPanel *rgbpanel = new Arduino_ESP32RGBPanel(
658659
Arduino_RGB_Display *gfx = new Arduino_RGB_Display(
659660
800 /* width */, 480 /* height */, rgbpanel, 0 /* rotation */, true /* auto_flush */);
660661

662+
#elif defined(WAVESHARE_ESP32_S3_LCD_2_8)
663+
#define GFX_DEV_DEVICE WAVESHARE_ESP32_S3_LCD_2_8
664+
#define GFX_BL 5
665+
Arduino_DataBus *bus = new Arduino_HWSPI(41 /* DC */, 42 /* CS */, 40 /* SCK */, 45 /* MOSI */, 46 /* MISO */);
666+
Arduino_GFX *gfx = new Arduino_ST7789(bus, 39 /* RST */, 0 /* rotation */, true /* IPS */);
667+
661668
#elif defined(WAVESHARE_RP2040_LCD_0_96)
662669
#define GFX_DEV_DEVICE WAVESHARE_RP2040_LCD_0_96
663670
#define GFX_BL 25

0 commit comments

Comments
 (0)