(Note: This create currently targets the latest stable version of embedded-hal.
If you're looking for a version that's compatible with the 1.0.0 alpha of
embedded-hal, check out the 1-alpha
branch.)
This is a collection of types that implement the embedded-hal traits.
The implementations never access real hardware. Instead, the hardware is mocked or no-op implementations are used.
The goal of the crate is to be able to test drivers in CI without having access to hardware.
- I²C
- SPI
- No-op delay
- Actual delay
- Serial
- RNG
- I/O pins (including PWM)
- ADC
- Timers (with
embedded-time
Cargo feature) - ...
Pull requests for more mock implementations are welcome! :)
Currently this crate is not no_std
. If you think this is important, let me
know.
See docs.
This crate is guaranteed to compile on stable Rust 1.60 and up. It might compile with older versions but that may change in any new patch release.
If you would like to use the current development version of embedded-hal
(or any other version),
so long as they are API compatible you can use a patch field in your Cargo.toml
file to override
the dependency version.
[patch.crates-io]
embedded-hal = { git = "https://github.com/rust-embedded/embedded-hal" }
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.