Enum w5500_ll::OperationMode
source · #[repr(u8)]pub enum OperationMode {
HalfDuplex10bt,
FullDuplex10bt,
HalfDuplex100bt,
FullDuplex100bt,
HalfDuplex100btAuto,
PowerDown,
Auto,
}
Expand description
PHY operation mode.
This is used by PhyCfg::opmdc
method for the phycfgr
register.
Variants§
HalfDuplex10bt
10BT half-duplex. Auto-negotiation disabled.
FullDuplex10bt
10BT full-duplex. Auto-negotiation disabled.
HalfDuplex100bt
100BT half-duplex. Auto-negotiation disabled.
FullDuplex100bt
100BT full-duplex. Auto-negotiation disabled.
HalfDuplex100btAuto
100BT half-duplex. Auto-negotiation enabled.
PowerDown
Power down mode.
Auto
All capable. Auto-negotiation enabled.
Implementations§
source§impl OperationMode
impl OperationMode
sourcepub const fn from_raw(val: u8) -> Self
pub const fn from_raw(val: u8) -> Self
Convert a raw u8
to an OperationMode
.
Only the first 3 bits of the u8
value are used.
Example
use w5500_ll::OperationMode;
assert_eq!(
OperationMode::from_raw(0b000),
OperationMode::HalfDuplex10bt
);
assert_eq!(
OperationMode::from_raw(0b001),
OperationMode::FullDuplex10bt
);
assert_eq!(
OperationMode::from_raw(0b010),
OperationMode::HalfDuplex100bt
);
assert_eq!(
OperationMode::from_raw(0b011),
OperationMode::FullDuplex100bt
);
assert_eq!(
OperationMode::from_raw(0b100),
OperationMode::HalfDuplex100btAuto
);
assert_eq!(OperationMode::from_raw(0b110), OperationMode::PowerDown);
assert_eq!(OperationMode::from_raw(0b111), OperationMode::Auto);
Trait Implementations§
source§impl Clone for OperationMode
impl Clone for OperationMode
source§fn clone(&self) -> OperationMode
fn clone(&self) -> OperationMode
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for OperationMode
impl Debug for OperationMode
source§impl Default for OperationMode
impl Default for OperationMode
source§impl Format for OperationMode
impl Format for OperationMode
source§impl From<OperationMode> for u8
impl From<OperationMode> for u8
source§fn from(val: OperationMode) -> u8
fn from(val: OperationMode) -> u8
Converts to this type from the input type.
source§impl Hash for OperationMode
impl Hash for OperationMode
source§impl Ord for OperationMode
impl Ord for OperationMode
source§fn cmp(&self, other: &OperationMode) -> Ordering
fn cmp(&self, other: &OperationMode) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<OperationMode> for OperationMode
impl PartialEq<OperationMode> for OperationMode
source§fn eq(&self, other: &OperationMode) -> bool
fn eq(&self, other: &OperationMode) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<OperationMode> for OperationMode
impl PartialOrd<OperationMode> for OperationMode
source§fn partial_cmp(&self, other: &OperationMode) -> Option<Ordering>
fn partial_cmp(&self, other: &OperationMode) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for OperationMode
impl Eq for OperationMode
impl StructuralEq for OperationMode
impl StructuralPartialEq for OperationMode
Auto Trait Implementations§
impl RefUnwindSafe for OperationMode
impl Send for OperationMode
impl Sync for OperationMode
impl Unpin for OperationMode
impl UnwindSafe for OperationMode
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
Mutably borrows from an owned value. Read more