Documentation improvements for esp-hal-procmacros
This commit is contained in:
parent
8a54c8a3e3
commit
0304a10b2f
@ -8,14 +8,14 @@ repository = "https://github.com/esp-rs/esp-hal"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
features = ["esp32c3", "interrupt", "ram"]
|
||||
features = ["esp32c3", "embassy", "interrupt", "ram"]
|
||||
|
||||
[lib]
|
||||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
darling = "0.20.3"
|
||||
litrs = "0.4.0"
|
||||
litrs = "0.4.1"
|
||||
object = { version = "0.32.1", optional = true }
|
||||
proc-macro-crate = "2.0.0"
|
||||
proc-macro-error = "1.0.4"
|
||||
|
||||
@ -5,7 +5,13 @@
|
||||

|
||||
[](https://matrix.to/#/#esp-rs:matrix.org)
|
||||
|
||||
Procedural macros for placing statics and functions into RAM, and for marking interrupt handlers.
|
||||
Procedural macros for use with the `esp-hal` family of HAL packages.
|
||||
|
||||
Provides macros for:
|
||||
|
||||
- Placing statics and functions into RAM
|
||||
- Marking interrupt handlers
|
||||
- Automatically creating an `embassy` executor instance and spawning the defined entry point
|
||||
|
||||
## [Documentation]
|
||||
|
||||
|
||||
@ -1,15 +1,29 @@
|
||||
//! Procedural macros
|
||||
//!
|
||||
//! ## Overview
|
||||
//! The `esp-hal-procmacros` module provides procedural macros for placing
|
||||
//! statics and functions into RAM and for marking interrupt handlers on ESP
|
||||
//! microcontrollers.
|
||||
//!
|
||||
//! 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
|
||||
//! - Automatically creating an `embassy` executor instance and spawning the
|
||||
//! defined entry point
|
||||
//!
|
||||
//! 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:
|
||||
//! - [interrupt](attr.interrupt.html) - Attribute macro for marking interrupt
|
||||
//! handlers. Interrupt handlers are used to handle specific hardware
|
||||
//! interrupts generated by peripherals.<br> The macro allows users to
|
||||
//! specify the interrupt name explicitly or use the function name to match
|
||||
//! the interrupt.
|
||||
//! - [main](attr.main.html) - Creates a new `executor`` instance and declares
|
||||
//! an application entry point spawning the corresponding function body as an
|
||||
//! async task.
|
||||
//! - [ram](attr.ram.html) - Attribute macro for placing statics and functions
|
||||
//! into specific memory sections, such as SRAM or RTC RAM (slow or fast)
|
||||
//! with different initialization options. Supported options are:
|
||||
@ -17,15 +31,35 @@
|
||||
//! - `rtc_slow` - Use RTC slow RAM (not all targets support slow RTC RAM)
|
||||
//! - `uninitialized` - Skip initialization of the memory
|
||||
//! - `zeroed` - Initialize the memory to zero
|
||||
//! - [interrupt](attr.interrupt.html) - Attribute macro for marking interrupt
|
||||
//! handlers. Interrupt handlers are used to handle specific hardware
|
||||
//! interrupts generated by peripherals.<br> The macro allows users to
|
||||
//! specify the interrupt name explicitly or use the function name to match
|
||||
//! the interrupt.
|
||||
//!
|
||||
//! ## Examples
|
||||
//!
|
||||
//! #### `interrupt` macro
|
||||
//!
|
||||
//! Requires the `interrupt` feature to be enabled.
|
||||
//!
|
||||
//! ```no_run
|
||||
//! #[interrupt]
|
||||
//! fn INTR_NAME() {
|
||||
//! // Interrupt handling code here
|
||||
//! }
|
||||
//! ```
|
||||
//!
|
||||
//! #### `main` macro
|
||||
//!
|
||||
//! Requires the `embassy` feature to be enabled.
|
||||
//!
|
||||
//! ```no_run
|
||||
//! #[main]
|
||||
//! async fn main(spawner: Spawner) -> ! {
|
||||
//! // Your application's entry point
|
||||
//! }
|
||||
//! ```
|
||||
//!
|
||||
//! #### `ram` macro
|
||||
//!
|
||||
//! Requires the `ram` feature to be enabled.
|
||||
//!
|
||||
//! ```no_run
|
||||
//! #[ram(rtc_fast)]
|
||||
//! static mut SOME_INITED_DATA: [u8; 2] = [0xaa, 0xbb];
|
||||
@ -36,14 +70,6 @@
|
||||
//! #[ram(rtc_fast, zeroed)]
|
||||
//! static mut SOME_ZEROED_DATA: [u8; 8] = [0; 8];
|
||||
//! ```
|
||||
//!
|
||||
//! #### `interrupt` macro
|
||||
//! ```no_run
|
||||
//! #[interrupt]
|
||||
//! fn INTR_NAME() {
|
||||
//! // Interrupt handling code here
|
||||
//! }
|
||||
//! ```
|
||||
|
||||
#![doc(html_logo_url = "https://avatars.githubusercontent.com/u/46717278")]
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user