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

12 Commits

Author SHA1 Message Date
MrKevinWeiss
7a68fb0d5e
*Kconfig*: Remove dep-only Kconfig files 2024-03-26 14:54:22 +01:00
bors[bot]
5cf32002f5
Merge #19880
19880: drivers/ft5x06: fix initialization if callback function parameter is NULL r=aabadie a=gschorcht

### Contribution description

This PR fixes the `ft5x06` driver initialization if the callback function parameter `cb` is `NULL. This might be the case for example if the application uses the touch device in polling mode.

If the interrupt pin is initialized if the callback function parameter `cb` is `NULL`, the driver crashes the first time an interrupt is triggered. Therefore, the INT pin must be initialized only if also the callback function parameter `cb` is not `NULL`.

To be able to test the polling mode, this PR also includes a change of the `tests/drivers/ft5x06` application which introduces the environment variables `FT5X06_POLLING_MODE` `FT5X06_POLLING_PERIOD` and in the makefile.

### Testing procedure

1. Use any board with a FTXXXX touch device and test it in polling mode, for example:
   ```
   FT5X06_POLLING_MODE=1 BOARD=stm32f746g-disco make -C tests/drivers/ft5x06 flash term
   ```
   It should work as expected.
   ```
   main(): This is RIOT! (Version: 2023.10-devel-119-g92a44a-drivers/ft5x06_fix_cb_null)
   FT5x06 test application
   +------------Initializing------------+
   Initialization successful
   1 touch detected
   Touch 1 - X: 236, Y:111
   Touch 1 - X: 236, Y:111
   ...
   Touch 1 - X: 236, Y:111
   Released!
   ```

2. Checkout master branch and cerry-pick commit 691a5e6308426ddc685e5a2c297238529211c258. The test application `tests/drivers/ft5x06` will crash once a touch event occur:
   ```
   +------------Initializing------------+
   Initialization successful
   1 touch detected
   Context before hardfault:
   ```

### Issues/PRs references

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-08-29 08:19:52 +00:00
Gunar Schorcht
bf720c0b41 drivers/ft5x06: configure interrupt mode in any case
The interrupt mode has to be configured independent on whether the INT pin is initialized already by the `ft5x06_init` function if parameter `cb` is defined or later, for example by the `touch_dev` implementation.
2023-08-28 18:50:04 +02:00
Gunar Schorcht
ca6760047c drivers/ft5x06: introduce coordinate conversions
To obtain coordinates from the touch panel that correspond to the display coordinates, it is often necessary to convert the coordinates from the touch display by swapping and mirroring. For the sake of simplicity, possible rotations are additionally defined.
2023-08-26 17:49:29 +02:00
Gunar Schorcht
7ac2865f7e drivers/ft5x06: init INT pin only if callback is defined
If the INT pin is initialized if the callback function parameter `cb` is `NULL`, the driver crashes the first time an interrupt is triggered. Therefore, the INT pin must be initialized only if also the callback function parameter `cb` is not `NULL`.
2023-08-25 17:35:23 +02:00
Gunar Schorcht
d88e46b3d5 drivers/ft5x06: use a const pointer to params instead of a copy
There is no need to copy the configuration parameter set to the device descriptor. A const pointer to the configuration parameter set in ROM is sufficient. It saves some 16 byte of RAM.
2023-08-23 23:36:39 +02:00
Gunar Schorcht
a9f3ce121a drivers/ft5x06: fix register addresses 2023-08-15 00:06:14 +02:00
Gunar Schorcht
0df9480126 drivers/fx5x06: fix vendor ID for FT6xx6
The vendor ID of FT6xx6 touch panel driver ICs is `0x11` instead of `0xcd`.
2023-08-06 16:09:40 +02:00
Leandro Lanzieri
91012bc3f9
drivers/ft5x06: remove unnecessary pseudomodules 2022-01-21 14:13:49 +01:00
Leandro Lanzieri
4eb58d74b5
drivers/ft5x06: allow multiple device types 2022-01-21 13:13:09 +01:00
f5b5af9469
drivers/ft5x06: add touch_dev interface 2022-01-09 16:43:34 +01:00
11f73ea5c9
drivers/ft5x06: add touch panel driver 2022-01-08 15:08:05 +01:00