Rust on the LilyGo T-Deck

I've been having a lot of fun with this little device called a LilyGo T-Deck. It's built on an ESP32-S3, has a 320x240 touch screen, a funky little track ball, built in wi-fi, and a seriously nostalgia-inducing physical keyboard. I bought the T-Deck about a year ago but because I was sick (with undiagnosed Type 1 Diabetes) and haven't done much with it until the past few weeks.

Whenever I see a little device with wi-fi the first thing I want to do is built a tiny web browser. I might have a problem. Since you can't pay me enough to write C code, I decided to do it in Rust.

Getting the board up and running with Embedded Rust was pretty easy, but I didn't find many docs on accessing the hardware. By scrutinizing the diagram and thanks to the pioneering work by tstellanova I was able to get the display, keyboard, and wi-fi chip working.

Example Code

I'm a big fan of sharing research. After all, the only difference between alchemy and chemistry is showing your work. Sir Isaac Newton was both. Thusly presently I present to you: Rust Tdeck Experiments a set of examples for accessing the core features of the T-Deck. It includes

  • drawing to the display with the embedded-graphics api.
  • getting input from the keyboard, trackball, and touchscreen.
  • scanning for wifi nodes and making an http request.
  • listing files on an SD Card
  • I'm still working on the web browser, and of course a full UI toolkit required to implement it. It's not ready to show yet, but I can let you know I've been able to render CNN and NPR's lite weight mobile sites, even over SSL. Interestingly, TLS support is one of the hardest things to do on embedded systems. I suspect the security algorithms are slow and memory heavy.

    Embedded Rust Evolution

    Overall I'm pretty happy with Embedded Rust. It's fairly verbose but straight forward once you get the hardware configured. In typical Rust fashion, the code never just crashes. If you can get your code to compile then it will run. You can do fearless refactoring and not break anything (which I do frequently). All that said, the ecosystem is still pretty immature. The APIs have changed a lot over the past few years, rendering old code examples useless.

    For ESP32 chips I'm using esp_hal, which is nearing its 1.0 release and stabilizing their APIs. I'm currently using 1.0.0-rc0 and will do my best to keep the examples up to date as the APIs evolve.

    Talk to me about it on Twitter

    Posted August 13th, 2025

    Tagged: rust embedded embeddedrust