|
LCDGFX LCD display driver
1.2.0
Lightweight graphics library for SSD1306, SSD1325, SSD1327, SSD1331, SSD1351, SH1106, SH1107, IL9163, ST7735, ST7789, ILI9341, PCD8544 displays over I2C/SPI
|
lcdgfx v1.3.0 ships a templated XPT2046 resistive-touch driver in src/touch/xpt2046.h. The driver is transport-agnostic: any class exposing begin(), end(), and transfer(uint8_t) works.
| XPT2046 | MCU pin (typical) |
|---|---|
T_CLK | SPI SCK |
T_DIN | SPI MOSI |
T_DO | SPI MISO |
T_CS | any GPIO |
T_IRQ | any GPIO (optional, falling-edge) |
T_CS may safely be the same physical CS as a non-XPT slave on the same bus as long as you select only one device at a time. The driver uses 2.5 MHz SPI mode 0.
TouchCalibration performs a per-axis affine transform (`x' = ax * raw + bx`) followed by optional axis swap, axis invert, and output clamping. A 3-point or 5-point calibration helper is not shipped — pick three on-screen targets, record the raw samples, and solve for ax/bx.
See examples/gui/touch_demo for a full sketch.