Hello,
I am using a Renesas RA6M3 microcontroller to drive the display I am using. It all works fine.
However, I am trying to flip the display via dedicated hardware, which visually speaking works well, but the touch inputs are read the wrong way around.
I have fixed this by simply inverting the read inputs in my input’s callback function:
void touch_read_cb(lv_indev_drv_t* drv, lv_indev_data_t* data)
{
FSP_PARAMETER_NOT_USED(drv);
if (xMessageBufferReceiveFromISR(g_touch_message_buffer, &touch_data, sizeof(touch_data_t), NULL))
{
#if !FLIP_INPUT
data->point.x = (lv_coord_t)touch_data.point[0].x;
data->point.y = (lv_coord_t)touch_data.point[0].y;
#else
data->point.x = (lv_coord_t)(DISP_HOR_RES - touch_data.point[0].x);
data->point.y = (lv_coord_t)(DISP_VER_RES - touch_data.point[0].y);
#endif
data->state = LV_INDEV_STATE_PRESSED;
}
else
{
data->state = LV_INDEV_STATE_RELEASED;
}
}
This works fine for buttons and even sliders in the horizontal axis… but when I try to use scrollable objects in the vertical axis, the input is inverted. I understand WHY this happens, but is there an easy fix?
EDIT: Sorry to bother you, @kisvegabor but I really think you are the only person who might know this and I’m still pondering this issue. Inverting the display using LVGL also inverts touch, so it is definitely possible.