pub struct Status(/* private fields */);
Expand description
A PCI device’s Status
register.
Implementations§
source§impl Status
impl Status
sourcepub const INTERRUPT_STATUS: Pack16<bool, Status> = _
pub const INTERRUPT_STATUS: Pack16<bool, Status> = _
Interrupt Status.
Represents the state of the device’s INTx#
signal. If set to 1 and
bit 10 of the Command
register ([INTERRUPT_DISABLE
]) is set to
0, the signal will be asserted; otherwise, the signal will be ignored.
sourcepub const CAPABILITIES_LIST: Pack16<bool, Status> = _
pub const CAPABILITIES_LIST: Pack16<bool, Status> = _
Capabilities List
If set to 1, the device implements the pointer for a New Capabilities
linked list at offset 0x34
; otherwise, the linked list is not available.
sourcepub const IS_66MHZ_CAPABLE: Pack16<bool, Status> = _
pub const IS_66MHZ_CAPABLE: Pack16<bool, Status> = _
66 MHz Capable
If set to 1 the device is capable of running at 66 MHz; otherwise, the device runs at 33 MHz.
sourcepub const FAST_BACK_TO_BACK_CAPABLE: Pack16<bool, Status> = _
pub const FAST_BACK_TO_BACK_CAPABLE: Pack16<bool, Status> = _
Fast Back-To-Back Capable
If set to 1 the device can accept fast back-to-back transactions that are not from the same agent; otherwise, transactions can only be accepted from the same agent.
sourcepub const MASTER_DATA_PARITY_ERROR: Pack16<bool, Status> = _
pub const MASTER_DATA_PARITY_ERROR: Pack16<bool, Status> = _
Master Data Parity Error
This bit is only set when the following conditions are met. The bus
agent asserted PERR#
on a read or observed an assertion of PERR#
on a write, the agent setting the bit acted as the bus master for
the operation in which the error occurred, and bit 6 of the
Command
register (PARITY_ERROR_RESPONSE
bit) is set to 1.
sourcepub const DEVSEL_TIMING: Pack16<DevselTiming, Status> = _
pub const DEVSEL_TIMING: Pack16<DevselTiming, Status> = _
DEVSEL#
Timing
Read-only bits that represent the slowest time that a device will
assert DEVSEL#
for any bus command except Configuration Space read
and writes. A value of 0x0 represents fast timing, a value of
0x1 represents medium timing, and a value of 0x2 represents slow
timing.
sourcepub const SIGNALLED_TARGET_ABORT: Pack16<bool, Status> = _
pub const SIGNALLED_TARGET_ABORT: Pack16<bool, Status> = _
Signalled Target Abort
This bit will be set to 1 whenever a target device terminates a transaction with Target-Abort.
sourcepub const RECEIVED_TARGET_ABORT: Pack16<bool, Status> = _
pub const RECEIVED_TARGET_ABORT: Pack16<bool, Status> = _
Received Target Abort
This bit will be set to 1, by a master device, whenever its transaction is terminated with Target-Abort.
sourcepub const RECEIVED_MASTER_ABORT: Pack16<bool, Status> = _
pub const RECEIVED_MASTER_ABORT: Pack16<bool, Status> = _
Received Master Abort
This bit will be set to 1, by a master device, whenever its transaction (except for Special Cycle transactions) is terminated with Master-Abort.
sourcepub const SIGNALLED_SYSTEM_ERROR: Pack16<bool, Status> = _
pub const SIGNALLED_SYSTEM_ERROR: Pack16<bool, Status> = _
Signalled System Error
This bit will be set to 1 whenever the device asserts SERR#
.
sourcepub const DETECTED_PARITY_ERROR: Pack16<bool, Status> = _
pub const DETECTED_PARITY_ERROR: Pack16<bool, Status> = _
Detected Parity Error
This bit will be set to 1 whenever the device detects a parity error, even if parity error handling is disabled.
sourcepub const fn from_bits(bits: u16) -> Status
pub const fn from_bits(bits: u16) -> Status
Constructs a new instance of Self
from the provided raw bits.
sourcepub fn with<T>(self, field: Pack16<T, Status>, value: T) -> Status
pub fn with<T>(self, field: Pack16<T, Status>, value: T) -> Status
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, Status>, value: T) -> &mut Status
pub fn set<T>(&mut self, field: Pack16<T, Status>, value: T) -> &mut Status
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, Status>) -> T
pub fn get<T>(self, field: Pack16<T, Status>) -> 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, Status>
) -> Result<T, <T as FromBits<u16>>::Error>
pub fn try_get<T>( self, field: Pack16<T, Status> ) -> Result<T, <T as FromBits<u16>>::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.
source§impl Status
impl Status
sourcepub fn received_abort(self) -> bool
pub fn received_abort(self) -> bool
Returns true
if this device received an abort (either a Master Abort
or Target Abort).
This returns true
if the Status::RECEIVED_MASTER_ABORT
or
Status::RECEIVED_TARGET_ABORT
bits are set.
Trait Implementations§
source§impl FromBits<u32> for Status
impl FromBits<u32> for Status
source§impl PartialEq for Status
impl PartialEq for Status
impl Copy for Status
impl Eq for Status
impl StructuralEq for Status
impl StructuralPartialEq for Status
Auto Trait Implementations§
impl RefUnwindSafe for Status
impl Send for Status
impl Sync for Status
impl Unpin for Status
impl UnwindSafe for Status
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> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.