Skip to content

Commit 28abc3b

Browse files
committed
Updated base components up to step 6
Todo: - Doc files - README - PanelVersions - CHANGELOG
1 parent 43f0bc1 commit 28abc3b

File tree

4 files changed

+270
-6
lines changed

4 files changed

+270
-6
lines changed

ESP_Panel_Board_Supported.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,12 @@
7777
/*
7878
* Waveshare Supported Boards (https://www.waveshare.com/):
7979
*
80-
* - ESP32_S3_Touch_LCD_4_3:
81-
* - https://www.waveshare.com/esp32-s3-touch-lcd-4.3.htm
80+
* - BOARD_WAVESHARE_ESP32_S3_Touch_LCD_4_3 (ESP32_S3_Touch_LCD_4_3): https://www.waveshare.com/esp32-s3-touch-lcd-4.3.htm
81+
* - BOARD_WAVESHARE_ESP32_S3_Touch_LCD_1_85 (ESP32_S3_Touch_LCD_1_85): https://www.waveshare.com/esp32-s3-touch-lcd-1.85.htm
8282
*
8383
*/
8484
// #define BOARD_WAVESHARE_ESP32_S3_Touch_LCD_4_3
85+
// #define BOARD_WAVESHARE_ESP32_S3_Touch_LCD_1_85
8586

8687
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
8788
/////////////////////////////////////////////// File Version ///////////////////////////////////////////////////////////

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name=ESP32_Display_Panel
2-
version=0.1.7
2+
version=0.1.8
33
author=espressif
44
maintainer=espressif
55
sentence=ESP32_Display_Panel is an Arduino library designed for ESP SoCs to drive display panels and facilitate rapid GUI development.
6-
paragraph=Currently supported boards:ESP32-C3-LCDkit,ESP32-S3-BOX,ESP32-S3-BOX-3,ESP32-S3-BOX-3B,ESP32-S3-BOX-3(beta),ESP32-S3-BOX-Lite,ESP32-S3-EYE,ESP32-S3-Korvo-2,ESP32-S3-LCD-EV-Board,ESP32-S3-LCD-EV-Board-2,ESP32-S3-USB-OTG,M5STACK-M5CORE2,M5STACK-M5DIAL,M5STACK-M5CORES3,ESP32-4848S040C_I_Y_3. Currently supported devices: Bus,LCD,Touch,Backlight,IO expander. Currently supported Bus: I2C,SPI,QSPI,3-wire SPI + RGB. Currently supported LCD controllers: EK9716B,GC9A01,GC9B71,GC9503,ILI9341,NV3022B,ST7262,ST7701,ST7789,ST7796,ST77916,ST77922. Currently supported Touch controllers: CST816S,FT5x06,GT1151,GT911,ST7123,TT21100,XPT2046.
6+
paragraph=Currently supported boards:ESP32-C3-LCDkit,ESP32-S3-BOX,ESP32-S3-BOX-3,ESP32-S3-BOX-3B,ESP32-S3-BOX-3(beta),ESP32-S3-BOX-Lite,ESP32-S3-EYE,ESP32-S3-Korvo-2,ESP32-S3-LCD-EV-Board,ESP32-S3-LCD-EV-Board-2,ESP32-S3-USB-OTG,M5STACK-M5CORE2,M5STACK-M5DIAL,M5STACK-M5CORES3,ESP32-4848S040C_I_Y_3,ESP32-S3-Touch-LCD-4.3,ESP32-S3-Touch-LCD-1.85. Currently supported devices: Bus,LCD,Touch,Backlight,IO expander. Currently supported Bus: I2C,SPI,QSPI,3-wire SPI + RGB. Currently supported LCD controllers: EK9716B,GC9A01,GC9B71,GC9503,ILI9341,NV3022B,ST7262,ST7701,ST7789,ST7796,ST77916,ST77922. Currently supported Touch controllers: CST816S,FT5x06,GT1151,GT911,ST7123,TT21100,XPT2046.
77
category=Other
88
architectures=esp32
99
url=https://github.com/esp-arduino-libs/ESP32_Display_Panel

