Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,45 @@ The Tab5 ships with ESP32-P4 **revision v1.0**. The ``nsh`` defconfig sets
``CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y`` accordingly. A harmless boot warning
is printed because the upstream default targets rev >= 3.0.

Display panel and touch controller
==================================

The Tab5 ships in two hardware variants, and they always come as a pair:

======================= ============================ ==========================
Variant Panel Touch controller
======================= ============================ ==========================
Earlier units ILI9881C GT911 (I2C ``0x14``)
Later units ST7121 / ST7123 ST7123 (I2C ``0x55``)
======================= ============================ ==========================

The panels need different initialization tables and different display
timings, so the wrong selection leaves the panel lit but black, and the wrong
touch selection fails the bring-up with::

ERROR: failed to register ST7123: -5

Identify the board by scanning I2C0 with the ``nsh`` configuration. The
address that answers tells which variant is fitted, and therefore which
panel to select as well::

nsh> i2c dev -b 0 0x03 0x77

Select the panel with ``ESP32P4_TAB5_LCD_ST7121`` (the default),
``ESP32P4_TAB5_LCD_ST7123`` or ``ESP32P4_TAB5_LCD_ILI9881C``, and the touch
controller with ``ESP32P4_TAB5_TOUCH_ST7123`` (the default) or
``ESP32P4_TAB5_TOUCH_GT911``, both under the board menu.

Both panels report their identification at boot, which confirms the
selection. The ILI9881C answers ``98 81`` in the first two ID registers::

ili9881c: panel ID 98 81 5c
gt911: product "911" (39 31 31 00) fw 1060

On the GT911 units the touch interrupt line has a pull-up to 3V3 that keeps
the controller from scanning, so the board drives it low instead of using it
as an interrupt. Contacts are picked up when the device is read.

Configurations
==============

Expand All @@ -165,7 +204,6 @@ lvgl_demo
---------

LVGL demo configuration with touch support.
Requires the ST7123 touch controller version.

.. note::
This configuration redirects the console to UART0 instead of the USB Serial/JTAG port
Expand All @@ -181,11 +219,12 @@ lvgl_term
---------

LVGL terminal configuration with touch support.
Requires the ST7123 touch controller version.

.. note::
This configuration redirects the console to UART0 instead of the USB Serial/JTAG port
and sets a custom entry point to open LVGL terminal on screen.
This configuration starts the LVGL terminal on the panel as its entry
point, and it runs its own NSH on a pseudo-terminal. The console is kept
on the USB Serial/JTAG port (exposed as ``ttyACM`` on the host), which
carries the system log.

.. code-block:: console

Expand Down
42 changes: 40 additions & 2 deletions boards/risc-v/esp32p4/esp32p4-tab5/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,53 @@ config ESP32P4_TAB5_LCD_ST7123
---help---
Use the ST7123 initialization table and display timings.

config ESP32P4_TAB5_LCD_ILI9881C
bool "ILI9881C"
---help---
Use the ILI9881C initialization table and display timings. This is
the panel fitted to the earlier Tab5 units, the ones that also carry
the GT911 touch controller.

endchoice

config ESP32P4_TAB5_TOUCHSCREEN
bool "Touch Screen Controller"
default n
select INPUT
select INPUT_ST7123
select ESP32P4_TAB5_HMI_POWER
---help---
Initialize the ST7123 touch screen controller.
Initialize the touch screen controller.

if ESP32P4_TAB5_TOUCHSCREEN

choice
prompt "Touch screen controller"
default ESP32P4_TAB5_TOUCH_ST7123

config ESP32P4_TAB5_TOUCH_ST7123
bool "ST7123"
select INPUT_ST7123
---help---
Sitronix ST7123, fitted to the Tab5 units that ship with the
ST7121/ST7123 panel. Answers on I2C address 0x55.

config ESP32P4_TAB5_TOUCH_GT911
bool "GT911"
select INPUT_GT9XX
---help---
Goodix GT911, fitted to the earlier Tab5 units.

endchoice

config ESP32P4_TAB5_TOUCH_GT911_ADDR
hex "GT911 I2C address"
depends on ESP32P4_TAB5_TOUCH_GT911
default 0x14
---help---
The GT911 latches its I2C address from the INT pin while it is
held in reset: either 0x14 or 0x5d. Scan the bus with
"i2c dev -b 0 0x03 0x77" if unsure.

endif # ESP32P4_TAB5_TOUCHSCREEN

endif # ARCH_BOARD_ESP32P4_TAB5
27 changes: 21 additions & 6 deletions boards/risc-v/esp32p4/esp32p4-tab5/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,27 +63,42 @@
*
* Enable /dev/fb0 with CONFIG_ESP32P4_TAB5_LCD (see configs/lcd), which
* selects power + MIPI host + VIDEO_FB. Select the matching panel with
* CONFIG_ESP32P4_TAB5_LCD_ST7121 or CONFIG_ESP32P4_TAB5_LCD_ST7123.
* CONFIG_ESP32P4_TAB5_LCD_ST7121, CONFIG_ESP32P4_TAB5_LCD_ST7123 or
* CONFIG_ESP32P4_TAB5_LCD_ILI9881C (board version 1, paired with GT911).
*/

#define TAB5_GPIO_LCD_BL_EN 22 /* Backlight enable -> ME2212 boost EN */

