// the find
Rahix/avr-hal
embedded-hal abstractions for AVR microcontrollers
A Rust HAL for AVR microcontrollers (ATmega, ATtiny, and Arduino boards), built on top of the embedded-hal traits. It's the go-to choice if you want to write Rust instead of C for Arduino Uno/Nano/Mega projects. Targets developers who know Rust and want to escape the Arduino C++ ecosystem.
The workspace structure is clean — arduino-hal sits on top of atmega-hal/attiny-hal, which sit on top of avr-hal-generic. Writing a driver against avr-hal-generic means it works across all supported chips without changes. ravedude is a genuine quality-of-life win: `cargo run` flashes the board and opens a serial console, which is about as close to the Arduino IDE workflow as you can get without actually using it. The example coverage across boards is solid — Uno alone has 20+ examples covering ADC, SPI, I2C, PWM, EEPROM, interrupts, and watchdog. The project actively maintains a nightly toolchain pin via rust-toolchain.toml, so you're not left chasing a compiler version that stopped working.
Nightly-only is a real tax. AVR support in Rust has been stuck requiring nightly for years and there's no sign that changes soon — your project will break on random nightly regressions and you'll have to wait for fixes upstream. Peripheral coverage has gaps: no DMA, no USB (ironic given the Leonardo and Pro Micro support), and async/embassy integration is absent. If you want to run an async executor on an ATmega, you're largely on your own. ATtiny support is noticeably thinner than ATmega — the attiny-hal has no I2C and limited examples, so anything beyond blinking LEDs on a tiny chip requires dropping down to raw register writes. Stars and community are healthy for a niche, but this is ultimately a one-maintainer project; the bus factor is real.