pub struct ConfigSpace<'a, S: ConfigSpaceKind = Extended> { /* private fields */ }Expand description
The PCI configuration space of a device.
Provides typed read and write accessors for configuration registers
using the standard pci_read_config_* and pci_write_config_* helpers.
The generic parameter S indicates the maximum size of the configuration space.
Use Normal for 256-byte legacy configuration space or Extended for
4096-byte PCIe extended configuration space (default).
Trait Implementations§
Source§impl<'a, S: ConfigSpaceKind> Io for ConfigSpace<'a, S>
impl<'a, S: ConfigSpaceKind> Io for ConfigSpace<'a, S>
Source§fn addr(&self) -> usize
fn addr(&self) -> usize
Returns the base address of the I/O region. It is always 0 for configuration space.
Source§fn read8(&self, offset: usize) -> u8
fn read8(&self, offset: usize) -> u8
Read IO data from a given offset known at compile time.
Bound checks are performed on compile time, hence if the offset is not known at compile time, the build will fail.
Source§fn read16(&self, offset: usize) -> u16
fn read16(&self, offset: usize) -> u16
Read IO data from a given offset known at compile time.
Bound checks are performed on compile time, hence if the offset is not known at compile time, the build will fail.
Source§fn read32(&self, offset: usize) -> u32
fn read32(&self, offset: usize) -> u32
Read IO data from a given offset known at compile time.
Bound checks are performed on compile time, hence if the offset is not known at compile time, the build will fail.
Source§fn write8(&self, value: u8, offset: usize)
fn write8(&self, value: u8, offset: usize)
Write IO data from a given offset known at compile time.
Bound checks are performed on compile time, hence if the offset is not known at compile time, the build will fail.
Source§fn write16(&self, value: u16, offset: usize)
fn write16(&self, value: u16, offset: usize)
Write IO data from a given offset known at compile time.
Bound checks are performed on compile time, hence if the offset is not known at compile time, the build will fail.
Source§fn write32(&self, value: u32, offset: usize)
fn write32(&self, value: u32, offset: usize)
Write IO data from a given offset known at compile time.
Bound checks are performed on compile time, hence if the offset is not known at compile time, the build will fail.
Source§fn io_addr<U>(&self, offset: usize) -> Result<usize>
fn io_addr<U>(&self, offset: usize) -> Result<usize>
offset,
performing runtime bound checks.Source§fn try_read8(&self, _offset: usize) -> Result<u8>
fn try_read8(&self, _offset: usize) -> Result<u8>
Source§fn try_read16(&self, _offset: usize) -> Result<u16>
fn try_read16(&self, _offset: usize) -> Result<u16>
Source§fn try_read32(&self, _offset: usize) -> Result<u32>
fn try_read32(&self, _offset: usize) -> Result<u32>
Source§fn try_write8(&self, _value: u8, _offset: usize) -> Result
fn try_write8(&self, _value: u8, _offset: usize) -> Result
Source§impl<'a, S: ConfigSpaceKind> IoKnownSize for ConfigSpace<'a, S>
impl<'a, S: ConfigSpaceKind> IoKnownSize for ConfigSpace<'a, S>
impl<'a, S: ConfigSpaceKind> IoCapable<u16> for ConfigSpace<'a, S>
impl<'a, S: ConfigSpaceKind> IoCapable<u32> for ConfigSpace<'a, S>
impl<'a, S: ConfigSpaceKind> IoCapable<u8> for ConfigSpace<'a, S>
Auto Trait Implementations§
impl<'a, S> Freeze for ConfigSpace<'a, S>
impl<'a, S = Extended> !RefUnwindSafe for ConfigSpace<'a, S>
impl<'a, S = Extended> !Send for ConfigSpace<'a, S>
impl<'a, S = Extended> !Sync for ConfigSpace<'a, S>
impl<'a, S> Unpin for ConfigSpace<'a, S>where
S: Unpin,
impl<'a, S = Extended> !UnwindSafe for ConfigSpace<'a, S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
slot. Read more