#hal #io #spi #i2c #delay

dev embedded-hal-mock

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

11 releases (7 breaking)

0.8.0 Aug 16, 2021
0.7.2 Jun 2, 2020
0.7.1 Jan 3, 2020
0.7.0 May 22, 2019
0.1.0 Mar 31, 2018

#79 in Embedded development

Download history 336/week @ 2022-08-18 277/week @ 2022-08-25 466/week @ 2022-09-01 656/week @ 2022-09-08 353/week @ 2022-09-15 289/week @ 2022-09-22 639/week @ 2022-09-29 757/week @ 2022-10-06 251/week @ 2022-10-13 386/week @ 2022-10-20 697/week @ 2022-10-27 701/week @ 2022-11-03 683/week @ 2022-11-10 624/week @ 2022-11-17 270/week @ 2022-11-24 336/week @ 2022-12-01

2,051 downloads per month
Used in 133 crates (132 directly)

MIT/Apache

65KB
1.5K 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
  • ADC
  • 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

~64KB