-
Notifications
You must be signed in to change notification settings - Fork 16
/
xpt2046.h
37 lines (33 loc) · 940 Bytes
/
xpt2046.h
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
35
36
37
#include <stdbool.h>
#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 {
int _cs;
uint16_t tpc;
uint16_t tpx;
time_t lsec;
suseconds_t lusec;
TouchPoint tps[MAXTP];
bool _calibration;
int16_t _min_xp; // Minimum xp calibration
int16_t _min_yp; // Minimum yp calibration
int16_t _max_xp; // Maximum xp calibration
int16_t _max_yp; // Maximum yp calibration
int16_t _min_xc; // Minimum x coordinate
int16_t _min_yc; // Minimum y coordinate
int16_t _max_xc; // Maximum x coordinate
int16_t _max_yc; // Maximum y coordinate
} TouchInfo;
int xptGetit(int cmd);
void xptGetxy(int 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);