Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
4b9a1c0
Merge dev branch component to main.
kylix-rd Jan 20, 2024
fbed668
Added logging.
kylix-rd Jan 20, 2024
6033793
Adjust logging.
kylix-rd Jan 20, 2024
2b7c9b2
Move lcd.begin to later in init cycle.
kylix-rd Jan 20, 2024
ef104ec
Remove logging.
kylix-rd Jan 20, 2024
4dac3c0
Adjust rotation.
kylix-rd Jan 20, 2024
20d947a
Backlight is optional, for now.
kylix-rd Jan 20, 2024
dc08a79
Rotate 180.
kylix-rd Jan 20, 2024
5acd9f7
Mirror X
kylix-rd Jan 20, 2024
b8c6771
Better logging of pixels.
kylix-rd Jan 20, 2024
4bc2865
Center background image.
kylix-rd Jan 20, 2024
8001e27
Log touch points.
kylix-rd Jan 21, 2024
ed77d5f
Resize display buffer.
kylix-rd Jan 21, 2024
2369506
Swap width and height...
kylix-rd Jan 21, 2024
078442c
Swap width and height back.
kylix-rd Jan 21, 2024
7ed1106
Include conf.
kylix-rd Jan 21, 2024
115a1b2
Formatting.
kylix-rd Jan 21, 2024
5923d46
Removed quotes
kylix-rd Jan 21, 2024
e6586aa
Define the width and height.
kylix-rd Jan 21, 2024
62ec56f
Buffer only one line at a time.
kylix-rd Jan 21, 2024
be53ee0
Retore the pixel buffer
kylix-rd Jan 21, 2024
0102743
Rotate,
kylix-rd Jan 21, 2024
3f4c047
No rotation.
kylix-rd Jan 21, 2024
18fd6dd
Dual buffers
kylix-rd Jan 21, 2024
2580423
Test width change
kylix-rd Jan 21, 2024
be9f66f
Adjust front and back porch.
kylix-rd Jan 21, 2024
bf29937
Init the lcd host.
kylix-rd Jan 21, 2024
efe9e8f
Don't init SPI for display.
kylix-rd Jan 21, 2024
847faf9
Call readData() on the touch device.
kylix-rd Jan 21, 2024
d3fd039
No more porches.
kylix-rd Jan 21, 2024
fa75102
Restore porches.
kylix-rd Jan 21, 2024
cc5f6a5
Widen the porches.
kylix-rd Jan 21, 2024
d1e51d3
Sync with demos.
kylix-rd Jan 21, 2024
ebb8916
Include IO expander header.
kylix-rd Jan 21, 2024
95a4072
Fix compile error.
kylix-rd Jan 21, 2024
040bc31
More compile fixes.
kylix-rd Jan 21, 2024
d269d33
Don't show the background image.
kylix-rd Jan 21, 2024
8823332
start lv demos.
kylix-rd Jan 21, 2024
14e6d51
Enable lvgl demos.
kylix-rd Jan 21, 2024
870043d
Change allocation.
kylix-rd Jan 21, 2024
f4d3c5e
Format & code updates,
kylix-rd Jan 21, 2024
9422b5c
Cleanup.
kylix-rd Jan 21, 2024
5a2a12c
Don't use lvgl dev version.
kylix-rd Jan 22, 2024
a62a8d5
Different comment style for python...
kylix-rd Jan 22, 2024
c140059
Run lvgl in a separate task.
kylix-rd Jan 22, 2024
0a43e99
use esphome millis() and don't call lv_timer_handler() in loop().
kylix-rd Jan 22, 2024
684fd88
Use inner object instead of a component.
kylix-rd Jan 22, 2024
2f07be4
Fix compile error.
kylix-rd Jan 22, 2024
03cc5e0
Compile error.
kylix-rd Jan 22, 2024
f151533
Compile error.
kylix-rd Jan 22, 2024
12cdfa0
Another error.
kylix-rd Jan 22, 2024
e0467df
Move time_ field to lvglDeck class.
kylix-rd Jan 22, 2024
49a2b25
Include esphome hal.h
kylix-rd Jan 22, 2024
c4b8e30
Fix display Skewing.
kylix-rd Jan 22, 2024
5f0f340
Move updates to the foreground.
kylix-rd Jan 22, 2024
831f340
Update Background Image
kylix-rd Jan 22, 2024
25d866f
Update image reference
kylix-rd Jan 22, 2024
17bb430
Code cleanup
kylix-rd Jan 22, 2024
cda3749
Change background image.
kylix-rd Jan 24, 2024
522167e
Fix background image filename.
kylix-rd Jan 24, 2024
c91cd9b
Backlight is on or off only.
kylix-rd Jan 24, 2024
4adc58a
Directly access the expander.
kylix-rd Jan 24, 2024
d2978fb
Grey background.
kylix-rd Jan 24, 2024
e85319b
Blue Background.
kylix-rd Jan 24, 2024
3f1404c
Use correct bit mask for io expander.
kylix-rd Jan 27, 2024
1d8cb62
Update external library references for the panel and expander.
kylix-rd Jan 27, 2024
3b6a086
Update library syntax.
kylix-rd Jan 27, 2024
4f56d0b
Update expander & lcd panel library references.
kylix-rd Jan 27, 2024
9446dbe
Update library names.
kylix-rd Jan 27, 2024
c39cdc8
One more try.
kylix-rd Jan 27, 2024
5fb23fc
No need for arduinio.h
kylix-rd Jan 27, 2024
78fb889
Use multiDigitalWrite for BL pin
kylix-rd Jan 27, 2024
ba80f3c
Fix compiler error invalid conversion
kylix-rd Jul 19, 2025
67944f5
Update ESP Display and Expander version tags
kylix-rd Jul 19, 2025
1e8d1af
Add dependency on esp lib utils
kylix-rd Jul 19, 2025
8af8956
Update dependency on esp lib utils
kylix-rd Jul 19, 2025
c2b603f
Compiler error fix.
kylix-rd Jul 19, 2025
11b06cd
Another compiler error fix.
kylix-rd Jul 19, 2025
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
263 changes: 263 additions & 0 deletions components/waveshare_s3_touch_lcd/ESP_Panel_Conf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ESP_PANEL_CONF_H
#define ESP_PANEL_CONF_H

