discoverpixy
touch.h
Go to the documentation of this file.
1 #ifndef TOUCH_H
2 #define TOUCH_H
3 
14 
15 
16 #include<stdbool.h>
17 #include<stdint.h>
18 
22 typedef enum {
25 } TOUCH_STATE ;
26 
31 typedef enum {
32  NONE=0x00,
33  PEN_DOWN=0x01,
34  PEN_UP=0x02,
35  PEN_ENTER=0x04,
36  PEN_LEAVE=0x08,
37  PEN_MOVE=0x10
38 } TOUCH_ACTION;
39 
45 typedef void (*TOUCH_CALLBACK)(void* touchArea, TOUCH_ACTION triggeredAction);
46 
50 typedef struct {
52  uint16_t x1;
53  uint16_t y1;
54  uint16_t x2;
55  uint16_t y2;
57  uint8_t flags;
59 
60 
64 typedef struct {
65  uint16_t x;
66  uint16_t y;
67 } POINT_STRUCT;
68 
74 bool touch_init();
75 
85 bool touch_add_raw_event(uint16_t x, uint16_t y,TOUCH_STATE state);
86 
92 bool touch_have_empty(unsigned char num);
93 
100 
106 
112 
113 
116 #endif /* TOUCH_H */
TOUCH_ACTION
Definition: touch.h:31
bool touch_register_area(TOUCH_AREA_STRUCT *area)
Definition: touch.c:103
Receive an event when the pen moves inside the region (pen is down)
Definition: touch.h:37
Receive an event when the pen goes down inside the region.
Definition: touch.h:33
void(* TOUCH_CALLBACK)(void *touchArea, TOUCH_ACTION triggeredAction)
Definition: touch.h:45
Receive an event when the pen goes up inside the region.
Definition: touch.h:34
uint16_t y1
Top Left Y-Coordinate of Area.
Definition: touch.h:53
uint16_t y
The Y-Coordinate of the point.
Definition: touch.h:66
uint8_t flags
For internal Used, don't change, don't initialize.
Definition: touch.h:57
uint16_t x
The X-Coordinate of the point.
Definition: touch.h:65
uint16_t x1
Top Left X-Coordinate of Area.
Definition: touch.h:52
void touch_unregister_area(TOUCH_AREA_STRUCT *area)
Definition: touch.c:118
Definition: touch.h:50
bool touch_add_raw_event(uint16_t x, uint16_t y, TOUCH_STATE state)
Definition: touch.c:16
uint16_t y2
Bottom Right Y-Coordinate of Area.
Definition: touch.h:55
The display is currently not touched.
Definition: touch.h:23
The display is currently touched at some point.
Definition: touch.h:24
TOUCH_CALLBACK callback
Callback.
Definition: touch.h:56
uint16_t x2
Bottom Right X-Coordinate of Area.
Definition: touch.h:54
Receive an event when the pen enters the region (pen was down before)
Definition: touch.h:35
POINT_STRUCT touch_get_last_point()
Definition: touch.c:131
TOUCH_ACTION hookedActions
Actions to listen to.
Definition: touch.h:51
Definition: touch.h:64
TOUCH_STATE
Definition: touch.h:22
bool touch_have_empty(unsigned char num)
Definition: touch.c:93
Do not receive any events.
Definition: touch.h:32
bool touch_init()
Definition: touch.c:11
Receive an event when the pen leaves the region (pen was inside region before)
Definition: touch.h:36