1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/tests/drivers/touch_dev
Gunar Schorcht 2dd6457196 tests/drivers/touch_dev: introduce TOUCH_DEV_POLLING
To be able to test the touch device in polling mode, variable `TOUCH_DEV_POLLING` is introduced. It is set to 0 by default and can be overriden by 1 to use the polling mode. The polling period can be controlled by the `TOUCH_DEV_POLLING_PERIOD` variable.
2023-08-12 13:21:48 +02:00
..
app.config.test tests: move remaining driver related applications to tests/drivers 2023-05-10 11:58:32 +02:00
main.c tests/drivers/touch_dev: introduce TOUCH_DEV_POLLING 2023-08-12 13:21:48 +02:00
Makefile tests/drivers/touch_dev: introduce TOUCH_DEV_POLLING 2023-08-12 13:21:48 +02:00
Makefile.ci examples and tests: add atmega8 to relevent Makefile.ci 2023-07-11 21:22:02 +02:00
README.md tests/drivers/touch_dev: introduce TOUCH_DEV_POLLING 2023-08-12 13:21:48 +02:00

About

This is a manual test application for touch device drivers using the generic touch device API. Which touch device driver is used is determined by the board definition.

Usage

This test application initializes the touch device and then waits for touch events by using interrupts by default. When touch events occur, the application generates output like the following:

Event: pressed!
X: 157, Y:152
X: 158, Y:152
X: 158, Y:152
X: 158, Y:152
X: 158, Y:152
X: 158, Y:152
X: 158, Y:152
X: 158, Y:152
X: 158, Y:152
X: 158, Y:152
Event: released!

To use the touch device in polling mode, the environment variable TOUCH_DEV_POLLING_MODE must be set to 1. The polling period in milliseconds is defined by the environment variable TOUCH_DEV_POLLING_PERIOD. It is 50 ms by default. It can be changed by setting the environment variable TOUCH_DEV_POLLING_PERIOD in the make command, for example:

TOUCH_DEV_POLLING_MODE=1 TOUCH_DEV_POLLING_PERIOD=100 BOARD=... make -C tests/drivers/touch_dev flash term