Touch drivers
Touch controller helpers for board_config.py.
Source: drivers/touch/
board_config.py contract
Target wiring (see Board peripherals — touch duck-type):
touch— driver object withread_points()→()when up, else a sequence of(x, y[, id[, …]])touch_read = touch.read_points(neutral application-facing adapter)optional
touch_rotation_table— maps display rotation to touch orientation
Apps pass these exports to their chosen coordinator. appdev.App exposes
app.touch_dev; LVGL creates its own pointer adapter.
Do not collapse multi-touch to points[0] in the board file — return the full
read_points() sequence (or a sequence-preserving map).
See any working board config (e.g. wokwi_ili9341_ft6x36_esp32s3 or
fbdisplay/esp32-p4-wifi6-touch-lcd-4b) for a complete example.
Installing drivers
Board packages include the touch driver when needed. Individual install:
mip.install("github:PyDevices/omnipython/drivers/touch/tt21100.py", target="./drivers/touch")
mip.install("github:PyDevices/omnipython/drivers/touch/stmpe610.py", target="./drivers/touch")
mip.install("github:PyDevices/omnipython/drivers/touch/ft6x36.py", target="./drivers/touch")
These individual driver files are installed directly from GitHub; board installers already include the drivers they require.
MicroPython drivers
File |
Chip |
Typical boards |
|---|---|---|
|
FocalTech FT6x36 (and the FT5426-family part on a KeDei 5” DSI) |
ESP32-S3 dev boards, Wokwi, the P4 DEV-KIT with a KeDei 5” |
|
TT21100 |
PyPortal, FunHouse |
|
STMPE610 |
PiTFT FeatherWing |
|
XPT2046 |
Resistive SPI touch |
|
GT911 |
Many ESP32 panels |
|
CST816/CST820 |
Capacitive I2C |
|
CST226 |
Capacitive I2C |
|
CHSC6x |
Capacitive I2C |
CircuitPython shims
Touch drivers for CircuitPython under drivers/touch/circuitpython/, Adafruit’s vendored and a few of our own:
File |
Chip |
|---|---|
|
FocalTech FT6x36 family |
|
FT5336 |
|
TSC2007 resistive |
|
TT21100 (PyPortal) |
|
STMPE610 (PiTFT) |
|
4-wire analog resistive |
|
CHSC6x (Seeed Round Display), on |
|
CST816 |
The authoritative list is the source tree itself: drivers/touch/.
Calibration (STMPE610 / PiTFT)
PiTFT FeatherWing configs pass Adafruit’s factory calibration for the 2.4” wing (rotation 90°):
_PITFT_CALIBRATION = ((357, 3812), (390, 3555))
MicroPython (pitft_ili9341_featherwing) passes this to STMPE610(..., calibration=...).
CircuitPython (cp/busdisplay/spi/pitft_ili9341_featherwing) passes the same tuple to
Adafruit_STMPE610_SPI.
Calibration (CHSC6X / Seeed Round Display)
The Seeed Round Display’s CHSC6X reads x about 1.3 times too far from the
centre, while y reads true. Its configs pass each reading through
chsc6x.round_display_points, which undoes the scale:
def touch_read():
return round_display_points(touch.read_points())
The controller’s x reading also stops at the ends of its range, so touch can’t reach the outer 30 px or so at the left and right edges.