summaryrefslogtreecommitdiff
path: root/bsp/hpmicro/libraries/hpm_sdk/components/touch/hpm_touch.h
blob: 9af46c35f0029021c907d98b037e63ecd4e1da13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 * Copyright (c) 2021 hpmicro
 *
 * SPDX-License-Identifier: BSD-3-Clause
 *
 */

#ifndef HPM_TOUCH_H
#define HPM_TOUCH_H

#include "hpm_common.h"

#if CONFIG_TOUCH_FT5406
#include "hpm_ft5406.h"
#define HPM_TOUCH_MAX_POINTS (FT5406_MAX_TOUCH_POINTS)
#elif CONFIG_TOUCH_GT911
#include "hpm_gt911.h"
#define HPM_TOUCH_MAX_POINTS (GT911_MAX_TOUCH_POINTS)
#else
#error "unknown touch type, either have CONFIG_FT5406 or CONFIG_GT911 defined"
#endif

typedef struct {
    uint16_t x;
    uint16_t y;
} touch_point_t;

#ifdef __cplusplus
extern "C" {
#endif

hpm_stat_t touch_init(I2C_Type *i2c_ptr);

hpm_stat_t touch_get_data(touch_point_t *points, uint8_t *num_of_points);

#ifdef __cplusplus
}
#endif

#endif /* HPM_TOUCH_H */