feat(lcd): support rgb and i80 lcd on s31

This commit is contained in:
Chen Jichang
2026-04-07 14:21:46 +08:00
parent d22e05fbc2
commit a3f14c8ed1
36 changed files with 1607 additions and 113 deletions
+1
View File
@@ -1,5 +1,6 @@
INPUT += \
$(PROJECT_PATH)/components/esp_hal_dma/esp32s31/include/hal/bitscrambler_peri_select.h \
$(PROJECT_PATH)/components/esp_lcd/rgb/include/esp_lcd_panel_rgb.h \
$(PROJECT_PATH)/components/esp_driver_jpeg/include/driver/jpeg_decode.h \
$(PROJECT_PATH)/components/esp_driver_jpeg/include/driver/jpeg_encode.h \
$(PROJECT_PATH)/components/esp_driver_jpeg/include/driver/jpeg_types.h \
@@ -16,6 +16,49 @@ RGB LCD panel is created by :cpp:func:`esp_lcd_new_rgb_panel`, with various conf
- :cpp:member:`esp_lcd_rgb_panel_config_t::num_fbs` specifies how many frame buffers the driver should allocate. For backward compatibility, setting this to ``0`` will allocate a single frame buffer. If you don't want to allocate any frame buffer, use :cpp:member:`esp_lcd_rgb_panel_config_t::no_fb` instead.
- :cpp:member:`esp_lcd_rgb_panel_config_t::no_fb` determines whether frame buffer will be allocated. When it is set, no frame buffer will be allocated. This is also called the :ref:`bounce_buffer_only` mode.
GPIO Matrix and IOMUX Pins
--------------------------
.. only:: esp32s31
On {IDF_TARGET_NAME}, the RGB LCD driver can use IOMUX automatically when all required signals are mapped to dedicated pins:
- If ``data_gpio_nums``, ``hsync_gpio_num``, ``vsync_gpio_num``, ``pclk_gpio_num``, and ``de_gpio_num`` all match their dedicated IOMUX pins, the driver bypasses the GPIO matrix automatically.
- If any one of these signals does not match the dedicated IOMUX pin, the driver falls back to GPIO matrix routing automatically.
For higher pixel clock configurations, using IOMUX pins is recommended for better timing robustness.
Dedicated RGB IOMUX pins on {IDF_TARGET_NAME} are listed below:
- When ``data_width = 8``, ``DATA[0:7]`` is used
- When ``data_width = 16``, ``DATA[0:15]`` is used
- When ``data_width = 24``, ``DATA[0:23]`` is used
.. list-table::
:widths: 35 65
:header-rows: 1
* - Signal
- GPIO
* - DATA[0:7]
- 8, 9, 10, 11, 12, 13, 14, 15
* - DATA[8:15]
- 16, 17, 18, 19, 33, 34, 35, 36
* - DATA[16:23]
- 37, 38, 39, 2, 3, 4, 5, 7
* - HSYNC
- 44
* - VSYNC
- 45
* - PCLK
- 40
* - DE
- 43
.. only:: not esp32s31
On {IDF_TARGET_NAME}, RGB signals are routed through the GPIO matrix.
RGB LCD Frame Buffer Operation Modes
------------------------------------
@@ -16,6 +16,49 @@ RGB LCD 面板的分配步骤只需一步,即调用函数 :cpp:func:`esp_lcd_n
- :cpp:member:`esp_lcd_rgb_panel_config_t::num_fbs` 设置由驱动程序分配的 frame buffer 的数量。为了向后兼容,``0`` 表示分配 ``一个`` frame buffer。如果不想分配任何 frame buffer,请设置 :cpp:member:`esp_lcd_rgb_panel_config_t::no_fb`
- :cpp:member:`esp_lcd_rgb_panel_config_t::no_fb` 可决定是否分配 frame buffer。设置该字段后将不分配 frame buffer。这也被称为 :ref:`bounce_buffer_only` 模式。
GPIO 矩阵与 IOMUX 管脚
----------------------
.. only:: esp32s31
{IDF_TARGET_NAME} 上,RGB LCD 驱动支持在满足专用管脚条件时自动使用 IOMUX,无需额外配置开关:
-``data_gpio_nums````hsync_gpio_num````vsync_gpio_num````pclk_gpio_num````de_gpio_num`` 都配置为 RGB 外设的专用 IOMUX 管脚时,驱动会自动绕过 GPIO 矩阵。
- 只要上述任一信号未使用专用 IOMUX 管脚,驱动就会自动回退为 GPIO 矩阵路由。
在较高像素时钟下,建议优先使用 IOMUX 管脚以获得更稳定的时序表现。
{IDF_TARGET_NAME} 上 RGB 接口可用的专用 IOMUX 管脚如下:
-``data_width = 8`` 时,使用 ``DATA[0:7]``
-``data_width = 16`` 时,使用 ``DATA[0:15]``
-``data_width = 24`` 时,使用 ``DATA[0:23]``
.. list-table::
:widths: 35 65
:header-rows: 1
* - 信号
- GPIO
* - DATA[0:7]
- 8, 9, 10, 11, 12, 13, 14, 15
* - DATA[8:15]
- 16, 17, 18, 19, 33, 34, 35, 36
* - DATA[16:23]
- 37, 38, 39, 2, 3, 4, 5, 7
* - HSYNC
- 44
* - VSYNC
- 45
* - PCLK
- 40
* - DE
- 43
.. only:: not esp32s31
在 {IDF_TARGET_NAME} 上,RGB 信号通过 GPIO 矩阵路由。
RGB LCD frame buffer 操作模式
------------------------------