NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #1712 most downloaded on crates.io
A Hardware Abstraction Layer (HAL) for embedded systems
Last release 3 years ago
no release in 18 months
Ships fairly regularly
a new release about every 2 months
Most releases are documented
notes for 9 of 13 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
28 releases · first in 2018
Check out the announcement blog post and the migration guide .
Check out the announcement blog post and the migration guide.
Changes since v1.0.0-rc.3:
ToggleableOutputPin, move toggle() to StatefulOutputPin.Check out the announcement blog post and the migration guide for help with migrating from v0.2 to v1.0.
ToggleableOutputPin, move toggle() to StatefulOutputPin.One column per quarter.
gpio: require &mut self in InputPin and StatefulOutputPin.
&mut self in InputPin and StatefulOutputPin.Add #[inline] hints to most of embedded-hal functions.
embedded-hal functions.get_max_duty_cycle to max_duty_cycle.DelayUs to DelayNsDelayNs::delay_ns()delay_ms and delay_us based on delay_ns.delay_ms more efficient, it now does less calls to the underlying delay_ns (previously delay_us).Operation::DelayUs to Operation::DelayNs, with nanosecond precision.The Minimum Supported Rust Version (MSRV) is now 1.60.0
defmt 0.3 support.embedded-io crate.+ ?Sized to all blanket impls.* This is (also) an alpha release with breaking changes (sorry) *
*** This is (also) an alpha release with breaking changes (sorry) ***
Operation::DelayUs(u32).* This is (also) an alpha release with breaking changes (sorry) *
*** This is (also) an alpha release with breaking changes (sorry) ***
pwm::SetDutyCycle trait.ErrorKind enum for consistency with other traits and for future extensibility. No kinds are defined for now._iter() methods.transaction().* This is (also) an alpha release with breaking changes (sorry) *
*** This is (also) an alpha release with breaking changes (sorry) ***
embedded-hal crate now contains blocking traits only. Import paths no longer contain ::blocking.PartialOrd, Ord, Hash for can::StandardId, can::ExtendedId and can::Id according to CAN bus arbitration rulesEq for i2c::OperationPartialOrd, Ord, Hash for can::StandardId, can::ExtendedId and can::Id according to CAN bus arbitration rules.wait_for_rising_edge.digital::blocking::IoPin traits. See: #340, #397.nb traits are now available in a separate embedded-hal-nb crate.spi::blocking::ExclusiveDevice and spi::blocking::ExclusiveDeviceError. These have been moved to a separate embedded-hal-bus crate.embedded-can crate.* This is (also) an alpha release with breaking changes (sorry) *
*** This is (also) an alpha release with breaking changes (sorry) ***
spi: unify all traits into SpiReadBus, SpiWriteBus and SpiBus (read-write).spi: Add SpiDevice trait to represent a single device in a (possibly shared) bus, with managed chip-select (CS) pin.spi: Clarify that implementations are allowed to return before operations are finished, add flush to wait until finished.adc::nb::OneShot and adc::nb::Channel.* This is (also) an alpha release with breaking changes (sorry) *
*** This is (also) an alpha release with breaking changes (sorry) ***
Error traits for CAN, SPI, I2C and Serial are implemented for Infallible.DelayUs not covering the delay_ms method.spi: traits now enforce all impls on the same struct (e.g. Transfer and Write) have the same Error type.digital: traits now enforce all impls on the same struct have the same Error type.serial: traits now enforce all impls on the same struct have the same Error type.i2c: traits now enforce all impls on the same struct have the same Error type.i2c: unify all traits into a single I2c trait.* This is (also) an alpha release with breaking changes (sorry) *
*** This is (also) an alpha release with breaking changes (sorry) ***
u8 as default SPI as Serial Word typeCopy.Can Controller Area Network traits.Error traits for SPI, I2C and Serial traits. The error types used in those must
implement these Error traits, which implies providing a conversion to a common
set of error kinds. Generic drivers using these interfaces can then convert the errors
to this common set to act upon them.DelayMs in favor of DelayUs with u32 as type for clarity.* This is (also) an alpha release with breaking changes (sorry) *
*** This is (also) an alpha release with breaking changes (sorry) ***
IoPin trait for pins that can change between being inputs or outputs
dynamically.Debug to all spi mode types.&T or &mut T depending on the trait) when T implements the trait.Read trait and Read transactional operationTransfer trait with separate buffers (single-buffer Transfer has been renamed TransferInplace)try_ prefix (i.e. try_send -> send) for consistency.blocking and nb (non-blocking). For example, the spi traits can now be found under embedded_hal::spi::blocking or embedded_hal::spi::nb.Phase is now defined in embedded_hal::spi::Phase. For convenience, these definitions are reexported in both of its blocking and non-blocking submodules.nb::{block!, Error, Result} to avoid version mismatches. These should be used instead of
importing the nb crate directly in dependent crates.blocking::Serial: renamed bwrite_all to write, bflush to `flush.prelude to avoid method name conflicts between different flavors (blocking, nb) of the same trait. Traits must now be manually imported.Default marker traits.&[W] returned slice in spi::blocking::Transfer.core::fmt::Debug.rng) traits in favor of rand_core.Support for I2C addressing modes in Transactional I2C traits.
Transactional I2C traits.Transactional SPI interface for executing groups of SPI transactions.
Transactional SPI interface for executing groups of SPI transactions.Transactional I2C interface for executing groups of I2C transactions.* This is (also) an alpha release with breaking changes (sorry) *
*** This is (also) an alpha release with breaking changes (sorry) ***
try_set_state method for OutputPin using an input PinState value.AddressMode type parameter.
The trait features implementations for marker types SevenBitAddress and
TenBitAddress. SevenBitAddress is the default mode so this is not a
breaking change.try_write from the trait blocking::i2c::WriteIter trait
has been renamed try_write_iter for consistency.nb dependency to version 1.Channel trait now uses a stateful method to get the IDs.* This is an alpha release with breaking changes (sorry) *
*** This is an alpha release with breaking changes (sorry) ***
unproven feature has been removed).try_* (i.e. try_send) for consistency.Capture, Pwm, PwmPin and Qei traits have been moved into their own
capture, pwm and qei modules for consistency.core::convert::Infallible which should be used
in trait implementations where methods cannot fail.Channel trait now uses a constant to represent the IDs.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
The current versions of the OutputPin, StatefulOutputPin, ToggleableOutputPin and InputPin traits have been marked as deprecated. Please use the new v…
OutputPin, StatefulOutputPin, ToggleableOutputPin
and InputPin traits has been added under digital::v2. These traits are now
fallible and their methods now return a Result type as setting an output pin
and reading an input pin could potentially fail.
See here for more info.digital::v1 and digital::v2 traits allowing v1 traits
to be implicitly promoted to v2, and for v2 traits to be explicitly cast to v1 wrappers.OutputPin, StatefulOutputPin, ToggleableOutputPin
and InputPin traits have been marked as deprecated. Please use the new versions
included in digital::v2.
See here for more info.Nothing published for this version
Added the Rust Code of Conduct to this repository
Auto-generated documentation (docs.rs) now includes the unproven traits.
A ToggeableOutputPin trait has been added. This trait contains a single method: toggle that can be used to toggle the state of a push-pull pin.
ToggeableOutputPin trait has been added. This trait contains a single method: toggle that
can be used to toggle the state of a push-pull pin.CountDown.wait changed; it now returns nb::Result<(), Void>. Where Void is the stable alternative to the never type, !, provided by the stable
void crate. Implementations of the CountDown trait will have to be updated to use the new
signature. With this change this crate compiles on the stable and beta channels.[breaking-change] the OutputPin.is_{low,high} methods have been moved into its own trait
StatefulOutputPin and renamed to is_set_{low,high}.
It has been clarified in the documentation that OutputPin must be implemented for push-pull
output pins (and e.g. not for open drain output pins).
Re-export most / unchanged traits from embedded-hal v0.2.x to allow interoperation between HAL implementations and drivers that are using different mi
### Added - Unproven blocking::* traits
blocking::serial::* traitsUnproven digital::InputPin trait
digital::InputPin trait[Unreleased]: https://github.com/rust-embedded/embedded-hal/compare/v1.0.0...HEAD [v1.0.0]: https://github.com/rust-embedded/embedded-hal/compare/v1.0
Initial release
Your coding agent can read these notes before it upgrades. Set up the MCP server →