Skip to content

Commit 8940cfd

Browse files
bors[bot]eldruin
andauthored
Merge #294
294: Add project scope to readme + document fallibility r=ryankurte a=eldruin This replaces #293 Closes #293 Co-authored-by: Diego Barrios Romero <[email protected]>
2 parents 113cb81 + b76e87c commit 8940cfd

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,27 @@ This project is developed and maintained by the [HAL team][team].
1313

1414
[API reference]: https://docs.rs/embedded-hal
1515

16+
## Scope
17+
18+
`embedded-hal` serves as a foundation for building an ecosystem of platform agnostic drivers.
19+
(driver meaning library crates that let a target platform interface an external device like a digital
20+
sensor or a wireless transceiver).
21+
22+
The advantage of this system is that by writing the driver as a generic library on top
23+
of `embedded-hal` driver authors can support any number of target
24+
platforms (e.g. Cortex-M microcontrollers, AVR microcontrollers, embedded Linux, etc.).
25+
26+
The advantage for application developers is that by adopting `embedded-hal` they can unlock all
27+
these drivers for their platform.
28+
29+
`embedded-hal` is not tied to a specific execution model like blocking or non-blocking.
30+
31+
For functionality that goes beyond what is provided by `embedded-hal`, users are encouraged
32+
to use the target platform directly. Abstractions of common functionality can be proposed to be
33+
included into `embedded-hal` as described [below](#how-to-add-a-new-trait), though.
34+
35+
See more about the design goals in [this documentation section](https://docs.rs/embedded-hal/latest/embedded_hal/#design-goals).
36+
1637
## Releases
1738

1839
At the moment we are working towards a `1.0.0` release (see [#177]). During this process we will

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
//! advantage for application developers is that by adopting `embedded-hal` they can unlock all
3535
//! these drivers for their platform.
3636
//!
37+
//! - Trait methods must be fallible so that they can be used in any possible situation.
38+
//! Nevertheless, HAL implementations can additionally provide infallible versions of the same methods
39+
//! if they can never fail in their platform. This way, generic code can use the fallible abstractions
40+
//! provided here but platform-specific code can avoid fallibility-related boilerplate if possible.
41+
//!
3742
//! # Out of scope
3843
//!
3944
//! - Initialization and configuration stuff like "ensure this serial interface and that SPI

0 commit comments

Comments
 (0)