src/board/ESP_PanelBoard.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
defined(BOARD_ESP32_S3_LCD_EV_BOARD_V1_5) + defined(BOARD_ESP32_S3_LCD_EV_BOARD_2) + \
1616
defined(BOARD_ESP32_S3_LCD_EV_BOARD_2_V1_5) + defined(BOARD_ESP32_S3_USB_OTG) + defined(BOARD_ELECROW_CROWPANEL_7_0) + \
1717
defined(BOARD_M5STACK_M5CORE2) + defined(BOARD_M5STACK_M5DIAL) + defined(BOARD_M5STACK_M5CORES3) + \
18-
defined(BOARD_ESP32_4848S040C_I_Y_3) + defined(BOARD_WAVESHARE_ESP32_S3_Touch_LCD_4_3) \
18+
defined(BOARD_ESP32_4848S040C_I_Y_3) + defined(BOARD_WAVESHARE_ESP32_S3_Touch_LCD_4_3) + defined(BOARD_WAVESHARE_ESP32_S3_Touch_LCD_1_85) \
1919
> 1
2020
#error "Multiple boards enabled! Please check file `ESP_Panel_Board_Supported.h` and make sure only one board is enabled."
2121
#endif
@@ -62,8 +62,10 @@
6262
/* Waveshare */
6363
#elif defined(BOARD_WAVESHARE_ESP32_S3_Touch_LCD_4_3) || CONFIG_BOARD_WAVESHARE_ESP32_S3_Touch_LCD_4_3
6464
#include "board/waveshare/ESP32_S3_Touch_LCD_4.3.h"
65+
#elif defined(BOARD_WAVESHARE_ESP32_S3_Touch_LCD_1_85) || CONFIG_BOARD_WAVESHARE_ESP32_S3_Touch_LCD_1_85
66+
#include "board/waveshare/ESP32_S3_Touch_LCD_1.85.h"
6567
#else
66-
#error "Unkonw board selected! Please check file `ESP_Panel_Board_Supported.h` and make sure only one board is enabled."
68+
#error "Unknown board selected! Please check file `ESP_Panel_Board_Supported.h` and make sure only one board is enabled."
6769
#endif
6870

