Struct xhci::registers::Registers [−][src]
The access point to xHCI registers.
Fields
capability: Capability<M>
Host Controller Capability Register
doorbell: Array<Register, M>
Doorbell Array
operational: Operational<M>
Host Controller Operational Register
port_register_set: Array<PortRegisterSet, M>
Port Register Set Array
runtime: Runtime<M>
Runtime Registers
interrupt_register_set: Array<InterruptRegisterSet, M>
Interrupt Register Set Array
Implementations
impl<M> Registers<M> where
M: Mapper + Clone,
[src]
M: Mapper + Clone,
pub unsafe fn new(mmio_base: usize, mapper: M) -> Self
[src]
Creates an instance of Registers
.
Safety
The caller must ensure that the xHCI registers are accessed only through this struct.
Panics
This method panics if mmio_base
is not aligned correctly.
Examples
use core::num::NonZeroUsize; use xhci::accessor::Mapper; // This MMIO base address is for showing an example. The user must get the correct MMIO // address from the PCI configuration space. const MMIO_BASE: usize = 0x1000; #[derive(Clone)] struct MemoryMapper; impl Mapper for MemoryMapper { unsafe fn map(&mut self, phys_base: usize, bytes: usize) -> NonZeroUsize { unimplemented!() } fn unmap(&mut self, virt_base: usize, bytes: usize) { unimplemented!() } } let mapper = MemoryMapper; let r = unsafe { xhci::Registers::new(MMIO_BASE, mapper) };
Trait Implementations
Auto Trait Implementations
impl<M> Send for Registers<M> where
M: Send,
M: Send,
impl<M> Sync for Registers<M> where
M: Sync,
M: Sync,
impl<M> Unpin for Registers<M> where
M: Unpin,
M: 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,
pub 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.
pub 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>,