touch_dev.h
1 /*
2  * Copyright (C) 2020 Inria
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
20 #ifndef TOUCH_DEV_H
21 #define TOUCH_DEV_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #include <stddef.h>
28 #include <stdint.h>
29 #include <stdbool.h>
30 
34 typedef struct touch_dev touch_dev_t;
35 
39 typedef struct {
40  uint16_t x;
41  uint16_t y;
42 } touch_t;
43 
47 typedef struct {
48 
56  uint16_t (*height)(const touch_dev_t *dev);
57 
65  uint16_t (*width)(const touch_dev_t *dev);
66 
77  uint8_t (*touches)(const touch_dev_t *dev, touch_t *touches, size_t len);
79 
83 struct touch_dev {
85 };
86 
94 uint16_t touch_dev_height(const touch_dev_t *dev);
95 
103 uint16_t touch_dev_width(const touch_dev_t *dev);
104 
117 uint8_t touch_dev_touches(const touch_dev_t *dev, touch_t *touches, size_t len);
118 
119 #ifdef __cplusplus
120 }
121 #endif
122 
123 #endif /* TOUCH_DEV_H */
124 
touch_dev::driver
const touch_dev_driver_t * driver
Pointer to driver of the touch device.
Definition: touch_dev.h:84
touch_t
Touch coordinates.
Definition: touch_dev.h:39
touch_t::y
uint16_t y
Y coordinate.
Definition: touch_dev.h:41
touch_t::x
uint16_t x
X coordinate.
Definition: touch_dev.h:40
touch_dev_height
uint16_t touch_dev_height(const touch_dev_t *dev)
Get the height of the touch device.
touch_dev_driver_t::touches
uint8_t(* touches)(const touch_dev_t *dev, touch_t *touches, size_t len)
Get the current touches on the touch device.
Definition: touch_dev.h:77
touch_dev
Generic type for a touch device.
Definition: touch_dev.h:83
touch_dev_driver_t
Generic type for a touch driver.
Definition: touch_dev.h:47
touch_dev_width
uint16_t touch_dev_width(const touch_dev_t *dev)
Get the width of the touch device.
touch_dev_touches
uint8_t touch_dev_touches(const touch_dev_t *dev, touch_t *touches, size_t len)
Get the current touches on the touch device.