rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Toggle main menu visibility
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
16
extern
"C"
{
17
#endif
18
20
#define TOUCH_MAX_POINTS 5
21
23
typedef
struct
{
24
uint8_t
id
;
25
int16_t
x
;
26
int16_t
y
;
27
uint16_t
strength
;
28
}
touch_point_t
;
29
31
typedef
enum
{
32
TOUCH_ROTATION_0
= 0,
33
TOUCH_ROTATION_90
,
34
TOUCH_ROTATION_180
,
35
TOUCH_ROTATION_270
,
36
}
touch_rotation_t
;
37
39
typedef
enum
{
40
TOUCH_EVENT_DOWN
= 0,
41
TOUCH_EVENT_MOVE
,
42
TOUCH_EVENT_UP
,
43
}
touch_event_type_t
;
44
56
#define TOUCH_FLAG_NO_TAP 0x01u
57
66
#define TOUCH_FLAG_JUMP 0x02u
67
69
typedef
struct
{
70
touch_event_type_t
type
;
71
touch_point_t
point
;
72
uint8_t
flags
;
73
}
touch_event_t
;
74
80
static
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
touch_event_t
A DOWN, MOVE or UP of one contact.
Definition
touch_types.h:69
touch_event_t::flags
uint8_t flags
Definition
touch_types.h:72
touch_event_t::point
touch_point_t point
Definition
touch_types.h:71
touch_event_t::type
touch_event_type_t type
Definition
touch_types.h:70
touch_point_t
One contact.
Definition
touch_types.h:23
touch_point_t::id
uint8_t id
Definition
touch_types.h:24
touch_point_t::y
int16_t y
Definition
touch_types.h:26
touch_point_t::strength
uint16_t strength
Definition
touch_types.h:27
touch_point_t::x
int16_t x
Definition
touch_types.h:25
TOUCH_FLAG_NO_TAP
#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
touch_event_is_tap_up
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
touch_event_type_t
What happened to a contact.
Definition
touch_types.h:39
TOUCH_EVENT_MOVE
@ TOUCH_EVENT_MOVE
Definition
touch_types.h:41
TOUCH_EVENT_UP
@ TOUCH_EVENT_UP
Definition
touch_types.h:42
TOUCH_EVENT_DOWN
@ TOUCH_EVENT_DOWN
Definition
touch_types.h:40
touch_rotation_t
touch_rotation_t
How far the controller's frame is turned against the panel's.
Definition
touch_types.h:31
TOUCH_ROTATION_0
@ TOUCH_ROTATION_0
Definition
touch_types.h:32
TOUCH_ROTATION_180
@ TOUCH_ROTATION_180
Definition
touch_types.h:34
TOUCH_ROTATION_270
@ TOUCH_ROTATION_270
Definition
touch_types.h:35
TOUCH_ROTATION_90
@ TOUCH_ROTATION_90
Definition
touch_types.h:33
shared
touch
include
touch_types.h
Generated by
1.18.0