Crate esp32_hal[][src]

Expand description

This ESP32 hal crate provides support for the ESP32 peripherals


  • external_ram (enabled by default)
    • Enables support for external ram (psram). However proper initialization of external ram relies on a customized bootloader
  • all_in_ram
    • Forces all code and data in RAM instead of flash. This allows usage with the ROM bootloader and eases debugging
  • alloc
    • Enables support for dynamic memory allocations via a GlobalAllocator and/or AllocRef
  • mem
    • Include customized memcpy, memset, etc. which use word (4-byte) sized and aligned instructions to support IRAM usage and as optimization


pub use embedded_hal as hal;
pub use esp32 as target;


Analog peripherals control.

Clock and RTC watchdog control.

Implementation of embedded hal delay traits using busy waiting

DPort peripheral configuration

Print debug information to UART0

GPIO and pin configuration

ESP32 specific interrupt handling

Custom versions of routines used by LLVM (like memcpy, memset, etc.)

The prelude.

UART peripheral control

SPI peripheral control

Timer peripherals

Units of measurement implementation for times and frequencies.


Macro for flushing the UART0 TX buffer

Macro for sending a formatted string to UART0 for debugging

Macro for sending a formatted string to UART0 for debugging, with a newline.



The esp32 has a first stage bootloader that handles loading program data into the right place therefore we skip loading it again.

Attribute Macros

Marks a function as an interrupt handler

This attribute allows placing statics, constants and functions into ram.