diff options
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); |