Expand description
§Overview
Procedural macros for use with the esp-hal family of HAL packages. In
general, you should not need to depend on this package directly, as the
relevant procmacros are re-exported by the various HAL packages.
Provides macros for:
- Placing statics and functions into RAM
- Marking interrupt handlers
- Blocking and Async
#[main]macros
These macros offer developers a convenient way to control memory placement and define interrupt handlers in their embedded applications, allowing for optimized memory usage and precise handling of hardware interrupts.
Key Components:
-
handler- Attribute macro for marking interrupt handlers. Interrupt handlers are used to handle specific hardware interrupts generated by peripherals. -
ram- Attribute macro for placing statics and functions into specific memory sections, such as SRAM or RTC RAM (slow or fast) with different initialization options. See its documentation for details. -
esp_rtos::main- Creates a new instance ofesp_rtos::embassy::Executorand declares an application entry point spawning the corresponding function body as an async task.
§Examples
§main macro
Requires the embassy feature to be enabled.
#[main]
async fn main(spawner: Spawner) {
// Your application's entry point
}§Feature Flags
rtc-slow— Indicates the target device has RTC slow memory available.
§Low-power Core Feature Flags
has-lp-core— Indicate that the SoC contains an LP core.has-ulp-core— Indicate that the SoC contains a ULP core.is-lp-core— Provide an#[entry]macro for running applications on the ESP32-C6’s LP core.is-ulp-core— Provide an#[entry]macro for running applications on the ESP32-S2/S3’s ULP core.
Macros§
Attribute Macros§
- blocking_
main - Attribute to declare the entry point of the program
- doc_
replace - Replaces placeholders in rustdoc doc comments.
- handler
- Mark a function as an interrupt handler.
- ram
- Sets which segment of RAM to use for a function or static and how it should be initialized.
- rtos_
main - Creates a new instance of
esp_rtos::embassy::Executorand declares an application entry point spawning the corresponding function body as an async task.
Derive Macros§
- Builder
Lite - Automatically implement the Builder Lite pattern for a struct.