Zephyr Project API 4.4.99
A Scalable Open Source RTOS
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
27extern "C" {
28#endif
29
53
65#define INPUT_TOUCH_OUTPUT_DIM(node_id, dim, prop) \
66 COND_CODE_1(DT_NODE_HAS_PROP(node_id, display), \
67 (DT_PROP(DT_PHANDLE(node_id, display), dim)), \
68 (DT_PROP_OR(node_id, prop, 0)))
69
75#define INPUT_TOUCH_DT_COMMON_CONFIG_INIT(node_id) \
76 { \
77 .screen_width = DT_PROP(node_id, screen_width), \
78 .screen_height = DT_PROP(node_id, screen_height), \
79 .inverted_x = DT_PROP(node_id, inverted_x), \
80 .inverted_y = DT_PROP(node_id, inverted_y), \
81 .swapped_x_y = DT_PROP(node_id, swapped_x_y), \
82 .output_width = INPUT_TOUCH_OUTPUT_DIM(node_id, width, output_width), \
83 .output_height = INPUT_TOUCH_OUTPUT_DIM(node_id, height, output_height), \
84 }
85
91#define INPUT_TOUCH_DT_INST_COMMON_CONFIG_INIT(inst) \
92 INPUT_TOUCH_DT_COMMON_CONFIG_INIT(DT_DRV_INST(inst))
93
99#define INPUT_TOUCH_STRUCT_CHECK(config) \
100 BUILD_ASSERT(offsetof(config, common) == 0, \
101 "struct input_touchscreen_common_config must be placed first");
102
112 uint32_t x, uint32_t y,
113 k_timeout_t timeout);
114
115#ifdef __cplusplus
116}
117#endif
118
120
121#endif /* ZEPHYR_INCLUDE_INPUT_INPUT_TOUCH_H_ */
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.
Main header file for Input driver API.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
Common touchscreen config.
Definition input_touch.h:37
bool inverted_x
X axis is inverted.
Definition input_touch.h:43
uint32_t screen_width
Horizontal resolution of the touch controller's own coordinate space.
Definition input_touch.h:39
bool swapped_x_y
X and Y axes are swapped.
Definition input_touch.h:47
bool inverted_y
Y axis is inverted.
Definition input_touch.h:45
uint32_t output_width
Horizontal resolution of the panel to scale into, 0 to disable scaling.
Definition input_touch.h:49
uint32_t output_height
Vertical resolution of the panel to scale into, 0 to disable scaling.
Definition input_touch.h:51
uint32_t screen_height
Vertical resolution of the touch controller's own coordinate space.
Definition input_touch.h:41
Kernel timeout type.
Definition clock.h:65