morpheus_network::device::pci

Trait ConfigAccess

Source
pub trait ConfigAccess {
    // Required methods
    unsafe fn read32(&self, device: DeviceFunction, offset: u8) -> u32;
    unsafe fn write32(&self, device: DeviceFunction, offset: u8, value: u32);

    // Provided methods
    unsafe fn read16(&self, device: DeviceFunction, offset: u8) -> u16 { ... }
    unsafe fn read8(&self, device: DeviceFunction, offset: u8) -> u8 { ... }
}
Expand description

Trait for PCI configuration space access.

Required Methods§

Source

unsafe fn read32(&self, device: DeviceFunction, offset: u8) -> u32

Read a 32-bit value from configuration space.

§Safety

The offset must be valid and aligned to 4 bytes.

Source

unsafe fn write32(&self, device: DeviceFunction, offset: u8, value: u32)

Write a 32-bit value to configuration space.

§Safety

The offset must be valid and aligned to 4 bytes.

Provided Methods§

Source

unsafe fn read16(&self, device: DeviceFunction, offset: u8) -> u16

Read a 16-bit value from configuration space.

Source

unsafe fn read8(&self, device: DeviceFunction, offset: u8) -> u8

Read an 8-bit value from configuration space.

Implementors§