1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

drivers/stmpe811: add touch_dev set event callback wrapper

This commit is contained in:
Alexandre Abadie 2020-07-20 16:38:35 +02:00
parent 1362c61abb
commit f9f394c88b
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405

View File

@ -72,8 +72,18 @@ uint8_t _stmpe811_touches(const touch_dev_t *touch_dev, touch_t *touches, size_t
return ret;
}
void _stmpe811_set_event_callback(const touch_dev_t *touch_dev, touch_event_cb_t cb, void *arg)
{
stmpe811_t *dev = (stmpe811_t *)touch_dev;
assert(dev);
dev->cb = (stmpe811_event_cb_t)cb;
dev->cb_arg = arg;
}
const touch_dev_driver_t stmpe811_touch_dev_driver = {
.height = _stmpe811_height,
.width = _stmpe811_width,
.touches = _stmpe811_touches,
.set_event_callback = _stmpe811_set_event_callback,
};