Overview Fixed

HAL TypeInput
ChipXPT2046
InterfaceSPI
DescriptionResistive touch with pressure detection, outlier rejection, and debounce filtering.

Implementation

Sourcecomponents/kernel_rs/src/drv_touch_xpt2046.rs (1514 lines)
WrapsNone — manual SPI ADC reads
Tests31 unit tests

Devices

Boards that use this driver:

DeviceStatus
CYD S028Fixed

Configuration

Configured via board.json: SPI pins (MOSI, MISO, CLK, CS), pin_irq for touch interrupt.

Known Issues

Fixed: Z1+Z2 pressure formula per datasheet, IRQ masking in control byte, interleaved X/Y sampling, median-of-3 outlier rejection, 50ms debounce.