summaryrefslogtreecommitdiff
path: root/firmware/export/ft6x06.h
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-11-20 19:05:16 +0000
committerAidan MacDonald <amachronic@protonmail.com>2021-11-24 18:49:03 -0500
commit44acbc66291da6a8ade8571b73a10e34341a622b (patch)
tree226f9d9f971756f481455da082443f700bcfc786 /firmware/export/ft6x06.h
parentb39acee3abd199d80b84c68ebfa7301b7e7a957e (diff)
downloadrockbox-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.h23
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
28typedef void(*ft6x06_event_cb)(int, int, int); 28enum 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
30struct ft6x06_state { 35struct 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
36enum ft6x06_event { 44struct 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
43extern struct ft6x06_state ft6x06_state; 50extern struct ft6x06_state ft6x06_state;
44 51
52typedef void(*ft6x06_event_cb)(struct ft6x06_state* state);
53
45void ft6x06_init(void); 54void ft6x06_init(void);
46void ft6x06_set_event_cb(ft6x06_event_cb fn); 55void ft6x06_set_event_cb(ft6x06_event_cb fn);
47void ft6x06_enable(bool en); 56void ft6x06_enable(bool en);