Library to control a Graphics TFT connected to 4-wire SPI - revised for the Raio RA8875 Display Controller.
Dependents: FRDM_RA8875_mPaint RA8875_Demo RA8875_KeyPadDemo SignalGenerator ... more
Fork of SPI_TFT by
See Components - RA8875 Based Display
Enhanced touch-screen support - where it previous supported both the Resistive Touch and Capacitive Touch based on the FT5206 Touch Controller, now it also has support for the GSL1680 Touch Controller.
Offline Help Manual (Windows chm)
/media/uploads/WiredHome/ra8875.zip.bin (download, rename to .zip and unzip)
Diff: TextDisplay.cpp
- Revision:
- 198:9b6851107426
- Parent:
- 182:8832d03a2a29
diff -r 853d08e2fb53 -r 9b6851107426 TextDisplay.cpp --- a/TextDisplay.cpp Tue Feb 11 21:51:42 2020 +0000 +++ b/TextDisplay.cpp Sat Mar 28 15:01:38 2020 +0000 @@ -9,9 +9,9 @@ // INFO("Stuff to show %d", var); // new-line is automatically appended // #if (defined(DEBUG) && !defined(TARGET_LPC11U24)) -#define INFO(x, ...) std::printf("[INF %s %3d] "x"\r\n", DEBUG, __LINE__, ##__VA_ARGS__); -#define WARN(x, ...) std::printf("[WRN %s %3d] "x"\r\n", DEBUG, __LINE__, ##__VA_ARGS__); -#define ERR(x, ...) std::printf("[ERR %s %3d] "x"\r\n", DEBUG, __LINE__, ##__VA_ARGS__); +#define INFO(x, ...) std::printf("[INF %s %3d] " x "\r\n", DEBUG, __LINE__, ##__VA_ARGS__); +#define WARN(x, ...) std::printf("[WRN %s %3d] " x "\r\n", DEBUG, __LINE__, ##__VA_ARGS__); +#define ERR(x, ...) std::printf("[ERR %s %3d] " x "\r\n", DEBUG, __LINE__, ##__VA_ARGS__); #else #define INFO(x, ...) #define WARN(x, ...) @@ -72,12 +72,15 @@ return noerror; } -RetCode_t TextDisplay::locate(textloc_t column, textloc_t row) +point_t TextDisplay::locate(textloc_t column, textloc_t row) { + point_t oldPt; + + oldPt.x = _column; oldPt.y = _row; INFO("locate(%d,%d)", column, row); _column = column; _row = row; - return noerror; + return oldPt; } int TextDisplay::_getc() @@ -85,18 +88,20 @@ return -1; } -RetCode_t TextDisplay::foreground(uint16_t color) +color_t TextDisplay::foreground(uint16_t color) { + color_t oldColor = _foreground; //INFO("foreground(%4X)", color); _foreground = color; - return noerror; + return oldColor; } -RetCode_t TextDisplay::background(uint16_t color) +color_t TextDisplay::background(uint16_t color) { + color_t oldColor = _background; //INFO("background(%4X)", color); _background = color; - return noerror; + return oldColor; } bool TextDisplay::claim(FILE *stream)