upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/main/touch.h
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-05-18 22:44:37 +0530
committerYour Name <you@example.com>2026-05-18 22:44:37 +0530
commitf2c4b15c72a2fa89caed5d8a11a4ea9832c48be6 (patch)
tree4cfaa400b1bddcd6cff2a5e53f3789256c40700d /main/touch.h
parent7820837d79ebc8e00221b5206bdd8e3ca0ae4c15 (diff)
feat: add AXS15231B touch driver with coordinate parsing tests
Diffstat (limited to 'main/touch.h')
-rw-r--r--main/touch.h28
1 files changed, 28 insertions, 0 deletions
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 @@
1#ifndef TOUCH_H
2#define TOUCH_H
3
4#include "esp_err.h"
5#include <stdint.h>
6#include <stdbool.h>
7
8#define TOUCH_SDA_PIN 4
9#define TOUCH_SCL_PIN 8
10#define TOUCH_RST_PIN 12
11#define TOUCH_INT_PIN 11
12#define TOUCH_I2C_ADDR 0x3B
13#define TOUCH_MAX_X 319
14#define TOUCH_MAX_Y 479
15
16typedef struct {
17 uint16_t x;
18 uint16_t y;
19 bool touched;
20} touch_point_t;
21
22esp_err_t touch_init(void);
23bool touch_read(touch_point_t *pt);
24void touch_deinit(void);
25
26void touch_parse_raw(const uint8_t *data, touch_point_t *pt);
27
28#endif