GithubHelp home page GithubHelp logo

qomo / embedded-hal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rust-embedded/embedded-hal

0.0 0.0 0.0 1.09 MB

A Hardware Abstraction Layer (HAL) for embedded systems

License: Apache License 2.0

Rust 100.00%

embedded-hal's Introduction

crates.io crates.io Documentation Minimum Supported Rust Version

embedded-hal

A Hardware Abstraction Layer (HAL) for embedded systems

This project is developed and maintained by the HAL team.

Scope

embedded-hal serves as a foundation for building an ecosystem of platform agnostic drivers. (driver meaning library crates that let a target platform interface an external device like a digital sensor or a wireless transceiver).

The advantage of this system is that by writing the driver as a generic library on top of embedded-hal driver authors can support any number of target platforms (e.g. Cortex-M microcontrollers, AVR microcontrollers, embedded Linux, etc.).

The advantage for application developers is that by adopting embedded-hal they can unlock all these drivers for their platform.

embedded-hal is not tied to a specific execution model like blocking or non-blocking.

For functionality that goes beyond what is provided by embedded-hal, users are encouraged to use the target platform directly. Abstractions of common functionality can be proposed to be included into embedded-hal as described below, though.

See more about the design goals in this documentation section.

Releases

At the moment we are working towards a 1.0.0 release (see #177). During this process we will release alpha versions like 1.0.0-alpha.1 and 1.0.0-alpha.2. Alpha releases are not guaranteed to be compatible with each other. They are provided as early previews for community testing and preparation for the final release. If you use an alpha release, we recommend you choose an exact version specification in your Cargo.toml like: embedded-hal = "=1.0.0-alpha.2"

See below for a way to implement both an embedded-hal 0.2.x version and an -alpha version side by side in a HAL.

How-to: add a new trait

This is the suggested approach to adding a new trait to embedded-hal

Research / Discussion

Ideally, before proposing a new trait, or set of traits, you should check for an existing issue suggesting the need for the trait, as well as any related works / use cases / requirements that are useful to consider in the design of the trait.

These issues will be labeled as discussion in the issue tracker.

Implementation / Demonstration

Proposed traits should then be implemented and demonstrated, either by forking embedded-hal or by creating a new crate with the intent of integrating this into embedded-hal once the traits have stabilized. You may find cargo workspaces and patch useful for the forking approach.

Traits should be demonstrated with at least two implementations on different platforms and one generic driver built on the trait. Where it is possible we suggest an implementation on a microcontroller, and implementation for linux, and a driver (or drivers where requirements are more complex) with bounds using the trait.

Proposing a trait

Once the trait has been demonstrated a PR should be opened to merge the new trait(s) into embedded-hal. This should include a link to the previous discussion issue.

If there is determined to be more than one alternative then there should be further discussion to try to single out the best option. Once there is consensus this will be merged into the embedded-hal repository.

These issues / PRs will be labeled as proposals in the issue tracker.

Implementations and drivers

For a list of embedded-hal implementations and driver crates check the awesome-embedded-rust list.

Supporting different (alpha and non-alpha) HALs

embedded-hal-compat provides shims to support interoperability between the latest 0.2.x and 1.0.0-alpha.N HALs, allowing one to use incompatible HAL components (generally) without alteration. See the docs for examples.

It is also possible for HAL implementations to support both the latest 0.2.x and 1.0.0-alpha.N versions side by side, for an example see LPC8xx HAL.

Note that embedded-hal -alpha versions are a moving target and not guaranteed to be compatible. Because of this we only aim to support the latest -alpha.

Minimum Supported Rust Version (MSRV)

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

License

Licensed under either of

at your option.

Contribution

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.

Code of Conduct

Contribution to this crate is organized under the terms of the Rust Code of Conduct, the maintainer of this crate, the HAL team, promises to intervene to uphold that code of conduct.

embedded-hal's People

Contributors

bors[bot] avatar eldruin avatar japaric avatar ryankurte avatar hannobraun avatar therealprof avatar dirbaio avatar timokroeger avatar grantm11235 avatar no111u3 avatar homunkulus avatar david-sawatzke avatar disasm avatar astro avatar burrbull avatar thejpster avatar nils-van-zuijlen avatar sh3rm4n avatar lachlansneff avatar luojia65 avatar chrysn avatar dkm avatar jonas-schievink avatar jannic avatar yodaldevoid avatar dbrgn avatar almindor avatar austinbes avatar thenewwazoo avatar randominsano 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.