// *INDENT-OFF*
/* Set to 0 if use a custom board */
#define ESP_PANEL_USE_SUPPORTED_BOARD (0)

#if ESP_PANEL_USE_SUPPORTED_BOARD
/*
* Supported Boards.
* - ESP32-C3-LCDkit: https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32c3/esp32-c3-lcdkit/index.html
* - ESP32-S3-Box: https://github.com/espressif/esp-box/tree/master
* - ESP32-S3-Box-3: https://github.com/espressif/esp-box/tree/master
* - ESP32-S3-Box-3(beta): https://github.com/espressif/esp-box/tree/c4c954888e11250423f083df0067d99e22d59fbe
* - ESP32-S3-Box-Lite: https://github.com/espressif/esp-box/tree/master
* - ESP32-S3-EYE: https://github.com/espressif/esp-who/blob/master/docs/en/get-started/ESP32-S3-EYE_Getting_Started_Guide.md
* - ESP32-S3-Korvo-2: https://docs.espressif.com/projects/esp-adf/en/latest/design-guide/dev-boards/user-guide-esp32-s3-korvo-2.html
* - ESP32-S3-LCD-EV-Board: https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32s3/esp32-s3-lcd-ev-board/index.html
* - ESP32-S3-LCD-EV-Board-2: https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32s3/esp32-s3-lcd-ev-board/index.html
* - ESP32-S3-USB-OTG: https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32s3/esp32-s3-usb-otg/index.html
*
* Uncomment one of the following macros to select an supported development board.
*/
// #define ESP_PANEL_BOARD_ESP32_C3_LCDKIT
// #define ESP_PANEL_BOARD_ESP32_S3_BOX
// #define ESP_PANEL_BOARD_ESP32_S3_BOX_3
// #define ESP_PANEL_BOARD_ESP32_S3_BOX_3_BETA
// #define ESP_PANEL_BOARD_ESP32_S3_BOX_LITE
// #define ESP_PANEL_BOARD_ESP32_S3_EYE
// #define ESP_PANEL_BOARD_ESP32_S3_KORVO_2
// #define ESP_PANEL_BOARD_ESP32_S3_LCD_EV_BOARD
// #define ESP_PANEL_BOARD_ESP32_S3_LCD_EV_BOARD_2
// #define ESP_PANEL_BOARD_ESP32_S3_USB_OTG

