Module arbiter

Source
Expand description

A Mutex-like FIFO with unlimited-waiter for embedded systems.

Example usage:

use rtic_sync::arbiter::Arbiter;

// Instantiate an Arbiter with a static lifetime.
static ARBITER: Arbiter<u32> = Arbiter::new(32);

async fn run(){
    let write_42 = async move {
        *ARBITER.access().await = 42;
    };

    let write_1337 = async move {
        *ARBITER.access().await = 1337;
    };

    // Attempt to access the Arbiter concurrently.
    select(write_42, write_1337).await;
}

Modules§

i2c
I2C bus sharing using Arbiter
spi
SPI bus sharing using Arbiter

Structs§

Arbiter
An FIFO waitqueue for use in shared bus usecases.
ExclusiveAccess
This token represents exclusive access to the value protected by the Arbiter.