pub struct MmioBank<Base, MaxAccess: Accessible> { /* private fields */ }Expand description
Represents a contiguous region of memory containing registers. Contained
registers are accessed via MmioBank::at and must feature access
permissions narrower than MaxAccess.
Implementations§
Source§impl<Base, MaxAccess> MmioBank<Base, MaxAccess>where
Base: Copy,
MaxAccess: Accessible,
impl<Base, MaxAccess> MmioBank<Base, MaxAccess>where
Base: Copy,
MaxAccess: Accessible,
Sourcepub const fn new(base: MmioPtr<Base, MaxAccess>, size_bytes: usize) -> Self
pub const fn new(base: MmioPtr<Base, MaxAccess>, size_bytes: usize) -> Self
Constructs a new bank from its base pointer and length.
Sourcepub const unsafe fn at<Layout, Access>(
&self,
offset: Offset<Layout, Access>,
) -> Mmio<Layout, Base, Access>
pub const unsafe fn at<Layout, Access>( &self, offset: Offset<Layout, Access>, ) -> Mmio<Layout, Base, Access>
Returns the memory-backed register at the specified offset into the bank.
§Panics
Panics if the offset is misaligned for Base or exceeds the bounds of
the bank.
§Safety
Same as MmioPtr::new for underlying offset pointer.