Expand description
Embassy support for Raspberry Pi boards using
the BCM2836/BCM2837 SoC (Pi 2, Pi 3), on top of the rpi-hal crate.
Provides the two platform pieces Embassy needs and cannot supply
itself: an embassy-time driver over the BCM System Timer, and a
thread-mode executor for AArch32 and AArch64.
This is a separate crate from rpi-hal rather than a feature of it
because an embassy-time driver is installed by linkage: the
time_driver_impl! macro defines #[unsafe(no_mangle)] symbols that
embassy-time resolves against, and a program links only if exactly
one driver exists in its crate graph. Behind a feature on the HAL, any
dependency enabling that feature would force this driver onto the whole
program and conflict with an application supplying its own — an opt-in
that cannot be opted out of.
§What an application must provide
- A
critical-sectionimplementation, whichrpi-hal’srtfeature provides. The timer queue is guarded by one. rpi-hal’smmufeature (on by default). The executor’s run queue is built on atomic compare-exchange, andldrex/strexare UNPREDICTABLE until RAM is mapped as cacheable Normal memory.- Interrupt dispatch.
rpi-halleaves__irq_handlerto the application, so this crate cannot claim it; the application routes the System Timer’s interrupt here from its own handler.
Re-exports§
pub use executor::Executor;
Modules§
- executor
- Thread-mode executor for AArch32 and AArch64 — see the module’s own
documentation for why this isn’t one of
embassy-executor’s backends. Thread-mode executor, idling inwfeand woken bysev. - irq
- Getting interrupts to the code waiting on them — see
irq::dispatch, and theirq-dispatchfeature for the case where an application has no sources of its own. Getting interrupts to the code waiting on them. - time_
driver embassy-timedriver over the BCM System Timer — see the module’s own documentation for the interrupt wiring an application must provide.embassy-timedriver over the BCM System Timer.