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

drivers/stmpe811: fix interrupt polarity & type

The Interrupt on the stmpe811 is generated on the falling edge.
By observing the rising edge, we will only get an event if the
interrupt gets cleared.

Also configure the interrupt to be edge triggered instead of
level triggered.
This commit is contained in:
Benjamin Valentin 2020-07-15 23:07:37 +02:00 committed by Alexandre Abadie
parent 43d2de0885
commit cbae0186ca
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405

View File

@ -162,7 +162,7 @@ int stmpe811_init(stmpe811_t *dev, const stmpe811_params_t * params, touch_event
if ((dev->params.int_pin != GPIO_UNDEF) && cb) {
DEBUG("[stmpe811] init: configuring touchscreen interrupt\n");
gpio_init_int(dev->params.int_pin, GPIO_IN, GPIO_RISING, cb, arg);
gpio_init_int(dev->params.int_pin, GPIO_IN, GPIO_FALLING, cb, arg);
/* Enable touchscreen interrupt */
ret += i2c_write_reg(STMPE811_DEV_I2C, STMPE811_DEV_ADDR,
@ -170,7 +170,7 @@ int stmpe811_init(stmpe811_t *dev, const stmpe811_params_t * params, touch_event
/* Enable global interrupt */
ret += i2c_write_reg(STMPE811_DEV_I2C, STMPE811_DEV_ADDR,
STMPE811_INT_CTRL, STMPE811_INT_CTRL_GLOBAL_INT, 0);
STMPE811_INT_CTRL, STMPE811_INT_CTRL_GLOBAL_INT | STMPE811_INT_CTRL_INT_TYPE, 0);
}
if (ret < 0) {