diff options
author | Stanley Huang <stanleyhuangyc@gmail.com> | 2016-05-17 11:11:52 +1000 |
---|---|---|
committer | Stanley Huang <stanleyhuangyc@gmail.com> | 2016-05-17 11:11:52 +1000 |
commit | 09293ac73d85f592fcee7a53670b2749bdf41164 (patch) | |
tree | dd7a68e4ef26b53a9cc2431a45f42e94ea20f5c3 /libraries/MultiLCD/MultiLCD.h | |
parent | bcc1dc50292f65fc958f56df0c0558e301175189 (diff) | |
download | 2021-arduino-obd-09293ac73d85f592fcee7a53670b2749bdf41164.tar.gz 2021-arduino-obd-09293ac73d85f592fcee7a53670b2749bdf41164.tar.bz2 2021-arduino-obd-09293ac73d85f592fcee7a53670b2749bdf41164.zip |
Added touch screen support for 3.2" and 3.5" LCD
Diffstat (limited to 'libraries/MultiLCD/MultiLCD.h')
-rw-r--r-- | libraries/MultiLCD/MultiLCD.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libraries/MultiLCD/MultiLCD.h b/libraries/MultiLCD/MultiLCD.h index ddda23d..620023c 100644 --- a/libraries/MultiLCD/MultiLCD.h +++ b/libraries/MultiLCD/MultiLCD.h @@ -62,6 +62,9 @@ public: virtual void clear() {} virtual void begin() {} virtual void setCursor(byte column, byte line) {} + virtual byte readTouchData(int& x, int& y) { return 0; } + virtual int getScreenWidth() { return 320; } + virtual int getScreenHeight() { return 240; } void printInt(uint16_t value, int8_t padding = -1); void printLong(uint32_t value, int8_t padding = -1); void printSpace(byte n) @@ -248,12 +251,16 @@ public: clear(0, line * TFT_LINE_HEIGHT, disp_y_size, 8); } void setBackLight(byte brightness); + void drawPixel(uint16_t poX, uint16_t poY, uint16_t color); + byte getTouchData(int& x, int& y); private: void setXY(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2); void writeDigit(byte n); void clearPixels(uint32_t pixels); void Enable(); void Disable(); + void shiftOutTouchData(unsigned char data); + unsigned int shiftInTouchData(); }; class LCD_R61581 : public UTFT, public LCD_Common, public Print @@ -303,11 +310,17 @@ public: clear(0, line * TFT_LINE_HEIGHT, disp_y_size, 8); } void setBackLight(byte brightness); + void drawPixel(uint16_t poX, uint16_t poY, uint16_t color); + byte getTouchData(int& x, int& y); + int getScreenWidth() { return 480; } + int getScreenHeight() { return 320; } private: void setXY(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2); void writeDigit(byte n); void clearPixels(uint32_t pixels); void Enable(); void Disable(); + void shiftOutTouchData(unsigned char data); + unsigned int shiftInTouchData(); }; |