forked from nopnop2002/Raspberry-ili9340spi
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathxpt2046.h
More file actions
34 lines (29 loc) · 737 Bytes
/
xpt2046.h
File metadata and controls
34 lines (29 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <sys/time.h>
typedef struct {
uint32_t x1;
uint32_t x2;
uint32_t y1;
uint32_t y2;
uint32_t id;
} TouchPoint;
#define MAXTP 20
typedef struct {
uint16_t tpc;
uint16_t tpx;
time_t lsec;
suseconds_t lusec;
TouchPoint tps[MAXTP];
} TouchInfo;
// black header:
//#define XRATE 133
//#define YRATE 94
//yellow header:
#define XRATE 133
#define YRATE 120
#define DTMAX 800000 // 800m sec
int xptGetit(int cmd);
void xptGetxy(uint8_t chipSelect, int *xp, int *yp);
void xptInit(TouchInfo *hoge);
void xptDump(TouchInfo *hoge);
void xptSetPoint(TouchInfo *hoge,uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2,uint16_t id);
int xptGetPoint(uint8_t chipSelect, TouchInfo *hoge);