diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2021-11-20 19:05:16 +0000 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2021-11-24 18:49:03 -0500 |
commit | 44acbc66291da6a8ade8571b73a10e34341a622b (patch) | |
tree | 226f9d9f971756f481455da082443f700bcfc786 /firmware/export/ft6x06.h | |
parent | b39acee3abd199d80b84c68ebfa7301b7e7a957e (diff) | |
download | rockbox-44acbc66291da6a8ade8571b73a10e34341a622b.tar.gz rockbox-44acbc66291da6a8ade8571b73a10e34341a622b.zip |
Shanling Q1: enable multi-touch reporting
The FT6x06 driver used for the Shanling Q1's touchscreen
has been extended to report more than one touch point. It
can also return the gesture detected by the controller,
but this doesn't seem to report anything useful on the Q1.
Multi-touch is only useful in 3x3 grid mode since the Rockbox
button API cannot report more than one touch point.
The FiiO M3K uses the same driver so it's been updated to the
multi-touch API, but functionality is unchanged.
Change-Id: I4de42f44808d6eb902e3da212d8f936b7a5042c7
Diffstat (limited to 'firmware/export/ft6x06.h')
-rw-r--r-- | firmware/export/ft6x06.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/firmware/export/ft6x06.h b/firmware/export/ft6x06.h index de1fdd0979..6596f89272 100644 --- a/firmware/export/ft6x06.h +++ b/firmware/export/ft6x06.h | |||
@@ -25,23 +25,32 @@ | |||
25 | #include "config.h" | 25 | #include "config.h" |
26 | #include <stdbool.h> | 26 | #include <stdbool.h> |
27 | 27 | ||
28 | typedef void(*ft6x06_event_cb)(int, int, int); | 28 | enum ft6x06_event { |
29 | FT6x06_EVT_NONE = -1, | ||
30 | FT6x06_EVT_PRESS = 0, | ||
31 | FT6x06_EVT_RELEASE = 1, | ||
32 | FT6x06_EVT_CONTACT = 2, | ||
33 | }; | ||
29 | 34 | ||
30 | struct ft6x06_state { | 35 | struct ft6x06_point { |
31 | int event; | 36 | int event; |
37 | int touch_id; | ||
32 | int pos_x; | 38 | int pos_x; |
33 | int pos_y; | 39 | int pos_y; |
40 | int weight; | ||
41 | int area; | ||
34 | }; | 42 | }; |
35 | 43 | ||
36 | enum ft6x06_event { | 44 | struct ft6x06_state { |
37 | FT6x06_EVT_NONE = -1, | 45 | int gesture; |
38 | FT6x06_EVT_PRESS = 0, | 46 | int nr_points; |
39 | FT6x06_EVT_RELEASE = 1, | 47 | struct ft6x06_point points[FT6x06_NUM_POINTS]; |
40 | FT6x06_EVT_CONTACT = 2, | ||
41 | }; | 48 | }; |
42 | 49 | ||
43 | extern struct ft6x06_state ft6x06_state; | 50 | extern struct ft6x06_state ft6x06_state; |
44 | 51 | ||
52 | typedef void(*ft6x06_event_cb)(struct ft6x06_state* state); | ||
53 | |||
45 | void ft6x06_init(void); | 54 | void ft6x06_init(void); |
46 | void ft6x06_set_event_cb(ft6x06_event_cb fn); | 55 | void ft6x06_set_event_cb(ft6x06_event_cb fn); |
47 | void ft6x06_enable(bool en); | 56 | void ft6x06_enable(bool en); |