1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//! Synchronization and Concurrency Support
//!
//! This module provides synchronization primitives and concurrency-safe wrappers
//! for the EMAC driver. It includes:
//!
//! - **Primitives** (`primitives`): Low-level synchronization types (internal)
//! - `CriticalSectionCell` - ISR-safe interior mutability
//! - `AtomicWaker` - Async waker storage for interrupts
//!
//! - **Shared Wrappers** (`shared`): ISR-safe EMAC wrappers
//! - [`SharedEmac`] - Synchronous critical-section protected EMAC
//! - [`AsyncSharedEmac`] - Async-capable ISR-safe EMAC wrapper
//!
//! - **Async Support** (`asynch`): Async/await support for EMAC operations
//! - [`AsyncEmacState`] - Per-instance waker state for RX/TX/error events
//! - [`AsyncEmacExt`] - Extension trait adding async methods to EMAC
//! - [`RxFuture`], [`TxFuture`] - Futures for async I/O
//! - Interrupt handler helpers for waking tasks
//!
//! # Feature Flags
//!
//! - `critical-section`: Enables `primitives` and `shared` modules
//! - `async`: Enables `asynch` module (also requires `critical-section`)
//!
//! # Example
//!
//! ```ignore
//! use ph_esp32_mac::sync::SharedEmac;
//!
//! // Static ISR-safe EMAC
//! static EMAC: SharedEmac<10, 10, 1600> = SharedEmac::new();
//!
//! fn main() {
//! EMAC.with(|emac| {
//! emac.init(EmacConfig::default()).unwrap();
//! emac.start().unwrap();
//! });
//! }
//!
//! #[interrupt]
//! fn EMAC_IRQ() {
//! EMAC.with(|emac| {
//! // Safe access from ISR
//! let status = emac.read_interrupt_status();
//! emac.clear_interrupts(status);
//! });
//! }
//! ```
// Primitives module (requires critical-section)
pub
// Shared wrappers (requires critical-section)
pub use ;
// Async support (requires async feature)
pub use ;