rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Toggle main menu visibility
Loading...
Searching...
No Matches
gt911.h
Go to the documentation of this file.
1
12
13
#pragma once
14
15
#include "driver/i2c_master.h"
16
#include "esp_err.h"
17
18
#include "
touch_types.h
"
19
20
#ifdef __cplusplus
21
extern
"C"
{
22
#endif
23
24
/* Register map (only what this driver needs). */
25
#define GT911_REG_COMMAND 0x8040
26
#define GT911_REG_CONFIG 0x8047
27
#define GT911_REG_X_MAX 0x8048
28
#define GT911_REG_Y_MAX 0x804A
29
#define GT911_REG_PRODUCT_ID 0x8140
30
#define GT911_REG_FW_VERSION 0x8144
31
#define GT911_REG_STATUS 0x814E
32
#define GT911_REG_POINT0 0x814F
33
34
#define GT911_STATUS_READY 0x80
35
#define GT911_STATUS_COUNT_MASK 0x0F
36
#define GT911_POINT_STRIDE 8
37
38
typedef
struct
gt911_dev_t
*gt911_handle_t;
39
40
typedef
struct
{
41
uint16_t
i2c_addr
;
42
uint32_t
scl_speed_hz
;
43
}
gt911_config_t
;
44
46
esp_err_t gt911_new(i2c_master_bus_handle_t bus,
const
gt911_config_t
*cfg,
47
gt911_handle_t *out);
48
49
esp_err_t gt911_del(gt911_handle_t h);
50
52
uint16_t gt911_address(gt911_handle_t h);
53
55
esp_err_t gt911_info(gt911_handle_t h,
char
product_id[5], uint16_t *fw_version);
56
58
esp_err_t gt911_resolution(gt911_handle_t h, uint16_t *x_max, uint16_t *y_max);
59
69
esp_err_t gt911_read(gt911_handle_t h,
touch_point_t
*out,
int
max,
70
int
*count,
bool
*fresh);
71
72
#ifdef __cplusplus
73
}
74
#endif
gt911_config_t
Definition
gt911.h:40
gt911_config_t::scl_speed_hz
uint32_t scl_speed_hz
Definition
gt911.h:42
gt911_config_t::i2c_addr
uint16_t i2c_addr
Definition
gt911.h:41
gt911_dev_t
Definition
gt911.c:19
touch_point_t
One contact.
Definition
touch_types.h:23
touch_types.h
Plain data types shared by the touch controller driver, the coordinate mapper and the event tracker....
firmware
panel
components
gt911
include
gt911.h
Generated by
1.18.0