66 digitalWrite(gpio,
level);
75 return digitalRead(gpio);
101 Serial.print(
"Successfully initialized "); Serial.print(model);
102 Serial.print(
",using "); Serial.print(model); Serial.println(
" Driver!");
113 Serial.print(
"Successfully initialized "); Serial.print(model);
114 Serial.print(
",using "); Serial.print(model); Serial.println(
" Driver!");
127 Serial.print(
"Successfully initialized "); Serial.print(model);
128 Serial.print(
",using "); Serial.print(model); Serial.println(
" Driver!");
133 Serial.println(
"Unable to find touch device.");
142 Serial.
begin(115200);
144 Serial.println(
"Start!");
146#if (defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_ARCH_STM32)) && !defined(ARDUINO_ARCH_MBED)
150#elif defined(ARDUINO_ARCH_NRF52)
153#elif defined(ARDUINO_ARCH_ESP32)
159 SensorWireHelper::dumpDevices(Wire);
164 Serial.println(
"Failed to find XL9555 - check your wiring!");
189 Serial.print(point.
x);
194 Serial.print(point.
y);
bool begin(SensorCommCustom::CustomCallback callback, uint8_t addr)
Initialize the sensor using custom callback interface.
bool digitalRead(uint8_t pin)
Read the digital value from an input pin.
void pinMode(uint8_t pin, uint8_t mode)
Set the direction of a GPIO pin.
void digitalWrite(uint8_t pin, bool value)
Write a digital value to an output pin.
Concrete driver for the XL9555 16‑bit I2C GPIO expander.
void interruptPolling(void)
Polling mode for touch interrupt.
Abstract base class for touch screen drivers.
virtual void setGpioCallback(SensorHalCustom::CustomMode mode_cb, SensorHalCustom::CustomWrite write_cb, SensorHalCustom::CustomRead read_cb)
Set custom GPIO callbacks for pin control (e.g., reset, interrupt).
virtual const TouchPoints & getTouchPoints()=0
Get the current touch points (pure virtual).
virtual const char * getModelName()=0
Get the human-readable model name of the touch controller.
virtual bool begin(SensorCommCustom::CustomCallback callback, SensorCommCustomHal::CustomHalCallback hal_callback, uint8_t addr)
Initialize the touch driver with custom communication callbacks.
virtual void setPins(int rst, int irq)
Set the hardware reset and interrupt pin numbers.
Container for touch point data and optional gesture information.
uint8_t getPointCount() const
Returns the number of stored touch points.
TouchPoint & getPoint(uint8_t index)
Gets a reference to a touch point at the specified index.
bool hasPoints() const
Checks whether any touch points are stored.
Represents a single touch point with its properties.
uint16_t x
X coordinate of the touch point.
uint16_t y
Y coordinate of the touch point.
void TouchDrvPinMode(uint8_t gpio, uint8_t mode)
void TouchDrvDigitalWrite(uint8_t gpio, uint8_t level)
TouchDrvInterface * touchDrv
uint8_t TouchDrvDigitalRead(uint8_t gpio)
uint8_t expander_io_tp_reset
IoExpanderXL9555 expander