#else
/*-------------------------------- LCD Related --------------------------------*/
/* Set to 0 if not using LCD */
#define ESP_PANEL_USE_LCD (1)
#if ESP_PANEL_USE_LCD
/**
* LCD IC name. Choose one of the following:
* - ILI9341
* - GC9503, GC9A01
* - ST7262, ST7789, ST7796
*/
#define ESP_PANEL_LCD_NAME ST7262

/* LCD resolution in pixels */
#define ESP_PANEL_LCD_H_RES (800)
#define ESP_PANEL_LCD_V_RES (480)

/* LCD Bus Settings */
/**
* If set to 1, the bus will skip to initialize the corresponding host. Users need to initialize the host in advance.
* It is useful if other devices use the same host. Please ensure that the host is initialized only once.
*/
#define ESP_PANEL_LCD_BUS_SKIP_INIT_HOST (1)
/**
* LCD bus type. Choose one of the following:
* - 0: I2C (not supported yet)
* - 1: SPI
* - 2: I80 (not supported yet)
* - 3: RGB
*/
#define ESP_PANEL_LCD_BUS_TYPE (3)
/**
* LCD bus parameters.
*
* Please refer to https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/peripherals/lcd.html for details.
*/
#if ESP_PANEL_LCD_BUS_TYPE == 0
#elif ESP_PANEL_LCD_BUS_TYPE == 1
#define ESP_PANEL_LCD_BUS_HOST_ID (1)
#define ESP_PANEL_LCD_SPI_IO_CS (5)
#define ESP_PANEL_LCD_SPI_IO_DC (4)
#define ESP_PANEL_LCD_SPI_MODE (0)
#define ESP_PANEL_LCD_SPI_CLK_HZ (40 * 1000 * 1000)
#define ESP_PANEL_LCD_SPI_TRANS_QUEUE_SZ (10)
#define ESP_PANEL_LCD_SPI_CMD_BITS (8)
#define ESP_PANEL_LCD_SPI_PARAM_BITS (8)
#if !ESP_PANEL_LCD_BUS_SKIP_INIT_HOST
#define ESP_PANEL_LCD_SPI_IO_SCK (7)
#define ESP_PANEL_LCD_SPI_IO_MOSI (6)
#define ESP_PANEL_LCD_SPI_IO_MISO (-1)
#endif /* ESP_PANEL_LCD_BUS_SKIP_INIT_HOST */
#elif ESP_PANEL_LCD_BUS_TYPE == 2
#elif ESP_PANEL_LCD_BUS_TYPE == 3
#define ESP_PANEL_LCD_RGB_CLK_HZ (14 * 1000 * 1000)
#define ESP_PANEL_LCD_RGB_HPW (10)
#define ESP_PANEL_LCD_RGB_HBP (10)
#define ESP_PANEL_LCD_RGB_HFP (20)
#define ESP_PANEL_LCD_RGB_VPW (10)
#define ESP_PANEL_LCD_RGB_VBP (10)
#define ESP_PANEL_LCD_RGB_VFP (10)
#define ESP_PANEL_LCD_RGB_PCLK_ACTIVE_NEG (0)
#define ESP_PANEL_LCD_RGB_DATA_WIDTH (16)
#define ESP_PANEL_LCD_RGB_IO_HSYNC (46)
#define ESP_PANEL_LCD_RGB_IO_VSYNC (3)
#define ESP_PANEL_LCD_RGB_IO_DE (5)
#define ESP_PANEL_LCD_RGB_IO_PCLK (7)
#define ESP_PANEL_LCD_RGB_IO_DATA0 (14)
#define ESP_PANEL_LCD_RGB_IO_DATA1 (38)
#define ESP_PANEL_LCD_RGB_IO_DATA2 (18)
#define ESP_PANEL_LCD_RGB_IO_DATA3 (17)
#define ESP_PANEL_LCD_RGB_IO_DATA4 (10)
#define ESP_PANEL_LCD_RGB_IO_DATA5 (39)
#define ESP_PANEL_LCD_RGB_IO_DATA6 (0)
#define ESP_PANEL_LCD_RGB_IO_DATA7 (45)
#define ESP_PANEL_LCD_RGB_IO_DATA8 (48)
#define ESP_PANEL_LCD_RGB_IO_DATA9 (47)
#define ESP_PANEL_LCD_RGB_IO_DATA10 (21)
#define ESP_PANEL_LCD_RGB_IO_DATA11 (1)
#define ESP_PANEL_LCD_RGB_IO_DATA12 (2)
#define ESP_PANEL_LCD_RGB_IO_DATA13 (42)
#define ESP_PANEL_LCD_RGB_IO_DATA14 (41)
#define ESP_PANEL_LCD_RGB_IO_DATA15 (40)
#define ESP_PANEL_LCD_RGB_IO_DISP (-1)
#if !ESP_PANEL_LCD_BUS_SKIP_INIT_HOST
#define ESP_PANEL_LCD_SPI_CLK_HZ (500 * 1000)
#define ESP_PANEL_LCD_SPI_MODE (0)
#define ESP_PANEL_LCD_SPI_CMD_BYTES (1)
#define ESP_PANEL_LCD_SPI_PARAM_BYTES (1)
#define ESP_PANEL_LCD_SPI_USE_DC_BIT (1)
#define ESP_PANEL_LCD_SPI_DC_ZERO_ON_DATA (0)
#define ESP_PANEL_LCD_SPI_LSB_FIRST (0)
#define ESP_PANEL_LCD_SPI_CS_HIGH_ACTIVE (0)
#define ESP_PANEL_LCD_SPI_DEL_KEEP_CS (1)
#define ESP_PANEL_LCD_SPI_CS_USE_EXPNADER (1)
#define ESP_PANEL_LCD_SPI_SCL_USE_EXPNADER (1)
#define ESP_PANEL_LCD_SPI_SDA_USE_EXPNADER (1)
#define ESP_PANEL_LCD_SPI_IO_CS (1)
#define ESP_PANEL_LCD_SPI_IO_SCL (2)
#define ESP_PANEL_LCD_SPI_IO_SDA (3)
#endif /* ESP_PANEL_LCD_BUS_SKIP_INIT_HOST */
#endif /* ESP_PANEL_LCD_BUS_TYPE */

