The GT911 is one of the most popular capacitive touch panel controllers in the embedded world. Found in everything from Raspberry Pi touchscreens and DIY handheld gaming consoles to industrial HMIs and automotive displays, its popularity stems from its robust noise immunity, support for up to 5 simultaneous touches, and low cost. However, for engineers and hobbyists alike, the true power of the GT911 lies hidden within its register map .
int gt911_read_touches(gt911_touch_t *touches, int max_touches) uint8_t status = i2c_read_u8(GT911_ADDR, GT911_STATUS); gt911 register map
X = (read_u16(0x8012) << 8) | read_u8(0x8011) ... Wait, careful. Because the GT911 is big-endian: The GT911 is one of the most popular
#define GT911_ADDR 0x5D #define GT911_STATUS 0x8009 #define GT911_TOUCH1 0x8010 typedef struct uint8_t track_id; uint16_t x; uint16_t y; uint16_t size; gt911_touch_t; By mastering registers like 0x8009 for status, 0x8010
return touch_count; The GT911 register map is not just a list of memory locations—it is the control panel for one of the most versatile touch controllers on the market. By mastering registers like 0x8009 for status, 0x8010 for coordinates, 0x8040 for gestures, and the extensive 0x8100 configuration block, you can unlock the full potential of your touch interface.
if (!(status & 0x80)) return 0; // No new data
| Value | Gesture | | :--- | :--- | | 0x00 | No gesture | | 0x01 | Move Up (Swipe from bottom to top) | | 0x02 | Move Right | | 0x03 | Move Left | | 0x04 | Move Down | | 0x05 | Double-Click | | 0x06 | Long Press (Unconfirmed on some firmware) | | 0x07 | Zoom In / Spread | | 0x08 | Zoom Out / Pinch |