Zephyr API
4.4.99
A Scalable Open Source RTOS
Toggle main menu visibility
Loading...
Searching...
No Matches
input_touch.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2024 Antmicro <www.antmicro.com>
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
12
13
#ifndef ZEPHYR_INCLUDE_INPUT_INPUT_TOUCH_H_
14
#define ZEPHYR_INCLUDE_INPUT_INPUT_TOUCH_H_
15
23
24
#include <
zephyr/input/input.h
>
25
26
#ifdef __cplusplus
27
extern
"C"
{
28
#endif
29
37
struct
input_touchscreen_common_config
{
39
uint32_t
screen_width
;
41
uint32_t
screen_height
;
43
bool
inverted_x
;
45
bool
inverted_y
;
47
bool
swapped_x_y
;
48
};
49
55
#define INPUT_TOUCH_DT_COMMON_CONFIG_INIT(node_id) \
56
{ \
57
.screen_width = DT_PROP(node_id, screen_width), \
58
.screen_height = DT_PROP(node_id, screen_height), \
59
.inverted_x = DT_PROP(node_id, inverted_x), \
60
.inverted_y = DT_PROP(node_id, inverted_y), \
61
.swapped_x_y = DT_PROP(node_id, swapped_x_y) \
62
}
63
69
#define INPUT_TOUCH_DT_INST_COMMON_CONFIG_INIT(inst) \
70
INPUT_TOUCH_DT_COMMON_CONFIG_INIT(DT_DRV_INST(inst))
71
77
#define INPUT_TOUCH_STRUCT_CHECK(config) \
78
BUILD_ASSERT(offsetof(config, common) == 0, \
79
"struct input_touchscreen_common_config must be placed first");
80
89
void
input_touchscreen_report_pos
(
const
struct
device
*dev,
90
uint32_t
x,
uint32_t
y,
91
k_timeout_t
timeout);
92
93
#ifdef __cplusplus
94
}
95
#endif
96
98
99
#endif
/* ZEPHYR_INCLUDE_INPUT_INPUT_TOUCH_H_ */
input_touchscreen_report_pos
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.
input.h
Main header file for Input driver API.
uint32_t
__UINT32_TYPE__ uint32_t
Definition
stdint.h:90
device
Runtime device structure (in ROM) per driver instance.
Definition
device.h:513
input_touchscreen_common_config
Common touchscreen config.
Definition
input_touch.h:37
input_touchscreen_common_config::inverted_x
bool inverted_x
X axis is inverted.
Definition
input_touch.h:43
input_touchscreen_common_config::screen_width
uint32_t screen_width
Horizontal resolution of touchscreen.
Definition
input_touch.h:39
input_touchscreen_common_config::swapped_x_y
bool swapped_x_y
X and Y axes are swapped.
Definition
input_touch.h:47
input_touchscreen_common_config::inverted_y
bool inverted_y
Y axis is inverted.
Definition
input_touch.h:45
input_touchscreen_common_config::screen_height
uint32_t screen_height
Vertical resolution of touchscreen.
Definition
input_touch.h:41
k_timeout_t
Kernel timeout type.
Definition
clock.h:65
zephyr
input
input_touch.h
Generated on
for Zephyr API by
1.17.0