From f2c4b15c72a2fa89caed5d8a11a4ea9832c48be6 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 18 May 2026 22:44:37 +0530 Subject: feat: add AXS15231B touch driver with coordinate parsing tests --- main/touch.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 main/touch.h (limited to 'main/touch.h') diff --git a/main/touch.h b/main/touch.h new file mode 100644 index 0000000..a4a5aa4 --- /dev/null +++ b/main/touch.h @@ -0,0 +1,28 @@ +#ifndef TOUCH_H +#define TOUCH_H + +#include "esp_err.h" +#include +#include + +#define TOUCH_SDA_PIN 4 +#define TOUCH_SCL_PIN 8 +#define TOUCH_RST_PIN 12 +#define TOUCH_INT_PIN 11 +#define TOUCH_I2C_ADDR 0x3B +#define TOUCH_MAX_X 319 +#define TOUCH_MAX_Y 479 + +typedef struct { + uint16_t x; + uint16_t y; + bool touched; +} touch_point_t; + +esp_err_t touch_init(void); +bool touch_read(touch_point_t *pt); +void touch_deinit(void); + +void touch_parse_raw(const uint8_t *data, touch_point_t *pt); + +#endif -- cgit v1.2.3