rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Toggle main menu visibility
Loading...
Searching...
No Matches
touch.h
Go to the documentation of this file.
1
16
17
#pragma once
18
19
#include "esp_err.h"
20
21
#include "
board_pins.h
"
22
23
#include "
touch_map.h
"
24
#include "
touch_types.h
"
25
26
#ifdef __cplusplus
27
extern
"C"
{
28
#endif
29
31
typedef
struct
{
32
touch_rotation_t
rotation
;
33
bool
mirror_x
;
34
bool
mirror_y
;
35
uint32_t
poll_interval_ms
;
36
uint32_t
event_queue_len
;
37
int
task_priority
;
38
int
task_core
;
39
}
touch_config_t
;
40
42
#define TOUCH_CONFIG_DEFAULT() \
43
(touch_config_t) { \
44
.rotation = TOUCH_ROTATION_0, \
45
.mirror_x = BOARD_TOUCH_MIRROR_X, \
46
.mirror_y = BOARD_TOUCH_MIRROR_Y, \
47
.poll_interval_ms = 10, \
48
.event_queue_len = 32, \
49
.task_priority = 5, \
50
.task_core = 0, \
51
}
52
59
esp_err_t
touch_init
(
const
touch_config_t
*cfg);
60
65
esp_err_t
touch_deinit
(
void
);
66
71
int
touch_snapshot
(
touch_point_t
*out,
int
max);
72
74
bool
touch_pressed
(
touch_point_t
*out);
75
85
bool
touch_wait_event
(
touch_event_t
*out, uint32_t *seq, uint32_t timeout_ms);
86
93
uint32_t
touch_published
(
void
);
94
96
void
touch_flush_events
(
void
);
97
99
uint16_t
touch_i2c_address
(
void
);
100
113
uint32_t
touch_age_ms
(
void
);
114
115
#ifdef RCBENCH_TOUCH_INJECTOR
125
bool
touch_injector_attached
(
void
);
126
#endif
127
128
129
#ifdef __cplusplus
130
}
131
#endif
board_pins.h
Pin map for the 7-inch ESP32-P4 display board from Waveshare (ESP32-P4-WIFI6-Touch-LCD-7B).
touch_config_t
How touch_init() sets the touch input up.
Definition
touch.h:31
touch_config_t::poll_interval_ms
uint32_t poll_interval_ms
Definition
touch.h:35
touch_config_t::event_queue_len
uint32_t event_queue_len
Definition
touch.h:36
touch_config_t::task_priority
int task_priority
Definition
touch.h:37
touch_config_t::rotation
touch_rotation_t rotation
Definition
touch.h:32
touch_config_t::mirror_y
bool mirror_y
Definition
touch.h:34
touch_config_t::task_core
int task_core
Definition
touch.h:38
touch_config_t::mirror_x
bool mirror_x
Definition
touch.h:33
touch_event_t
A DOWN, MOVE or UP of one contact.
Definition
touch_types.h:69
touch_point_t
One contact.
Definition
touch_types.h:23
touch_snapshot
int touch_snapshot(touch_point_t *out, int max)
Definition
touch.c:344
touch_injector_attached
bool touch_injector_attached(void)
Whether a touch injector (testbench/touch-injector) is attached: it answered at start-up and has not ...
Definition
touch_inject.c:104
touch_pressed
bool touch_pressed(touch_point_t *out)
Definition
touch.c:359
touch_init
esp_err_t touch_init(const touch_config_t *cfg)
Reset the controller, probe it and start the polling task.
Definition
touch.c:204
touch_age_ms
uint32_t touch_age_ms(void)
Definition
touch.c:404
touch_flush_events
void touch_flush_events(void)
Definition
touch.c:392
touch_published
uint32_t touch_published(void)
Definition
touch.c:387
touch_i2c_address
uint16_t touch_i2c_address(void)
Definition
touch.c:399
touch_wait_event
bool touch_wait_event(touch_event_t *out, uint32_t *seq, uint32_t timeout_ms)
Definition
touch.c:369
touch_deinit
esp_err_t touch_deinit(void)
Stop the task and release the controller.
Definition
touch.c:321
touch_map.h
Coordinate mapping and press/move/release tracking. Pure C; the unit tests are in test/host.
touch_types.h
Plain data types shared by the touch controller driver, the coordinate mapper and the event tracker....
touch_rotation_t
touch_rotation_t
How far the controller's frame is turned against the panel's.
Definition
touch_types.h:31
firmware
panel
components
gt911
include
touch.h
Generated by
1.18.0