This is the David Smart RA8875 Library with mods for working with FRDM-K64F
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];