esp-hal 1.2.0

Bare-metal HAL for Espressif devices
Documentation

esp-hal

Crates.io docs.rs MSRV Crates.io Matrix

Bare-metal (no_std) hardware abstraction layer for Espressif devices.

Implements a number of blocking and, where applicable, async traits from the various packages in the embedded-hal repository.

For help getting started with this HAL, please refer to The Rust on ESP Book and the documentation.

Documentation

Supported Devices

Chip Documentation Target Note
ESP32 Datasheet TRM xtensa-esp32-none-elf Revisions below v3.0 are not supported.
ESP32-C2 Datasheet TRM riscv32imc-unknown-none-elf
ESP32-C3 Datasheet TRM riscv32imc-unknown-none-elf
ESP32-C5 Datasheet TRM riscv32imac-unknown-none-elf
ESP32-C6 Datasheet TRM riscv32imac-unknown-none-elf
ESP32-C61 Datasheet TRM riscv32imac-unknown-none-elf
ESP32-H2 Datasheet TRM riscv32imac-unknown-none-elf
ESP32-P4 Datasheet TRM riscv32imafc-unknown-none-elf Revisions below v3.0 are not supported.
ESP32-S2 Datasheet TRM xtensa-esp32s2-none-elf
ESP32-S3 Datasheet TRM xtensa-esp32s3-none-elf
ESP32-S31 Datasheet TRM riscv32imafc-unknown-none-elf In early stages of development.

Peripheral support

  • Empty cell: Not available
  • ❌: Not supported
  • ⚒️: Partial support
  • ✔️: Supported

GPIO

Driver ESP32 ESP32-C2 ESP32-C3 ESP32-C5 ESP32-C6 ESP32-C61 ESP32-H2 ESP32-P4 ESP32-S2 ESP32-S3 ESP32-S31
GPIO ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Dedicated GPIO ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️
IOMUX ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️
LP IO ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️

Serial interfaces

Driver ESP32 ESP32-C2 ESP32-C3 ESP32-C5 ESP32-C6 ESP32-C61 ESP32-H2 ESP32-P4 ESP32-S2 ESP32-S3 ESP32-S31
UART ✔️ [^1] ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
LP UART [^1] ⚒️
UHCI ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️
I2C master ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
LP I2C master ⚒️ ⚒️ ⚒️ ⚒️
I2C slave [^1] ⚒️ [^1] ⚒️ [^1] [^1] [^1] [^1]
I3C master
I3C slave
SPI master ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
SPI slave ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️
LP SPI master
LP SPI slave
I2S ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️
LP I2S
PARL_IO ⚒️ ⚒️ ⚒️
RMT ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️
SDMMC/SDIO host ⚒️ ⚒️ ⚒️ ⚒️
SDIO slave [^1] [^1]
TWAI ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️
CANFD [^1]
USB OTG FS ⚒️ ⚒️ ⚒️
USB OTG HS ⚒️ ⚒️
USB Serial/JTAG ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️

Wireless and networking

Driver ESP32 ESP32-C2 ESP32-C3 ESP32-C5 ESP32-C6 ESP32-C61 ESP32-H2 ESP32-P4 ESP32-S2 ESP32-S3 ESP32-S31
Bluetooth ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️
WIFI ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️
IEEE 802.15.4 ⚒️ ⚒️ ⚒️
Ethernet ⚒️ ⚒️

Display and camera

Driver ESP32 ESP32-C2 ESP32-C3 ESP32-C5 ESP32-C6 ESP32-C61 ESP32-H2 ESP32-P4 ESP32-S2 ESP32-S3 ESP32-S31
Camera interface ⚒️
MIPI-CSI
MIPI-DSI ⚒️
RGB display ⚒️ ⚒️
SPI LCD interface [^1]

Signal processing

Driver ESP32 ESP32-C2 ESP32-C3 ESP32-C5 ESP32-C6 ESP32-C61 ESP32-H2 ESP32-P4 ESP32-S2 ESP32-S3 ESP32-S31
Bit Scrambler [^1]
Image Signal Processor
Pixel Processing Accelerator
JPEG Codec
H.264 encoder
Audio Sample Rate Converter
CORDIC accelerator
Voice Activity Detection

Analog

Driver ESP32 ESP32-C2 ESP32-C3 ESP32-C5 ESP32-C6 ESP32-C61 ESP32-H2 ESP32-P4 ESP32-S2 ESP32-S3 ESP32-S31
ADC ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️
Analog Voltage Comparator [^1] [^1]
DAC ⚒️ ⚒️
Temperature sensor ⚒️ ⚒️ ⚒️ [^1] ⚒️ [^1] ⚒️ ⚒️ ⚒️
Touch ⚒️ [^1] [^1] [^1]

Timers and motor control

Driver ESP32 ESP32-C2 ESP32-C3 ESP32-C5 ESP32-C6 ESP32-C61 ESP32-H2 ESP32-P4 ESP32-S2 ESP32-S3 ESP32-S31
LEDC ⚒️ ⚒️ ⚒️ [^1] ⚒️ [^1] ⚒️ ⚒️ ⚒️
MCPWM ⚒️ [^1] ⚒️ ⚒️ ⚒️
PCNT ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️
RTC Timekeeping ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️
SDM ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️
SYSTIMER ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️
Timers ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️

Cryptography and security

Driver ESP32 ESP32-C2 ESP32-C3 ESP32-C5 ESP32-C6 ESP32-C61 ESP32-H2 ESP32-P4 ESP32-S2 ESP32-S3 ESP32-S31
AES ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️
RSA Digital Signature [^1] [^1] [^1] [^1] [^1] [^1]
ECDSA Digital Signature [^1] [^1] [^1]
ECC ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ [^1]
HMAC ⚒️ [^1] ⚒️ ⚒️ ⚒️ ⚒️
Key Manager [^1]
RNG ⚒️ [^1] ⚒️ [^1] ⚒️ [^1] ⚒️ [^1] ⚒️ [^1] ⚒️ [^1] ⚒️ [^1] ⚒️ [^1] ⚒️ [^1] ⚒️ [^1] ⚒️ [^1]
RSA ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️
SHA ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ [^1]

Low power

Driver ESP32 ESP32-C2 ESP32-C3 ESP32-C5 ESP32-C6 ESP32-C61 ESP32-H2 ESP32-P4 ESP32-S2 ESP32-S3 ESP32-S31
Light/deep sleep ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️
ULP (FSM) [^1] [^1] [^1]
ULP (RISC-V) [^1] ⚒️ ⚒️ ⚒️

System

Driver ESP32 ESP32-C2 ESP32-C3 ESP32-C5 ESP32-C6 ESP32-C61 ESP32-H2 ESP32-P4 ESP32-S2 ESP32-S3 ESP32-S31
ASSIST_DEBUG ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️
DMA ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️
ETM [^1] ⚒️ [^1] ⚒️
Interrupts ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️
PSRAM ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️ ⚒️

[^1]: This cell is clickable and will open the peripheral's issue on GitHub

unstable feature

The stable feature set is designed to remain consistent and reliable. Other parts guarded by the unstable feature, however, are still under active development and may undergo breaking changes and are disabled by default.

Minimum Supported Rust Version (MSRV)

This crate is guaranteed to compile when using the latest stable Rust version at the time of the crate's release. It might compile with older versions, but that may change in any new release, including patches.

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.