[−][src]Struct shared_bus_rtic::BusManager
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]
M: BusMutex<RefCell<T>>,
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,
M: Send,
T: Send,
impl<M, T> Sync for BusManager<M, T> where
M: Sync,
T: Sync,
M: Sync,
T: Sync,
impl<M, T> Unpin for BusManager<M, T> where
M: Unpin,
T: Unpin,
M: Unpin,
T: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,