Overview
Firmware for the Raspberry Pi Pico that reads an XPT2046 resistive touch controller over SPI and republishes the touch as a native USB HID device, so no host driver is needed.
Core features
- Two USB classes from one board: an HID mouse for desktops, or a HID digitizer for touchscreens
- Driverless on every host: Linux, Windows and macOS see an ordinary input device
- 12-bit touch reads over SPI0 at 1 MHz, mode 0
- Calibrated coordinates mapped from raw ADC values to the panel’s screen range
- Noise rejection: median filter, moving average, jitter threshold and a release guard
- Optional UART telemetry on GPIO 0 at 115200 baud for calibration
In this project
| Chapter | What it covers |
|---|---|
| Source repository | repository link, both targets, build commands |
| System architecture | block diagram and the signal path |
| Hardware | bill of materials, pin map, SPI configuration |
| XPT2046 controller and calibration | reads, coordinate mapping, how to recalibrate |
| USB HID descriptors | mouse against digitizer, and host behaviour |
| Software | both implementations and how to choose one |
| Signal filtering and noise suppression | the coordinate filter chain |
| PlatformIO Arduino mouse target | the simpler of the two builds |
| Results | what each target achieves, and known figures |
| Diagnostics and serial debugging | UART output and troubleshooting |