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
38
39
42
43
46
47
50
52
61
64
65
68
72
73
74
75
76
77
78
79
83
84
85
86
87
92
93
99
100
105
106
107
108
109
110
111
112
113
114
115
116
117
122
123
130
131
134
135
138
142
143
144
148
149
152
153
156
157
158
159
160
162
163
164
165
166
167
169
170
171
174
175
178
179
182
183
186
187
188
189
190
191
192
/* ... */
#ifndef __STM32469I_DISCOVERY_TS_H
#define __STM32469I_DISCOVERY_TS_H
#ifdef __cplusplus
extern "C" {
#endif
#include "stm32469i_discovery.h"
#include "stm32469i_discovery_lcd.h"
#include "../Components/ft6x06/ft6x06.h"
/* ... */
/* ... */
/* ... */
/* ... */
/* ... */
#define TS_MAX_NB_TOUCH ((uint32_t) FT6206_MAX_DETECTABLE_TOUCH)
#define TS_NO_IRQ_PENDING ((uint8_t) 0)
#define TS_IRQ_PENDING ((uint8_t) 1)
#define TS_SWAP_NONE ((uint8_t) 0x01)
#define TS_SWAP_X ((uint8_t) 0x02)
#define TS_SWAP_Y ((uint8_t) 0x04)
#define TS_SWAP_XY ((uint8_t) 0x08)
7 defines
/* ... */
/* ... */
/* ... */
typedef struct
{
uint8_t touchDetected;
uint16_t touchX[TS_MAX_NB_TOUCH];
uint16_t touchY[TS_MAX_NB_TOUCH];
#if (TS_MULTI_TOUCH_SUPPORTED == 1)
uint8_t touchWeight[TS_MAX_NB_TOUCH];
uint8_t touchEventId[TS_MAX_NB_TOUCH];
uint8_t touchArea[TS_MAX_NB_TOUCH];
uint32_t gestureId; /* ... */
#endif
...} TS_StateTypeDef;
/* ... */
typedef enum
{
TS_OK = 0x00,
TS_ERROR = 0x01,
TS_TIMEOUT = 0x02,
TS_DEVICE_NOT_FOUND = 0x03
...} TS_StatusTypeDef;
/* ... */
typedef enum
{
GEST_ID_NO_GESTURE = 0x00,
GEST_ID_MOVE_UP = 0x01,
GEST_ID_MOVE_RIGHT = 0x02,
GEST_ID_MOVE_DOWN = 0x03,
GEST_ID_MOVE_LEFT = 0x04,
GEST_ID_ZOOM_IN = 0x05,
GEST_ID_ZOOM_OUT = 0x06,
GEST_ID_NB_MAX = 0x07
...} TS_GestureIdTypeDef;
/* ... */
typedef enum
{
TOUCH_EVENT_NO_EVT = 0x00,
TOUCH_EVENT_PRESS_DOWN = 0x01,
TOUCH_EVENT_LIFT_UP = 0x02,
TOUCH_EVENT_CONTACT = 0x03,
TOUCH_EVENT_NB_MAX = 0x04
...} TS_TouchEventTypeDef;
/* ... */
/* ... */
/* ... */
extern char * ts_event_string_tab[TOUCH_EVENT_NB_MAX];
/* ... */
extern char * ts_gesture_id_string_tab[GEST_ID_NB_MAX];
/* ... */
/* ... */
uint8_t BSP_TS_Init(uint16_t ts_SizeX, uint16_t ts_SizeY);
uint8_t BSP_TS_GetState(TS_StateTypeDef *TS_State);
#if (TS_MULTI_TOUCH_SUPPORTED == 1)
uint8_t BSP_TS_Get_GestureId(TS_StateTypeDef *TS_State);
uint8_t BSP_TS_ResetTouchData(TS_StateTypeDef *TS_State);/* ... */
#endif
uint8_t BSP_TS_ITConfig(void);
/* ... */
void BSP_TS_INT_MspInit(void);
/* ... */
/* ... */
/* ... */
/* ... */
#ifdef __cplusplus
}extern "C" { ... }
#endif
/* ... */
#endif