XPT2046: Handle MKS touchscreen w/out PenIRQ pin (#14640)

This commit is contained in:
Tanguy Pruvot
2019-07-17 11:41:10 +02:00
committed by Scott Lahteine
parent f2c5740d06
commit 9dfa5ba3a5
3 changed files with 28 additions and 7 deletions

View File

@@ -28,15 +28,20 @@
#define XPT2046_CONTROL 0x80
enum XPTCoordinate : uint8_t {
XPT2046_X = 0x10,
XPT2046_Y = 0x50
XPT2046_X = 0x10,
XPT2046_Y = 0x50,
XPT2046_Z1 = 0x30,
XPT2046_Z2 = 0x40
};
#define XPT2046_Z1_TRESHHOLD 10
class XPT2046 {
public:
static void init(void);
static uint8_t read_buttons();
private:
static bool isTouched();
static uint16_t getInTouch(const XPTCoordinate coordinate);
};