Merge branch 'refactor/remove_nt35510' into 'master'

refactor(lcd)!: moved nt35510 device driver to component registry

Closes IDF-13717

See merge request espressif/esp-idf!41864
This commit is contained in:
morris
2025-09-24 01:43:23 +08:00
15 changed files with 15 additions and 358 deletions

View File

@@ -6,7 +6,6 @@ endif()
set(srcs "src/esp_lcd_common.c" set(srcs "src/esp_lcd_common.c"
"src/esp_lcd_panel_io.c" "src/esp_lcd_panel_io.c"
"src/esp_lcd_panel_nt35510.c"
"src/esp_lcd_panel_ssd1306.c" "src/esp_lcd_panel_ssd1306.c"
"src/esp_lcd_panel_st7789.c" "src/esp_lcd_panel_st7789.c"
"src/esp_lcd_panel_ops.c") "src/esp_lcd_panel_ops.c")

View File

@@ -47,7 +47,6 @@
/////////// Warning, It turns out that, the following bitmask is not defined as a standard, some manufacturer may use different bit position /////////// Warning, It turns out that, the following bitmask is not defined as a standard, some manufacturer may use different bit position
/////////// Please check the datasheet of your LCD panel before using the following bitmask /////////// Please check the datasheet of your LCD panel before using the following bitmask
/////////// IDF will remove them in the next major release (esp-idf 6.0)
#define LCD_CMD_MH_BIT (1 << 2) // Display data latch order, 0: refresh left to right, 1: refresh right to left #define LCD_CMD_MH_BIT (1 << 2) // Display data latch order, 0: refresh left to right, 1: refresh right to left
#define LCD_CMD_BGR_BIT (1 << 3) // RGB/BGR order, 0: RGB, 1: BGR #define LCD_CMD_BGR_BIT (1 << 3) // RGB/BGR order, 0: RGB, 1: BGR
#define LCD_CMD_ML_BIT (1 << 4) // Line address order, 0: refresh top to bottom, 1: refresh bottom to top #define LCD_CMD_ML_BIT (1 << 4) // Line address order, 0: refresh top to bottom, 1: refresh bottom to top

View File

@@ -1,31 +0,0 @@
/*
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdbool.h>
#include "esp_err.h"
#include "esp_lcd_panel_dev.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Create LCD panel for model NT35510
*
* @param[in] io LCD panel IO handle
* @param[in] panel_dev_config general panel device configuration
* @param[out] ret_panel Returned LCD panel handle
* @return
* - ESP_ERR_INVALID_ARG if parameter is invalid
* - ESP_ERR_NO_MEM if out of memory
* - ESP_OK on success
*/
esp_err_t esp_lcd_new_panel_nt35510(const esp_lcd_panel_io_handle_t io, const esp_lcd_panel_dev_config_t *panel_dev_config, esp_lcd_panel_handle_t *ret_panel);
#ifdef __cplusplus
}
#endif

View File

@@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@@ -9,4 +9,3 @@
#include "esp_lcd_panel_dev.h" #include "esp_lcd_panel_dev.h"
#include "esp_lcd_panel_ssd1306.h" #include "esp_lcd_panel_ssd1306.h"
#include "esp_lcd_panel_st7789.h" #include "esp_lcd_panel_st7789.h"
#include "esp_lcd_panel_nt35510.h"

View File

