Driver for the XPT2046 resistive touch controller (also compatible with ADS7843 / TSC2046 silicon).
More...
|
|
| LcdGfxXpt2046 (SpiT &spi) |
| | Constructs the driver around an SPI transport instance owned by the caller.
|
| |
| void | begin () |
| | Initialises the SPI transport. More...
|
| |
|
void | end () |
| | Releases the SPI transport.
|
| |
| void | setCalibration (const TouchCalibration &cal) |
| | Sets the calibration used by read(). More...
|
| |
|
TouchCalibration & | calibration () |
| | Returns the current calibration (mutable reference).
|
| |
| void | setPressureThreshold (uint16_t threshold) |
| | Sets the minimum pressure (Z1 reading) considered an active touch. More...
|
| |
| bool | readRaw (int16_t &rawX, int16_t &rawY, int16_t &rawZ) |
| | Reads raw 12-bit ADC samples from the controller without applying any calibration. More...
|
| |
| bool | read (int16_t &x, int16_t &y) |
| | Reads calibrated screen-pixel coordinates. More...
|
| |
| bool | read (int16_t &x, int16_t &y, int16_t &pressure) |
| | Reads calibrated coordinates plus raw pressure. More...
|
| |
template<typename SpiT>
class LcdGfxXpt2046< SpiT >
Driver for the XPT2046 resistive touch controller (also compatible with ADS7843 / TSC2046 silicon).
The driver is parameterized on a SPI transport type so it can be unit-tested with a mock and used on any platform without coupling to lcdgfx's display SPI configuration.
- Template Parameters
-
| SpiT | SPI transport class. It must provide:
- void begin();
- void start(); // assert CS
- void stop(); // de-assert CS
- uint8_t transfer(uint8_t outByte); // full-duplex transfer of one byte
- void end();
|
Definition at line 71 of file xpt2046.h.