no_std Hardware Abstraction Layers for ESP32 microcontrollers
Go to file
Scott Mabin 9064177e99
Initial embassy support (#225)
* wip: timg embassy driver

- read_raw on timg renamed to now()
- timg initialized and stored in static for use in the embassy driver
- timg sets alarm value
- untested whether alarms actually trigger

* TIMG timer driver for esp32, esp32s3

- Adds the timg timer block as a time driver for embassy
- Not enabled on the C3 as it only has one timer block, better to use
  systimer
- s2 example added but can't build due to atomic requirements in
  futures-core

* Add S2 atomic support with emulation, fixup embassy support for the S2

* Move executor & static-cell to dev deps. Make eha optional

* Add c2 support, run fmt

* Update to crates.io embassy releases

* Update eha

* update timg time driver to new trait

* Remove exception feature of esp-backtrace and use the user handler for backtracing

* Add async testing workflow

* Update systick example

* Fix S2 examples

* Update xtensa-toolchain

* set rustflags for s2 target

* Disable systick for esp32s2 until we can fix the noted issues

* review improvements

- Fix intr prio array being off by one
- emabssy time prio interrupt set to max prio
- use cfg instead of feature for systick detection

* Update example time delays
2022-11-09 08:04:38 -08:00
.github/workflows Initial embassy support (#225) 2022-11-09 08:04:38 -08:00
esp32-hal Initial embassy support (#225) 2022-11-09 08:04:38 -08:00
esp32c2-hal Initial embassy support (#225) 2022-11-09 08:04:38 -08:00
esp32c3-hal Initial embassy support (#225) 2022-11-09 08:04:38 -08:00
esp32s2-hal Initial embassy support (#225) 2022-11-09 08:04:38 -08:00
esp32s3-hal Initial embassy support (#225) 2022-11-09 08:04:38 -08:00
esp-hal-common Initial embassy support (#225) 2022-11-09 08:04:38 -08:00
esp-hal-procmacros Update the Cargo manifests and top-level README (#168) 2022-08-25 09:20:05 -07:00
.gitignore Separate TIMG into timer0, (timer1), wdt (#104) 2022-07-20 06:51:39 -07:00
esp-hal.code-workspace Create the esp32c2-hal package and add it to the workspace 2022-10-11 08:03:43 -07:00
LICENSE-APACHE Initial commit 2021-10-19 15:00:41 -07:00
LICENSE-MIT Initial commit 2021-10-19 15:00:41 -07:00
README.md Add the ESP32-C2 to the CI workflow, update README 2022-10-11 10:12:42 -07:00
rustfmt.toml Begin adding some doc comments, update rustfmt config 2022-01-10 15:23:01 -08:00

esp-hal

GitHub Workflow Status MIT/Apache-2.0 licensed Matrix

Hardware Abstraction Layer crates for the ESP32, ESP32-C2, ESP32-C3, ESP32-S2, and ESP32-S3 from Espressif.

These HALs are no_std; if you are looking for std support please use esp-idf-hal instead.

This project is still in the early stages of development, and as such there should be no expectation of API stability. A significant number of peripherals currently have drivers implemented (you can see a full list here) but have varying levels of functionality. For most basic tasks, this should be usable already.

If you have any questions, comments, or concerns please open an issue, start a new discussion, or join us on Matrix. For additional information regarding any of the crates in this repository please refer to the crate's README.

Crate Target Technical Reference Manual
esp32-hal xtensa-esp32-none-elf ESP32
esp32c2-hal riscv32imc-unknown-none-elf
riscv32imac-unknown-none-elf*
ESP32-C2
esp32c3-hal riscv32imc-unknown-none-elf
riscv32imac-unknown-none-elf*
ESP32-C3
esp32s2-hal xtensa-esp32s2-none-elf ESP32-S2
esp32s3-hal xtensa-esp32s3-none-elf ESP32-S3

* via atomic emulation

Quickstart

We recommend using cargo-generate and esp-template in order to generate a new project with all the required dependencies and configuration:

$ cargo install cargo-generate
$ cargo generate --git https://github.com/esp-rs/esp-template

For more information on using this template please refer to its README.

Ancillary Crates

There are a number of other crates within the esp-rs organization which can be used in conjunction with esp-hal:

Crate Description
esp-alloc A simple no_std heap allocator
esp-backtrace Backtrace support for bare-metal applications
esp-storage Implementation of embedded-storage traits to access unencrypted flash memory

MSRV

The Minimum Supported Rust Versions are:

  • 1.60.0 for RISC-V devices (ESP32-C2, ESP32-C3)
  • 1.60.0 for Xtensa devices (ESP32, ESP32-S2, ESP32-S3)

Note that targeting the Xtensa ISA currently requires the use of the esp-rs/rust compiler fork. The esp-rs/rust-build repository has pre-compiled release artifacts for most common platforms, and provides installation scripts to aid you in the process.

RISC-V is officially supported by the official Rust compiler.

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.