1+ /*
2+ * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
3+ *
4+ * SPDX-License-Identifier: Apache-2.0
5+ */
6+
7+ #pragma once
8+
9+ #include " port/esp_lcd_touch_gsl3680.h"
10+ #include " esp_panel_touch_conf_internal.h"
11+ #include " esp_panel_touch.hpp"
12+
13+ namespace esp_panel ::drivers {
14+
15+ /* *
16+ * @brief GSL3680 touch controller
17+ *
18+ * This class provides implementation for GSL3680 touch controller, inheriting from
19+ * the base Touch class to provide common touch functionality
20+ */
21+ class TouchGSL3680 : public Touch {
22+ public:
23+ /* *
24+ * @brief Default basic attributes for GSL3680
25+ */
26+ static constexpr BasicAttributes BASIC_ATTRIBUTES_DEFAULT = {
27+ .name = " GSL3680" ,
28+ .max_points_num = 5 ,
29+ .max_buttons_num = 1 ,
30+ };
31+
32+ /* *
33+ * @brief Construct a touch device instance with individual configuration parameters
34+ *
35+ * @param bus Bus interface for communicating with the touch device
36+ * @param width Panel width in pixels
37+ * @param height Panel height in pixels
38+ * @param rst_io Reset GPIO pin number (-1 if unused)
39+ * @param int_io Interrupt GPIO pin number (-1 if unused)
40+ */
41+ TouchGSL3680 (Bus *bus, uint16_t width, uint16_t height, int rst_io = -1 , int int_io = -1 ):
42+ Touch (BASIC_ATTRIBUTES_DEFAULT, bus, width, height, rst_io, int_io)
43+ {
44+ }
45+
46+ /* *
47+ * @brief Construct a touch device instance with configuration
48+ *
49+ * @param[in] bus Pointer to the bus interface for communicating with the touch device
50+ * @param[in] config Configuration structure containing device settings and parameters
51+ */
52+ TouchGSL3680 (Bus *bus, const Config &config): Touch(BASIC_ATTRIBUTES_DEFAULT, bus, config) {}
53+
54+ /* *
55+ * @brief Construct a touch device instance with bus configuration and device configuration
56+ *
57+ * @param[in] bus_config Bus configuration
58+ * @param[in] touch_config Touch configuration
59+ * @note This constructor creates a new bus instance using the provided bus configuration
60+ */
61+ TouchGSL3680 (const BusFactory::Config &bus_config, const Config &touch_config):
62+ Touch (BASIC_ATTRIBUTES_DEFAULT, bus_config, touch_config)
63+ {
64+ }
65+
66+ /* *
67+ * @brief Destruct touch device
68+ */
69+ ~TouchGSL3680 () override ;
70+
71+ /* *
72+ * @brief Startup the touch device
73+ *
74+ * @return `true` if success, otherwise false
75+ *
76+ * @note This function should be called after `init()`
77+ */
78+ bool begin () override ;
79+ };
80+
81+ } // namespace esp_panel::drivers
82+
83+ /* *
84+ * @brief Deprecated type alias for backward compatibility
85+ * @deprecated Use `esp_panel::drivers::TouchGGL3680` instead
86+ */
87+ using ESP_PanelTouch_GTSL3680 [[deprecated(" Use `esp_panel::drivers::TouchGSL3680` instead" )]] =
88+ esp_panel::drivers::TouchGSL3680;
89+
0 commit comments