diff --git a/components/esp_lcd/include/esp_lcd_io_spi.h b/components/esp_lcd/include/esp_lcd_io_spi.h index ce2048b324..3a4b338b35 100644 --- a/components/esp_lcd/include/esp_lcd_io_spi.h +++ b/components/esp_lcd/include/esp_lcd_io_spi.h @@ -36,6 +36,8 @@ typedef struct { unsigned int dc_high_on_cmd: 1; /*!< If enabled, DC level = 1 indicates command transfer */ unsigned int dc_low_on_data: 1; /*!< If enabled, DC level = 0 indicates color data transfer */ unsigned int dc_low_on_param: 1; /*!< If enabled, DC level = 0 indicates parameter transfer */ + unsigned int octal_mode: 1; /*!< transmit data and parameters with 8 lines */ + unsigned int quad_mode: 1; /*!< transmit data and parameters with 4 lines */ unsigned int sio_mode: 1; /*!< Read and write through a single data line (MOSI) */ unsigned int lsb_first: 1; /*!< Transmit LSB bit first */ unsigned int cs_high_active: 1; /*!< CS line is high active */ diff --git a/components/esp_lcd/spi/esp_lcd_panel_io_spi.c b/components/esp_lcd/spi/esp_lcd_panel_io_spi.c index 02d533a874..6c0f49811f 100644 --- a/components/esp_lcd/spi/esp_lcd_panel_io_spi.c +++ b/components/esp_lcd/spi/esp_lcd_panel_io_spi.c @@ -101,17 +101,11 @@ esp_err_t esp_lcd_new_panel_io_spi(esp_lcd_spi_bus_handle_t bus, const esp_lcd_p gpio_output_enable(io_config->dc_gpio_num); } - const spi_bus_attr_t* bus_attr = spi_bus_get_attr((spi_host_device_t)bus); - uint32_t flags = bus_attr->bus_cfg.flags; - if ((flags & SPICOMMON_BUSFLAG_QUAD) == SPICOMMON_BUSFLAG_QUAD) { - spi_panel_io->flags.quad_mode = 1; - } else if ((flags & SPICOMMON_BUSFLAG_OCTAL) == SPICOMMON_BUSFLAG_OCTAL) { - spi_panel_io->flags.octal_mode = 1; - } - spi_panel_io->flags.dc_cmd_level = io_config->flags.dc_high_on_cmd; spi_panel_io->flags.dc_data_level = !io_config->flags.dc_low_on_data; spi_panel_io->flags.dc_param_level = !io_config->flags.dc_low_on_param; + spi_panel_io->flags.octal_mode = io_config->flags.octal_mode; + spi_panel_io->flags.quad_mode = io_config->flags.quad_mode; spi_panel_io->on_color_trans_done = io_config->on_color_trans_done; spi_panel_io->user_ctx = io_config->user_ctx; spi_panel_io->lcd_cmd_bits = io_config->lcd_cmd_bits; diff --git a/components/esp_lcd/test_apps/spi_lcd/main/test_spi_lcd_panel.c b/components/esp_lcd/test_apps/spi_lcd/main/test_spi_lcd_panel.c index e975eac556..eb40f3dcf9 100644 --- a/components/esp_lcd/test_apps/spi_lcd/main/test_spi_lcd_panel.c +++ b/components/esp_lcd/test_apps/spi_lcd/main/test_spi_lcd_panel.c @@ -66,6 +66,7 @@ void test_spi_lcd_common_initialize(esp_lcd_panel_io_handle_t *io_handle, esp_lc }; #if SOC_SPI_SUPPORT_OCT if (oct_mode) { + io_config.flags.octal_mode = 1; io_config.spi_mode = 3; } #endif diff --git a/docs/en/migration-guides/release-6.x/6.0/peripherals.rst b/docs/en/migration-guides/release-6.x/6.0/peripherals.rst index 9866123a22..94a7900483 100644 --- a/docs/en/migration-guides/release-6.x/6.0/peripherals.rst +++ b/docs/en/migration-guides/release-6.x/6.0/peripherals.rst @@ -170,7 +170,6 @@ LCD - The GPIO number type in the LCD driver has been changed from ``int`` to the more type-safe ``gpio_num_t``. For example, instead of using ``5`` as the GPIO number, you now need to use ``GPIO_NUM_5``. - The ``psram_trans_align`` and ``sram_trans_align`` members in the :cpp:type:`esp_lcd_i80_bus_config_t` structure have been replaced by the :cpp:member:`esp_lcd_i80_bus_config_t::dma_burst_size` member, which sets the DMA burst transfer size. - The ``psram_trans_align`` and ``sram_trans_align`` members in the :cpp:type:`esp_lcd_rgb_panel_config_t` structure have also been replaced by the :cpp:member:`esp_lcd_rgb_panel_config_t::dma_burst_size` member for configuring the DMA burst transfer size. -- The ``octal_mode`` and ``quad_mode`` flags in the :cpp:type:`esp_lcd_panel_io_spi_config_t` structure have been removed. The driver now automatically detects the data line mode of the current SPI bus. - The ``color_space`` and ``rgb_endian`` configuration options in the :cpp:type:`esp_lcd_panel_dev_config_t` structure have been replaced by the :cpp:member:`esp_lcd_panel_dev_config_t::rgb_ele_order` member, which sets the RGB element order. The corresponding types ``lcd_color_rgb_endian_t`` and ``esp_lcd_color_space_t`` have also been removed; use :cpp:type:`lcd_rgb_element_order_t` instead. - The ``esp_lcd_panel_disp_off`` function has been removed. Please use the :func:`esp_lcd_panel_disp_on_off` function to control display on/off. - The ``on_bounce_frame_finish`` member in :cpp:type:`esp_lcd_rgb_panel_event_callbacks_t` has been replaced by :cpp:member:`esp_lcd_rgb_panel_event_callbacks_t::on_frame_buf_complete`, which indicates that a complete frame buffer has been sent to the LCD controller. diff --git a/docs/zh_CN/migration-guides/release-6.x/6.0/peripherals.rst b/docs/zh_CN/migration-guides/release-6.x/6.0/peripherals.rst index 29100152eb..705e5e4e6e 100644 --- a/docs/zh_CN/migration-guides/release-6.x/6.0/peripherals.rst +++ b/docs/zh_CN/migration-guides/release-6.x/6.0/peripherals.rst @@ -170,7 +170,6 @@ LCD - LCD 驱动中的 GPIO 编号已经从 ``int`` 类型修改为更加类型安全的 ``gpio_num_t`` 类型。比如原来使用 ``5`` 作为 GPIO 编号,现在需要使用 ``GPIO_NUM_5``。 - :cpp:type:`esp_lcd_i80_bus_config_t` 结构体中的 ``psram_trans_align`` 和 ``sram_trans_align`` 均已被 :cpp:member:`esp_lcd_i80_bus_config_t::dma_burst_size` 成员取代,用来设置 DMA 的突发传输大小。 - :cpp:type:`esp_lcd_rgb_panel_config_t` 结构体中的 ``psram_trans_align`` 和 ``sram_trans_align`` 均已被 :cpp:member:`esp_lcd_rgb_panel_config_t::dma_burst_size` 成员取代,用来设置 DMA 的突发传输大小。 -- :cpp:type:`esp_lcd_panel_io_spi_config_t` 结构体中的 ``octal_mode`` 和 ``quad_mode`` 标志均已删除,驱动已经可以自动探测到当前 SPI 总线的数据线模式。 - :cpp:type:`esp_lcd_panel_dev_config_t` 结构体中的 ``color_space`` 和 ``rgb_endian`` 配置均已被 :cpp:member:`esp_lcd_panel_dev_config_t::rgb_ele_order` 成员取代,用来设置 RGB 元素的排列顺序。对应的类型 ``lcd_color_rgb_endian_t`` 和 ``esp_lcd_color_space_t`` 也已被移除,请使用 :cpp:type:`lcd_rgb_element_order_t` 替代。 - ``esp_lcd_panel_disp_off`` 函数已被移除。请使用 :func:`esp_lcd_panel_disp_on_off` 函数来控制显示内容的开关。 - :cpp:type:`esp_lcd_rgb_panel_event_callbacks_t` 中的 ``on_bounce_frame_finish`` 成员已被 :cpp:member:`esp_lcd_rgb_panel_event_callbacks_t::on_frame_buf_complete` 成员取代,用于指示一个完整的帧缓冲区已被发送给 LCD 控制器。