#define TAB5_MIPI_DSI_H_RES 720
#define TAB5_MIPI_DSI_V_RES 1280
#define TAB5_MIPI_DSI_DPI_CLK_MHZ 70
#define TAB5_MIPI_DSI_HSYNC_PULSE_WIDTH 2
#define TAB5_MIPI_DSI_HSYNC_BACK_PORCH 40
#define TAB5_MIPI_DSI_HSYNC_FRONT_PORCH 40
#define TAB5_MIPI_DSI_LANES 2

#ifdef CONFIG_ESP32P4_TAB5_LCD_ST7123
#if defined(CONFIG_ESP32P4_TAB5_LCD_ILI9881C)
# define TAB5_LCD_PANEL_NAME "ILI9881C"
# define TAB5_MIPI_DSI_DPI_CLK_MHZ 60
# define TAB5_MIPI_DSI_HSYNC_PULSE_WIDTH 40
# define TAB5_MIPI_DSI_HSYNC_BACK_PORCH 140
# define TAB5_MIPI_DSI_HSYNC_FRONT_PORCH 40
# define TAB5_MIPI_DSI_VSYNC_PULSE_WIDTH 4
# define TAB5_MIPI_DSI_VSYNC_BACK_PORCH 20
# define TAB5_MIPI_DSI_VSYNC_FRONT_PORCH 20
# define TAB5_MIPI_DSI_LANE_BITRATE_MBPS 1000
#elif defined(CONFIG_ESP32P4_TAB5_LCD_ST7123)
# define TAB5_LCD_PANEL_NAME "ST7123"
# define TAB5_MIPI_DSI_DPI_CLK_MHZ 70
# define TAB5_MIPI_DSI_HSYNC_PULSE_WIDTH 2
# define TAB5_MIPI_DSI_HSYNC_BACK_PORCH 40
# define TAB5_MIPI_DSI_HSYNC_FRONT_PORCH 40
# define TAB5_MIPI_DSI_VSYNC_PULSE_WIDTH 2
# define TAB5_MIPI_DSI_VSYNC_BACK_PORCH 8
# define TAB5_MIPI_DSI_VSYNC_FRONT_PORCH 220
# define TAB5_MIPI_DSI_LANE_BITRATE_MBPS 1000
#else
# define TAB5_LCD_PANEL_NAME "ST7121"
# define TAB5_MIPI_DSI_DPI_CLK_MHZ 70
# define TAB5_MIPI_DSI_HSYNC_PULSE_WIDTH 2
# define TAB5_MIPI_DSI_HSYNC_BACK_PORCH 40
# define TAB5_MIPI_DSI_HSYNC_FRONT_PORCH 40
# define TAB5_MIPI_DSI_VSYNC_PULSE_WIDTH 20
# define TAB5_MIPI_DSI_VSYNC_BACK_PORCH 24
# define TAB5_MIPI_DSI_VSYNC_FRONT_PORCH 200
Expand Down
8 changes: 7 additions & 1 deletion boards/risc-v/esp32p4/esp32p4-tab5/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,17 @@ if(CONFIG_ESP32P4_TAB5_LCD)
list(APPEND SRCS esp32p4_lcd_st7121.c)
elseif(CONFIG_ESP32P4_TAB5_LCD_ST7123)
list(APPEND SRCS esp32p4_lcd_st7123.c)
elseif(CONFIG_ESP32P4_TAB5_LCD_ILI9881C)
list(APPEND SRCS esp32p4_lcd_ili9881c.c)
endif()
endif()

if(CONFIG_ESP32P4_TAB5_TOUCHSCREEN)
list(APPEND SRCS esp32p4_touch.c)
if(CONFIG_ESP32P4_TAB5_TOUCH_ST7123)
list(APPEND SRCS esp32p4_touch_st7123.c)
elseif(CONFIG_ESP32P4_TAB5_TOUCH_GT911)
list(APPEND SRCS esp32p4_touch_gt911.c)
endif()
endif()

if(CONFIG_BOARDCTL)
Expand Down
8 changes: 7 additions & 1 deletion boards/risc-v/esp32p4/esp32p4-tab5/src/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,17 @@ ifeq ($(CONFIG_ESP32P4_TAB5_LCD),y)
CSRCS += esp32p4_lcd_st7121.c
else ifeq ($(CONFIG_ESP32P4_TAB5_LCD_ST7123),y)
CSRCS += esp32p4_lcd_st7123.c
else ifeq ($(CONFIG_ESP32P4_TAB5_LCD_ILI9881C),y)
CSRCS += esp32p4_lcd_ili9881c.c
endif
endif

ifeq ($(CONFIG_ESP32P4_TAB5_TOUCHSCREEN),y)
CSRCS += esp32p4_touch.c
ifeq ($(CONFIG_ESP32P4_TAB5_TOUCH_ST7123),y)
CSRCS += esp32p4_touch_st7123.c
else ifeq ($(CONFIG_ESP32P4_TAB5_TOUCH_GT911),y)
CSRCS += esp32p4_touch_gt911.c
endif
endif

ifeq ($(CONFIG_BOARDCTL),y)
Expand Down
5 changes: 4 additions & 1 deletion boards/risc-v/esp32p4/esp32p4-tab5/src/esp32p4_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@

#include "esp32p4-tab5.h"

#ifdef CONFIG_ESP32P4_TAB5_LCD_ST7123
#if defined(CONFIG_ESP32P4_TAB5_LCD_ILI9881C)
# include "esp32p4_lcd_ili9881c.h"
# define tab5_panel_initialize tab5_ili9881c_initialize
#elif defined(CONFIG_ESP32P4_TAB5_LCD_ST7123)
# include "esp32p4_lcd_st7123.h"
# define tab5_panel_initialize tab5_st7123_initialize
#else
Expand Down
Loading
Loading