Gt911 Register Map -

X = (read_u16(0x8012) << 8) | read_u8(0x8011) ... Wait, careful. Because the GT911 is big-endian:

"Buffer Status". If set to 1, the host should read the touch data. After reading, the host write 0 back to this register to clear the flag. (Point 1 Coordinates): gt911 register map

Poll 0x8101 first. If it returns >0, then read the touch data. X = (read_u16(0x8012) &lt;&lt; 8) | read_u8(0x8011)

Alex immediately stopped what he was doing and joined Rachel in debugging the issue. They started by reviewing the GT911 register map, searching for any clues that might indicate the cause of the problem. After a few minutes of analysis, Alex noticed that one of the configuration registers was not set correctly. If set to 1, the host should read the touch data

Note that this is not an exhaustive list of GT911 registers, but rather a selection of key registers discussed in this article. For a complete list of GT911 registers, refer to the GT911 datasheet or user manual.

// Read the first touch point (7 bytes) uint8_t raw[35]; // Space for up to 5 touches * 7 bytes i2c_read_bytes(GT911_ADDR, GT911_TOUCH1, raw, touch_count * 7);