-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathlv_port_indev.h
84 lines (67 loc) · 2.02 KB
/
lv_port_indev.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/**
* @file lv_port_indev_templ.h
*
*/
/*Copy this file as "lv_port_indev.h" and set this value to "1" to enable content*/
#if 1
#ifndef LV_PORT_INDEV_TEMPL_H
#define LV_PORT_INDEV_TEMPL_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lvgl.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
#define GT911_I2C_SLAVE_ADDR 0x5D
#define GT911_PRODUCT_ID_LEN 4
/* Register Map of GT911 */
#define GT911_PRODUCT_ID1 0x8140
#define GT911_PRODUCT_ID2 0x8141
#define GT911_PRODUCT_ID3 0x8142
#define GT911_PRODUCT_ID4 0x8143
#define GT911_FIRMWARE_VER_L 0x8144
#define GT911_FIRMWARE_VER_H 0x8145
#define GT911_X_COORD_RES_L 0x8146
#define GT911_X_COORD_RES_H 0x8147
#define GT911_Y_COORD_RES_L 0x8148
#define GT911_Y_COORD_RES_H 0x8149
#define GT911_VENDOR_ID 0x814A
#define GT911_STATUS_REG 0x814E
#define GT911_STATUS_REG_BUF 0x80
#define GT911_STATUS_REG_LARGE 0x40
#define GT911_STATUS_REG_PROX_VALID 0x20
#define GT911_STATUS_REG_HAVEKEY 0x10
#define GT911_STATUS_REG_PT_MASK 0x0F
#define GT911_TRACK_ID1 0x814F
#define GT911_PT1_X_COORD_L 0x8150
#define GT911_PT1_X_COORD_H 0x8151
#define GT911_PT1_Y_COORD_L 0x8152
#define GT911_PT1_Y_COORD_H 0x8153
#define GT911_PT1_X_SIZE_L 0x8154
#define GT911_PT1_X_SIZE_H 0x8155
typedef struct {
bool inited;
char product_id[GT911_PRODUCT_ID_LEN];
uint16_t max_x_coord;
uint16_t max_y_coord;
uint8_t i2c_dev_addr;
} gt911_status_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
void lv_port_indev_init(void);
/**********************
* MACROS
**********************/
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*LV_PORT_INDEV_TEMPL_H*/
#endif /*Disable/Enable content*/