Zephyr API 3.6.99
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#ifndef ZEPHYR_INCLUDE_INPUT_TOUCH_H_
7#define ZEPHYR_INCLUDE_INPUT_TOUCH_H_
8
18#include <zephyr/input/input.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
43};
44
50#define INPUT_TOUCH_DT_COMMON_CONFIG_INIT(node_id) \
51 { \
52 .screen_width = DT_PROP(node_id, screen_width), \
53 .screen_height = DT_PROP(node_id, screen_height), \
54 .inverted_x = DT_PROP(node_id, inverted_x), \
55 .inverted_y = DT_PROP(node_id, inverted_y), \
56 .swapped_x_y = DT_PROP(node_id, swapped_x_y) \
57 }
58
64#define INPUT_TOUCH_DT_INST_COMMON_CONFIG_INIT(inst) \
65 INPUT_TOUCH_DT_COMMON_CONFIG_INIT(DT_DRV_INST(inst))
66
72#define INPUT_TOUCH_STRUCT_CHECK(config) \
73 BUILD_ASSERT(offsetof(config, common) == 0, \
74 "struct input_touchscreen_common_config must be placed first");
75
84void input_touchscreen_report_pos(const struct device *dev,
85 uint32_t x, uint32_t y,
86 k_timeout_t timeout);
87
88#ifdef __cplusplus
89}
90#endif
91
94#endif /* ZEPHYR_INCLUDE_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.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
Runtime device structure (in ROM) per driver instance.
Definition: device.h:403
Common touchscreen config.
Definition: input_touch.h:37
bool inverted_x
Definition: input_touch.h:40
uint32_t screen_width
Definition: input_touch.h:38
bool swapped_x_y
Definition: input_touch.h:42
bool inverted_y
Definition: input_touch.h:41
uint32_t screen_height
Definition: input_touch.h:39
Kernel timeout type.
Definition: sys_clock.h:65