pub unsafe fn new(mmio_base: usize, caplength: CapabilityRegistersLength, mapper: &M) -> Self
    where
        M: Mapper,
    {
        let base = mmio_base + usize::from(caplength.get());

        macro_rules! m {
            ($offset:expr) => {
                accessor::Single::new(base + $offset, mapper.clone())
            };
        }

        Self {
            usbcmd: m!(0x00),
            usbsts: m!(0x04),
            pagesize: m!(0x08),
            dnctrl: m!(0x14),
            crcr: m!(0x18),
            dcbaap: m!(0x30),
            config: m!(0x38),
        }
    }
/// Creates a new accessor to the Host Controller Operational Registers.
///
/// # Safety
///
/// The caller must ensure that the Host Controller Operational Registers are accessed only
/// through this struct.
///
/// # Panics
///
/// This method panics if the base address of the Host Controller Operational Registers is not
/// aligned correctly.
Creates a new accessor to the Host Controller Operational Registers.
Creates a new accessor to the Host Controller Operational Registers .
pub unsafe fn new(mmio_base: usize, caplength: CapabilityRegistersLength, mapper: &M) -> Self
    where
        M: Mapper,
    {
        let base = mmio_base + usize::from(caplength.get());
        macro_rules! m {
            ($offset:expr) => {
                accessor::Single::new(base + $offset, mapper.clone())
            };
        }
        Self {
            usbcmd: m!(0x00),
            usbsts: m!(0x04),
            pagesize: m!(0x08),
            dnctrl: m!(0x14),
            crcr: m!(0x18),
            dcbaap: m!(0x30),
            config: m!(0x38),
        }
    }
pub unsafe fn new ( mmio_base : usize , caplength : CapabilityRegistersLength , mapper : & M ) -> Self where M : Mapper , { let base = mmio_base + usize :: from ( caplength . get ( ) ) ; macro_rules! m { ( $offset : expr ) => { accessor Single new ( base $offset mapper clone ( ) ) } ; } Self { usbcmd : m ! ( 0x00 ) , usbsts : m ! ( 0x04 ) , pagesize : m ! ( 0x08 ) , dnctrl : m ! ( 0x14 ) , crcr : m ! ( 0x18 ) , dcbaap : m ! ( 0x30 ) , config : m ! ( 0x38 ) , } }
Creates a new accessor to the Host Controller Operational Registers.
Creates a new accessor to the Host Controller Operational Registers .
mmio_base
usize
caplength
CapabilityRegistersLength
mapper
&M
mmio_base
usize
caplength
CapabilityRegistersLength
mapper
&M
safety
The caller must ensure that the Host Controller Operational Registers are accessed only
through this struct.
The caller must ensure that the Host Controller Operational Registers are accessed only through this struct .
panics
This method panics if the base address of the Host Controller Operational Registers is not
aligned correctly.
This method panics if the base address of the Host Controller Operational Registers is not aligned correctly .