Type Alias shared_bus::BusManagerSimple

source ·
pub type BusManagerSimple<BUS> = BusManager<NullMutex<BUS>>;
Expand description

A bus manager for sharing within a single task/thread.

This is the bus manager with the least overhead; it should always be used when all bus users are confined to a single task/thread as it has no side-effects (like blocking or turning off interrupts).

Example

// For example:
// let i2c = I2c::i2c1(dp.I2C1, (scl, sda), 90.khz(), clocks, &mut rcc.apb1);

let bus = shared_bus::BusManagerSimple::new(i2c);

let mut proxy1 = bus.acquire_i2c();
let mut my_device = MyDevice::new(bus.acquire_i2c());

proxy1.write(0x39, &[0xc0, 0xff, 0xee]);
my_device.do_something_on_the_bus();

Aliased Type§

struct BusManagerSimple<BUS> { /* private fields */ }