/* LCD Color Settings */
/* LCD color depth in bits */
#define ESP_PANEL_LCD_COLOR_BITS (16)
/*
* LCD Color Space. Choose one of the following:
* - 0: RGB
* - 1: BGR
*/
#define ESP_PANEL_LCD_COLOR_SPACE (0)
#define ESP_PANEL_LCD_INEVRT_COLOR (0)

/* LCD Transformation Flags */
#define ESP_PANEL_LCD_SWAP_XY (0)
#define ESP_PANEL_LCD_MIRROR_X (0)
#define ESP_PANEL_LCD_MIRROR_Y (0)

/* LCD Other Settings */
/* IO num of RESET pin, set to -1 if not use */
#define ESP_PANEL_LCD_IO_RST (-1)
#define ESP_PANEL_LCD_RST_LEVEL (0)

#endif /* ESP_PANEL_USE_LCD */

/*-------------------------------- LCD Touch Related --------------------------------*/
/* Set to 0 if not using LCD touch */
#define ESP_PANEL_USE_LCD_TOUCH (1)
#if ESP_PANEL_USE_LCD_TOUCH
/**
* LCD Touch IC name. Choose one of the following:
* - CST816S
* - FT5x06
* - GT1151, GT911
* - TT21100
* - STMPE610
*/
#define ESP_PANEL_LCD_TOUCH_NAME GT911

/* LCD Touch resolution in pixels */
#define ESP_PANEL_LCD_TOUCH_H_RES (ESP_PANEL_LCD_H_RES)
#define ESP_PANEL_LCD_TOUCH_V_RES (ESP_PANEL_LCD_V_RES)

