diff options
Diffstat (limited to 'main/touch.h')
| -rw-r--r-- | main/touch.h | 28 |
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 | |||
| 16 | typedef struct { | ||
| 17 | uint16_t x; | ||
| 18 | uint16_t y; | ||
| 19 | bool touched; | ||
| 20 | } touch_point_t; | ||
| 21 | |||
| 22 | esp_err_t touch_init(void); | ||
| 23 | bool touch_read(touch_point_t *pt); | ||
| 24 | void touch_deinit(void); | ||
| 25 | |||
| 26 | void touch_parse_raw(const uint8_t *data, touch_point_t *pt); | ||
| 27 | |||
| 28 | #endif | ||