summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/config/fiiom3k.h1
-rw-r--r--firmware/export/config/shanlingq1.h1
-rw-r--r--firmware/export/ft6x06.h23
3 files changed, 18 insertions, 7 deletions
diff --git a/firmware/export/config/fiiom3k.h b/firmware/export/config/fiiom3k.h
index 29395bd433..61b6123a67 100644
--- a/firmware/export/config/fiiom3k.h
+++ b/firmware/export/config/fiiom3k.h
@@ -24,6 +24,7 @@
24#define HAVE_I2C_ASYNC 24#define HAVE_I2C_ASYNC
25#define HAVE_FT6x06 25#define HAVE_FT6x06
26#define FT6x06_SWAP_AXES 26#define FT6x06_SWAP_AXES
27#define FT6x06_NUM_POINTS 1
27 28
28/* Buffer for plugins and codecs. */ 29/* Buffer for plugins and codecs. */
29#define PLUGIN_BUFFER_SIZE 0x200000 /* 2 MiB */ 30#define PLUGIN_BUFFER_SIZE 0x200000 /* 2 MiB */
diff --git a/firmware/export/config/shanlingq1.h b/firmware/export/config/shanlingq1.h
index 1f1ee79ca7..16ce888958 100644
--- a/firmware/export/config/shanlingq1.h
+++ b/firmware/export/config/shanlingq1.h
@@ -59,6 +59,7 @@
59#define HAVE_TOUCHSCREEN 59#define HAVE_TOUCHSCREEN
60#define HAVE_BUTTON_DATA 60#define HAVE_BUTTON_DATA
61#define HAVE_FT6x06 61#define HAVE_FT6x06
62#define FT6x06_NUM_POINTS 5
62#define HAVE_HEADPHONE_DETECTION 63#define HAVE_HEADPHONE_DETECTION
63 64
64/* Storage defines */ 65/* Storage defines */
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);