Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Touchscreen Events

Files

file  input_touch.h
 Header file for touch events API.

Data Structures

struct  input_touchscreen_common_config
 Common touchscreen config. More...

Macros

#define INPUT_TOUCH_OUTPUT_DIM(node_id, dim, prop)
 Select an output dimension from the display phandle, else the node's own property.
#define INPUT_TOUCH_DT_COMMON_CONFIG_INIT(node_id)
 Initialize common touchscreen config from devicetree.
#define INPUT_TOUCH_DT_INST_COMMON_CONFIG_INIT(inst)
 Initialize common touchscreen config from devicetree instance.
#define INPUT_TOUCH_STRUCT_CHECK(config)
 Validate the offset of the common config structure.

Functions

void input_touchscreen_report_pos (const struct device *dev, uint32_t x, uint32_t y, k_timeout_t timeout)
 Common utility for reporting touchscreen position events.

Detailed Description

Since
3.7
Version
0.1.0

Macro Definition Documentation

◆ INPUT_TOUCH_DT_COMMON_CONFIG_INIT

#define INPUT_TOUCH_DT_COMMON_CONFIG_INIT ( node_id)

#include <input_touch.h>

Value:
{ \
.screen_width = DT_PROP(node_id, screen_width), \
.screen_height = DT_PROP(node_id, screen_height), \
.inverted_x = DT_PROP(node_id, inverted_x), \
.inverted_y = DT_PROP(node_id, inverted_y), \
.swapped_x_y = DT_PROP(node_id, swapped_x_y), \
.output_width = INPUT_TOUCH_OUTPUT_DIM(node_id, width, output_width), \
.output_height = INPUT_TOUCH_OUTPUT_DIM(node_id, height, output_height), \
}
#define DT_PROP(node_id, prop)
Get a devicetree property value.
Definition devicetree.h:873
#define INPUT_TOUCH_OUTPUT_DIM(node_id, dim, prop)
Select an output dimension from the display phandle, else the node's own property.
Definition input_touch.h:65

Initialize common touchscreen config from devicetree.

Parameters
node_idThe devicetree node identifier.

◆ INPUT_TOUCH_DT_INST_COMMON_CONFIG_INIT

#define INPUT_TOUCH_DT_INST_COMMON_CONFIG_INIT ( inst)

#include <input_touch.h>

Value:
#define DT_DRV_INST(inst)
Node identifier for an instance of a DT_DRV_COMPAT compatible.
Definition devicetree.h:4333
#define INPUT_TOUCH_DT_COMMON_CONFIG_INIT(node_id)
Initialize common touchscreen config from devicetree.
Definition input_touch.h:75

Initialize common touchscreen config from devicetree instance.

Parameters
instInstance.

◆ INPUT_TOUCH_OUTPUT_DIM

#define INPUT_TOUCH_OUTPUT_DIM ( node_id,
dim,
prop )

#include <input_touch.h>

Value:
COND_CODE_1(DT_NODE_HAS_PROP(node_id, display), \
(DT_PROP(DT_PHANDLE(node_id, display), dim)), \
(DT_PROP_OR(node_id, prop, 0)))
#define DT_NODE_HAS_PROP(node_id, prop)
Does a devicetree node have a property?
Definition devicetree.h:4080
#define DT_PROP_OR(node_id, prop, default_value)
Like DT_PROP(), but with a fallback to default_value.
Definition devicetree.h:1046
#define DT_PHANDLE(node_id, prop)
Get a node identifier for a phandle property's value.
Definition devicetree.h:1922
#define COND_CODE_1(_flag, _if_1_code, _else_code)
Insert code depending on whether _flag expands to 1 or not.
Definition util_macro.h:209

Select an output dimension from the display phandle, else the node's own property.

Prefers the width/height of the node referenced by the display phandle; falls back to the node's own output-width / output-height when display is not set, and to 0 when neither is present, which disables scaling.

Parameters
node_idThe devicetree node identifier.
dimThe display-controller dimension property (width or height).
propThe touchscreen fallback property (output_width or output_height).

◆ INPUT_TOUCH_STRUCT_CHECK

#define INPUT_TOUCH_STRUCT_CHECK ( config)

#include <input_touch.h>

Value:
BUILD_ASSERT(offsetof(config, common) == 0, \
"struct input_touchscreen_common_config must be placed first");
#define BUILD_ASSERT(EXPR, MSG...)
Definition llvm.h:51

Validate the offset of the common config structure.

Parameters
configName of the config structure.

Function Documentation

◆ input_touchscreen_report_pos()

void input_touchscreen_report_pos ( const struct device * dev,
uint32_t x,
uint32_t y,
k_timeout_t timeout )

#include <input_touch.h>

Common utility for reporting touchscreen position events.

Parameters
devTouchscreen controller
xX coordinate as reported by the controller
yY coordinate as reported by the controller
timeoutTimeout for reporting the event