All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Errortraits for Can, SPI, I2C and Serial are implemented for Infallible
- Fixed blanket impl of
DelayUsnot covering thedelay_msmethod.
spi: traits now enforce all impls on the same struct (egTransferandWrite) have the sameErrortype.
digital: traits now enforce all impls on the same struct have the sameErrortype.
serial: traits now enforce all impls on the same struct have the sameErrortype.
i2c: traits now enforce all impls on the same struct have the sameErrortype.
v1.0.0-alpha.6 - 2021-11-19
*** This is (also) an alpha release with breaking changes (sorry) ***
- Use
u8as default SPI as Serial Word type - The Minimum Supported Rust Version (MSRV) is now 1.46.0
- Require all SPI and Serial word types to be
Copy.
- Added
CanController Area Network traits. Errortraits for SPI, I2C and Serial traits. The error types used in those must implement theseErrortraits, 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.
- Removed
DelayMsin favor ofDelayUswithu32as type for clarity.
v1.0.0-alpha.5 - 2021-09-11
*** This is (also) an alpha release with breaking changes (sorry) ***
- Added
IoPintrait for pins that can change between being inputs or outputs dynamically. - Added
Debugto all spi mode types. - Add impls of all traits for references (
&Tor&mut Tdepending on the trait) whenTimplements the trait. - SPI: Added blocking
Readtrait andReadtransactional operation - SPI: Added blocking
Transfertrait with separate buffers (single-bufferTransferhas been renamedTransferInplace)
- Swap PWM channel arguments to references
- All trait methods have been renamed to remove the
try_prefix (i.e.try_send->send) for consistency. - Moved all traits into two sub modules for each feature depending on the execution model:
blockingandnb(non-blocking). For example, the spi traits can now be found underembedded_hal::spi::blockingorembedded_hal::spi::nb. - Execution-model-independent definitions have been moved into the feature module. For example, SPI
Phaseis now defined inembedded_hal::spi::Phase. For convenience, these definitions are reexported in both of its blocking and non-blocking submodules. - Re-export
nb::{block!, Error, Result}to avoid version mismatches. These should be used instead of importing thenbcrate directly in dependent crates. blocking::Serial: renamedbwrite_alltowrite,bflushto `flush.- Removed
preludeto avoid method name conflicts between different flavors (blocking, nb) of the same trait. Traits must now be manually imported. - Removed the various
Defaultmarker traits. - Removed
&[W]returned slice inspi::blocking::Transfer. - Require all associated error types to implement
core::fmt::Debug.
- Removed random number generation (
rng) traits in favor of rand_core.
v1.0.0-alpha.4 - 2020-11-11
- Support for I2C addressing modes in
TransactionalI2C traits.
v1.0.0-alpha.3 - 2020-11-04
TransactionalSPI interface for executing groups of SPI transactions.TransactionalI2C interface for executing groups of I2C transactions.
v1.0.0-alpha.2 - 2020-10-16
*** This is (also) an alpha release with breaking changes (sorry) ***
- 10-bit addressing mode for I2C traits.
try_set_statemethod forOutputPinusing an inputPinStatevalue.
- I2C addressing modes are now selected via an
AddressModetype parameter. The trait features implementations for marker typesSevenBitAddressandTenBitAddress.SevenBitAddressis the default mode so this is not a breaking change. - The method
try_writefrom the traitblocking::i2c::WriteItertrait has been renamedtry_write_iterfor consistency. - Updated
nbdependency to version1. - The watchdog API now uses move semantics. See PR.
- The ADC
Channeltrait now uses a stateful method to get the IDs.
v1.0.0-alpha.1 - 2020-06-16
*** This is an alpha release with breaking changes (sorry) ***
- A nonblocking trait for interfacing with random number generation hardware.
- All traits have been marked as proven (
unprovenfeature has been removed). - All trait methods have been made fallible.
- All trait methods have been renamed
try_*(i.e.try_send) for consistency. - The
Capture,Pwm,PwmPinandQeitraits have been moved into their owncapture,pwmandqeimodules for consistency. - Void has been replaced with
core::convert::Infalliblewhich should be used in trait implementations where methods cannot fail. - A new process has been adopted for the addition of traits to the embedded-hal.
- The ADC
Channeltrait now uses a constant to represent the IDs. - The minimum supported Rust version is 1.35 due to this issue.
v0.2.3 - 2019-05-09
- A new version of the digital
OutputPin,StatefulOutputPin,ToggleableOutputPinandInputPintraits has been added underdigital::v2. These traits are now fallible and their methods now return aResulttype as setting an output pin and reading an input pin could potentially fail. See here for more info. - Compatibility shims between
digital::v1anddigital::v2traits allowing v1 traits to be implicitly promoted to v2, and for v2 traits to be explicitly cast to v1 wrappers.
- The current versions of the
OutputPin,StatefulOutputPin,ToggleableOutputPinandInputPintraits have been marked as deprecated. Please use the new versions included indigital::v2. See here for more info.
v0.2.2 - 2018-11-03
- Added the Rust Code of Conduct to this repository
- The first ADC-related trait. This is a simple trait for one-shot conversions.
- Iterator-based blocking write and write+read traits have been added to I2C and SPI.
- New helper constants for SPI modes.
- A new trait for a cancellable countdown.
- New traits for watchdog timer management, including startup, feeding, and stopping.
- Updated docs to clarify I2C address bit widths and expectations.
v0.2.1 - 2018-05-14
- Auto-generated documentation (docs.rs) now includes the unproven traits.
v0.2.0 - 2018-05-12
- A
ToggeableOutputPintrait has been added. This trait contains a single method:togglethat can be used to toggle the state of a push-pull pin.
- [breaking-change] The signature of
CountDown.waitchanged; it now returnsnb::Result<(), Void>. WhereVoidis the stable alternative to the never type,!, provided by the stablevoidcrate. Implementations of theCountDowntrait 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 traitStatefulOutputPinand renamed tois_set_{low,high}. -
It has been clarified in the documentation that
OutputPinmust 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 inter-operation between HAL implementations and drivers that are using different minor versions.
v0.1.2 - 2018-02-14
- Unproven
blocking::serial::*traits
v0.1.1 - 2018-02-06
- Unproven
digital::InputPintrait
Initial release