Skip to content

Commit 516a46c

Browse files
committed
Merge branch 'revert/spi_lcd_mode_auto_detect' into 'master'
revert(lcd): data line number auto detect See merge request espressif/esp-idf!41795
2 parents 0d10158 + 08dc794 commit 516a46c

File tree

5 files changed

+5
-10
lines changed

5 files changed

+5
-10
lines changed

components/esp_lcd/include/esp_lcd_io_spi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ typedef struct {
3636
unsigned int dc_high_on_cmd: 1; /*!< If enabled, DC level = 1 indicates command transfer */
3737
unsigned int dc_low_on_data: 1; /*!< If enabled, DC level = 0 indicates color data transfer */
3838
unsigned int dc_low_on_param: 1; /*!< If enabled, DC level = 0 indicates parameter transfer */
39+
unsigned int octal_mode: 1; /*!< transmit data and parameters with 8 lines */
40+
unsigned int quad_mode: 1; /*!< transmit data and parameters with 4 lines */
3941
unsigned int sio_mode: 1; /*!< Read and write through a single data line (MOSI) */
4042
unsigned int lsb_first: 1; /*!< Transmit LSB bit first */
4143
unsigned int cs_high_active: 1; /*!< CS line is high active */

components/esp_lcd/spi/esp_lcd_panel_io_spi.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,11 @@ esp_err_t esp_lcd_new_panel_io_spi(esp_lcd_spi_bus_handle_t bus, const esp_lcd_p
101101
gpio_output_enable(io_config->dc_gpio_num);
102102
}
103103

104-
const spi_bus_attr_t* bus_attr = spi_bus_get_attr((spi_host_device_t)bus);
105-
uint32_t flags = bus_attr->bus_cfg.flags;
106-
if ((flags & SPICOMMON_BUSFLAG_QUAD) == SPICOMMON_BUSFLAG_QUAD) {
107-
spi_panel_io->flags.quad_mode = 1;
108-
} else if ((flags & SPICOMMON_BUSFLAG_OCTAL) == SPICOMMON_BUSFLAG_OCTAL) {
109-
spi_panel_io->flags.octal_mode = 1;
110-
}
111-
112104
spi_panel_io->flags.dc_cmd_level = io_config->flags.dc_high_on_cmd;
113105
spi_panel_io->flags.dc_data_level = !io_config->flags.dc_low_on_data;
114106
spi_panel_io->flags.dc_param_level = !io_config->flags.dc_low_on_param;
107+
spi_panel_io->flags.octal_mode = io_config->flags.octal_mode;
108+
spi_panel_io->flags.quad_mode = io_config->flags.quad_mode;
115109
spi_panel_io->on_color_trans_done = io_config->on_color_trans_done;
116110
spi_panel_io->user_ctx = io_config->user_ctx;
117111
spi_panel_io->lcd_cmd_bits = io_config->lcd_cmd_bits;

components/esp_lcd/test_apps/spi_lcd/main/test_spi_lcd_panel.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ void test_spi_lcd_common_initialize(esp_lcd_panel_io_handle_t *io_handle, esp_lc
6666
};
6767
#if SOC_SPI_SUPPORT_OCT
6868
if (oct_mode) {
69+
io_config.flags.octal_mode = 1;
6970
io_config.spi_mode = 3;
7071
}
7172
#endif

docs/en/migration-guides/release-6.x/6.0/peripherals.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ LCD
170170
- 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``.
171171
- 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.
172172
- 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.
173-
- 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.
174173
- 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.
175174
- 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.
176175
- 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.

docs/zh_CN/migration-guides/release-6.x/6.0/peripherals.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ LCD
170170
- LCD 驱动中的 GPIO 编号已经从 ``int`` 类型修改为更加类型安全的 ``gpio_num_t`` 类型。比如原来使用 ``5`` 作为 GPIO 编号,现在需要使用 ``GPIO_NUM_5``。
171171
- :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 的突发传输大小。
172172
- :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 的突发传输大小。
173-
- :cpp:type:`esp_lcd_panel_io_spi_config_t` 结构体中的 ``octal_mode`` 和 ``quad_mode`` 标志均已删除,驱动已经可以自动探测到当前 SPI 总线的数据线模式。
174173
- :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` 替代。
175174
- ``esp_lcd_panel_disp_off`` 函数已被移除。请使用 :func:`esp_lcd_panel_disp_on_off` 函数来控制显示内容的开关。
176175
- :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 控制器。

0 commit comments

Comments
 (0)