From 81f0c0a0dc8afd2d2a19d4bbd53ef40b24a20a0f Mon Sep 17 00:00:00 2001 From: CTCaer Date: Thu, 30 Apr 2020 15:06:31 +0300 Subject: [PATCH] touch: Add FB SRAM read function --- nyx/nyx_gui/input/touch.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/nyx/nyx_gui/input/touch.c b/nyx/nyx_gui/input/touch.c index df1860f..9887e6f 100644 --- a/nyx/nyx_gui/input/touch.c +++ b/nyx/nyx_gui/input/touch.c @@ -276,6 +276,29 @@ int touch_panel_ito_test(u8 *err) return res; } +int touch_get_fb_info(u8 *buf) +{ + u8 tmp[5]; + + u8 cmd[3] = { STMFTS_RW_FRAMEBUFFER_REG, 0, 0 }; + int res = 0; + + + for (u32 i = 0; i < 0x10000; i+=4) + { + if (!res) + { + cmd[1] = (i >> 8) & 0xFF; + cmd[2] = i & 0xFF; + memset(tmp, 0xCC, 5); + res = touch_read_reg(cmd, 3, tmp, 5); + memcpy(&buf[i], tmp + 1, 4); + } + } + + return res; +} + int touch_sense_enable() { // Enable auto tuning calibration and multi-touch sensing.