我的触摸屏有问题。我正在为TFTM032触摸屏使用FT6236触摸屏驱动程序。我从i2c协议获得了触摸信息,但我不知道如何确定坐标。我正在使用stm32f3发现板并使用标准的perhipral库进行编程。我尝试这个代码,但它不起作用
if (touch_event.event_id == 0)
{
if (buf.gest_id & TOUCH_FT6236_GESTURE_MOVE_FLAG)
{
// gesture for us! -> overwrite clicks
touch_event.event_id = (buf.gest_id & 0x0F) + 1;
touch_event.x = 0;
touch_event.y = 0;
}
else
{
uint8_t ev = buf.points[0].event >> 6;
touch_event.event_id = TOUCH_GESTURE_MOUSE_DOWN + ev;
touch_event.y = (buf.points[0].xhi & 0x0F) << 8 | (buf.points[0].xlo);
touch_event.y = (touch_event.y >> 1);
touch_event.x = (buf.points[0].yhi & 0x0F) << 8 | (buf.points[0].ylo);
touch_event.x = 128 - (touch_event.x >> 1);
}
xpos = touch_event.x;
ypos = touch_event.y;
}
}