Capacitive Touch Screen (GT911) for SKR SE BX (#21843)

Co-authored-by: Msq001 <alansayyeah@gmail.com>
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
This commit is contained in:
BigTreeTech
2021-05-09 10:02:16 +08:00
committed by GitHub
parent 6cc45d2578
commit c9de9d4f9b
14 changed files with 425 additions and 62 deletions

View File

@@ -30,8 +30,15 @@
#include "../tft_io/touch_calibration.h"
#endif
#include HAL_PATH(../../HAL, tft/xpt2046.h)
#define TOUCH_DRIVER XPT2046
#if ENABLED(TFT_TOUCH_DEVICE_GT911)
#include HAL_PATH(../../HAL, tft/gt911.h)
#define TOUCH_DRIVER_CLASS GT911
#elif ENABLED(TFT_TOUCH_DEVICE_XPT2046)
#include HAL_PATH(../../HAL, tft/xpt2046.h)
#define TOUCH_DRIVER_CLASS XPT2046
#else
#error "Unknown Touch Screen Type."
#endif
// Menu Navigation
extern int8_t encoderTopLine, encoderLine, screen_items;
@@ -85,7 +92,7 @@ typedef struct __attribute__((__packed__)) {
class Touch {
private:
static TOUCH_DRIVER io;
static TOUCH_DRIVER_CLASS io;
static int16_t x, y;
static bool enabled;