#hal #idf #esp-idf #esp32

esp-idf-hal

A Hardware abstraction layer for Espressif's ESP family of microcontrollers based on the ESP-IDF framework

59 releases (24 breaking)

0.39.3 Nov 23, 2022
0.38.1 Aug 18, 2022
0.38.0 Jun 19, 2022
0.35.0 Mar 31, 2022
0.1.2 Aug 7, 2019

#48 in Embedded development

Download history 1093/week @ 2022-08-15 1188/week @ 2022-08-22 1823/week @ 2022-08-29 2092/week @ 2022-09-05 2216/week @ 2022-09-12 493/week @ 2022-09-19 416/week @ 2022-09-26 500/week @ 2022-10-03 444/week @ 2022-10-10 426/week @ 2022-10-17 393/week @ 2022-10-24 489/week @ 2022-10-31 422/week @ 2022-11-07 497/week @ 2022-11-14 1102/week @ 2022-11-21 553/week @ 2022-11-28

2,609 downloads per month
Used in 3 crates

MIT/Apache

345KB
9K SLoC

An embedded-hal implementation for ESP32[-XX] + ESP-IDF

CI crates.io Documentation

  • This crate is intended for usage in ESP32[-XX] embedded projects that utilize and link with the ESP-IDF SDK.
  • For embedded projects that don't need Rust STD support, WiFi or BLE (and thus don't link with the ESP-IDF SDK), please check esp-hal.

For more information, check out:

Hardware Notes

Each chip has a number of GPIO pins which are generally used by the SPI0 and SPI1 peripherals in order to connect external PSRAM and/or SPI Flash memory. The datasheets explicitly state that these are not recommended for use, however this crate includes them anyways for completeness.

Please refer to the table below to determine the pins which are not recommended for use for your chip.

Chip GPIOs
ESP32 6 - 11, 16 - 17
ESP32-C3 12 - 17
ESP32-S2 26 - 32
ESP32-S3 26 - 32, 33 - 37*

* When using Octal Flash and/or Octal PSRAM

Examples

The examples could be built and flashed conveniently with cargo-espflash. To run ledc-simple on an ESP32-C3:

$ cargo espflash --release --target riscv32imc-esp-espidf --example ledc-simple --monitor /dev/ttyUSB0

In order to run the examples on other chips you will most likely need to adapt at least the used pins.

Dependencies

~2.2–5.5MB
~101K SLoC