summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/eve/eve_touch.h
diff options
context:
space:
mode:
Diffstat (limited to 'fw/fe310/eos/eve/eve_touch.h')
-rw-r--r--fw/fe310/eos/eve/eve_touch.h57
1 files changed, 24 insertions, 33 deletions
diff --git a/fw/fe310/eos/eve/eve_touch.h b/fw/fe310/eos/eve/eve_touch.h
index 8ec6e0e..1f639b3 100644
--- a/fw/fe310/eos/eve/eve_touch.h
+++ b/fw/fe310/eos/eve/eve_touch.h
@@ -1,5 +1,7 @@
#include <stdint.h>
+#define EVE_TOUCH_ACC_A 10000
+
#define EVE_TOUCH_TIMEOUT_TAP 1000
#define EVE_TOUCH_TIMEOUT_TRACK 20
@@ -13,23 +15,22 @@
/* events */
#define EVE_TOUCH_ETYPE_TAG 0x0001
#define EVE_TOUCH_ETYPE_TAG_UP 0x0002
-#define EVE_TOUCH_ETYPE_POINT 0x0004
-#define EVE_TOUCH_ETYPE_POINT_UP 0x0008
-#define EVE_TOUCH_ETYPE_TRACK 0x0010
-#define EVE_TOUCH_ETYPE_TRACK_START 0x0020
-#define EVE_TOUCH_ETYPE_TRACK_STOP 0x0040
-#define EVE_TOUCH_ETYPE_TRACK_ABORT 0x0080
-#define EVE_TOUCH_ETYPE_TIMER 0x0100
-#define EVE_TOUCH_ETYPE_TIMER_ABORT 0x0200
-#define EVE_TOUCH_ETYPE_TRACK_REG 0x0400
-#define EVE_TOUCH_ETYPE_LPRESS 0x0800
-#define EVE_TOUCH_ETYPE_TAP1 0x1000
-#define EVE_TOUCH_ETYPE_TAP2 0x2000
-#define EVE_TOUCH_ETYPE_USR 0x4000
-#define EVE_TOUCH_ETYPE_USR1 0x8000
+#define EVE_TOUCH_ETYPE_POINT0 0x0004 /* emitted without tag0, possibly useless */
+#define EVE_TOUCH_ETYPE_POINT 0x0008
+#define EVE_TOUCH_ETYPE_POINT_UP 0x0010
+#define EVE_TOUCH_ETYPE_TRACK 0x0020
+#define EVE_TOUCH_ETYPE_TRACK_START 0x0040
+#define EVE_TOUCH_ETYPE_TRACK_STOP 0x0080
+#define EVE_TOUCH_ETYPE_TRACK_ABORT 0x0100
+#define EVE_TOUCH_ETYPE_TRACK_REG 0x0200
+#define EVE_TOUCH_ETYPE_LPRESS 0x0400
+#define EVE_TOUCH_ETYPE_TAP1 0x0800
+#define EVE_TOUCH_ETYPE_TAP2 0x1000
+#define EVE_TOUCH_ETYPE_USR 0x2000
+#define EVE_TOUCH_ETYPE_USR1 0x4000
+#define EVE_TOUCH_ETYPE_EXT 0x8000 /* events emitted outside of eve_touch scope */
#define EVE_TOUCH_ETYPE_TRACK_MASK (EVE_TOUCH_ETYPE_TRACK | EVE_TOUCH_ETYPE_TRACK_START | EVE_TOUCH_ETYPE_TRACK_STOP | EVE_TOUCH_ETYPE_TRACK_ABORT | EVE_TOUCH_ETYPE_TRACK_REG)
-#define EVE_TOUCH_ETYPE_TIMER_MASK (EVE_TOUCH_ETYPE_TIMER | EVE_TOUCH_ETYPE_TIMER_ABORT)
#define EVE_TOUCH_ETYPE_POINT_MASK (EVE_TOUCH_ETYPE_POINT | EVE_TOUCH_ETYPE_POINT_UP)
#define EVE_TOUCH_ETYPE_USR_MASK (EVE_TOUCH_ETYPE_USR | EVE_TOUCH_ETYPE_USR1)
@@ -44,7 +45,6 @@
#define EVE_TOUCH_EETYPE_TRACK_DOWN 0x0080
#define EVE_TOUCH_EETYPE_TRACK_ABORT 0x0100
-#define EVE_TOUCH_EETYPE_TIMER_ABORT 0x0200
#define EVE_TOUCH_EETYPE_USR 0x1000
#define EVE_TOUCH_EETYPE_USR1 0x2000
@@ -54,11 +54,9 @@
#define EVE_TOUCH_EETYPE_TRACK_X (EVE_TOUCH_EETYPE_TRACK_LEFT | EVE_TOUCH_EETYPE_TRACK_RIGHT)
#define EVE_TOUCH_EETYPE_TRACK_Y (EVE_TOUCH_EETYPE_TRACK_UP | EVE_TOUCH_EETYPE_TRACK_DOWN)
#define EVE_TOUCH_EETYPE_TRACK_XY (EVE_TOUCH_EETYPE_TRACK_X | EVE_TOUCH_EETYPE_TRACK_Y)
-#define EVE_TOUCH_EETYPE_ABORT (EVE_TOUCH_EETYPE_TRACK_ABORT | EVE_TOUCH_EETYPE_TIMER_ABORT)
/* tag options */
-#define EVE_TOUCH_OPT_TRACK 0x01
-#define EVE_TOUCH_OPT_TRACK_REG 0x02
+#define EVE_TOUCH_OPT_TRACK_REG 0x01
#define EVE_TOUCH_OPT_TRACK_X 0x04
#define EVE_TOUCH_OPT_TRACK_Y 0x08
#define EVE_TOUCH_OPT_TRACK_EXT_X 0x10
@@ -90,12 +88,10 @@ typedef struct EVETouch {
typedef struct EVETouchTimer {
EVETouch *touch;
- uint32_t to;
uint16_t evt;
- uint8_t tag0;
} EVETouchTimer;
-typedef void (*eve_touch_handler_t) (EVETouch *, uint16_t, uint8_t, void *);
+typedef void (*eve_touch_handler_t) (EVETouch *, uint16_t, void *);
void eve_touch_init(void);
void eve_handle_touch(uint16_t intr_flags);
@@ -104,19 +100,14 @@ void eve_handle_time(void);
void eve_touch_set_handler(eve_touch_handler_t handler, void *handler_param);
EVETouch *eve_touch_get_obj(int i);
int8_t eve_touch_get_idx(EVETouch *touch);
-uint16_t eve_touch_evt(EVETouch *touch, uint16_t evt, uint8_t tag0, uint8_t tag_min, uint8_t tag_n);
+uint16_t eve_touch_evt(EVETouch *touch, uint16_t evt, uint8_t tag_min, uint8_t tag_n);
-void eve_touch_set_opt(uint8_t tag, uint8_t opt);
-uint8_t eve_touch_get_opt(uint8_t tag);
-void eve_touch_clear_opt(void);
+void eve_tag_set_opt(uint8_t tag, uint8_t opt);
+uint8_t eve_tag_get_opt(uint8_t tag);
+void eve_tag_clear_opt(void);
-void eve_timer_set(EVETouch *touch, uint16_t evt, uint8_t tag0, uint32_t to);
+void eve_timer_set(EVETouch *touch, uint16_t evt, uint32_t to);
void eve_timer_clear(EVETouch *touch);
+void eve_timer_reset(void);
void eve_timer_set_evt(EVETouch *touch, uint16_t evt);
uint16_t eve_timer_get_evt(EVETouch *touch);
-EVETouchTimer *eve_timer_get_obj(void);
-
-void eve_timer_start(uint8_t tag0, uint32_t to);
-void eve_timer_stop(void);
-int eve_timer_running(void);
-void eve_touch_clear_tag0(void);