Struct shared_bus::proxy::BusManager [−][src]
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());
Methods
impl<M: BusMutex<RefCell<T>>, T> BusManager<M, T>
[src]
impl<M: BusMutex<RefCell<T>>, T> BusManager<M, T>
pub fn new(d: T) -> BusManager<M, T>
[src]
pub fn new(d: T) -> BusManager<M, T>
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>(&'a self) -> BusProxy<'a, M, T>
[src]
pub fn acquire<'a>(&'a self) -> BusProxy<'a, M, T>
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> 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> Sync for BusManager<M, T> where
M: Sync,
T: Sync,