pub struct Bcr { /* private fields */ }Expand description
Register 0, the Base Control Register
Implementations§
Source§impl Bcr
impl Bcr
pub const RESET: Bcr
pub const LOOPBACK: Bcr
pub const SPEED_SEL_LSB: Bcr
pub const AUTONEG_ENABLE: Bcr
pub const POWER_DOWN: Bcr
pub const ISOLATE: Bcr
pub const RESTART_AUTONEG: Bcr
pub const DUPLEX_MODE: Bcr
pub const COLLISION_TEST: Bcr
pub const SPEED_SEL_MSB: Bcr
pub const UNIDIRECTIONAL_ENABLE: Bcr
Sourcepub const fn from_bits(bits: u16) -> Option<Bcr>
pub const fn from_bits(bits: u16) -> Option<Bcr>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
Sourcepub const fn from_bits_truncate(bits: u16) -> Bcr
pub const fn from_bits_truncate(bits: u16) -> Bcr
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
Sourcepub const unsafe fn from_bits_unchecked(bits: u16) -> Bcr
pub const unsafe fn from_bits_unchecked(bits: u16) -> Bcr
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
§Safety
The caller of the bitflags! macro can chose to allow or
disallow extra bits for their bitflags type.
The caller of from_bits_unchecked() has to ensure that
all bits correspond to a defined flag or that extra bits
are valid for this bitflags type.
Sourcepub const fn intersects(&self, other: Bcr) -> bool
pub const fn intersects(&self, other: Bcr) -> bool
Returns true if there are flags common to both self and other.
Sourcepub const fn contains(&self, other: Bcr) -> bool
pub const fn contains(&self, other: Bcr) -> bool
Returns true if all of the flags in other are contained within self.
Sourcepub fn set(&mut self, other: Bcr, value: bool)
pub fn set(&mut self, other: Bcr, value: bool)
Inserts or removes the specified flags depending on the passed value.
Sourcepub const fn intersection(self, other: Bcr) -> Bcr
pub const fn intersection(self, other: Bcr) -> Bcr
Returns the intersection between the flags in self and
other.
Specifically, the returned set contains only the flags which are
present in both self and other.
This is equivalent to using the & operator (e.g.
ops::BitAnd), as in flags & other.
Sourcepub const fn union(self, other: Bcr) -> Bcr
pub const fn union(self, other: Bcr) -> Bcr
Returns the union of between the flags in self and other.
Specifically, the returned set contains all flags which are
present in either self or other, including any which are
present in both (see Self::symmetric_difference if that
is undesirable).
This is equivalent to using the | operator (e.g.
ops::BitOr), as in flags | other.
Sourcepub const fn difference(self, other: Bcr) -> Bcr
pub const fn difference(self, other: Bcr) -> Bcr
Returns the difference between the flags in self and other.
Specifically, the returned set contains all flags present in
self, except for the ones present in other.
It is also conceptually equivalent to the “bit-clear” operation:
flags & !other (and this syntax is also supported).
This is equivalent to using the - operator (e.g.
ops::Sub), as in flags - other.
Sourcepub const fn symmetric_difference(self, other: Bcr) -> Bcr
pub const fn symmetric_difference(self, other: Bcr) -> Bcr
Returns the symmetric difference between the flags
in self and other.
Specifically, the returned set contains the flags present which
are present in self or other, but that are not present in
both. Equivalently, it contains the flags present in exactly
one of the sets self and other.
This is equivalent to using the ^ operator (e.g.
ops::BitXor), as in flags ^ other.
Sourcepub const fn complement(self) -> Bcr
pub const fn complement(self) -> Bcr
Returns the complement of this set of flags.
Specifically, the returned set contains all the flags which are
not set in self, but which are allowed for this type.
Alternatively, it can be thought of as the set difference
between Self::all() and self (e.g. Self::all() - self)
This is equivalent to using the ! operator (e.g.
ops::Not), as in !flags.
Source§impl Bcr
impl Bcr
Sourcepub fn set_unidirectional(&mut self, value: bool) -> &mut Bcr
pub fn set_unidirectional(&mut self, value: bool) -> &mut Bcr
Configure unidirectional communications mode.
Sourcepub fn unidirectional(&self) -> bool
pub fn unidirectional(&self) -> bool
Get whether the PHY is configured for unidirectional communications mode.
Sourcepub fn set_collision_test(&mut self, value: bool) -> &mut Bcr
pub fn set_collision_test(&mut self, value: bool) -> &mut Bcr
Enable or disable the collision test signal.
Sourcepub fn collision_test(&self) -> bool
pub fn collision_test(&self) -> bool
Determine whether the collision test signal is enabled or disabled.
Sourcepub fn set_full_duplex(&mut self, value: bool) -> &mut Bcr
pub fn set_full_duplex(&mut self, value: bool) -> &mut Bcr
Enable or disable full duplex. This flag is ignored by the PHY if Self::autonegotiation is set.
Sourcepub fn full_duplex(&self) -> bool
pub fn full_duplex(&self) -> bool
true if full-duplex is enabled. This flag is ignored by the PHY if Self::autonegotiation is set.
Sourcepub fn set_isolated(&mut self, value: bool) -> &mut Bcr
pub fn set_isolated(&mut self, value: bool) -> &mut Bcr
Enable or disable electric isolation mode.
Sourcepub fn isolated(&self) -> bool
pub fn isolated(&self) -> bool
Determine whether electric isolation mode is enabled or disabled.
Sourcepub fn set_power_down(&mut self, value: bool) -> &mut Bcr
pub fn set_power_down(&mut self, value: bool) -> &mut Bcr
Enable or disable power down mode.
Sourcepub fn power_down(&self) -> bool
pub fn power_down(&self) -> bool
Determine whether power down is enabled or disabled.
Sourcepub fn set_autonegotiation(&mut self, value: bool) -> &mut Bcr
pub fn set_autonegotiation(&mut self, value: bool) -> &mut Bcr
Enable or disable autonegotiation.
Sourcepub fn autonegotiation(&self) -> bool
pub fn autonegotiation(&self) -> bool
Determine if autonegotiation is enabled or disabled.
Sourcepub fn set_loopback(&mut self, value: bool) -> &mut Bcr
pub fn set_loopback(&mut self, value: bool) -> &mut Bcr
Enable or disable loopback mode.
Sourcepub fn is_resetting(&self) -> bool
pub fn is_resetting(&self) -> bool
Determine if the PHY is currently resetting
Sourcepub fn restart_autonegotiation(&mut self) -> &mut Bcr
pub fn restart_autonegotiation(&mut self) -> &mut Bcr
Restart the autonegotiation process
Trait Implementations§
Source§impl BitAndAssign for Bcr
impl BitAndAssign for Bcr
Source§fn bitand_assign(&mut self, other: Bcr)
fn bitand_assign(&mut self, other: Bcr)
Disables all flags disabled in the set.
Source§impl BitOrAssign for Bcr
impl BitOrAssign for Bcr
Source§fn bitor_assign(&mut self, other: Bcr)
fn bitor_assign(&mut self, other: Bcr)
Adds the set of flags.
Source§impl BitXorAssign for Bcr
impl BitXorAssign for Bcr
Source§fn bitxor_assign(&mut self, other: Bcr)
fn bitxor_assign(&mut self, other: Bcr)
Toggles the set of flags.
Source§impl Extend<Bcr> for Bcr
impl Extend<Bcr> for Bcr
Source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = Bcr>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = Bcr>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl FromIterator<Bcr> for Bcr
impl FromIterator<Bcr> for Bcr
Source§impl Ord for Bcr
impl Ord for Bcr
Source§impl PartialOrd for Bcr
impl PartialOrd for Bcr
Source§impl SubAssign for Bcr
impl SubAssign for Bcr
Source§fn sub_assign(&mut self, other: Bcr)
fn sub_assign(&mut self, other: Bcr)
Disables all flags enabled in the set.