no_std Hardware Abstraction Layers for ESP32 microcontrollers
Go to file
liebman 37466fd9c7
deep sleep api for esp32 (#574)
* deep sleep api for esp32

* move to list of wakeup sources

* improve Ext0WakeupSource - still WIP

* add deep sleep with timer wakeup example
add Ext0 wakeup source (WIP/Non-working)

* removed alloc (using heapless now)

* Sleep: ext0 wakeup working

* add sleep_timer_ext0 example

* API change: move sleep into RTC as sleep, sleep_deep, sleep_light

* fix sleep examples for new API

* sleep only implemented for esp32 at this time

* sleep only implemented for esp32 at this time

* Implement a simple RTCPin trait to support sleep

* implement RTCPin for all xtensa SOC

* cargo fmt & update changelog

* fix change log order (accidentally swaped during rebase)

* implement Drop for Ext0WakeupSource

* added Ext1 wakeup source

* cargo fmt

* healpess was unused, removed

* fix pase macro usage
2023-07-14 15:44:13 +00:00
.github Create issue_handler.yml 2023-06-22 05:37:24 -07:00
esp32-hal deep sleep api for esp32 (#574) 2023-07-14 15:44:13 +00:00
esp32c2-hal Use latest published release of embassy-time 2023-07-06 07:16:24 -07:00
esp32c3-hal Remove the allow-opt-level-z feature from esp32c3-hal (#654) 2023-07-14 10:30:56 +01:00
esp32c6-hal Add basic LP_IO support (#639) 2023-07-07 10:08:52 +02:00
esp32h2-hal Use latest published release of embassy-time 2023-07-06 07:16:24 -07:00
esp32s2-hal Use latest published release of embassy-time 2023-07-06 07:16:24 -07:00
esp32s3-hal Use latest published release of embassy-time 2023-07-06 07:16:24 -07:00
esp-hal-common deep sleep api for esp32 (#574) 2023-07-14 15:44:13 +00:00
esp-hal-procmacros New package releases 2023-07-04 10:57:06 -07:00
esp-hal-smartled New package releases 2023-07-04 10:57:06 -07:00
esp-riscv-rt Move esp-riscv-rt into esp-hal (#578) 2023-06-07 08:15:47 -07:00
.gitattributes Set merge=union git attribute for CHANGELOG.md 2023-07-12 09:24:09 -07:00
.gitignore move rwtext after other RAM data sections (#464) 2023-03-31 14:27:53 +01:00
CHANGELOG.md deep sleep api for esp32 (#574) 2023-07-14 15:44:13 +00:00
esp-hal.code-workspace Assorted small fixes and improvements (#635) 2023-07-04 10:41:32 -07:00
LICENSE-APACHE
LICENSE-MIT
pre-commit Improve the pre-commit hook 2023-05-11 08:53:03 -07:00
README.md docs: Add H2 TRM 2023-07-05 10:31:44 +02:00
rustfmt.toml

esp-hal

GitHub Workflow Status MIT/Apache-2.0 licensed Matrix

Hardware Abstraction Layer crates for the ESP32, ESP32-C2/C3/C6, ESP32-H2, and ESP32-S2/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 ESP32-C2
esp32c3-hal riscv32imc-unknown-none-elf ESP32-C3
esp32c6-hal riscv32imac-unknown-none-elf ESP32-C6
esp32h2-hal riscv32imac-unknown-none-elf ESP32-H2
esp32s2-hal xtensa-esp32s2-none-elf ESP32-S2
esp32s3-hal xtensa-esp32s3-none-elf ESP32-S3

Quickstart

If you have not already, we strongly encourage you to read The Rust on ESP Book prior to starting.

We recommend using cargo-generate and esp-template in order to generate a new project. This will allow you to generate a minimal project skeleton with all the required dependencies and configuration ready to go.

You can install cargo-generate and generate a new project by running:

$ cargo install cargo-generate
$ cargo generate -a 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-ieee802154 Low-level IEEE802.15.4 driver for the ESP32-C6 and ESP32-H2
esp-println Provides print! and println! implementations
esp-storage Implementation of embedded-storage traits to access unencrypted flash memory
esp-wifi no_std Wi-Fi/Bluetooth LE support

MSRV

The Minimum Supported Rust Versions are:

  • 1.65.0 for RISC-V devices (ESP32-C2, ESP32-C3, ESP32-C6, ESP32-H2)
  • 1.65.0 for Xtensa devices (ESP32, ESP32-S2, ESP32-S3)
  • 1.67.0 for all async examples (embassy_hello_world, embassy_wait, etc.)

Note that targeting the Xtensa ISA currently requires the use of the esp-rs/rust compiler fork. Our recommend method of installation is espup.

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

Git Hooks

We provide a simple pre-commit hook to verify the formatting of each package prior to committing changes. We strongly encourage use of this git hook.

The hook can be enabled by placing it in the .git/hooks/ directory:

$ cp pre-commit .git/hooks/pre-commit

When using this hook, you can choose to ignore its failure on a per-commit basis by committing with the --no-verify flag; however, you will need to be sure that all packages are formatted when submitting a pull request.

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.