#hal #io #spi #i2c #delay

dev embedded-hal-mock

A collection of mocked devices that implement the embedded-hal traits

10 releases (6 breaking)

0.7.2 Jun 2, 2020
0.7.1 Jan 3, 2020
0.7.0 May 22, 2019
0.5.0 Jan 7, 2019
0.1.0 Mar 31, 2018

#19 in Embedded development

Download history 237/week @ 2020-12-21 259/week @ 2020-12-28 340/week @ 2021-01-04 474/week @ 2021-01-11 377/week @ 2021-01-18 569/week @ 2021-01-25 446/week @ 2021-02-01 400/week @ 2021-02-08 476/week @ 2021-02-15 451/week @ 2021-02-22 371/week @ 2021-03-01 470/week @ 2021-03-08 386/week @ 2021-03-15 488/week @ 2021-03-22 469/week @ 2021-03-29 521/week @ 2021-04-05

1,663 downloads per month
Used in 83 crates (82 directly)

MIT/Apache

60KB
1K SLoC

embedded-hal-mock

CircleCI Minimum Rust Version Crates.io Version

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.

Dependencies

~82KB