14 #include <picofuse/hid/event.h> 215 uint32_t polling_interval_ms,
void dev_stmpe610_default_config(dev_stmpe610_config_t *config)
Fill an STMPE610 config struct with safe defaults.
struct hw_deviceio_t hw_deviceio_t
Opaque device I/O handle.
struct hw_gpio_t hw_gpio_t
GPIO logical pin structure.
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.
Optional STMPE610 initialization options.
Touch-oriented HID event payload.
bool irq_active_low
True when the interrupt pin is active low.
Hardware abstraction headers for on-board peripherals.
struct hid_device_t hid_device_t
HID child-device descriptor tracked by a HID instance.
void dev_stmpe610_set_callback(dev_stmpe610_t *stmpe610, dev_stmpe610_callback_t callback, void *userdata)
Set (or replace) the callback invoked from dev_stmpe610_poll().
dev_stmpe610_t * dev_stmpe610_init(hw_deviceio_t *device, 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.
struct hid_t hid_t
Opaque HID instance handle.
void dev_stmpe610_deinit(dev_stmpe610_t *stmpe610)
Deinitialize an STMPE610 controller.
void(* dev_stmpe610_callback_t)(dev_stmpe610_t *stmpe610, const hid_touch_t *touch, void *userdata)
Touch event callback invoked from dev_stmpe610_poll().
hid_device_t * dev_stmpe610_register_hid(hid_t *instance, dev_stmpe610_t *stmpe610, uint32_t polling_interval_ms, void *userdata)
Register an STMPE610 controller as a HID touchscreen source.
hw_gpio_t * int_pin
Optional interrupt GPIO handle.