1 unstable release
| 0.1.0 | Aug 25, 2025 |
|---|
#2577 in Embedded development
40,781 downloads per month
Used in 46 crates
(2 directly)
8KB
Timer queue item for embassy-executor integrated timer queues
embassy-executor provides the memory needed to implement integrated timer queues. This crate
exists to separate that memory from embassy-executor itself, to decouple the timer queue's
release cycle from embassy-executor.
This crate contains two things:
TimerQueueItem: The item type that can be requested from the executor. The size of this type can be configured using thetimer-item-size-N-wordsCargo features.- The expectation that
extern "Rust" fn __embassy_time_queue_item_from_waker(waker: &Waker) -> &mut TimerQueueItemis implemented (byembassy-executor, most likely). This function must return a mutable reference to theTimerQueueItemassociated with the given waker.
As a queue implementor, you will need to choose one of the timer-item-size-N-words features to
select a queue item size. You can then define your own item type, which must be
#[repr(align(8))] (or less) and must fit into the size you selected.
You can access the TimerQueueItem from a Waker using the from_embassy_waker
method. You can then use the as_ref and as_mut
methods to reinterpret the data stored in the item as your custom item type.
embassy-executor-time-queue
This crate defines the timer queue item that embassy-executor provides, and a way to access it, for executor-integrated timer queues. The crate decouples the release cycle of embassy-executor from that of the queue implementations'.
As a HAL implementer, you only need to depend on this crate if you want to implement executor-integrated
timer queues yourself, without using embassy-time-queue-utils.
As a HAL user, you should not need to depend on this crate.