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: RA8875_Touch_GSL1680.cpp
- Revision:
- 193:74f80834d59d
- Parent:
- 182:8832d03a2a29
- Child:
- 197:853d08e2fb53
--- a/RA8875_Touch_GSL1680.cpp Fri Oct 18 20:32:23 2019 +0000 +++ b/RA8875_Touch_GSL1680.cpp Mon Nov 25 19:55:17 2019 +0000 @@ -77,8 +77,7 @@ #define INFO(x, ...) std::printf("[INF %s %4d] "x"\r\n", DEBUG, __LINE__, ##__VA_ARGS__); #define WARN(x, ...) std::printf("[WRN %s %4d] "x"\r\n", DEBUG, __LINE__, ##__VA_ARGS__); #define ERR(x, ...) std::printf("[ERR %s %4d] "x"\r\n", DEBUG, __LINE__, ##__VA_ARGS__); -static void HexDump(const char * title, const uint8_t * p, int count) -{ +static void HexDump(const char * title, const uint8_t * p, int count) { int i; char buf[100] = "0000: "; @@ -170,17 +169,15 @@ ptr_fw = GSLX680_FW; source_len = ARRAY_SIZE(GSLX680_FW); for (source_line = 0; source_line < source_len; source_line++) + { /* init page trans, set the page val */ - if (0xf0 == ptr_fw[source_line].offset) - { + if (0xf0 == ptr_fw[source_line].offset) { buf[0] = 0xf0; buf[1] = (uint8_t)(ptr_fw[source_line].val & 0x000000ff); INFO("GSL1680 Firmware set page: %02X", buf[1]); m_i2c->write(m_addr, (char *)buf, 2); - } - else - { + } else { buf[0] = ptr_fw[source_line].offset; buf[1] = (uint8_t)(ptr_fw[source_line].val & 0x000000ff); buf[2] = (uint8_t)((ptr_fw[source_line].val & 0x0000ff00) >> 8); @@ -227,6 +224,7 @@ // [8A] | // [8B] --+ // ... + #define TD_SPACE (4 + 4 * GSL1680_TOUCH_POINTS) if (m_irq->read() == 0) { uint8_t touch_data[TD_SPACE];