// the find
rust-embedded/embedded-hal
A Hardware Abstraction Layer (HAL) for embedded systems
The de facto standard trait library for platform-agnostic embedded Rust drivers. You write a driver against embedded-hal traits once, and it works on any microcontroller that implements those traits — STM32, nRF, AVR, RISC-V, embedded Linux, whatever. v1.0 finally shipped after years of 0.2.x being the slightly-wrong-but-everywhere version.
The trait split across blocking/async/nb is well thought out — you pick the execution model that fits your constraints rather than being forced into one. The embedded-hal-bus crate solves the shared SPI/I2C bus problem properly with multiple strategies (RefCell, CriticalSection, Mutex, Rc) instead of leaving every driver to reinvent it badly. The v0.2→v1.0 migration guide is thorough and honest about the breaking changes. The ecosystem payoff is real: a driver written against these traits today can run on dozens of MCU families without modification.
GPIO interrupts are conspicuously absent from the trait surface — you still have to drop to platform-specific code the moment you need an edge-triggered callback, which is almost every real embedded project. The nb (non-blocking poll) approach in embedded-hal-nb is awkward in practice; the async version is cleaner but requires an async executor which adds complexity on bare-metal targets. PWM traits cover basic duty cycle but nothing for complementary outputs, dead-time insertion, or center-aligned modes that motor control actually needs. The 'write a driver once, run anywhere' promise also depends entirely on HAL implementors doing it correctly — and the quality varies wildly across chip families.