Create GT911 Touchscreen component (#4027)

Co-authored-by: clydebarrow <2366188+clydebarrow@users.noreply.github.com>
This commit is contained in:
Jesse Hills
2023-11-28 09:44:09 +13:00
committed by GitHub
parent a15a812466
commit f63f722afb
11 changed files with 314 additions and 0 deletions

View File

@@ -18,6 +18,11 @@ void Touchscreen::set_display(display::Display *display) {
}
}
void Touchscreen::send_release_() {
for (auto *listener : this->touch_listeners_)
listener->release();
}
void Touchscreen::send_touch_(TouchPoint tp) {
ESP_LOGV(TAG, "Touch (x=%d, y=%d)", tp.x, tp.y);
this->touch_trigger_.trigger(tp);

View File

@@ -41,6 +41,7 @@ class Touchscreen {
protected:
/// Call this function to send touch points to the `on_touch` listener and the binary_sensors.
void send_touch_(TouchPoint tp);
void send_release_();
uint16_t display_width_;
uint16_t display_height_;