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
40
41
44
45
48
49
52
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
71
72
75
79
80
81
82
83
84
85
86
90
91
92
93
94
99
100
106
107
112
113
114
115
116
117
118
119
120
121
122
123
124
129
130
137
138
141
142
145
149
150
151
155
156
159
160
163
164
165
166
167
168
170
171
172
173
174
175
177
178
179
182
183
186
187
190
191
194
195
196
197
198
199
200
/* ... */
#ifndef __STM32412G_DISCOVERY_TS_H
#define __STM32412G_DISCOVERY_TS_H
#ifdef __cplusplus
extern "C" {
#endif
#include "stm32412g_discovery.h"
#include "stm32412g_discovery_lcd.h"
#include "../Components/ft6x06/ft6x06.h"
#if defined (USE_STM32412G_DISCOVERY_REVD)
#include "../Components/ft3x67/ft3x67.h"
#endif
/* ... */
/* ... */
/* ... */
/* ... */
/* ... */
#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)
#define TS_ORIENTATION_PORTRAIT ((uint8_t) 0)
#define TS_ORIENTATION_LANDSCAPE ((uint8_t) 1)
#define TS_ORIENTATION_LANDSCAPE_ROT180 ((uint8_t) 2)
10 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_InitEx(uint16_t ts_SizeX, uint16_t ts_SizeY, uint8_t orientation);
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_Reset(void);
/* ... */
void BSP_TS_INT_MspInit(void);
/* ... */
/* ... */
/* ... */
/* ... */
#ifdef __cplusplus
}extern "C" { ... }
#endif
/* ... */
#endif