1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
29
30
34
35
/* ... */
#include <OTM8009TouchController.hpp>
extern "C"
{
#include "stm32469i_eval.h"
#include "stm32469i_eval_ts.h"
uint32_t LCD_GetXSize();
uint32_t LCD_GetYSize();
}extern "C" { ... }
void OTM8009TouchController::init()
{
BSP_TS_Init(LCD_GetXSize(), LCD_GetYSize());
}{ ... }
bool OTM8009TouchController::sampleTouch(int32_t& x, int32_t& y)
{
TS_StateTypeDef state;
BSP_TS_GetState(&state);
if (state.touchDetected)
{
x = state.touchX[0];
y = state.touchY[0];
return true;
}if (state.touchDetected) { ... }
return false;
}{ ... }