void dev_stmpe610_default_config(dev_stmpe610_config_t *config)
Fill an STMPE610 config struct with safe defaults.
dev_stmpe610_touch_event_t
Touch contact state reported to a dev_stmpe610_callback_t.
struct hw_deviceio_t hw_deviceio_t
Opaque device I/O handle.
struct hw_gpio_t hw_gpio_t
GPIO logical pin structure.
uint16_t x
Raw X ADC reading - see struct doc.
Contact lifted - no longer touching.
void dev_stmpe610_poll(dev_stmpe610_t *stmpe610)
Poll the controller, invoking the callback if the touch state changed.
struct dev_stmpe610_t dev_stmpe610_t
Opaque STMPE610 handle.
uint8_t z
Raw pressure ADC reading - see struct doc.
An existing contact moved.
Optional STMPE610 initialization options.
bool irq_active_low
True when the interrupt pin is active low.
Hardware abstraction headers for on-board peripherals.
The single touch contact reported to a dev_stmpe610_callback_t - unlike a capacitive controller...
void(* dev_stmpe610_callback_t)(dev_stmpe610_t *stmpe610, const dev_stmpe610_touch_t *touch, void *userdata)
Touch event callback invoked from dev_stmpe610_poll().
dev_stmpe610_touch_event_t event
Contact state for this sample.
uint16_t y
Raw Y ADC reading - see struct doc.
dev_stmpe610_t * dev_stmpe610_init(hw_deviceio_t *device, hw_gpio_t *int_pin, dev_stmpe610_callback_t callback, void *userdata, const dev_stmpe610_config_t *config)
Initialize an STMPE610 resistive touch controller over SPI.
bool dev_stmpe610_irq_active(const dev_stmpe610_t *stmpe610)
Report whether the STMPE610 interrupt line is currently asserted.
void dev_stmpe610_deinit(dev_stmpe610_t *stmpe610)
Deinitialize an STMPE610 controller.