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
41
42
45
46
49
50
53
55
56
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
77
78
81
85
86
98
99
104
105
111
112
113
118
119
120
121
122
123
124
125
126
127
128
129
130
135
136
143
144
147
148
151
155
156
157
161
162
165
168
169
170
171
172
173
175
176
177
178
179
181
182
183
186
187
190
191
194
195
198
199
200
201
202
203
204
/* ... */
#ifndef __STM32F413H_DISCOVERY_TS_H
#define __STM32F413H_DISCOVERY_TS_H
#ifdef __cplusplus
extern "C" {
#endif
#include "stm32f413h_discovery.h"
#include "stm32f413h_discovery_lcd.h"
#if defined (USE_STM32F413H_DISCOVERY_REVE)
#include "../Components/ft3x67/ft3x67.h"
#else
#include "../Components/ft6x06/ft6x06.h"
#endif
/* ... */
/* ... */
/* ... */
/* ... */
/* ... */
#if defined (USE_STM32F413H_DISCOVERY_REVE)
#define TS_MAX_NB_TOUCH ((uint32_t) FT3X67_MAX_DETECTABLE_TOUCH)
#define TS_MAX_WIDTH_HEIGHT ((uint16_t)240)
/* ... */#else
#define TS_MAX_NB_TOUCH ((uint32_t) FT6206_MAX_DETECTABLE_TOUCH)
#endif
#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)
9 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_INT_MspInit(void);
/* ... */
/* ... */
/* ... */
/* ... */
#ifdef __cplusplus
}extern "C" { ... }
#endif
/* ... */
#endif