From 8151f5378ab01968e04624c58407975e2f2094a1 Mon Sep 17 00:00:00 2001 From: Guy Sloan Date: Tue, 12 May 2026 13:16:14 +0200 Subject: [PATCH] added bt81x_touch_xy() for synchronous touch reads --- src/drivers/gpu/bt81x/bt81x.c | 10 +++++++++- src/drivers/gpu/bt81x/bt81x.h | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/drivers/gpu/bt81x/bt81x.c b/src/drivers/gpu/bt81x/bt81x.c index 1b5d28b4..73d58e80 100644 --- a/src/drivers/gpu/bt81x/bt81x.c +++ b/src/drivers/gpu/bt81x/bt81x.c @@ -106,7 +106,6 @@ bt81x_rd32(bt81x_t *b, uint32_t addr) } - static void bt81x_cmd(bt81x_t *b, uint8_t command, uint8_t param) { @@ -788,6 +787,14 @@ bt81x_backlight(gfx_display_t *gd, uint8_t backlight) } +uint32_t +bt81x_touch_xy(gfx_display_t *gd) +{ + bt81x_t *b = (bt81x_t *)gd; + return bt81x_rd32(b, EVE_REG_CTOUCH_TOUCH0_XY); +} + + /************************************************************************ * * GUI draw primitives @@ -1285,3 +1292,4 @@ cmd_gpu_info(cli_t *cli, int argc, char **argv) CLI_CMD_DEF("gpu_info", cmd_gpu_info); #endif + diff --git a/src/drivers/gpu/bt81x/bt81x.h b/src/drivers/gpu/bt81x/bt81x.h index 7e17a7e0..584fc4cc 100644 --- a/src/drivers/gpu/bt81x/bt81x.h +++ b/src/drivers/gpu/bt81x/bt81x.h @@ -52,3 +52,6 @@ struct gfx_display *bt81x_create(spi_t *spi, gpio_t ncs, gpio_t pd, gpio_t irq, void bt81x_enable(struct gfx_display *, int enabled); void bt81x_backlight(struct gfx_display *, uint8_t backlight); + +uint32_t bt81x_touch_xy(struct gfx_display *gd); +