embedded-asyncdelay-rp2040

Crates.ioembedded-asyncdelay-rp2040
lib.rsembedded-asyncdelay-rp2040
version
sourcesrc
created_at2024-11-12 19:50:48.183963+00
updated_at2025-02-09 19:02:56.849979+00
descriptionA hardware-based, asynchronous delay that can be used with async/await runtimes
homepage
repositoryhttps://github.com/KizzyCode/embedded-asyncdelay-rust-rp2040
max_upload_size
id1445457
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Keziah Biermann (KizzyCode)

documentation

README

License BSD-2-Clause License MIT AppVeyor CI docs.rs crates.io Download numbers dependency status

embedded-asyncdelay-rp2040

A hardware-based, asynchronous delay that can be used with async/await runtimes. The implementation uses one of the underlying hardware alarms (Alarm0 to Alarm3) to trigger an interrupt, which in turn wakes the future's associated waker.

Configure Hardware Alarm

To use this crate, you must specify which hardware alarm to use for the underlying interrupt scheduler. This is done by setting the appropriate alarm feature. By default, alarm0 is selected.

Waker Slots and Initialization

Since we need to wake the async wakers from the interrupt callback, we need some stack-allocated shared storage. By default, this crate automatically allocates enough space for 16 slots by default. To override this, you must disable the init16 feature, and call the setup_waker_slots! macro once with your desired number of slots manually.

IMPORTANT: If you disable the init16 feature, but don't call setup_waker_slots!, this will yield a rather cryptic linker error and compilation will fail.

Commit count: 14

cargo fmt