Skip to content

Commit b2c69bd

Browse files
add Waveshare ESP32-S3-LCD-1.46 Dev Device support
1 parent 97c62b2 commit b2c69bd

File tree

3 files changed

+25
-13
lines changed

3 files changed

+25
-13
lines changed

examples/PDQgraphicstest/Arduino_GFX_dev_device.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
// #define XIAO_ESP32S3_ROUND_DISPLAY
5050
// #define WAVESHARE_ESP32_S3_LCD_1_3
5151
// #define WAVESHARE_ESP32_S3_LCD_1_3_PRISM
52+
// #define WAVESHARE_ESP32_S3_LCD_1_46
5253
// #define WAVESHARE_ESP32_S3_LCD_2_8
5354
// #define WAVESHARE_ESP32_S3_TOUCH_AMOLED_2_41
5455
// #define WAVESHARE_ESP32_C6_LCD_1_47
@@ -727,6 +728,15 @@ Arduino_GFX *gfx = new Arduino_ST7789(bus, 42 /* RST */, 2 /* rotation */, true
727728
Arduino_DataBus *bus = new Arduino_ESP32SPI(38 /* DC */, 39 /* CS */, 40 /* SCK */, 41 /* MOSI */, GFX_NOT_DEFINED /* MISO */);
728729
Arduino_GFX *gfx = new Arduino_ST7789(bus, 42 /* RST */, 6 /* rotation */, true /* IPS */, 240 /* width */, 240 /* height */, 0 /* col offset 1 */, 0 /* row offset 1 */, 0 /* col offset 2 */, 80 /* row offset 2 */);
729730

731+
#elif defined(WAVESHARE_ESP32_S3_LCD_1_46)
732+
#define GFX_DEV_DEVICE WAVESHARE_ESP32_S3_LCD_1_46
733+
#define GFX_BL 5
734+
Arduino_DataBus *bus = new Arduino_ESP32QSPI(
735+
21 /* CS */, 40 /* SCK */, 46 /* D0 */, 45 /* D1 */, 42 /* D2 */, 41 /* D3 */);
736+
Arduino_GFX *g = new Arduino_SPD2010(bus, GFX_NOT_DEFINED /* RST */);
737+
#define CANVAS
738+
Arduino_Canvas *gfx = new Arduino_Canvas(412 /* width */, 412 /* height */, g, 0 /* output_x */, 0 /* output_y */, 0 /* rotation */);
739+
730740
#elif defined(WAVESHARE_ESP32_S3_LCD_2_8)
731741
#define GFX_DEV_DEVICE WAVESHARE_ESP32_S3_LCD_2_8
732742
#define GFX_BL 5

src/display/Arduino_SPD2010.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,6 @@ void Arduino_SPD2010::tftInit()
7777
digitalWrite(_rst, HIGH);
7878
delay(SPD2010_RST_DELAY);
7979
}
80-
else
81-
{
82-
// Software Rest
83-
_bus->sendCommand(SPD2010_SWRESET);
84-
delay(SPD2010_RST_DELAY);
85-
}
8680

8781
_bus->batchOperation(spd2010_init_operations, sizeof(spd2010_init_operations));
8882

src/display/Arduino_SPD2010.h

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#define SPD2010_TFTWIDTH 412 ///< SPD2010 max TFT width
77
#define SPD2010_TFTHEIGHT 412 ///< SPD2010 max TFT height
88

9-
#define SPD2010_RST_DELAY 100 ///< delay ms wait for reset finish
10-
#define SPD2010_SLPIN_DELAY 100 ///< delay ms wait for sleep in finish
11-
#define SPD2010_SLPOUT_DELAY 100 ///< delay ms wait for sleep out finish
9+
#define SPD2010_RST_DELAY 120 ///< delay ms wait for reset finish
10+
#define SPD2010_SLPIN_DELAY 120 ///< delay ms wait for sleep in finish
11+
#define SPD2010_SLPOUT_DELAY 120 ///< delay ms wait for sleep out finish
1212

1313
#define SPD2010_SWRESET 0x01 ///< Software reset register
1414

@@ -18,6 +18,9 @@
1818
#define SPD2010_INVOFF 0x20 ///< Display Inversion OFF
1919
#define SPD2010_INVON 0x21 ///< Display Inversion ON
2020

21+
#define SPD2010_DISPOFF 0x28 ///< Display OFF
22+
#define SPD2010_DISPON 0x29 ///< Display ON
23+
2124
#define SPD2010_CASET 0x2A ///< Column Address Set
2225
#define SPD2010_PASET 0x2B ///< Page Address Set
2326
#define SPD2010_RAMWR 0x2C ///< Memory Write
@@ -35,7 +38,13 @@
3538

3639
static const uint8_t spd2010_init_operations[] = {
3740
BEGIN_WRITE,
41+
WRITE_C8_BYTES, 0xFF, 3, 0x20, 0x10, 0x00,
42+
WRITE_COMMAND_8, SPD2010_SWRESET,
43+
END_WRITE,
3844

45+
DELAY, SPD2010_RST_DELAY,
46+
47+
BEGIN_WRITE,
3948
WRITE_C8_BYTES, 0xFF, 3, 0x20, 0x10, 0x10,
4049
WRITE_C8_D8, 0x0C, 0x11,
4150
WRITE_C8_D8, 0x10, 0x02,
@@ -432,17 +441,16 @@ static const uint8_t spd2010_init_operations[] = {
432441
WRITE_C8_D8, 0x09, 0x00,
433442
WRITE_C8_BYTES, 0xFF, 3, 0x20, 0x10, 0x00,
434443
WRITE_C8_D8, 0x35, 0x00,
435-
// {0x3A, 0x05,
436444
WRITE_C8_D8, SPD2010_PIXFMT, 0x55,
437445
WRITE_C8_BYTES, 0xFF, 3, 0x20, 0x10, 0x12,
438446
WRITE_C8_D8, 0x21, 0x70,
439447
WRITE_C8_BYTES, 0xFF, 3, 0x20, 0x10, 0x2D,
440448
WRITE_C8_D8, 0x02, 0x00,
441449
WRITE_C8_BYTES, 0xFF, 3, 0x20, 0x10, 0x00,
442-
443-
WRITE_COMMAND_8, 0x11,
450+
WRITE_COMMAND_8, SPD2010_SLPOUT,
451+
WRITE_COMMAND_8, SPD2010_DISPON,
444452
END_WRITE,
445-
DELAY, 120};
453+
DELAY, SPD2010_SLPOUT_DELAY};
446454

447455
class Arduino_SPD2010 : public Arduino_TFT
448456
{

0 commit comments

Comments
 (0)