pub trait EmbassyBoardEntry: Board {
type Spawner: 'static;
type Executor: 'static;
type Runtime: NodeDispatchRuntime + 'static;
const CHANNEL_CAPACITY: usize = 32;
// Required method
fn init_hardware(spawner: Self::Spawner) -> (Self::Executor, Self::Runtime);
}Expand description
Board-side hook for Embassy integration (Phase 216.C.1).
Implementations live in per-board Embassy crates such as
nros-board-embassy-stm32f4 (Phase 216.C.2). Each impl wires
the Embassy Self::Spawner handle through to the board’s
peripheral init code and hands back the
(Self::Executor, Self::Runtime) pair the
proc-macro-generated entry point then drives.
Provided Associated Constants§
Sourceconst CHANNEL_CAPACITY: usize = 32
const CHANNEL_CAPACITY: usize = 32
Capacity of the per-board embassy_sync::channel::Channel
used by signal_callback to enqueue callbacks for the
dispatch task. 32 covers typical Node loads without
exhausting RAM; boards with very high callback density
override.
Required Associated Types§
Sourcetype Spawner: 'static
type Spawner: 'static
Embassy spawner handle. Typically embassy_executor::Spawner
on real boards; kept abstract so nros-platform doesn’t take
a transitive embassy_executor dep (see the module-level
“Layering” note).
Sourcetype Executor: 'static
type Executor: 'static
Executor type the board hands back. Concrete board impls plug
in nros::Executor; the assoc type keeps nros-platform
free of an nros dep.
Sourcetype Runtime: NodeDispatchRuntime + 'static
type Runtime: NodeDispatchRuntime + 'static
Dispatch sink the macro spawns into an Embassy task. Required
to be a NodeDispatchRuntime so signaled callbacks can be
enqueued from the spawner-driven dispatch task.
Required Methods§
Sourcefn init_hardware(spawner: Self::Spawner) -> (Self::Executor, Self::Runtime)
fn init_hardware(spawner: Self::Spawner) -> (Self::Executor, Self::Runtime)
Run from inside the proc-macro-generated
#[embassy_executor::main] body. Returns the
(Executor, Runtime) pair the macro then spawns dispatch /
spin tasks against.
Sync on purpose — see the module-level “Sync
init_hardware” note for the trade-off vs the spec’s
async fn sketch.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.