CST328 触摸屏控制器
cst328 触摸屏平台允许使用基于 cst328 芯片的触摸屏控制器与 ESPHome。
配置中需要设置 I²C 才能使此触摸屏正常工作。
此控制器用于 Waveshare ESP32-S3 Touch LCD 2.8 开发板。
基础触摸屏配置
Section titled “基础触摸屏配置”# Example configuration entrytouchscreen: platform: cst328 id: my_touchscreen interrupt_pin: GPIOXX-
id (可选, ID): 手动设置此触摸屏的 ID。
-
interrupt_pin (可选, Pin Schema): 触摸检测引脚。
-
reset_pin (可选, Pin Schema): 芯片复位引脚。
-
还包括 Touchscreen 的所有其他选项。
二进制传感器
Section titled “二进制传感器”除了通过 Touchscreen 组件在屏幕上配置的触摸区域外, 还可以配置二进制传感器以响应屏幕任何位置的触摸。
# Example configuration entrybinary_sensor: - platform: cst328 name: "Screen touched"-
cst328_id (可选, ID): 手动指定触摸屏的 ID。
-
还包括 Binary Sensor 的所有其他选项。
Waveshare ESP32-S3 Touch LCD 2.8 开发板示例配置
Section titled “Waveshare ESP32-S3 Touch LCD 2.8 开发板示例配置”i2c: sda: GPIO6 scl: GPIO7
touchscreen: - platform: cst328 id: my_touchscreen interrupt_pin: GPIO8 reset_pin: GPIO17