Mocks for testing embedded-hal based drivers without hardware access.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
src
.gitignore
.rustfmt.toml
CHANGELOG.md
CONTRIBUTING.md
Cargo.toml
LICENSE-APACHE
LICENSE-MIT
README.md
RELEASING.md

README.md

embedded-hal-mock

CircleCI

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.

This crate requires Rust 1.31+!

Docs

Status

  • I²C
  • SPI
  • No-op delay
  • Actual delay
  • Serial
  • RNG
  • I/O pins
  • Timers
  • ...

Pull requests for more mock implementations are welcome! :)

no_std

Currently this crate is not no_std. If you think this is important, let me know.

Usage

See docs.

Development Version of embedded-hal

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" }

License

Licensed under either of

Contributing

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.