Cargo Features
[dependencies]
esp-hal = { version = "0.17.0", default-features = false, features = ["riscv", "xtensa", "bluetooth", "usb-otg", "debug", "log", "place-spi-driver-in-ram", "esp32", "esp32c2", "esp32c3", "esp32c6", "esp32h2", "esp32s2", "esp32s3", "flip-link", "rv-init-data", "rv-zero-rtc-bss", "rv-init-rtc-data", "async", "defmt", "embedded-hal", "embedded-hal-02", "embedded-io", "ufmt", "embassy", "embassy-executor-interrupt", "embassy-executor-thread", "embassy-integrated-timers", "embassy-time-systick-16mhz", "embassy-time-systick-80mhz", "embassy-time-timg0", "psram-2m", "psram-4m", "psram-8m", "psram-80mhz", "opsram-2m", "opsram-4m", "opsram-8m", "opsram-16m", "ci"] }
- default ci? = embedded-hal
-
The
embedded-hal
feature is set by default wheneveresp-hal
is added without
somewhere in the dependency tree.default-features = false - riscv esp32c2? esp32c3? esp32c6? esp32h2?
-
Enables riscv, restore-state-u8 of critical-section and zero-bss of esp-riscv-rt
esp-riscv-rt:
Zero the
.bss
section. - xtensa esp32? esp32s2? esp32s3?
-
Enables xtensa-lx, restore-state-u32 of critical-section
- bluetooth
- usb-otg esp32s2? esp32s3? = esp-synopsys-usb-otg, usb-device
- debug
-
Enable debug features in the HAL (used for development).
Enables impl-register-debug of optional esp32, optional esp32c2, optional esp32c3, optional esp32c6, optional esp32h2, optional esp32s2, and optional esp32s3
esp32:
IMPORTANT:
Each supported device MUST have its PAC included below along with a corresponding feature. - log
-
Enable logging output using the
log
crate.Enables log
- place-spi-driver-in-ram
-
Configuration for placing device drivers in the IRAM for faster access.
- esp32 = xtensa
-
Chip Support Feature Flags
Target the ESP32.Enables esp32, spin of xtensa-lx, esp32 of xtensa-lx-rt
- esp32c2 = riscv
-
Target the ESP32-C2.
Enables esp32c2, unsafe-assume-single-core of portable-atomic
- esp32c3 = riscv, rv-zero-rtc-bss
-
Target the ESP32-C3.
Enables esp32c3, unsafe-assume-single-core of portable-atomic
- esp32c6 = riscv, rv-zero-rtc-bss
-
Target the ESP32-C6.
Enables esp32c6, has-lp-core of esp-hal-procmacros
- esp32h2 = riscv, rv-zero-rtc-bss
-
Target the ESP32-H2.
Enables esp32h2
- esp32s2 = usb-otg, xtensa
-
Target the ESP32-S2.
Enables esp32s2, critical-section of portable-atomic, has-ulp-core of esp-hal-procmacros, esp32s2 of xtensa-lx-rt
- esp32s3 = usb-otg, xtensa
-
Target the ESP32-S3.
Enables esp32s3, has-ulp-core of esp-hal-procmacros, spin of xtensa-lx, esp32s3 of xtensa-lx-rt
- flip-link
-
### RISC-V Exclusive Feature Flags
Move the stack to start of RAM to get zero-cost stack overflow protection (ESP32-C6 and ESPS32-H2 only!).Enables fix-sp of esp-riscv-rt
- rv-init-data
-
Initialize the
.data
section of memory.Enables init-data and init-rw-text of esp-riscv-rt
- rv-zero-rtc-bss esp32c3? esp32c6? esp32h2?
-
Zero the
.bss
section of low-power memory.Enables zero-rtc-fast-bss of esp-riscv-rt
- rv-init-rtc-data
-
Initialize the
.data
section of low-power memory.Enables init-rtc-fast-data and init-rtc-fast-text of esp-riscv-rt
- async ci? = embassy-futures, embassy-sync, embedded-hal, embedded-hal-async, embedded-io, embedded-io-async
-
Trait Implementation Feature Flags
Enable support for asynchronous operation, with interfaces provided by
embedded-hal-async
andembedded-io-async
.Affects
dma::RxPrivate.waker
,dma::RxChannel.waker
,dma::TxPrivate.waker
,dma::TxChannel.waker
,i2s::asynch
,parl_io::asynch
,rmt::TxChannelCreatorAsync
,rmt::RxChannelCreatorAsync
,rmt::asynch
,twai::Instance.async_handler
,twai::OperationInstance.async_state
… - defmt
-
Implement
defmt::Format
on certain types.Enables defmt, defmt of optional embassy-executor, optional embassy-futures, and optional embassy-sync, defmt-03 of embedded-io, optional embedded-hal, and optional embedded-io-async, defmt of optional esp32, optional esp32c2, optional esp32c3, optional esp32c6, optional esp32h2, optional esp32s2, and optional esp32s3
- embedded-hal default async?
-
Implement the traits defined in the
1.0.0
releases ofembedded-hal
andembedded-hal-nb
for the relevant peripherals.Enables embedded-can, embedded-hal, and embedded-hal-nb
- embedded-hal-02 ci?
-
Implement the traits defined in the
0.2.x
release ofembedded-hal
.Enables embedded-hal ^0.2.7
- embedded-io async? defmt?
-
Implement the traits defined in
embedded-io
for certain peripherals.Enables embedded-io
- ufmt ci?
-
Implement the
ufmt_write::uWrite
trait for certain peripherals.Enables ufmt-write
- embassy embassy-executor-interrupt? embassy-executor-thread? = embassy-time-driver
-
Embassy Feature Flags
Enable support for
embassy
, a modern asynchronous embedded framework.Enables embassy of esp-hal-procmacros
Affects
esp-hal::embassy
… - embassy-executor-interrupt = embassy, embassy-executor
-
Use the interrupt-mode embassy executor.
Affects
executor::interrupt
,embassy::executor
… - embassy-executor-thread = embassy, embassy-executor
-
Use the thread-mode embassy executor.
Affects
executor::thread
,embassy::executor
… - embassy-integrated-timers
-
Uses hardware timers as alarms for the executors. Using this feature limits the number of executors to the number of hardware alarms provided by the time driver.
Enables integrated-timers of optional embassy-executor
- embassy-time-systick-16mhz
-
Enable the embassy time driver using the
SYSTIMER
peripheral. TheSYSTIMER
peripheral has three alarams available for use. Do not use when targeting anesp32s2
.Enables tick-hz-16_000_000 of embassy-time-driver
- embassy-time-systick-80mhz
-
Enable the embassy time driver using the
SYSTIMER
peripheral. TheSYSTIMER
peripheral has three alarams available for use. Must only be used when targeting anesp32s2
.Enables tick-hz-80_000_000 of embassy-time-driver
- embassy-time-timg0
-
Enable the embassy time driver using the
TIMG0
peripheral. TheTIMG0
peripheral has two alarms available for use.Enables tick-hz-1_000_000 of embassy-time-driver
- psram-2m
-
### PSRAM Feature Flags
Use externally connected PSRAM (2MB).Affects
psram::init_psram
,psram::init_psram
,psram::init_psram
… - psram-4m
-
Use externally connected PSRAM (4MB).
Affects
psram::init_psram
,psram::init_psram
,psram::init_psram
… - psram-8m
-
Use externally connected PSRAM (8MB).
Affects
psram::init_psram
,psram::init_psram
,psram::init_psram
… - psram-80mhz
-
PSRAM 80Mhz frequency support
- opsram-2m
-
### Octal RAM Feature Flags
Use externally connected Octal RAM (2MB).Affects
psram::init_psram
… - opsram-4m
-
Use externally connected Octal RAM (4MB).
Affects
psram::init_psram
… - opsram-8m
-
Use externally connected Octal RAM (8MB).
Affects
psram::init_psram
… - opsram-16m
-
Use externally connected Octal RAM (16MB).
Affects
psram::init_psram
… - ci = async, default, embedded-hal-02, ufmt
-
This feature is intended for testing; you probably don't want to enable it:
Features from optional dependencies
In crates that don't use the dep:
syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.
- embassy-executor embassy-executor-interrupt? embassy-executor-thread?
- embassy-futures async?
- embassy-sync async?
- embassy-time-driver embassy? embassy-time-systick-16mhz? embassy-time-systick-80mhz? embassy-time-timg0?
- embedded-hal-async async?
- embedded-io-async async?
- esp-synopsys-usb-otg usb-otg?
- usb-device usb-otg?