Skip to main content

Module async_runtime

Module async_runtime 

Source
Expand description

Embassy-based async runtime hosted on the oveRTOS C substrate.

Activated by the async Cargo feature combined with C-side CONFIG_OVE_ASYNC=y (build.rs detects this and emits cfg(has_async)). The module provides:

  • Executor — wraps embassy_executor::raw::Executor and blocks on ove_event_wait between polls. Yields cleanly to the underlying RTOS scheduler on FreeRTOS / Zephyr / NuttX; on POSIX blocks on a pthread condvar. Replaces the upstream __pender symbol with one that signals an ove_event via the right thread-vs-ISR variant.
  • critical_section::Impl backed by ove_irq_lock / ove_irq_unlock on every target.
  • embassy_time_driver::Driver backed by ove_time_get_us + ove_timer_*_ns.
  • Async wrappers around the comm primitives (AsyncStream, AsyncQueue, AsyncEventGroup, AsyncSemaphore, AsyncUart, AsyncInput) that ride on the C-level _set_notify hooks.

Re-exports§

pub use eventgroup::AsyncEventGroup;
pub use executor::Executor;
pub use gpio::AsyncInput;
pub use i2c::AsyncI2c;
pub use queue::AsyncQueue;
pub use semaphore::AsyncSemaphore;
pub use spi::AsyncSpi;
pub use stream::AsyncStream;
pub use uart::AsyncUart;

Modules§

eventgroup
Async wrapper around crate::EventGroup using ove_eventgroup_set_notify.
executor
oveRTOS-native embassy executor.
gpio
Async GPIO input wrapper using the existing ove_gpio_irq_register callback path — no new C-side API needed.
i2c
Async I2C bus wrapper. See super::spi for the design notes — same pattern, with an embedded_hal_async::i2c::I2c<SevenBitAddress> impl when the embedded-hal-async feature is enabled.
queue
Async wrapper around crate::Queue using ove_queue_set_notify.
semaphore
Async wrapper around crate::Semaphore using ove_sem_set_notify.
spi
Async SPI bus wrapper.
stream
Async wrapper around crate::Stream using the C-level ove_stream_set_notify notify hook.
uart
Async wrapper around crate::Uart using ove_uart_set_rx_notify, which delegates to the underlying RX stream’s notify hook.

Structs§

Spawner
Re-export of embassy_executor::Spawner. The Spawner returned by the executor’s run-loop init closure is this type. Handle to spawn tasks into an executor.