cst226 触摸屏控制器
cst226 触摸屏平台允许在 ESPHome 中使用基于 cst226 芯片的触摸屏控制器。
需要在配置中设置 I²C 才能使此触摸屏工作。
此控制器用于 Lilygo T4-S3 AMOLED 显示屏。
基本触摸屏配置
Section titled “基本触摸屏配置”# 配置示例touchscreen: platform: cst226 id: my_touchscreen interrupt_pin: GPIOXX-
id (可选, ID):手动设置此触摸屏的 ID。
-
interrupt_pin (可选, 引脚模式):触摸检测引脚。
-
reset_pin (可选, 引脚模式):芯片复位引脚。
-
所有其他选项来自 触摸屏。
二进制传感器
Section titled “二进制传感器”除了通过 触摸屏 组件配置的屏幕触摸区域外, cst226 支持一个位于正常触摸屏区域之外的按钮。 可以配置二进制传感器来响应触摸此按钮。
# 配置示例binary_sensor: - platform: cst226 name: "Home"T4-S3 配置示例
Section titled “T4-S3 配置示例”i2c: sda: GPIO6 scl: GPIO7
touchscreen: - platform: cst226 id: my_touchscreen interrupt_pin: GPIO8 reset_pin: GPIO17