diff --git a/components/esp_lcd/rgb/esp_lcd_panel_rgb.c b/components/esp_lcd/rgb/esp_lcd_panel_rgb.c index 025df69f41..b08cab1959 100644 --- a/components/esp_lcd/rgb/esp_lcd_panel_rgb.c +++ b/components/esp_lcd/rgb/esp_lcd_panel_rgb.c @@ -27,7 +27,6 @@ #include "soc/soc_caps.h" #include "esp_clk_tree.h" #include "hal/dma_types.h" -#include "driver/gpio.h" #include "esp_bit_defs.h" #include "esp_private/esp_clk_tree_common.h" #include "esp_private/gdma.h" @@ -763,36 +762,36 @@ static esp_err_t lcd_rgb_panel_configure_gpio(esp_rgb_panel_t *rgb_panel, const lcd_ll_set_data_wire_width(rgb_panel->hal.dev, panel_config->data_width); // connect peripheral signals via GPIO matrix for (size_t i = 0; i < panel_config->data_width; i++) { - if (panel_config->data_gpio_nums[i] >= 0) { + if (GPIO_IS_VALID_OUTPUT_GPIO(panel_config->data_gpio_nums[i])) { gpio_matrix_output(panel_config->data_gpio_nums[i], lcd_periph_rgb_signals.panels[panel_id].data_sigs[i], false, false); gpio_reserve_mask |= (1ULL << panel_config->data_gpio_nums[i]); } } - if (panel_config->hsync_gpio_num >= 0) { + if (GPIO_IS_VALID_OUTPUT_GPIO(panel_config->hsync_gpio_num)) { gpio_matrix_output(panel_config->hsync_gpio_num, lcd_periph_rgb_signals.panels[panel_id].hsync_sig, false, false); gpio_reserve_mask |= (1ULL << panel_config->hsync_gpio_num); } - if (panel_config->vsync_gpio_num >= 0) { + if (GPIO_IS_VALID_OUTPUT_GPIO(panel_config->vsync_gpio_num)) { gpio_matrix_output(panel_config->vsync_gpio_num, lcd_periph_rgb_signals.panels[panel_id].vsync_sig, false, false); gpio_reserve_mask |= (1ULL << panel_config->vsync_gpio_num); } // PCLK may not be necessary in some cases (i.e. VGA output) - if (panel_config->pclk_gpio_num >= 0) { + if (GPIO_IS_VALID_OUTPUT_GPIO(panel_config->pclk_gpio_num)) { gpio_matrix_output(panel_config->pclk_gpio_num, lcd_periph_rgb_signals.panels[panel_id].pclk_sig, false, false); gpio_reserve_mask |= (1ULL << panel_config->pclk_gpio_num); } // DE signal might not be necessary for some RGB LCD - if (panel_config->de_gpio_num >= 0) { + if (GPIO_IS_VALID_OUTPUT_GPIO(panel_config->de_gpio_num)) { gpio_matrix_output(panel_config->de_gpio_num, lcd_periph_rgb_signals.panels[panel_id].de_sig, false, false); gpio_reserve_mask |= (1ULL << panel_config->de_gpio_num); } // disp enable GPIO is optional, it is a general purpose output GPIO - if (panel_config->disp_gpio_num >= 0) { + if (GPIO_IS_VALID_OUTPUT_GPIO(panel_config->disp_gpio_num)) { gpio_matrix_output(panel_config->disp_gpio_num, lcd_periph_rgb_signals.panels[panel_id].disp_sig, false, false); gpio_reserve_mask |= (1ULL << panel_config->disp_gpio_num); diff --git a/docs/en/api-reference/peripherals/lcd/dsi_lcd.rst b/docs/en/api-reference/peripherals/lcd/dsi_lcd.rst index c44c288bfa..d24da8cecb 100644 --- a/docs/en/api-reference/peripherals/lcd/dsi_lcd.rst +++ b/docs/en/api-reference/peripherals/lcd/dsi_lcd.rst @@ -87,6 +87,15 @@ MIPI DSI Interfaced LCD ESP_ERROR_CHECK(esp_lcd_new_panel_dpi(mipi_dsi_bus, &dpi_config, &mipi_dpi_panel)); ESP_ERROR_CHECK(esp_lcd_panel_init(mipi_dpi_panel)); +Power Supply for MIPI DPHY +-------------------------- + +The MIPI DPHY on {IDF_TARGET_NAME} requires a dedicated 2.5V power supply. Please refer to your schematic and ensure that the power pin (often labeled ``VDD_MIPI_DPHY``) is properly connected to a 2.5V power source before using the MIPI DSI driver. + +.. only:: SOC_GP_LDO_SUPPORTED + + On {IDF_TARGET_NAME}, the MIPI DPHY can be powered by the internal adjustable LDO. Connect the output pin of the LDO channel to the MIPI DPHY power pin. Before initializing the DSI driver, use the API provided in :doc:`/api-reference/peripherals/ldo_regulator` to configure the LDO output voltage to 2.5V. + API Reference ------------- diff --git a/docs/en/api-reference/peripherals/lcd/i2c_lcd.rst b/docs/en/api-reference/peripherals/lcd/i2c_lcd.rst index f50d902ec8..8e71d8e897 100644 --- a/docs/en/api-reference/peripherals/lcd/i2c_lcd.rst +++ b/docs/en/api-reference/peripherals/lcd/i2c_lcd.rst @@ -1,5 +1,5 @@ I2C Interfaced LCD ------------------- +================== :link_to_translation:`zh_CN:[中文]` diff --git a/docs/en/api-reference/peripherals/lcd/i80_lcd.rst b/docs/en/api-reference/peripherals/lcd/i80_lcd.rst index b942597345..e8b8ad663c 100644 --- a/docs/en/api-reference/peripherals/lcd/i80_lcd.rst +++ b/docs/en/api-reference/peripherals/lcd/i80_lcd.rst @@ -1,5 +1,5 @@ I80 Interfaced LCD ------------------- +================== :link_to_translation:`zh_CN:[中文]` diff --git a/docs/en/api-reference/peripherals/lcd/parl_lcd.rst b/docs/en/api-reference/peripherals/lcd/parl_lcd.rst index a5e1a9d07d..235238bb2e 100644 --- a/docs/en/api-reference/peripherals/lcd/parl_lcd.rst +++ b/docs/en/api-reference/peripherals/lcd/parl_lcd.rst @@ -1,5 +1,5 @@ Parallel IO simulation of SPI or I80 Interfaced LCD ---------------------------------------------------- +=================================================== :link_to_translation:`zh_CN:[中文]` diff --git a/docs/en/api-reference/peripherals/lcd/spi_lcd.rst b/docs/en/api-reference/peripherals/lcd/spi_lcd.rst index 2fbb8fc2a9..c50a043973 100644 --- a/docs/en/api-reference/peripherals/lcd/spi_lcd.rst +++ b/docs/en/api-reference/peripherals/lcd/spi_lcd.rst @@ -1,5 +1,5 @@ SPI Interfaced LCD ------------------- +================== :link_to_translation:`zh_CN:[中文]` diff --git a/docs/zh_CN/api-reference/peripherals/lcd/dsi_lcd.rst b/docs/zh_CN/api-reference/peripherals/lcd/dsi_lcd.rst index ace7b536ca..4bbba0e0cb 100644 --- a/docs/zh_CN/api-reference/peripherals/lcd/dsi_lcd.rst +++ b/docs/zh_CN/api-reference/peripherals/lcd/dsi_lcd.rst @@ -87,6 +87,15 @@ MIPI DSI 接口的 LCD ESP_ERROR_CHECK(esp_lcd_new_panel_dpi(mipi_dsi_bus, &dpi_config, &mipi_dpi_panel)); ESP_ERROR_CHECK(esp_lcd_panel_init(mipi_dpi_panel)); +关于 MIPI DPHY 的供电 +--------------------- + +{IDF_TARGET_NAME} 中的 MIPI DPHY 需要独立的 2.5V 电源供电,请查阅原理图,确保在使用 MIPI DSI 驱动之前,已将其供电引脚(名字可能是 ``VDD_MIPI_DPHY``)连接至 2.5V 电源。 + +.. only:: SOC_GP_LDO_SUPPORTED + + 在 {IDF_TARGET_NAME} 中, MIPI DPHY 可以使用内部的可调 LDO 供电。请将 LDO 通道的输出引脚连接至 MIPI DPHY 的供电引脚。然后在初始化 DSI 驱动之前,使用 :doc:`/api-reference/peripherals/ldo_regulator` 中提供的 API 配置 LDO 输出 2.5V 电压。 + API 参考 -------- diff --git a/docs/zh_CN/api-reference/peripherals/lcd/i2c_lcd.rst b/docs/zh_CN/api-reference/peripherals/lcd/i2c_lcd.rst index 0843caf4f2..d21ae7b087 100644 --- a/docs/zh_CN/api-reference/peripherals/lcd/i2c_lcd.rst +++ b/docs/zh_CN/api-reference/peripherals/lcd/i2c_lcd.rst @@ -1,5 +1,5 @@ I2C 接口的 LCD ---------------- +============== :link_to_translation:`en:[English]` diff --git a/docs/zh_CN/api-reference/peripherals/lcd/i80_lcd.rst b/docs/zh_CN/api-reference/peripherals/lcd/i80_lcd.rst index fe964be8a8..755ef417ac 100644 --- a/docs/zh_CN/api-reference/peripherals/lcd/i80_lcd.rst +++ b/docs/zh_CN/api-reference/peripherals/lcd/i80_lcd.rst @@ -1,5 +1,5 @@ I80 接口的 LCD ---------------- +============== :link_to_translation:`en:[English]` diff --git a/docs/zh_CN/api-reference/peripherals/lcd/parl_lcd.rst b/docs/zh_CN/api-reference/peripherals/lcd/parl_lcd.rst index 035bdbd6cf..66845c028c 100644 --- a/docs/zh_CN/api-reference/peripherals/lcd/parl_lcd.rst +++ b/docs/zh_CN/api-reference/peripherals/lcd/parl_lcd.rst @@ -1,5 +1,5 @@ 并行 IO 模拟 SPI 或 I80 接口的 LCD --------------------------------------------------------------- +================================== :link_to_translation:`en:[English]` diff --git a/docs/zh_CN/api-reference/peripherals/lcd/rgb_lcd.rst b/docs/zh_CN/api-reference/peripherals/lcd/rgb_lcd.rst index f73e2a6cbb..255cffb95b 100644 --- a/docs/zh_CN/api-reference/peripherals/lcd/rgb_lcd.rst +++ b/docs/zh_CN/api-reference/peripherals/lcd/rgb_lcd.rst @@ -1,5 +1,5 @@ RGB 接口的 LCD -================== +============== :link_to_translation:`en:[English]` diff --git a/docs/zh_CN/api-reference/peripherals/lcd/spi_lcd.rst b/docs/zh_CN/api-reference/peripherals/lcd/spi_lcd.rst index 44d511c547..1424a22bd5 100644 --- a/docs/zh_CN/api-reference/peripherals/lcd/spi_lcd.rst +++ b/docs/zh_CN/api-reference/peripherals/lcd/spi_lcd.rst @@ -1,5 +1,5 @@ SPI 接口的 LCD ---------------- +============== :link_to_translation:`en:[English]`