[][src]Struct shared_bus_rtic::BusManager

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

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

impl<M, T> BusManager<M, T> where
    M: BusMutex<RefCell<T>>, 
[src]

pub fn new(d: T) -> BusManager<M, T>[src]

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);

pub fn acquire(&'a self) -> BusProxy<'a, M, T>[src]

Acquire a proxy for this bus.

Auto Trait Implementations

impl<M, T> Send for BusManager<M, T> where
    M: Send,
    T: Send

impl<M, T> Sync for BusManager<M, T> where
    M: Sync,
    T: Sync

impl<M, T> Unpin for BusManager<M, T> where
    M: Unpin,
    T: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.