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 CONFIG_TOUCH_FT5406 14 #include "hpm_ft5406.h" 15 #define HPM_TOUCH_MAX_POINTS (FT5406_MAX_TOUCH_POINTS) 16 #elif CONFIG_TOUCH_GT911 17 #include "hpm_gt911.h" 18 #define HPM_TOUCH_MAX_POINTS (GT911_MAX_TOUCH_POINTS) 19 #else 20 #error "unknown touch type, either have CONFIG_FT5406 or CONFIG_GT911 defined" 21 #endif 22 23 typedef struct { 24 uint16_t x; 25 uint16_t y; 26 } touch_point_t; 27 28 #ifdef __cplusplus 29 extern "C" { 30 #endif 31 32 hpm_stat_t touch_init(I2C_Type *i2c_ptr); 33 34 hpm_stat_t touch_get_data(touch_point_t *points, uint8_t *num_of_points); 35 36 #ifdef __cplusplus 37 } 38 #endif 39 40 #endif /* HPM_TOUCH_H */ 41