pub struct Command(/* private fields */);
Expand description
A PCI device’s Command
register.
Implementations§
Source§impl Command
impl Command
Sourcepub const IO_SPACE_ENABLED: Pack16<bool, Self>
pub const IO_SPACE_ENABLED: Pack16<bool, Self>
I/O Space Enabled
If set to 1 the device can respond to I/O Space accesses; otherwise, the device’s response is disabled.
Sourcepub const MEMORY_SPACE_ENABLED: Pack16<bool, Self>
pub const MEMORY_SPACE_ENABLED: Pack16<bool, Self>
Memory Space Enabled
If set to 1 the device can respond to Memory Space accesses; otherwise, the device’s response is disabled.
Sourcepub const BUS_MASTER: Pack16<bool, Self>
pub const BUS_MASTER: Pack16<bool, Self>
Bus Master
If set to 1, the device can behave as a bus master; otherwise, the device can not generate PCI accesses.
Sourcepub const SPECIAL_CYCLE_ENABLE: Pack16<bool, Self>
pub const SPECIAL_CYCLE_ENABLE: Pack16<bool, Self>
Special Cycle Enabled
If set to 1 the device can monitor Special Cycle operations; otherwise, the device will ignore them.
Sourcepub const MEMORY_WRITE_AND_INVALIDATE_ENABLED: Pack16<bool, Self>
pub const MEMORY_WRITE_AND_INVALIDATE_ENABLED: Pack16<bool, Self>
Memory Write and Invalidate Enabled
If set to 1 the device can generate the Memory Write and Invalidate command; otherwise, the Memory Write command must be used.
Sourcepub const VGA_PALETTE_SNOOP: Pack16<bool, Self>
pub const VGA_PALETTE_SNOOP: Pack16<bool, Self>
VGA Palette Snoop
If set to 1 the device does not respond to palette register writes and will snoop the data; otherwise, the device will treat palette write accesses like all other accesses.
Sourcepub const PARITY_ERROR_RESPONSE_ENABLED: Pack16<bool, Self>
pub const PARITY_ERROR_RESPONSE_ENABLED: Pack16<bool, Self>
Parity Error Response enabled
If set to 1 the device will take its normal action when a parity
error is detected; otherwise, when an error is detected, the device
will set bit 15 of the Status
register
(DETECTED_PARITY_ERROR
), but will not assert the PERR# (Parity
Error) pin and will continue operation as normal.
Sourcepub const SERR_ENABLED: Pack16<bool, Self>
pub const SERR_ENABLED: Pack16<bool, Self>
SERR#
Enabled
If set to 1 the SERR#
driver is enabled; otherwise, the driver is disabled.
Sourcepub const FAST_BACK_TO_BACK_ENABLED: Pack16<bool, Self>
pub const FAST_BACK_TO_BACK_ENABLED: Pack16<bool, Self>
Fast Back-To-Back Enabled
If set to 1, indicates a device is allowed to generate fast back-to-back transactions; otherwise, fast back-to-back transactions are only allowed to the same agent.
Sourcepub const INTERRUPT_DISABLE: Pack16<bool, Self>
pub const INTERRUPT_DISABLE: Pack16<bool, Self>
Interrupt Disable
If set to 1, the assertion of the devices INTx#
signal is
disabled; otherwise, assertion of the signal is enabled.
Sourcepub const fn from_bits(bits: u16) -> Self
pub const fn from_bits(bits: u16) -> Self
Constructs a new instance of Self
from the provided raw bits.
Sourcepub fn with<T>(self, field: Pack16<T, Self>, value: T) -> Self
pub fn with<T>(self, field: Pack16<T, Self>, value: T) -> Self
Packs the bit representation of value
into self
at the bit
range designated by field
, returning a new bitfield.
Sourcepub fn set<T>(&mut self, field: Pack16<T, Self>, value: T) -> &mut Self
pub fn set<T>(&mut self, field: Pack16<T, Self>, value: T) -> &mut Self
Packs the bit representation of value
into self
at the range
designated by field
, mutating self
in place.
Sourcepub fn get<T>(self, field: Pack16<T, Self>) -> T
pub fn get<T>(self, field: Pack16<T, Self>) -> T
Unpacks the bit range represented by field
from self
, and
converts it into a T
-typed value.
§Panics
This method panics if self
does not contain a valid bit
pattern for a T
-typed value, as determined by T
’s
FromBits::try_from_bits
implementation.
Sourcepub fn try_get<T>(self, field: Pack16<T, Self>) -> Result<T, T::Error>
pub fn try_get<T>(self, field: Pack16<T, Self>) -> Result<T, T::Error>
Unpacks the bit range represented by field
from self
and attempts to convert it into a T
-typed value.
§Returns
Ok(T)
if aT
-typed value could be constructed from the bits insrc
Err(T::Error)
ifsrc
does not contain a valid bit pattern for aT
-typed value, as determined byT
’s [FromBits::try_from_bits
implementation.
Sourcepub fn assert_valid()
pub fn assert_valid()
Asserts that all the packing specs for this type are valid.
This is intended to be used in unit tests.
Sourcepub fn display_ascii(&self) -> impl Display
pub fn display_ascii(&self) -> impl Display
Returns a value that formats this bitfield in a multi-line format, using only ASCII characters.
This is equivalent to formatting this bitfield using a {}
display specifier, but will never use Unicode box-drawing
characters, even when an upstream formatter uses the {:#}
fmt::Display
specifier. This is intended for use on platforms
where Unicode box drawing characters are never available.
Sourcepub fn display_unicode(&self) -> impl Display
pub fn display_unicode(&self) -> impl Display
Returns a value that formats this bitfield in a multi-line format, always using Unicode box-drawing characters.
This is equivalent to formatting this bitfield using a {:#}
format specifier, but will always use Unicode box-drawing
characters, even when an upstream formatter uses the {}
fmt::Display
specifier.
Trait Implementations§
Source§impl FromBits<u32> for Command
impl FromBits<u32> for Command
Source§type Error = Infallible
type Error = Infallible
Self::try_from_bits
when an invalid bit
pattern is encountered. Read more