6971
// *INDENT-OFF*
Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#pragma once
8+
9+
// *INDENT-OFF*
10+
11+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
12+
//////////////////////////// Please update the following macros to configure the LCD panel /////////////////////////////
13+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
14+
/* Set to 1 when using an LCD panel */
15+
#define ESP_PANEL_USE_LCD (1) // 0/1
16+
17+
#if ESP_PANEL_USE_LCD
18+
/**
19+
* LCD Controller Name
20+
*/
21+
#define ESP_PANEL_LCD_NAME ST77916
22+
23+
/* LCD resolution in pixels */
24+
#define ESP_PANEL_LCD_WIDTH (360)
25+
#define ESP_PANEL_LCD_HEIGHT (360)
26+
27+
/* LCD Bus Settings */
28+
/**
29+
* If set to 1, the bus will skip to initialize the corresponding host. Users need to initialize the host in advance.
30+
* It is useful if other devices use the same host. Please ensure that the host is initialized only once.
31+
*/
32+
#define ESP_PANEL_LCD_BUS_SKIP_INIT_HOST (0) // 0/1
33+
/**
34+
* LCD Bus Type.
35+
*/
36+
#define ESP_PANEL_LCD_BUS_TYPE (ESP_PANEL_BUS_TYPE_QSPI)
37+
/**
38+
* LCD Bus Parameters.
39+
*
40+
* Please refer to https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/peripherals/lcd.html and
41+
* https://docs.espressif.com/projects/esp-iot-solution/en/latest/display/lcd/index.html for more details.
42+
*
43+
*/
44+
#if ESP_PANEL_LCD_BUS_TYPE == ESP_PANEL_BUS_TYPE_QSPI
45+
46+
#define ESP_PANEL_LCD_BUS_HOST_ID (1) // Typically set to 1
47+
#define ESP_PANEL_LCD_SPI_IO_CS (21)
48+
#if !ESP_PANEL_LCD_BUS_SKIP_INIT_HOST
49+
#define ESP_PANEL_LCD_SPI_IO_SCK (40)
50+
#define ESP_PANEL_LCD_SPI_IO_DATA0 (46)
51+
#define ESP_PANEL_LCD_SPI_IO_DATA1 (45)
52+
#define ESP_PANEL_LCD_SPI_IO_DATA2 (42)
53+
#define ESP_PANEL_LCD_SPI_IO_DATA3 (41)
54+
#endif
55+
#define ESP_PANEL_LCD_SPI_MODE (0) // 0/1/2/3, typically set to 0
56+
#define ESP_PANEL_LCD_SPI_CLK_HZ (80 * 1000 * 1000)
57+
// Should be an integer divisor of 80M, typically set to 40M
58+
#define ESP_PANEL_LCD_SPI_TRANS_QUEUE_SZ (10) // Typically set to 10
59+
#define ESP_PANEL_LCD_SPI_CMD_BITS (32) // Typically set to 32
60+
#define ESP_PANEL_LCD_SPI_PARAM_BITS (8) // Typically set to 8
61+
62+
#endif /* ESP_PANEL_LCD_BUS_TYPE */
63+
64+
/**
65+
* LCD Vendor Initialization Commands.
66+
*
67+
* Vendor specific initialization can be different between manufacturers, should consult the LCD supplier for
68+
* initialization sequence code. Please uncomment and change the following macro definitions. Otherwise, the LCD driver
69+
* will use the default initialization sequence code.
70+
*
71+
* There are two formats for the sequence code:
72+
* 1. Raw data: {command, (uint8_t []){ data0, data1, ... }, data_size, delay_ms}
73+
* 2. Formater: ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(delay_ms, command, { data0, data1, ... }) and
74+
* ESP_PANEL_LCD_CMD_WITH_NONE_PARAM(delay_ms, command)
75+
*/
76+
// #define ESP_PANEL_LCD_VENDOR_INIT_CMD() \
77+
// { \
78+
// {0xFF, (uint8_t []){0x77, 0x01, 0x00, 0x00, 0x10}, 5, 0}, \
79+
// {0xC0, (uint8_t []){0x3B, 0x00}, 2, 0}, \
80+
// {0xC1, (uint8_t []){0x0D, 0x02}, 2, 0}, \
81+
// {0x29, (uint8_t []){0x00}, 0, 120}, \
82+
// or \
83+
// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xFF, {0x77, 0x01, 0x00, 0x00, 0x10}), \
84+
// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC0, {0x3B, 0x00}), \
85+
// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC1, {0x0D, 0x02}), \
86+
// ESP_PANEL_LCD_CMD_WITH_NONE_PARAM(120, 0x29), \
87+
// }
88+
89+
/* LCD Color Settings */
90+
/* LCD color depth in bits */
91+
#define ESP_PANEL_LCD_COLOR_BITS (16) // 8/16/18/24
92+
/*
93+
* LCD RGB Element Order. Choose one of the following:
94+
* - 0: RGB
95+
* - 1: BGR
96+
*/
97+
#define ESP_PANEL_LCD_BGR_ORDER (0) // 0/1
98+
#define ESP_PANEL_LCD_INEVRT_COLOR (0) // 0/1
99+
100+
/* LCD Transformation Flags */
101+
#define ESP_PANEL_LCD_SWAP_XY (0) // 0/1
102+
#define ESP_PANEL_LCD_MIRROR_X (0) // 0/1
103+
#define ESP_PANEL_LCD_MIRROR_Y (0) // 0/1
104+
105+
/* LCD Other Settings */
106+
/* Reset pin */
107+
#define ESP_PANEL_LCD_IO_RST (-1) // IO num of RESET pin, set to -1 if not use
108+
#define ESP_PANEL_LCD_RST_LEVEL (0) // Active level. 0: low level, 1: high level
109+
110+
#endif /* ESP_PANEL_USE_LCD */
111+
112+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
113+
//////////////////////////// Please update the following macros to configure the touch panel ///////////////////////////
114+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
115+
/* Set to 1 when using an touch panel */
116+
#define ESP_PANEL_USE_TOUCH (1) // 0/1
117+
#if ESP_PANEL_USE_TOUCH
118+
/**
119+
* Touch controller name.
120+
*/
121+
#define ESP_PANEL_TOUCH_NAME CST816S
122+
123+
/* Touch resolution in pixels */
124+
#define ESP_PANEL_TOUCH_H_RES (ESP_PANEL_LCD_WIDTH) // Typically set to the same value as the width of LCD
125+
#define ESP_PANEL_TOUCH_V_RES (ESP_PANEL_LCD_HEIGHT) // Typically set to the same value as the height of LCD
126+
127+
/* Touch Panel Bus Settings */
128+
/**
129+
* If set to 1, the bus will skip to initialize the corresponding host. Users need to initialize the host in advance.
130+
* It is useful if other devices use the same host. Please ensure that the host is initialized only once.
131+
*/
132+
#define ESP_PANEL_TOUCH_BUS_SKIP_INIT_HOST (0) // 0/1
133+
/**
134+
* Touch panel bus type.
135+
*/
136+
#define ESP_PANEL_TOUCH_BUS_TYPE (ESP_PANEL_BUS_TYPE_I2C)
137+
/* Touch panel bus parameters */
138+
#if ESP_PANEL_TOUCH_BUS_TYPE == ESP_PANEL_BUS_TYPE_I2C
139+
140+
#define ESP_PANEL_TOUCH_BUS_HOST_ID (1) // Typically set to 0
141+
#define ESP_PANEL_TOUCH_I2C_ADDRESS (0) // Typically set to 0 to use the default address.
142+
// - For touchs with only one address, set to 0
143+
// - For touchs with multiple addresses, set to 0 or the address
144+
// Like GT911, there are two addresses: 0x5D(default) and 0x14
145+
#if !ESP_PANEL_TOUCH_BUS_SKIP_INIT_HOST
146+
#define ESP_PANEL_TOUCH_I2C_CLK_HZ (400 * 1000)
147+
// Typically set to 400K
148+
#define ESP_PANEL_TOUCH_I2C_SCL_PULLUP (1) // 0/1
149+
#define ESP_PANEL_TOUCH_I2C_SDA_PULLUP (1) // 0/1
150+
#define ESP_PANEL_TOUCH_I2C_IO_SCL (3)
151+
#define ESP_PANEL_TOUCH_I2C_IO_SDA (1)
152+
#endif
153+
154+
#endif /* ESP_PANEL_TOUCH_BUS_TYPE */
155+
156+
/* Touch Transformation Flags */
157+
#define ESP_PANEL_TOUCH_SWAP_XY (0) // 0/1
158+
#define ESP_PANEL_TOUCH_MIRROR_X (0) // 0/1
159+
#define ESP_PANEL_TOUCH_MIRROR_Y (0) // 0/1
160+
161+
/* Touch Other Settings */
162+
/* Reset pin */
163+
#define ESP_PANEL_TOUCH_IO_RST (-1) // IO num of RESET pin, set to -1 if not use
164+
// For GT911, the RST pin is also used to configure the I2C address
165+
#define ESP_PANEL_TOUCH_RST_LEVEL (0) // Active level. 0: low level, 1: high level
166+
/* Interrupt pin */
167+
#define ESP_PANEL_TOUCH_IO_INT (4) // IO num of INT pin, set to -1 if not use
168+
// For GT911, the INT pin is also used to configure the I2C address
169+
#define ESP_PANEL_TOUCH_INT_LEVEL (0) // Active level. 0: low level, 1: high level
170+
171+
#endif /* ESP_PANEL_USE_TOUCH */
172+
173+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
174+
///////////////////////////// Please update the following macros to configure the backlight ////////////////////////////
175+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
176+
#define ESP_PANEL_USE_BACKLIGHT (1) // 0/1
177+
#if ESP_PANEL_USE_BACKLIGHT
178+
/* Backlight pin */
179+
#define ESP_PANEL_BACKLIGHT_IO (5) // IO num of backlight pin
180+
#define ESP_PANEL_BACKLIGHT_ON_LEVEL (1) // 0: low level, 1: high level
181+
182+
/* Set to 1 if you want to turn off the backlight after initializing the panel; otherwise, set it to turn on */
183+
#define ESP_PANEL_BACKLIGHT_IDLE_OFF (0) // 0: on, 1: off
184+
185+
/* Set to 1 if use PWM for brightness control */
186+
#define ESP_PANEL_LCD_BL_USE_PWM (1) // 0/1
187+
#endif /* ESP_PANEL_USE_BACKLIGHT */
188+
189+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
190+
///////////////////////////// Please update the following macros to configure the IO expander //////////////////////////
191+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
192+
/* Set to 0 if not using IO Expander */
193+
#define ESP_PANEL_USE_EXPANDER (1) // 0/1
194+
#if ESP_PANEL_USE_EXPANDER
195+
/**
196+
* IO expander name.
197+
*/
198+
#define ESP_PANEL_EXPANDER_NAME TCA95xx_8bit
199+
200+
/* IO expander Settings */
201+
/**
202+
* If set to 1, the driver will skip to initialize the corresponding host. Users need to initialize the host in advance.
203+
* It is useful if other devices use the same host. Please ensure that the host is initialized only once.
204+
*/
205+
#define ESP_PANEL_EXPANDER_SKIP_INIT_HOST (0) // 0/1
206+
/* IO expander parameters */
207+
#define ESP_PANEL_EXPANDER_HOST_ID (0) // Typically set to 0
208+
#define ESP_PANEL_EXPANDER_I2C_ADDRESS (0x20) // The actual I2C address. Even for the same model of IC,
209+
// the I2C address may be different, and confirmation based on
210+
// the actual hardware connection is required
211+
#if !ESP_PANEL_EXPANDER_SKIP_INIT_HOST
212+
#define ESP_PANEL_EXPANDER_I2C_CLK_HZ (400 * 1000)
213+
// Typically set to 400K
214+
#define ESP_PANEL_EXPANDER_I2C_SCL_PULLUP (0) // 0/1
215+
#define ESP_PANEL_EXPANDER_I2C_SDA_PULLUP (0) // 0/1
216+
#define ESP_PANEL_EXPANDER_I2C_IO_SCL (10)
217+
#define ESP_PANEL_EXPANDER_I2C_IO_SDA (11)
218+
#endif
219+
#endif /* ESP_PANEL_USE_EXPANDER */
220+
221+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
222+
///////////////////////////// Please utilize the following macros to execute any additional code if required. //////////
223+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
224+
// #define ESP_PANEL_BEGIN_START_FUNCTION( panel )
225+
// #define ESP_PANEL_BEGIN_EXPANDER_START_FUNCTION( panel )
226+
#define ESP_PANEL_BEGIN_EXPANDER_END_FUNCTION( panel ) \
227+
{ \
228+
_expander_ptr->pinMode(0,OUTPUT); \
229+
_expander_ptr->digitalWrite(0,LOW); \
230+
vTaskDelay(pdMS_TO_TICKS(30)); \
231+
_expander_ptr->digitalWrite(0,HIGH); \
232+
vTaskDelay(pdMS_TO_TICKS(50)); \
233+
}
234+
// #define ESP_PANEL_BEGIN_LCD_START_FUNCTION( panel )
235+
// #define ESP_PANEL_BEGIN_LCD_END_FUNCTION( panel )
236+
// #define ESP_PANEL_BEGIN_TOUCH_START_FUNCTION( panel )
237+
// #define ESP_PANEL_BEGIN_TOUCH_END_FUNCTION( panel )
238+
// #define ESP_PANEL_BEGIN_BACKLIGHT_START_FUNCTION( panel )
239+
// #define ESP_PANEL_BEGIN_BACKLIGHT_END_FUNCTION( panel )
240+
// #define ESP_PANEL_BEGIN_END_FUNCTION( panel )
241+
242+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
243+
/////////////////////////////////////////////// File Version ///////////////////////////////////////////////////////////
244+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
245+
/**
246+
* Do not change the following versions, they are used to check if the configurations in this file are compatible with
247+
* the current version of `ESP_Panel_Board_Custom.h` in the library. The detailed rules are as follows:
248+
*
249+
* 1. If the major version is not consistent, then the configurations in this file are incompatible with the library
250+
* and must be replaced with the file from the library.
251+
* 2. If the minor version is not consistent, this file might be missing some new configurations, which will be set to
252+
* default values. It is recommended to replace it with the file from the library.
253+
* 3. Even if the patch version is not consistent, it will not affect normal functionality.
254+
*
255+
*/
256+
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 0
257+
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 2
258+
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 2
259+
260+
261+
// *INDENT-OFF*

0 commit comments

Comments
 (0)