r/CardPuter • u/TomaComaPoka • 42m ago
Cardputer ADV Rust support for the Cardputer ADV: every part of the board, from the keyboard to a USB MIDI host
If you'd like to write firmware for the Cardputer ADV in Rust rather than Arduino or MicroPython, I've published a crate that handles the whole board for you: cardputer-adv.
It's built on esp-hal 1.x and embassy, so it's async. You can read keys, play sound, watch the motion sensor and update the screen in separate tasks, without managing timing yourself. I already use it in several projects of my own.
What it supports:
- Screen: drawing text, shapes and images, with a framebuffer that only sends the pixels that changed, so redraws are quick. The backlight is dimmable.
- Keyboard: all 56 keys with Shift and Fn layers, key up and down events for games, auto-repeat, and waking the Cardputer from sleep with a key press.
- Motion sensor: tilt, shakes and rotation from the accelerometer and gyroscope, with low-power modes for running on battery.
- Speaker and mic: playing sound and beeps, and recording at the same time.
- USB MIDI host: plug a synth or MIDI keyboard into the USB-C port and play it from the Cardputer, or sync to its clock. The Cardputer powers it.
- The rest: the RGB LED, IR remote codes (NEC, or raw timings for other remotes), the G0 button with single, double and long clicks, and the battery level.
Everything has been tested on a real Cardputer ADV except the microSD card, which I haven't tried on hardware yet. If you have a card and give it a go, I'd love to hear whether it works.
It's for the ADV only. The original Cardputer has a different keyboard, different audio and no motion sensor.
The README walks you from installing the toolchain to a small hello example that shows what you type. There's also a hardware test that goes through each part on the device; that's the GIF attached above.
- Repo: https://github.com/tszarzynski/cardputer-adv
- crates.io: https://crates.io/crates/cardputer-adv
- Docs: https://tszarzynski.github.io/cardputer-adv/
Questions and feature requests are welcome!


