rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
touch_types.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include <stdbool.h>
13#include <stdint.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
20#define TOUCH_MAX_POINTS 5
21
23typedef struct {
24 uint8_t id;
25 int16_t x;
26 int16_t y;
27 uint16_t strength;
29
37
44
56#define TOUCH_FLAG_NO_TAP 0x01u
57
66#define TOUCH_FLAG_JUMP 0x02u
67
74
80static inline bool touch_event_is_tap_up(const touch_event_t *evt)
81{
82 return evt->type == TOUCH_EVENT_UP
83 && (evt->flags & TOUCH_FLAG_NO_TAP) == 0u;
84}
85
86#ifdef __cplusplus
87}
88#endif
A DOWN, MOVE or UP of one contact.
Definition touch_types.h:69
uint8_t flags
Definition touch_types.h:72
touch_point_t point
Definition touch_types.h:71
touch_event_type_t type
Definition touch_types.h:70
One contact.
Definition touch_types.h:23
uint8_t id
Definition touch_types.h:24
int16_t y
Definition touch_types.h:26
uint16_t strength
Definition touch_types.h:27
int16_t x
Definition touch_types.h:25
#define TOUCH_FLAG_NO_TAP
On an UP: the contact ends for its owner, and the finger did not lift at that point.
Definition touch_types.h:56
static bool touch_event_is_tap_up(const touch_event_t *evt)
Whether evt is an UP that may activate the control it ends on.
Definition touch_types.h:80
touch_event_type_t
What happened to a contact.
Definition touch_types.h:39
@ TOUCH_EVENT_MOVE
Definition touch_types.h:41
@ TOUCH_EVENT_UP
Definition touch_types.h:42
@ TOUCH_EVENT_DOWN
Definition touch_types.h:40
touch_rotation_t
How far the controller's frame is turned against the panel's.
Definition touch_types.h:31
@ TOUCH_ROTATION_0
Definition touch_types.h:32
@ TOUCH_ROTATION_180
Definition touch_types.h:34
@ TOUCH_ROTATION_270
Definition touch_types.h:35
@ TOUCH_ROTATION_90
Definition touch_types.h:33