/* LCD Touch Bus Settings */
/**
* If set to 1, the bus will skip to initialize the corresponding host. Users need to initialize the host in advance.
* It is useful if other devices use the same host. Please ensure that the host is initialized only once.
*/
#define ESP_PANEL_LCD_TOUCH_BUS_SKIP_INIT_HOST (0)
/**
* LCD touch bus type. Choose one of the following:
* - 0: I2C
* - 1: SPI
*/
#define ESP_PANEL_LCD_TOUCH_BUS_TYPE (0)
/**
* LCD touch bus parameters.
*
* Please refer to https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/peripherals/lcd.html for details.
*/
#if ESP_PANEL_LCD_TOUCH_BUS_TYPE == 0
#define ESP_PANEL_LCD_TOUCH_BUS_HOST_ID (0)
#if !ESP_PANEL_LCD_TOUCH_BUS_SKIP_INIT_HOST
#define ESP_PANEL_LCD_TOUCH_I2C_CLK_HZ (400 * 1000)
#define ESP_PANEL_LCD_TOUCH_I2C_SCL_PULLUP (0)
#define ESP_PANEL_LCD_TOUCH_I2C_SDA_PULLUP (0)
#define ESP_PANEL_LCD_TOUCH_I2C_IO_SCL (9)
#define ESP_PANEL_LCD_TOUCH_I2C_IO_SDA (8)
#endif /* ESP_PANEL_LCD_TOUCH_BUS_SKIP_INIT_HOST */
#elif ESP_PANEL_LCD_TOUCH_BUS_TYPE == 1
#define ESP_PANEL_LCD_TOUCH_BUS_HOST_ID (1)
#define ESP_PANEL_LCD_TOUCH_SPI_IO_CS (5)
#if !ESP_PANEL_LCD_TOUCH_BUS_SKIP_INIT_HOST
#define ESP_PANEL_LCD_TOUCH_SPI_IO_SCK (7)
#define ESP_PANEL_LCD_TOUCH_SPI_IO_MOSI (6)
#define ESP_PANEL_LCD_TOUCH_SPI_IO_MISO (4)
#endif /* ESP_PANEL_LCD_TOUCH_BUS_SKIP_INIT_HOST */
#endif /* ESP_PANEL_LCD_TOUCH_BUS_TYPE */

/* LCD Touch Transformation Flags */
#define ESP_PANEL_LCD_TOUCH_SWAP_XY (0)
#define ESP_PANEL_LCD_TOUCH_MIRROR_X (0)
#define ESP_PANEL_LCD_TOUCH_MIRROR_Y (0)

/* LCD Touch Other Settings */
#define ESP_PANEL_LCD_TOUCH_IO_RST (-1)
#define ESP_PANEL_LCD_TOUCH_IO_INT (-1)
#define ESP_PANEL_LCD_TOUCH_RST_LEVEL (0)
#define ESP_PANEL_LCD_TOUCH_INT_LEVEL (0)

#endif /* ESP_PANEL_USE_LCD_TOUCH */

/*-------------------------------- Backlight Related --------------------------------*/
#define ESP_PANEL_USE_BL (0)
#if ESP_PANEL_USE_BL
/* IO num of backlight pin */
#define ESP_PANEL_LCD_IO_BL (45)

/* If the backlight is on when high level, set to 1; otherwise to 0 */
#define ESP_PANEL_LCD_BL_ON_LEVEL (1)

/* Set to 1 if use PWM for backlight brightness control. */
#define ESP_PANEL_LCD_BL_USE_PWM (0)
#if ESP_PANEL_LCD_BL_USE_PWM
/**
* Backlight LEDC Parameters.
*
* Please refer to https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/peripherals/ledc.html for details.
*/
#define ESP_PANEL_LCD_BL_PWM_TIMER (0)
#define ESP_PANEL_LCD_BL_PWM_CHANNEL (0)
#define ESP_PANEL_LCD_BL_PWM_RESOLUTION (10)
#define ESP_PANEL_LCD_BL_PWM_FREQ_HZ (5000)
#endif /* ESP_PANEL_LCD_BL_USE_PWM */
#endif /* ESP_PANEL_USE_BL */

/*-------------------------------- Others --------------------------------*/
/* Assert on error. Otherwise return error code */
#define ESP_PANEL_CHECK_RESULT_ASSERT (0)

#endif /* ESP_PANEL_USE_SUPPORTED_BOARD */
// *INDENT-OFF*

#endif
Loading