pub struct SharedMmioPointer<'a, T: ?Sized> { /* private fields */ }Expand description
A shared pointer to the registers of some MMIO device.
It is guaranteed to be valid but unlike UniqueMmioPointer may not be unique.
Implementations§
Sourcepub unsafe fn read_unsafe(&self) -> T
pub unsafe fn read_unsafe(&self) -> T
Performs an MMIO read of the entire T.
§Safety
This field must be safe to perform an MMIO read from, and doing so must not cause any side-effects.
Sourcepub unsafe fn child<U>(&self, regs: NonNull<U>) -> SharedMmioPointer<'_, U>
pub unsafe fn child<U>(&self, regs: NonNull<U>) -> SharedMmioPointer<'_, U>
Creates a new SharedMmioPointer with the same lifetime as this one.
This is used internally by the field_shared! macro and shouldn’t be called directly.
§Safety
regs must be a properly aligned and valid pointer to some MMIO address space of type T,
within the allocation that self points to.
Sourcepub fn get(&self, index: usize) -> Option<SharedMmioPointer<'_, T>>
pub fn get(&self, index: usize) -> Option<SharedMmioPointer<'_, T>>
Returns a SharedMmioPointer to an element of this slice, or None if the index is out of
bounds.
Sourcepub fn split(&self) -> [SharedMmioPointer<'_, T>; LEN]
pub fn split(&self) -> [SharedMmioPointer<'_, T>; LEN]
Splits a SharedMmioPointer to an array into an array of SharedMmioPointers.
Sourcepub fn get(&self, index: usize) -> Option<SharedMmioPointer<'_, T>>
pub fn get(&self, index: usize) -> Option<SharedMmioPointer<'_, T>>
Returns a SharedMmioPointer to an element of this array, or None if the index is out of
bounds.