|
1 | 1 | # `embedded-hal`
|
2 | 2 |
|
3 |
| -The [`embedded-hal`](https://crates.io/crates/embedded-hal) crate provides a |
4 |
| -number of traits covering common microcontroller peripherals. |
| 3 | +The [`embedded-hal`] crate provides a number of traits covering common |
| 4 | +microcontroller peripherals: |
5 | 5 |
|
6 | 6 | - GPIO
|
7 |
| -- ADC |
8 |
| -- I2C, SPI, UART, CAN |
9 |
| -- RNG |
10 |
| -- Timers |
11 |
| -- Watchdogs |
| 7 | +- PWM |
| 8 | +- Delay timers |
| 9 | +- I2C and SPI buses and devices |
12 | 10 |
|
13 |
| -Other crates then implement |
14 |
| -[drivers](https://github.com/rust-embedded/awesome-embedded-rust#driver-crates) |
15 |
| -in terms of these traits, e.g. an accelerometer driver might need an I2C or SPI |
16 |
| -bus implementation. |
| 11 | +Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken out |
| 12 | +into [`embedded-io`], [`embedded-can`] and [`rand_core`] respectively. |
| 13 | + |
| 14 | +Other crates then implement [drivers] in terms of these traits, e.g. an |
| 15 | +accelerometer driver might need an I2C or SPI device instance. |
17 | 16 |
|
18 | 17 | <details>
|
19 | 18 |
|
| 19 | +- The traits cover using the peripherals but not initialising or configuring |
| 20 | + them, as initialisation and configuration is usually highly platform-specific. |
20 | 21 | - There are implementations for many microcontrollers, as well as other
|
21 | 22 | platforms such as Linux on Raspberry Pi.
|
22 |
| -- There is work in progress on an `async` version of `embedded-hal`, but it |
23 |
| - isn't stable yet. |
| 23 | +- [`embedded-hal-async`] provides async versions of the traits. |
| 24 | +- [`embedded-hal-nb`] provides another approach to non-blocking I/O, based on |
| 25 | + the [`nb`] crate. |
24 | 26 |
|
25 | 27 | </details>
|
| 28 | + |
| 29 | +[drivers]: https://github.com/rust-embedded/awesome-embedded-rust#driver-crates |
| 30 | +[`embedded-can`]: https://crates.io/crates/embedded-can |
| 31 | +[`embedded-hal`]: https://crates.io/crates/embedded-hal |
| 32 | +[`embedded-hal-async`]: https://crates.io/crates/embedded-hal-async |
| 33 | +[`embedded-hal-nb`]: https://crates.io/crates/embedded-hal-nb |
| 34 | +[`embedded-io`]: https://crates.io/crates/embedded-io |
| 35 | +[`nb`]: https://crates.io/crates/nb |
| 36 | +[`rand_core`]: https://crates.io/crates/rand_core |
0 commit comments