Skip to content
forked from esp-rs/esp-hal

no_std Hardware Abstraction Layers for ESP32 microcontrollers

License

Notifications You must be signed in to change notification settings

ptpaterson/esp-hal

 
 

Repository files navigation

esp-hal

GitHub Workflow Status MIT/Apache-2.0 licensed Matrix

Hardware Abstraction Layer crates for the ESP32, ESP32-C2/C3/C6, ESP32-H2, ESP32-P4, and ESP32-S2/S3 from Espressif. Additionally provides support for programming the low-power RISC-V cores found on the ESP32-C6 and ESP32-S2/S3.

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

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 relevant crate's README.

Note

This project is still in the relatively early stages of development, and as such there should be no expectation of API stability. A significant number of peripherals currently have drivers implemented but have varying levels of functionality. For most basic tasks, this should be usable already, however some more advanced or uncommon features may not yet be implemented.

Getting Started

For information relating to the development of Rust applications on ESP devices, please first read The Rust on ESP Book.

For information about the HAL and how to use it in your own projects, please refer to the documentation on docs.rs for the relevant chip.

Resources

Crates

Implements number of the traits defined in embedded-hal for various ESP devices. Full list of currently supported devices with basic information is in the table below.

Feature Technical Reference Manual Target MSRV
esp32 ESP32 xtensa-esp32-none-elf esp
esp32c2 ESP32-C2 riscv32imc-unknown-none-elf stable
esp32c3 ESP32-C3 riscv32imc-unknown-none-elf stable
esp32c6 ESP32-C6 riscv32imac-unknown-none-elf stable
esp32h2 ESP32-H2 riscv32imac-unknown-none-elf stable
esp32p4 ESP32-P4 riscv32imafc-unknown-none-elf stable
esp32s2 ESP32-S2 xtensa-esp32s2-none-elf esp
esp32s3 ESP32-S3 xtensa-esp32s3-none-elf esp

Implements a number of the traits defined in embedded-hal for the low-power (lp) RISC-V coprocessors found on the ESP32-C6, ESP32-S2, and ESP32-S3 from Espressif. The main idea is to have code running on lp core and putting the main core into sleep, making it more power-efficient.

Crate Documentation Targets
esp-lp-hal N/A (Not yet published) riscv32imc-unknown-none-elf, riscv32imac-unknown-none-elf

Procedural macros for use with the esp-hal family of HAL packages.

Minimal runtime / startup for RISC-V CPUs from Espressif.

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-openthread A bare-metal Thread implementation using esp-ieee802154
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/BLE/ESP-NOW support

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 copying it in to 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.

About

no_std Hardware Abstraction Layers for ESP32 microcontrollers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 99.8%
  • Other 0.2%