pub struct BusManager<M: BusMutex<RefCell<T>>, T>(_, _);
Expand description

A manager for managing a shared bus.

The manager owns the actual peripheral and hands out proxies which can be used by your devices.

When creating a bus manager you need to specify which mutex type should be used.

Examples


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

let manager = BusManager::<std::sync::Mutex<_>, _>::new(i2c);

// You can now acquire bus handles:
let mut handle1 = manager.acquire();
let mut mydevice = MyDevice::new(manager.acquire());

Implementations

Create a new manager for a bus peripheral d.

When creating the manager you need to specify which mutex type should be used:

let manager = BusManager::<std::sync::Mutex<_>, _>::new(bus);

Acquire a proxy for this bus.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.