1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
28
29
30
31
35
36
/* ... */
#include <ResistiveTouchController.hpp>
extern "C"
{
#include "stm32f429i_discovery_ts.h"
uint32_t LCD_GetXSize();
uint32_t LCD_GetYSize();
}extern "C" { ... }
using namespace touchgfx;
void ResistiveTouchController::init()
{
BSP_TS_Init(LCD_GetXSize(), LCD_GetYSize());
}{ ... }
bool ResistiveTouchController::sampleTouch(int32_t& x, int32_t& y)
{
TS_StateTypeDef state;
BSP_TS_GetState(&state);
if (state.TouchDetected)
{
x = state.X;
y = state.Y;
return true;
}if (state.TouchDetected) { ... }
return false;
}{ ... }