Coder Social home page Coder Social logo

avsaase / embedded-hal-mock Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dbrgn/embedded-hal-mock

0.0 0.0 0.0 172 KB

Mocks for testing embedded-hal based drivers without hardware access.

Home Page: https://docs.rs/embedded-hal-mock/

License: Apache License 2.0

Rust 100.00%

embedded-hal-mock's Introduction

embedded-hal-mock

GitHub Actions 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.

Docs

Usage

See module-level docs for more information.

embedded_hal version

This crate supports both version 0.x and version 1.x of embedded-hal. By default only support for version 0.x is enabled. To enable support for version 1.x, use the eh1 feature.

Cargo Features

There are currently the following cargo features:

  • eh0: Provide module eh0 that mocks embedded-hal version 0.x (enabled by default)
  • eh1: Provide module eh1 that mocks embedded-hal version 1.x
  • embedded-time: Enable the eh0::timer module (enabled by default)
  • embedded-hal-async: Provide mocks for embedded-hal-async in eh1

no_std

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

Status

  • 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! :)

Minimum Supported Rust Version (MSRV)

This crate is guaranteed to compile on stable Rust 1.63 and up. It might compile with older versions but that may change in any new patch release.

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]
eh0 = { 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.

embedded-hal-mock's People

Contributors

dbrgn avatar ryankurte avatar newam avatar rursprung avatar tommy-gilligan avatar mousius avatar eldruin avatar niclashoyer avatar hdoordt avatar dependabot[bot] avatar regexident avatar geomatsi avatar barafael avatar silvergasp avatar michael-p avatar jasonpeacock avatar mciantyre avatar simonsso avatar dirbaio avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.