GT911 Touchscreen Driver
A Rust driver for the Goodix GT911 touch screen device
Supports both blocking and async modes of operation and up to 5 touch points. The GT911 supports triggering an interrupt for touch events but this driver has not yet implemented that functionality. Therefore the examples below are for polling the state of the device (usually done for every rendered frame). The driver is stateless so it is up to the user to keep track of touch points in order to figure out what is pressed and released. See full example at the end.
Examples
Single-touch async poll example
let touch = default;
touch.init.await.unwrap;
if let Ok = touch.get_touch.await else
Muiti-touch async poll example
let touch = default;
touch.init.await.unwrap;
if let Ok = touch.get_multi_touch.await
Single-touch blocking poll example
let touch = default;
touch.init.unwrap;
if let Ok = touch.get_touch
Muiti-touch blocking exapoll examplemple
let touch = default;
touch.init.unwrap;
if let Ok = touch.get_multi_touch
Full single touch async poll example using Embassy and an stm32u5g9j-dk2
use ;
bind_interrupts!;
async