feat: 更新触摸屏支持与配置

- 移除不再使用的 CST816 触摸屏组件,替换为 CST816S 版本
- 更新依赖项以包含 espressif/esp_lcd_touch_cst816s
- 调整触摸屏初始化逻辑,支持新的 CST816S 驱动
- 修改显示配置以适应新的 LCD 分辨率和间隙设置
- 启用触摸功能并更新相关的 I2C 配置
- 更新 sdkconfig.defaults 以禁用 CST816S 的读取 ID 功能
This commit is contained in:
2026-07-01 21:04:27 +08:00
parent 7dc20b37a8
commit 55bbe951fe
6 changed files with 80 additions and 95 deletions
+6 -3
View File
@@ -1,14 +1,17 @@
#pragma once
#include "driver/i2c.h"
#include "driver/i2c_types.h"
#include "driver/ledc.h"
#include "driver/spi_master.h"
/* LCD SPI (ST7789) */
#define BOARD_LCD_HOST SPI2_HOST
#define BOARD_LCD_PIXEL_CLOCK_HZ (20 * 1000 * 1000)
#define BOARD_LCD_H_RES 240
#define BOARD_LCD_H_RES 170
#define BOARD_LCD_V_RES 320
#define BOARD_LCD_PANEL_H_RES 240
#define BOARD_LCD_GAP_X ((BOARD_LCD_PANEL_H_RES - BOARD_LCD_H_RES) / 2)
#define BOARD_LCD_GAP_Y 0
#define BOARD_LCD_CMD_BITS 8
#define BOARD_LCD_PARAM_BITS 8
@@ -35,7 +38,7 @@
#define BOARD_TOUCH_I2C_NUM I2C_NUM_0
#define BOARD_TOUCH_I2C_FREQ_HZ 400000
#define BOARD_TOUCH_ENABLED 0
#define BOARD_TOUCH_ENABLED 1
/* User IO */
#define BOARD_PIN_KEY 4