Select one of the symbols to view example projects that use it.
 
Outline
#include "stm32f413h_discovery.h"
#include "stm32f413h_discovery_ts.h"
tsDriver
I2C_Address
tsOrientation
ts_event_string_tab
ts_gesture_id_string_tab
BSP_TS_Init(uint16_t, uint16_t)
BSP_TS_InitEx(uint16_t, uint16_t, uint8_t)
BSP_TS_ITConfig()
BSP_TS_GetState(TS_StateTypeDef *)
BSP_TS_INT_MspInit()
Files
loading...
CodeScopeSTM32 Libraries and SamplesSTM32F413H-Discoverystm32f413h_discovery_ts.c
 
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/** ****************************************************************************** * @file stm32f413h_discovery_ts.c * @author MCD Application Team * @brief This file provides a set of functions needed to manage the Touch * Screen on STM32F413h-DISCOVERY evaluation board. ****************************************************************************** * @attention * * Copyright (c) 2017 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** *//* ... */ /* File Info : ----------------------------------------------------------------- User NOTES 1. How To use this driver: -------------------------- - This driver is used to drive the touch screen module of the STM32F413H-DISCOVERY evaluation board on the FRIDA LCD mounted on MB1209 daughter board. The touch screen driver IC is a FT6x36 type which share the same register naming with FT6206 type. 2. Driver description: --------------------- + Initialization steps: o Initialize the TS module using the BSP_TS_Init() function. This function includes the MSP layer hardware resources initialization and the communication layer configuration to start the TS use. The LCD size properties (x and y) are passed as parameters. o If TS interrupt mode is desired, you must configure the TS interrupt mode by calling the function BSP_TS_ITConfig(). The TS interrupt mode is generated as an external interrupt whenever a touch is detected. + Touch screen use o The touch screen state is captured whenever the function BSP_TS_GetState() is used. This function returns information about the last LCD touch occurred in the TS_StateTypeDef structure. ------------------------------------------------------------------------------*//* ... */ /* Includes ------------------------------------------------------------------*/ #include "stm32f413h_discovery.h" #include "stm32f413h_discovery_ts.h" /** @addtogroup BSP * @{ *//* ... */ /** @addtogroup STM32F413H_DISCOVERY * @{ *//* ... */ /** @defgroup STM32F413H_DISCOVERY_TS STM32F413H_DISCOVERY TS * @{ *//* ... */ /** @defgroup STM32F413H_DISCOVERY_TS_Private_Variables STM32F413H DISCOVERY TS Private Variables * @{ *//* ... */ static TS_DrvTypeDef *tsDriver; static uint8_t I2C_Address = 0; static uint8_t tsOrientation = TS_SWAP_NONE; /* Table for touchscreen event information display on LCD : table indexed on enum @ref TS_TouchEventTypeDef information */ char * ts_event_string_tab[TOUCH_EVENT_NB_MAX] = { "None", "Press down", "Lift up", "Contact" ...}; /* Table for touchscreen gesture Id information display on LCD : table indexed on enum @ref TS_GestureIdTypeDef information */ char * ts_gesture_id_string_tab[GEST_ID_NB_MAX] = { "None", "Move Up", "Move Right", "Move Down", "Move Left", "Zoom In", "Zoom Out" ...}; /** * @} *//* ... */ /** @defgroup STM32F413H_DISCOVERY_TS_Private_Functions STM32F413H DISCOVERY TS Private Functions * @{ *//* ... */ /** * @brief Initializes and configures the touch screen functionalities and * configures all necessary hardware resources (GPIOs, I2C, clocks..). * @param ts_SizeX : Maximum X size of the TS area on LCD * @param ts_SizeY : Maximum Y size of the TS area on LCD * @retval TS_OK if all initializations are OK. Other value if error. *//* ... */ uint8_t BSP_TS_Init(uint16_t ts_SizeX, uint16_t ts_SizeY) { return (BSP_TS_InitEx(ts_SizeX, ts_SizeY, TS_ORIENTATION_LANDSCAPE)); }{ ... } /** * @brief Initializes and configures the touch screen functionalities and * configures all necessary hardware resources (GPIOs, I2C, clocks..) * with a given orientation * @param ts_SizeX : Maximum X size of the TS area on LCD * @param ts_SizeY : Maximum Y size of the TS area on LCD * @param orientation : TS_ORIENTATION_LANDSCAPE or TS_ORIENTATION_PORTRAIT * @retval TS_OK if all initializations are OK. Other value if error. *//* ... */ uint8_t BSP_TS_InitEx(uint16_t ts_SizeX, uint16_t ts_SizeY, uint8_t orientation) { uint8_t ts_status = TS_OK; /* Note : I2C_Address is un-initialized here, but is not used at all in init function */ /* but the prototype of Init() is like that in template and should be respected */ /* Initialize the communication channel to sensor (I2C) if necessary */ /* that is initialization is done only once after a power up */ #if defined (USE_STM32F413H_DISCOVERY_REVE) ft3x67_ts_drv.Init(I2C_Address); if(ft3x67_ts_drv.ReadID(TS_I2C_ADDRESS) == FT3X67_ID_VALUE) { /* Found FT3x67 : Initialize the TS driver structure */ tsDriver = &ft3x67_ts_drv; I2C_Address = TS_I2C_ADDRESS; /* Get LCD chosen orientation */ if(orientation == TS_ORIENTATION_PORTRAIT) { tsOrientation = TS_SWAP_Y; }if (orientation == TS_ORIENTATION_PORTRAIT) { ... } else if(orientation == TS_ORIENTATION_LANDSCAPE_ROT180) { tsOrientation = TS_SWAP_XY; }else if (orientation == TS_ORIENTATION_LANDSCAPE_ROT180) { ... } else { tsOrientation = TS_SWAP_XY | TS_SWAP_Y; }else { ... } if(ts_status == TS_OK) { /* Software reset the TouchScreen */ tsDriver->Reset(I2C_Address); /* Calibrate, Configure and Start the TouchScreen driver */ tsDriver->Start(I2C_Address); }if (ts_status == TS_OK) { ... } /* of if(ts_status == TS_OK) */ }if (ft3x67_ts_drv.ReadID(TS_I2C_ADDRESS) == FT3X67_ID_VALUE) { ... } /* ... */#else /* USE_STM32413H_DISCOVERY */ ft6x06_ts_drv.Init(I2C_Address); /* Scan TouchScreen IC controller ID register by I2C Read */ /* Verify this is a FT6x36 or FT3x67, otherwise this is an error case */ if(ft6x06_ts_drv.ReadID(TS_I2C_ADDRESS) == FT6x36_ID_VALUE) { /* Found FT6x36 : Initialize the TS driver structure */ tsDriver = &ft6x06_ts_drv; I2C_Address = TS_I2C_ADDRESS; /* Get LCD chosen orientation */ if(orientation == TS_ORIENTATION_PORTRAIT) { tsOrientation = TS_SWAP_Y; }if (orientation == TS_ORIENTATION_PORTRAIT) { ... } else if(orientation == TS_ORIENTATION_LANDSCAPE_ROT180) { tsOrientation = TS_SWAP_XY; }else if (orientation == TS_ORIENTATION_LANDSCAPE_ROT180) { ... } else { tsOrientation = TS_SWAP_XY | TS_SWAP_Y; }else { ... } if(ts_status == TS_OK) { /* Software reset the TouchScreen */ tsDriver->Reset(I2C_Address); /* Calibrate, Configure and Start the TouchScreen driver */ tsDriver->Start(I2C_Address); }if (ts_status == TS_OK) { ... } /* of if(ts_status == TS_OK) */ }if (ft6x06_ts_drv.ReadID(TS_I2C_ADDRESS) == FT6x36_ID_VALUE) { ... } /* ... */#endif /* USE_STM32F413H_DISCOVERY_REVE */ else { ts_status = TS_DEVICE_NOT_FOUND; }else { ... } return (ts_status); }{ ... } /** * @brief Configures and enables the touch screen interrupts. * @retval TS_OK if all initializations are OK. Other value if error. *//* ... */ uint8_t BSP_TS_ITConfig(void) { uint8_t ts_status = TS_OK; /* Msp Init of GPIO used for TS_INT pin coming from TouchScreen driver IC FT6x36 */ /* When touchscreen is operated in interrupt mode */ BSP_TS_INT_MspInit(); /* Enable and set the TS_INT EXTI Interrupt to an intermediate priority */ HAL_NVIC_SetPriority((IRQn_Type)(TS_INT_EXTI_IRQn), 0x0F, 0x00); HAL_NVIC_EnableIRQ((IRQn_Type)(TS_INT_EXTI_IRQn)); /* Enable the TS in interrupt mode */ /* In that case the INT output of FT6206 when new touch is available */ /* is active on low level and directed on EXTI */ tsDriver->EnableIT(I2C_Address); return (ts_status); }{ ... } /** * @brief Returns status and positions of the touch screen. * @param TS_State: Pointer to touch screen current state structure * @retval TS_OK if all initializations are OK. Other value if error. *//* ... */ uint8_t BSP_TS_GetState(TS_StateTypeDef *TS_State) { static uint32_t _x[TS_MAX_NB_TOUCH] = {0, 0}; static uint32_t _y[TS_MAX_NB_TOUCH] = {0, 0}; uint8_t ts_status = TS_OK; uint16_t tmp; uint16_t Raw_x[TS_MAX_NB_TOUCH]; uint16_t Raw_y[TS_MAX_NB_TOUCH]; uint16_t xDiff; uint16_t yDiff; uint32_t index; #if (TS_MULTI_TOUCH_SUPPORTED == 1) uint32_t weight = 0; uint32_t area = 0; uint32_t event = 0;/* ... */ #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */ /* Check and update the number of touches active detected */ TS_State->touchDetected = tsDriver->DetectTouch(I2C_Address); if(TS_State->touchDetected) { for(index=0; index < TS_State->touchDetected; index++) { /* Get each touch coordinates */ tsDriver->GetXY(I2C_Address, &(Raw_x[index]), &(Raw_y[index])); if(tsOrientation & TS_SWAP_XY) { tmp = Raw_x[index]; Raw_x[index] = Raw_y[index]; Raw_y[index] = tmp; }if (tsOrientation & TS_SWAP_XY) { ... } #if defined (USE_STM32F413H_DISCOVERY_REVE) if(tsOrientation & TS_SWAP_X) { Raw_x[index] = TS_MAX_WIDTH_HEIGHT - 1 - Raw_x[index]; }if (tsOrientation & TS_SWAP_X) { ... } if(tsOrientation & TS_SWAP_Y) { Raw_y[index] = TS_MAX_WIDTH_HEIGHT - 1 - Raw_y[index]; }if (tsOrientation & TS_SWAP_Y) { ... } /* ... */#else /* USE_STM32413H_DISCOVERY */ if(tsOrientation & TS_SWAP_X) { Raw_x[index] = FT_6206_MAX_WIDTH_HEIGHT - 1 - Raw_x[index]; }if (tsOrientation & TS_SWAP_X) { ... } if(tsOrientation & TS_SWAP_Y) { Raw_y[index] = FT_6206_MAX_WIDTH_HEIGHT - 1 - Raw_y[index]; }if (tsOrientation & TS_SWAP_Y) { ... } /* ... */#endif /* USE_STM32F413H_DISCOVERY_REVE */ xDiff = Raw_x[index] > _x[index]? (Raw_x[index] - _x[index]): (_x[index] - Raw_x[index]); yDiff = Raw_y[index] > _y[index]? (Raw_y[index] - _y[index]): (_y[index] - Raw_y[index]); if ((xDiff + yDiff) > 5) { _x[index] = Raw_x[index]; _y[index] = Raw_y[index]; }if ((xDiff + yDiff) > 5) { ... } TS_State->touchX[index] = _x[index]; TS_State->touchY[index] = _y[index]; #if (TS_MULTI_TOUCH_SUPPORTED == 1) /* Get touch info related to the current touch */ #if defined (USE_STM32F413H_DISCOVERY_REVE) ft3x67_TS_GetTouchInfo(I2C_Address, index, &weight, &area, &event); #else /* USE_STM32413H_DISCOVERY */ ft6x06_TS_GetTouchInfo(I2C_Address, index, &weight, &area, &event); #endif /* USE_STM32F413H_DISCOVERY_REVE */ /* Update TS_State structure */ TS_State->touchWeight[index] = weight; TS_State->touchArea[index] = area; #if defined (USE_STM32F413H_DISCOVERY_REVE) /* Remap touch event */ switch(event) { case FT3X67_TOUCH_EVT_FLAG_PRESS_DOWN : TS_State->touchEventId[index] = TOUCH_EVENT_PRESS_DOWN; break;case FT3X67_TOUCH_EVT_FLAG_PRESS_DOWN : case FT3X67_TOUCH_EVT_FLAG_LIFT_UP : TS_State->touchEventId[index] = TOUCH_EVENT_LIFT_UP; break;case FT3X67_TOUCH_EVT_FLAG_LIFT_UP : case FT3X67_TOUCH_EVT_FLAG_CONTACT : TS_State->touchEventId[index] = TOUCH_EVENT_CONTACT; break;case FT3X67_TOUCH_EVT_FLAG_CONTACT : case FT3X67_TOUCH_EVT_FLAG_NO_EVENT : TS_State->touchEventId[index] = TOUCH_EVENT_NO_EVT; break;case FT3X67_TOUCH_EVT_FLAG_NO_EVENT : default : ts_status = TS_ERROR; break;default }switch (event) { ... } /* of switch(event) *//* ... */ #else /* USE_STM32413H_DISCOVERY */ /* Remap touch event */ switch(event) { case FT6206_TOUCH_EVT_FLAG_PRESS_DOWN : TS_State->touchEventId[index] = TOUCH_EVENT_PRESS_DOWN; break;case FT6206_TOUCH_EVT_FLAG_PRESS_DOWN : case FT6206_TOUCH_EVT_FLAG_LIFT_UP : TS_State->touchEventId[index] = TOUCH_EVENT_LIFT_UP; break;case FT6206_TOUCH_EVT_FLAG_LIFT_UP : case FT6206_TOUCH_EVT_FLAG_CONTACT : TS_State->touchEventId[index] = TOUCH_EVENT_CONTACT; break;case FT6206_TOUCH_EVT_FLAG_CONTACT : case FT6206_TOUCH_EVT_FLAG_NO_EVENT : TS_State->touchEventId[index] = TOUCH_EVENT_NO_EVT; break;case FT6206_TOUCH_EVT_FLAG_NO_EVENT : default : ts_status = TS_ERROR; break;default }switch (event) { ... } /* of switch(event) *//* ... */ #endif /* USE_STM32F413H_DISCOVERY_REVE *//* ... */ #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */ }for (index=0; index < TS_State->touchDetected; index++) { ... } /* of for(index=0; index < TS_State->touchDetected; index++) */ #if (TS_MULTI_TOUCH_SUPPORTED == 1) /* Get gesture Id */ ts_status = BSP_TS_Get_GestureId(TS_State);/* ... */ #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */ }if (TS_State->touchDetected) { ... } /* end of if(TS_State->touchDetected != 0) */ return (ts_status); }{ ... } #if (TS_MULTI_TOUCH_SUPPORTED == 1) /** * @brief Update gesture Id following a touch detected. * @param TS_State: Pointer to touch screen current state structure * @retval TS_OK if all initializations are OK. Other value if error. *//* ... */ uint8_t BSP_TS_Get_GestureId(TS_StateTypeDef *TS_State) { uint32_t gestureId = 0; uint8_t ts_status = TS_OK; #if defined (USE_STM32F413H_DISCOVERY_REVE) /* Get gesture Id */ ft3x67_TS_GetGestureID(I2C_Address, &gestureId); /* Remap gesture Id to a TS_GestureIdTypeDef value */ switch(gestureId) { case FT3X67_GEST_ID_NO_GESTURE : TS_State->gestureId = GEST_ID_NO_GESTURE; break;case FT3X67_GEST_ID_NO_GESTURE : case FT3X67_GEST_ID_MOVE_UP : TS_State->gestureId = GEST_ID_MOVE_UP; break;case FT3X67_GEST_ID_MOVE_UP : case FT3X67_GEST_ID_MOVE_RIGHT : TS_State->gestureId = GEST_ID_MOVE_RIGHT; break;case FT3X67_GEST_ID_MOVE_RIGHT : case FT3X67_GEST_ID_MOVE_DOWN : TS_State->gestureId = GEST_ID_MOVE_DOWN; break;case FT3X67_GEST_ID_MOVE_DOWN : case FT3X67_GEST_ID_MOVE_LEFT : TS_State->gestureId = GEST_ID_MOVE_LEFT; break;case FT3X67_GEST_ID_MOVE_LEFT : default : ts_status = TS_ERROR; break;default }switch (gestureId) { ... } /* of switch(gestureId) *//* ... */ #else /* USE_STM32413H_DISCOVERY */ /* Get gesture Id */ ft6x06_TS_GetGestureID(I2C_Address, &gestureId); /* Remap gesture Id to a TS_GestureIdTypeDef value */ switch(gestureId) { case FT6206_GEST_ID_NO_GESTURE : TS_State->gestureId = GEST_ID_NO_GESTURE; break;case FT6206_GEST_ID_NO_GESTURE : case FT6206_GEST_ID_MOVE_UP : TS_State->gestureId = GEST_ID_MOVE_UP; break;case FT6206_GEST_ID_MOVE_UP : case FT6206_GEST_ID_MOVE_RIGHT : TS_State->gestureId = GEST_ID_MOVE_RIGHT; break;case FT6206_GEST_ID_MOVE_RIGHT : case FT6206_GEST_ID_MOVE_DOWN : TS_State->gestureId = GEST_ID_MOVE_DOWN; break;case FT6206_GEST_ID_MOVE_DOWN : case FT6206_GEST_ID_MOVE_LEFT : TS_State->gestureId = GEST_ID_MOVE_LEFT; break;case FT6206_GEST_ID_MOVE_LEFT : case FT6206_GEST_ID_ZOOM_IN : TS_State->gestureId = GEST_ID_ZOOM_IN; break;case FT6206_GEST_ID_ZOOM_IN : case FT6206_GEST_ID_ZOOM_OUT : TS_State->gestureId = GEST_ID_ZOOM_OUT; break;case FT6206_GEST_ID_ZOOM_OUT : default : ts_status = TS_ERROR; break;default }switch (gestureId) { ... } /* of switch(gestureId) *//* ... */ #endif /* USE_STM32F413H_DISCOVERY_REVE */ return(ts_status); }BSP_TS_Get_GestureId (TS_StateTypeDef *TS_State) { ... } /** * @brief Function used to reset all touch data before a new acquisition * of touch information. * @param TS_State: Pointer to touch screen current state structure * @retval TS_OK if OK, TE_ERROR if problem found. *//* ... */ uint8_t BSP_TS_ResetTouchData(TS_StateTypeDef *TS_State) { uint8_t ts_status = TS_ERROR; uint32_t index; if (TS_State != (TS_StateTypeDef *)NULL) { TS_State->gestureId = GEST_ID_NO_GESTURE; TS_State->touchDetected = 0; for(index = 0; index < TS_MAX_NB_TOUCH; index++) { TS_State->touchX[index] = 0; TS_State->touchY[index] = 0; TS_State->touchArea[index] = 0; TS_State->touchEventId[index] = TOUCH_EVENT_NO_EVT; TS_State->touchWeight[index] = 0; }for (index = 0; index < TS_MAX_NB_TOUCH; index++) { ... } ts_status = TS_OK; }if (TS_State != (TS_StateTypeDef *)NULL) { ... } /* of if (TS_State != (TS_StateTypeDef *)NULL) */ return (ts_status); }BSP_TS_ResetTouchData (TS_StateTypeDef *TS_State) { ... } /* ... */#endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */ /** * @brief Initializes the TS_INT pin MSP. *//* ... */ __weak void BSP_TS_INT_MspInit(void) { GPIO_InitTypeDef gpio_init_structure; TS_INT_GPIO_CLK_ENABLE(); /* Configure Interrupt mode for TS_INT pin falling edge : when a new touch is available */ /* TS_INT pin is active on low level on new touch available */ gpio_init_structure.Pin = TS_INT_PIN; gpio_init_structure.Pull = GPIO_NOPULL; gpio_init_structure.Speed = GPIO_SPEED_FAST; gpio_init_structure.Mode = GPIO_MODE_IT_FALLING; HAL_GPIO_Init(TS_INT_GPIO_PORT, &gpio_init_structure); }{ ... } /** * @} *//* ... */ /** * @} *//* ... */ /** * @} *//* ... */ /** * @} *//* ... */