pub struct PeripheralManager<'a, H, C>where
H: 'a + PeripheralManagement<C>,
C: 'a + ClockInterface,{
pub registers: &'a H::RegisterType,
/* private fields */
}Expand description
Object used to access memory mapped registers with the
PeripheralManagement interface.
Structures encapsulating peripheral hardware (those implementing the
PeripheralManagement trait) should instantiate an instance of this
object.
impl PeripheralHardware {
fn example(&self) {
let peripheral = &PeripheralManager::new(self);
peripheral.registers.control.set(0x1);
}
}
Fields§
§registers: &'a H::RegisterTypeImplementations§
Source§impl<'a, H, C> PeripheralManager<'a, H, C>where
H: 'a + PeripheralManagement<C>,
C: 'a + ClockInterface,
impl<'a, H, C> PeripheralManager<'a, H, C>where
H: 'a + PeripheralManagement<C>,
C: 'a + ClockInterface,
pub fn new(peripheral_hardware: &'a H) -> PeripheralManager<'a, H, C>
Trait Implementations§
Source§impl<'a, H, C> Drop for PeripheralManager<'a, H, C>where
H: 'a + PeripheralManagement<C>,
C: 'a + ClockInterface,
impl<'a, H, C> Drop for PeripheralManager<'a, H, C>where
H: 'a + PeripheralManagement<C>,
C: 'a + ClockInterface,
Auto Trait Implementations§
impl<'a, H, C> Freeze for PeripheralManager<'a, H, C>
impl<'a, H, C> RefUnwindSafe for PeripheralManager<'a, H, C>where
<H as PeripheralManagement<C>>::RegisterType: RefUnwindSafe,
H: RefUnwindSafe,
C: RefUnwindSafe,
impl<'a, H, C> Send for PeripheralManager<'a, H, C>
impl<'a, H, C> Sync for PeripheralManager<'a, H, C>
impl<'a, H, C> Unpin for PeripheralManager<'a, H, C>
impl<'a, H, C> UnwindSafe for PeripheralManager<'a, H, C>where
<H as PeripheralManagement<C>>::RegisterType: RefUnwindSafe,
H: RefUnwindSafe,
C: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more