rcbench
Servo and ESC test bench: panel, IOmcu and shared C
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
27extern "C" {
28#endif
29
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
59esp_err_t touch_init(const touch_config_t *cfg);
60
65esp_err_t touch_deinit(void);
66
71int touch_snapshot(touch_point_t *out, int max);
72
75
85bool touch_wait_event(touch_event_t *out, uint32_t *seq, uint32_t timeout_ms);
86
93uint32_t touch_published(void);
94
96void touch_flush_events(void);
97
99uint16_t touch_i2c_address(void);
100
113uint32_t touch_age_ms(void);
114
115#ifdef RCBENCH_TOUCH_INJECTOR
125bool touch_injector_attached(void);
126#endif
127
128
129#ifdef __cplusplus
130}
131#endif
Pin map for the 7-inch ESP32-P4 display board from Waveshare (ESP32-P4-WIFI6-Touch-LCD-7B).
How touch_init() sets the touch input up.
Definition touch.h:31
uint32_t poll_interval_ms
Definition touch.h:35
uint32_t event_queue_len
Definition touch.h:36
int task_priority
Definition touch.h:37
touch_rotation_t rotation
Definition touch.h:32
bool mirror_y
Definition touch.h:34
int task_core
Definition touch.h:38
bool mirror_x
Definition touch.h:33
A DOWN, MOVE or UP of one contact.
Definition touch_types.h:69
One contact.
Definition touch_types.h:23
int touch_snapshot(touch_point_t *out, int max)
Definition touch.c:344
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
bool touch_pressed(touch_point_t *out)
Definition touch.c:359
esp_err_t touch_init(const touch_config_t *cfg)
Reset the controller, probe it and start the polling task.
Definition touch.c:204
uint32_t touch_age_ms(void)
Definition touch.c:404
void touch_flush_events(void)
Definition touch.c:392
uint32_t touch_published(void)
Definition touch.c:387
uint16_t touch_i2c_address(void)
Definition touch.c:399
bool touch_wait_event(touch_event_t *out, uint32_t *seq, uint32_t timeout_ms)
Definition touch.c:369
esp_err_t touch_deinit(void)
Stop the task and release the controller.
Definition touch.c:321
Coordinate mapping and press/move/release tracking. Pure C; the unit tests are in test/host.
Plain data types shared by the touch controller driver, the coordinate mapper and the event tracker....
touch_rotation_t
How far the controller's frame is turned against the panel's.
Definition touch_types.h:31