rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
touch_types.h File Reference

Plain data types shared by the touch controller driver, the coordinate mapper and the event tracker. No ESP-IDF dependencies, so the pure logic can be unit-tested on the host. More...

#include <stdbool.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  touch_point_t
 One contact. More...
struct  touch_event_t
 A DOWN, MOVE or UP of one contact. More...

Macros

#define TOUCH_MAX_POINTS   5
 The GT911 reports at most five simultaneous contacts.
#define TOUCH_FLAG_NO_TAP   0x01u
 On an UP: the contact ends for its owner, and the finger did not lift at that point.
#define TOUCH_FLAG_JUMP   0x02u
 On a DOWN: the tracker made it for a contact that jumped more than TOUCH_JUMP_PX between two reports. It is a new press whose predecessor's release went missing, or a finger that travels that fast; the tracker cannot tell which. A control in a list that scrolls by a drag takes such a DOWN for the drag and not for a press on it. Every other control takes it as a press.

Enumerations

enum  touch_rotation_t { TOUCH_ROTATION_0 = 0 , TOUCH_ROTATION_90 , TOUCH_ROTATION_180 , TOUCH_ROTATION_270 }
 How far the controller's frame is turned against the panel's. More...
enum  touch_event_type_t { TOUCH_EVENT_DOWN = 0 , TOUCH_EVENT_MOVE , TOUCH_EVENT_UP }
 What happened to a contact. More...

Functions

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.

Detailed Description

Plain data types shared by the touch controller driver, the coordinate mapper and the event tracker. No ESP-IDF dependencies, so the pure logic can be unit-tested on the host.

SPDX-License-Identifier: MIT

Macro Definition Documentation

◆ TOUCH_FLAG_NO_TAP

#define TOUCH_FLAG_NO_TAP   0x01u

On an UP: the contact ends for its owner, and the finger did not lift at that point.

The tracker sets it on the UP it makes when it splits a jump of more than TOUCH_JUMP_PX, the router on the UP it makes for a contact that reaches the band, and the touch merge on the UP of an injected contact it cuts to make room for the glass's (touch_merge.h). Such an UP ends a press or a drag. A control that stops what the bench drives may still act on it; no other control does (touch_event_is_tap_up()).

Enumeration Type Documentation

◆ touch_event_type_t

What happened to a contact.

Enumerator
TOUCH_EVENT_DOWN 

it came down

TOUCH_EVENT_MOVE 

it moved

TOUCH_EVENT_UP 

it lifted, or ended

◆ touch_rotation_t

How far the controller's frame is turned against the panel's.

Enumerator
TOUCH_ROTATION_0 

not turned

TOUCH_ROTATION_90 

90 degrees

TOUCH_ROTATION_180 

180 degrees

TOUCH_ROTATION_270 

270 degrees

Function Documentation

◆ touch_event_is_tap_up()

bool touch_event_is_tap_up ( const touch_event_t * evt)
inlinestatic

Whether evt is an UP that may activate the control it ends on.

Parameters
evtThe event.
Returns
True for an UP without TOUCH_FLAG_NO_TAP.