Struct xhci::registers::Registers[][src]

pub struct Registers<M> where
    M: Mapper + Clone
{ pub capability: Capability<M>, pub doorbell: Array<Register, M>, pub operational: Operational<M>, pub port_register_set: Array<PortRegisterSet, M>, pub runtime: Runtime<M>, pub interrupt_register_set: Array<InterruptRegisterSet, M>, }

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]

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

impl<M: Debug> Debug for Registers<M> where
    M: Mapper + Clone
[src]

Auto Trait Implementations

impl<M> Send for Registers<M> where
    M: Send

impl<M> Sync for Registers<M> where
    M: Sync

impl<M> Unpin for Registers<M> where
    M: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.