#hal #io #spi #i2c #delay

dev embedded-hal-mock

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

9 releases (breaking)

✓ Uses Rust 2018 edition

0.7.1 Jan 3, 2020
0.7.0 May 22, 2019
0.6.0 May 10, 2019
0.5.0 Jan 7, 2019
0.1.0 Mar 31, 2018

#8 in Embedded development

Download history 170/week @ 2019-12-02 132/week @ 2019-12-09 74/week @ 2019-12-16 92/week @ 2019-12-23 164/week @ 2019-12-30 52/week @ 2020-01-06 152/week @ 2020-01-13 185/week @ 2020-01-20 153/week @ 2020-01-27 189/week @ 2020-02-03 143/week @ 2020-02-10 103/week @ 2020-02-17 198/week @ 2020-02-24 141/week @ 2020-03-02 183/week @ 2020-03-09 120/week @ 2020-03-16

440 downloads per month
Used in 46 crates

MIT/Apache

55KB
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

~95KB