@@ -1,322 +0,0 @@
/*
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdlib.h>
#include <sys/cdefs.h>
#include "sdkconfig.h"
#if CONFIG_LCD_ENABLE_DEBUG_LOG
// The local log level must be defined before including esp_log.h
// Set the maximum log level for this source file
#define LOG_LOCAL_LEVEL ESP_LOG_DEBUG
#endif
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_lcd_panel_interface.h"
#include "esp_lcd_panel_io.h"
#include "esp_lcd_panel_vendor.h"
#include "esp_lcd_panel_ops.h"
#include "esp_lcd_panel_commands.h"
#include "driver/gpio.h"
#include "esp_log.h"
#include "esp_check.h"
#include "esp_compiler.h"
static const char *TAG = "lcd_panel.nt35510";
static esp_err_t panel_nt35510_del(esp_lcd_panel_t *panel);
static esp_err_t panel_nt35510_reset(esp_lcd_panel_t *panel);
static esp_err_t panel_nt35510_init(esp_lcd_panel_t *panel);
static esp_err_t panel_nt35510_draw_bitmap(esp_lcd_panel_t *panel, int x_start, int y_start, int x_end, int y_end,
const void *color_data);
static esp_err_t panel_nt35510_invert_color(esp_lcd_panel_t *panel, bool invert_color_data);
static esp_err_t panel_nt35510_mirror(esp_lcd_panel_t *panel, bool mirror_x, bool mirror_y);
static esp_err_t panel_nt35510_swap_xy(esp_lcd_panel_t *panel, bool swap_axes);
static esp_err_t panel_nt35510_set_gap(esp_lcd_panel_t *panel, int x_gap, int y_gap);
static esp_err_t panel_nt35510_disp_on_off(esp_lcd_panel_t *panel, bool off);
static esp_err_t panel_nt35510_sleep(esp_lcd_panel_t *panel, bool sleep);
typedef struct {
esp_lcd_panel_t base;
esp_lcd_panel_io_handle_t io;
gpio_num_t reset_gpio_num;
bool reset_level;
int x_gap;
int y_gap;
uint8_t fb_bits_per_pixel;
uint8_t madctl_val; // save current value of LCD_CMD_MADCTL register
uint8_t colmod_val; // save current value of LCD_CMD_COLMOD register
} nt35510_panel_t;
esp_err_t
esp_lcd_new_panel_nt35510(const esp_lcd_panel_io_handle_t io, const esp_lcd_panel_dev_config_t *panel_dev_config,
esp_lcd_panel_handle_t *ret_panel)
{
#if CONFIG_LCD_ENABLE_DEBUG_LOG
esp_log_level_set(TAG, ESP_LOG_DEBUG);
#endif
esp_err_t ret = ESP_OK;
nt35510_panel_t *nt35510 = NULL;
ESP_GOTO_ON_FALSE(io && panel_dev_config && ret_panel, ESP_ERR_INVALID_ARG, err, TAG, "invalid argument");
// leak detection of nt35510 because saving nt35510->base address
ESP_COMPILER_DIAGNOSTIC_PUSH_IGNORE("-Wanalyzer-malloc-leak")
nt35510 = calloc(1, sizeof(nt35510_panel_t));
ESP_GOTO_ON_FALSE(nt35510, ESP_ERR_NO_MEM, err, TAG, "no mem for nt35510 panel");
if (panel_dev_config->reset_gpio_num >= 0) {
gpio_config_t io_conf = {
.mode = GPIO_MODE_OUTPUT,
.pin_bit_mask = 1ULL << panel_dev_config->reset_gpio_num,
};
ESP_GOTO_ON_ERROR(gpio_config(&io_conf), err, TAG, "configure GPIO for RST line failed");
}
switch (panel_dev_config->rgb_ele_order) {
case LCD_RGB_ELEMENT_ORDER_RGB:
nt35510->madctl_val = 0;
break;
case LCD_RGB_ELEMENT_ORDER_BGR:
nt35510->madctl_val |= LCD_CMD_BGR_BIT;
break;
default:
ESP_GOTO_ON_FALSE(false, ESP_ERR_NOT_SUPPORTED, err, TAG, "unsupported RGB element order");
break;
}
uint8_t fb_bits_per_pixel = 0;
switch (panel_dev_config->bits_per_pixel) {
case 16: // RGB565
nt35510->colmod_val = 0x55;
fb_bits_per_pixel = 16;
break;
case 18: // RGB666
nt35510->colmod_val = 0x66;
// each color component (R/G/B) should occupy the 6 high bits of a byte, which means 3 full bytes are required for a pixel
fb_bits_per_pixel = 24;
break;
case 24: // RGB888
nt35510->colmod_val = 0x77;
fb_bits_per_pixel = 24;
break;
default:
ESP_GOTO_ON_FALSE(false, ESP_ERR_NOT_SUPPORTED, err, TAG, "unsupported pixel width");
break;
}
nt35510->io = io;
nt35510->fb_bits_per_pixel = fb_bits_per_pixel;
nt35510->reset_gpio_num = panel_dev_config->reset_gpio_num;
nt35510->reset_level = panel_dev_config->flags.reset_active_high;
nt35510->base.del = panel_nt35510_del;
nt35510->base.reset = panel_nt35510_reset;
nt35510->base.init = panel_nt35510_init;
nt35510->base.draw_bitmap = panel_nt35510_draw_bitmap;
nt35510->base.invert_color = panel_nt35510_invert_color;
nt35510->base.set_gap = panel_nt35510_set_gap;
nt35510->base.mirror = panel_nt35510_mirror;
nt35510->base.swap_xy = panel_nt35510_swap_xy;
nt35510->base.disp_on_off = panel_nt35510_disp_on_off;
nt35510->base.disp_sleep = panel_nt35510_sleep;
*ret_panel = &(nt35510->base);
ESP_LOGD(TAG, "new nt35510 panel @%p", nt35510);
return ESP_OK;
err:
if (nt35510) {
if (panel_dev_config->reset_gpio_num >= 0) {
gpio_reset_pin(panel_dev_config->reset_gpio_num);
}
free(nt35510);
}
return ret;
ESP_COMPILER_DIAGNOSTIC_POP("-Wanalyzer-malloc-leak")
}
static esp_err_t panel_nt35510_del(esp_lcd_panel_t *panel)
{
nt35510_panel_t *nt35510 = __containerof(panel, nt35510_panel_t, base);
if (nt35510->reset_gpio_num >= 0) {
gpio_reset_pin(nt35510->reset_gpio_num);
}
ESP_LOGD(TAG, "del nt35510 panel @%p", nt35510);
free(nt35510);
return ESP_OK;
}
static esp_err_t panel_nt35510_reset(esp_lcd_panel_t *panel)
{
nt35510_panel_t *nt35510 = __containerof(panel, nt35510_panel_t, base);
esp_lcd_panel_io_handle_t io = nt35510->io;
// perform hardware reset
if (nt35510->reset_gpio_num >= 0) {
gpio_set_level(nt35510->reset_gpio_num, nt35510->reset_level);
vTaskDelay(pdMS_TO_TICKS(10));
gpio_set_level(nt35510->reset_gpio_num, !nt35510->reset_level);
vTaskDelay(pdMS_TO_TICKS(10));
} else {
// perform software reset
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, LCD_CMD_SWRESET << 8, NULL, 0), TAG,
"io tx param failed");
vTaskDelay(pdMS_TO_TICKS(20)); // spec, wait at least 5m before sending new command
}
return ESP_OK;
}
static esp_err_t panel_nt35510_init(esp_lcd_panel_t *panel)
{
nt35510_panel_t *nt35510 = __containerof(panel, nt35510_panel_t, base);
esp_lcd_panel_io_handle_t io = nt35510->io;
// LCD goes into sleep mode and display will be turned off after power on reset, exit sleep mode first
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, LCD_CMD_SLPOUT << 8, NULL, 0), TAG,
"io tx param failed");;
vTaskDelay(pdMS_TO_TICKS(100));
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, LCD_CMD_MADCTL << 8, (uint16_t[]) {
nt35510->madctl_val,
}, 2), TAG, "io tx param failed");
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, LCD_CMD_COLMOD << 8, (uint16_t[]) {
nt35510->colmod_val,
}, 2), TAG, "io tx param failed");
return ESP_OK;
}
static esp_err_t panel_nt35510_draw_bitmap(esp_lcd_panel_t *panel, int x_start, int y_start, int x_end, int y_end,
const void *color_data)
{
nt35510_panel_t *nt35510 = __containerof(panel, nt35510_panel_t, base);
esp_lcd_panel_io_handle_t io = nt35510->io;
x_start += nt35510->x_gap;
x_end += nt35510->x_gap;
y_start += nt35510->y_gap;
y_end += nt35510->y_gap;
// define an area of frame memory where MCU can access
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, (LCD_CMD_CASET << 8) + 0, (uint16_t[]) {
(x_start >> 8) & 0xFF,
}, 2), TAG, "io tx param failed");
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, (LCD_CMD_CASET << 8) + 1, (uint16_t[]) {
x_start & 0xFF,
}, 2), TAG, "io tx param failed");
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, (LCD_CMD_CASET << 8) + 2, (uint16_t[]) {
((x_end - 1) >> 8) & 0xFF,
}, 2), TAG, "io tx param failed");
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, (LCD_CMD_CASET << 8) + 3, (uint16_t[]) {
(x_end - 1) & 0xFF,
}, 2), TAG, "io tx param failed");
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, (LCD_CMD_RASET << 8) + 0, (uint16_t[]) {
(y_start >> 8) & 0xFF,
}, 2), TAG, "io tx param failed");
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, (LCD_CMD_RASET << 8) + 1, (uint16_t[]) {
y_start & 0xFF,
}, 2), TAG, "io tx param failed");
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, (LCD_CMD_RASET << 8) + 2, (uint16_t[]) {
((y_end - 1) >> 8) & 0xFF,
}, 2), TAG, "io tx param failed");
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, (LCD_CMD_RASET << 8) + 3, (uint16_t[]) {
(y_end - 1) & 0xFF,
}, 2), TAG, "io tx param failed");
// transfer frame buffer
size_t len = (x_end - x_start) * (y_end - y_start) * nt35510->fb_bits_per_pixel / 8;
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_color(io, LCD_CMD_RAMWR << 8, color_data, len), TAG, "io tx color failed");
return ESP_OK;
}
static esp_err_t panel_nt35510_invert_color(esp_lcd_panel_t *panel, bool invert_color_data)
{
nt35510_panel_t *nt35510 = __containerof(panel, nt35510_panel_t, base);
esp_lcd_panel_io_handle_t io = nt35510->io;
int command = 0;
if (invert_color_data) {
command = LCD_CMD_INVON;
} else {
command = LCD_CMD_INVOFF;
}
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, command << 8, NULL, 0), TAG,
"io tx param failed");
return ESP_OK;
}
static esp_err_t panel_nt35510_mirror(esp_lcd_panel_t *panel, bool mirror_x, bool mirror_y)
{
nt35510_panel_t *nt35510 = __containerof(panel, nt35510_panel_t, base);
esp_lcd_panel_io_handle_t io = nt35510->io;
if (mirror_x) {
nt35510->madctl_val |= LCD_CMD_MX_BIT;
} else {
nt35510->madctl_val &= ~LCD_CMD_MX_BIT;
}
if (mirror_y) {
nt35510->madctl_val |= LCD_CMD_MY_BIT;
} else {
nt35510->madctl_val &= ~LCD_CMD_MY_BIT;
}
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, LCD_CMD_MADCTL << 8, (uint16_t[]) {
nt35510->madctl_val
}, 2), TAG, "io tx param failed");
return ESP_OK;
}
static esp_err_t panel_nt35510_swap_xy(esp_lcd_panel_t *panel, bool swap_axes)
{
nt35510_panel_t *nt35510 = __containerof(panel, nt35510_panel_t, base);
esp_lcd_panel_io_handle_t io = nt35510->io;
if (swap_axes) {
nt35510->madctl_val |= LCD_CMD_MV_BIT;
} else {
nt35510->madctl_val &= ~LCD_CMD_MV_BIT;
}
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, LCD_CMD_MADCTL << 8, (uint16_t[]) {
nt35510->madctl_val
}, 2), TAG, "io tx param failed");
return ESP_OK;
}
static esp_err_t panel_nt35510_set_gap(esp_lcd_panel_t *panel, int x_gap, int y_gap)
{
nt35510_panel_t *nt35510 = __containerof(panel, nt35510_panel_t, base);
nt35510->x_gap = x_gap;
nt35510->y_gap = y_gap;
return ESP_OK;
}
static esp_err_t panel_nt35510_disp_on_off(esp_lcd_panel_t *panel, bool on_off)
{
nt35510_panel_t *nt35510 = __containerof(panel, nt35510_panel_t, base);
esp_lcd_panel_io_handle_t io = nt35510->io;
int command = 0;
if (on_off) {
command = LCD_CMD_DISPON;
} else {
command = LCD_CMD_DISPOFF;
}
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, command << 8, NULL, 0), TAG,
"io tx param failed");
return ESP_OK;
}
static esp_err_t panel_nt35510_sleep(esp_lcd_panel_t *panel, bool sleep)
{
nt35510_panel_t *nt35510 = __containerof(panel, nt35510_panel_t, base);
esp_lcd_panel_io_handle_t io = nt35510->io;
int command = 0;
if (sleep) {
command = LCD_CMD_SLPIN;
} else {
command = LCD_CMD_SLPOUT;
}
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, command, NULL, 0), TAG,
"io tx param failed");
vTaskDelay(pdMS_TO_TICKS(100));
return ESP_OK;
}

View File

@@ -0,0 +1,2 @@
dependencies:
espressif/esp_lcd_nt35510: "^1.0.0"

View File

@@ -12,6 +12,7 @@
#include "esp_random.h" #include "esp_random.h"
#include "esp_lcd_panel_io.h" #include "esp_lcd_panel_io.h"
#include "esp_lcd_panel_vendor.h" #include "esp_lcd_panel_vendor.h"
#include "esp_lcd_nt35510.h"
#include "esp_lcd_panel_ops.h" #include "esp_lcd_panel_ops.h"
#include "esp_lcd_panel_commands.h" #include "esp_lcd_panel_commands.h"
#include "soc/soc_caps.h" #include "soc/soc_caps.h"

View File

@@ -0,0 +1,2 @@
dependencies:
espressif/esp_lcd_nt35510: "^1.0.0"

View File

@@ -13,6 +13,7 @@
#include "driver/gpio.h" #include "driver/gpio.h"
#include "esp_lcd_panel_io.h" #include "esp_lcd_panel_io.h"
#include "esp_lcd_panel_vendor.h" #include "esp_lcd_panel_vendor.h"
#include "esp_lcd_nt35510.h"
#include "esp_lcd_panel_ops.h" #include "esp_lcd_panel_ops.h"
#include "esp_lcd_panel_commands.h" #include "esp_lcd_panel_commands.h"
#include "soc/soc_caps.h" #include "soc/soc_caps.h"

View File

@@ -188,7 +188,6 @@ INPUT = \
$(PROJECT_PATH)/components/esp_lcd/include/esp_lcd_panel_dev.h \ $(PROJECT_PATH)/components/esp_lcd/include/esp_lcd_panel_dev.h \
$(PROJECT_PATH)/components/esp_lcd/include/esp_lcd_panel_ssd1306.h \ $(PROJECT_PATH)/components/esp_lcd/include/esp_lcd_panel_ssd1306.h \
$(PROJECT_PATH)/components/esp_lcd/include/esp_lcd_panel_st7789.h \ $(PROJECT_PATH)/components/esp_lcd/include/esp_lcd_panel_st7789.h \
$(PROJECT_PATH)/components/esp_lcd/include/esp_lcd_panel_nt35510.h \
$(PROJECT_PATH)/components/esp_lcd/include/esp_lcd_types.h \ $(PROJECT_PATH)/components/esp_lcd/include/esp_lcd_types.h \
$(PROJECT_PATH)/components/esp_local_ctrl/include/esp_local_ctrl.h \ $(PROJECT_PATH)/components/esp_local_ctrl/include/esp_local_ctrl.h \
$(PROJECT_PATH)/components/esp_mm/include/esp_mmu_map.h \ $(PROJECT_PATH)/components/esp_mm/include/esp_mmu_map.h \

View File

@@ -184,6 +184,7 @@ LCD
- 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. - 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.
- The LCD IO layer driver for the I2C interface previously had two implementations, based on the new and legacy I2C master bus drivers. As the legacy I2C driver is being deprecated, support for it in the LCD IO layer has been removed. Only the APIs provided in ``driver/i2c_master.h`` are now used. - The LCD IO layer driver for the I2C interface previously had two implementations, based on the new and legacy I2C master bus drivers. As the legacy I2C driver is being deprecated, support for it in the LCD IO layer has been removed. Only the APIs provided in ``driver/i2c_master.h`` are now used.
- :cpp:member:`esp_lcd_dpi_panel_config_t::pixel_format` member is deprecated. It is recommended to only use :cpp:member:`esp_lcd_dpi_panel_config_t::in_color_format` to set the MIPI DSI driver's input pixel data format. - :cpp:member:`esp_lcd_dpi_panel_config_t::pixel_format` member is deprecated. It is recommended to only use :cpp:member:`esp_lcd_dpi_panel_config_t::in_color_format` to set the MIPI DSI driver's input pixel data format.
- The NT35510 LCD device driver has been moved out of ESP-IDF and is now hosted in the `ESP Component Registry <https://components.espressif.com/components/espressif/esp_lcd_nt35510/versions/1.0.0/readme>`_. If your project uses the NT35510 driver, you can add it to your project by running ``idf.py add-dependency "espressif/esp_lcd_nt35510"``.
SPI SPI
--- ---

View File

@@ -184,6 +184,7 @@ LCD
- :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 控制器。 - :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 控制器。
- I2C 接口的 LCD IO 层驱动有两套实现,分别基于新、旧 I2C Master 总线驱动。由于旧版的 I2C Master 驱动逐渐被弃用,遂 LCD 的 IO 层也移除对旧版的支持,只使用 ``driver/i2c_master.h`` 中提供的 API。 - I2C 接口的 LCD IO 层驱动有两套实现,分别基于新、旧 I2C Master 总线驱动。由于旧版的 I2C Master 驱动逐渐被弃用,遂 LCD 的 IO 层也移除对旧版的支持,只使用 ``driver/i2c_master.h`` 中提供的 API。
- :cpp:member:`esp_lcd_dpi_panel_config_t::pixel_format` 成员已经被废弃。建议仅使用 :cpp:member:`esp_lcd_dpi_panel_config_t::in_color_format` 来设定 MIPI DSI 驱动输入的像素数据格式。 - :cpp:member:`esp_lcd_dpi_panel_config_t::pixel_format` 成员已经被废弃。建议仅使用 :cpp:member:`esp_lcd_dpi_panel_config_t::in_color_format` 来设定 MIPI DSI 驱动输入的像素数据格式。
- NT35510 LCD 设备驱动已经从 ESP-IDF 中移动到外部仓库,并且托管在了 `ESP Component Registry <https://components.espressif.com/components/espressif/esp_lcd_nt35510/versions/1.0.0/readme>`_ 上。如果你的项目使用到了 NT35510 驱动,你可以通过运行 ``idf.py add-dependency "espressif/esp_lcd_nt35510"`` 将它添加到你的项目中。
SPI SPI
--- ---

View File

@@ -15,6 +15,7 @@
#include "esp_log.h" #include "esp_log.h"
#include "esp_lcd_panel_io.h" #include "esp_lcd_panel_io.h"
#include "esp_lcd_panel_vendor.h" #include "esp_lcd_panel_vendor.h"
#include "esp_lcd_nt35510.h"
#include "esp_lcd_panel_ops.h" #include "esp_lcd_panel_ops.h"
#include "esp_spiffs.h" #include "esp_spiffs.h"
#include "driver/gpio.h" #include "driver/gpio.h"

View File

@@ -1,2 +1,3 @@
dependencies: dependencies:
lvgl/lvgl: "9.2.2" lvgl/lvgl: "9.2.2"
espressif/esp_lcd_nt35510: "^1.0.0"

View File

@@ -575,3 +575,7 @@
- -
re: "error: implicit declaration of function 'vPortCleanUpTCB'" re: "error: implicit declaration of function 'vPortCleanUpTCB'"
hint: "The legacy FreeRTOS hook vPortCleanUpTCB() has been removed from ESP-IDF. Use CONFIG_FREERTOS_TASK_PRE_DELETION_HOOK with vTaskPreDeletionHook( void * pxTCB ) instead." hint: "The legacy FreeRTOS hook vPortCleanUpTCB() has been removed from ESP-IDF. Use CONFIG_FREERTOS_TASK_PRE_DELETION_HOOK with vTaskPreDeletionHook( void * pxTCB ) instead."
-
re: "error: implicit declaration of function 'esp_lcd_new_panel_nt35510'"
hint: "The NT35510 LCD device driver has been moved out of ESP-IDF and is now hosted in the Component Registry. You can add it to your project by running idf.py add-dependency \"espressif/esp_lcd_nt35510\""