Enum w5500_ll::OperationMode [−][src]
#[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
10BT half-duplex. Auto-negotiation disabled.
10BT full-duplex. Auto-negotiation disabled.
100BT half-duplex. Auto-negotiation disabled.
100BT full-duplex. Auto-negotiation disabled.
100BT half-duplex. Auto-negotiation enabled.
Power down mode.
All capable. Auto-negotiation enabled.
Implementations
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
Performs the conversion.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
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
Mutably borrows from an owned value. Read more