HPM SDK
HPMicro Software Development Kit
hpm_touch.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021 HPMicro
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef HPM_TOUCH_H
9 #define HPM_TOUCH_H
10 
11 #include "hpm_common.h"
12 
13 #if defined(CONFIG_TOUCH_FT5406) && (CONFIG_TOUCH_FT5406 == 1)
14 #include "hpm_ft5406.h"
15 #define HPM_TOUCH_MAX_POINTS (FT5406_MAX_TOUCH_POINTS)
16 #elif defined(CONFIG_TOUCH_GT9XX) && (CONFIG_TOUCH_GT9XX == 1)
17 #include "hpm_gt9xx.h"
18 #define HPM_TOUCH_MAX_POINTS (GT9XX_MAX_TOUCH_POINTS)
19 #else
20 #error "unknown touch type, either have CONFIG_FT5406 or CONFIG_GT9XX defined"
21 #endif
22 
23 enum {
26 };
27 
28 typedef struct {
29  uint16_t x;
30  uint16_t y;
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
38 hpm_stat_t touch_config(bool exchange_xy, bool reverse_x, bool reverse_y);
39 hpm_stat_t touch_get_data(touch_point_t *points, uint8_t *num_of_points);
40 
41 #ifdef __cplusplus
42 }
43 #endif
44 
45 #endif /* HPM_TOUCH_H */
uint32_t hpm_stat_t
Definition: hpm_common.h:126
#define MAKE_STATUS(group, code)
Definition: hpm_common.h:135
@ status_group_touch
Definition: hpm_common.h:173
hpm_stat_t touch_config(bool exchange_xy, bool reverse_x, bool reverse_y)
Definition: hpm_touch_ft5406.c:53
hpm_stat_t touch_get_data(touch_point_t *points, uint8_t *num_of_points)
Definition: hpm_touch_ft5406.c:11
@ status_touch_buffer_no_ready
Definition: hpm_touch.h:24
@ status_touch_points_over_number
Definition: hpm_touch.h:25
hpm_stat_t touch_init(I2C_Type *i2c_ptr)
Definition: hpm_touch_ft5406.c:33
Definition: hpm_i2c_regs.h:12
Definition: hpm_touch.h:28
uint16_t x
Definition: hpm_touch.h:29
uint16_t y
Definition: hpm_touch.h:30