Expand description
Shared API for xpanse apps, module drivers, and platform firmware.
Module drivers implement driver::Driver to turn an owned
gpio_bank::GpioBank into capabilities stored in a registry::Registry.
Apps implement app::App and lease those capabilities for the duration of
their run. The platform constructs buses through bus::allocator::BusAllocator
while drivers are being initialized.
§Runtime requirements
This crate is no_std, but uses alloc for registry storage, trait objects,
and boxed futures. Firmware using the API must install a global allocator
before creating drivers, resources, or apps.
§Typical lifecycle
- Detect a module and select a driver using
metadata::ModuleID. - Call
driver::Driver::createwith the module’s GPIO bank. - Check
app::App::can_runand construct an app withapp::App::new. - Run the app, then call
app::App::releaseto return its resource leases.
Exact versions of HAL traits used by this API are available through
reexports, avoiding version mismatches in app and driver crates.
Modules§
- app
- Application lifecycle and resource ownership.
- bus
- Bus allocation, type-erased handles, and RP235x bus backends.
- driver
- Module driver traits.
- gpio_
bank - Strongly typed GPIO banks assigned to expansion modules.
- interfaces
- App- and driver-facing hardware capabilities.
- metadata
- Metadata for apps about the drivers, like what physical slot the module is in, that the driver uses, and what type of module is used by the driver.
- reexports
- Exact versions of dependencies whose types and traits appear in this crate’s public API.
- registry
- Exclusive capability registry shared by drivers and apps.
Macros§
- with_
pio - Dispatch over a
PioAccesshandle, recovering the typedCommonandStateMachineso a driver can load a custom PIO program.