elpekenin/touch.h
¶
Generic(ish) driver for touch screens.
Danger
Only XPT2046
has been implemented/tested.
-
struct touch_driver_t¶
[source] Configuration for a touch device.
-
spi_touch_comms_config_t spi_config¶
[source] Communications configuration.
-
spi_touch_comms_config_t spi_config¶
-
bool touch_spi_init(touch_device_t device)¶
[source] Initialize a device.
-
void report_from(int16_t x, int16_t y, touch_driver_t *driver, touch_report_t *report)¶
[source] (WEAK) Low-level function that performs math.
- Parameters:
x – Raw X reading from sensor.
y – Raw Y reading from sensor.
driver – Handle to the device, to fetch its configuration.
report – Output struct to be filled/updated.
-
touch_report_t get_spi_touch_report(touch_device_t device, bool check_irq)¶
[source] Get the current state of a sensor.
- Parameters:
device – Sensor’s configuration.
check_irq – Whether to check the IRQ’s pin state.