pub trait Phy<M>where
M: Miim,{
Show 23 methods
// Required methods
fn best_supported_advertisement(&self) -> AutoNegotiationAdvertisement;
fn get_miim(&mut self) -> &mut M;
fn get_phy_addr(&self) -> u8;
// Provided methods
fn read(&mut self, address: u8) -> u16 { ... }
fn write(&mut self, address: u8, value: u16) { ... }
fn bcr(&mut self) -> Bcr { ... }
fn modify_bcr<F>(&mut self, f: F)
where F: FnOnce(&mut Bcr) { ... }
fn is_resetting(&mut self) -> bool { ... }
fn reset(&mut self) { ... }
fn blocking_reset(&mut self) { ... }
fn bsr(&mut self) -> Bsr { ... }
fn phy_link_up(&mut self) -> bool { ... }
fn autoneg_completed(&mut self) -> bool { ... }
fn status(&mut self) -> PhyStatus { ... }
fn esr(&mut self) -> Option<Esr> { ... }
fn extended_status(&mut self) -> Option<ExtendedPhyStatus> { ... }
fn phy_ident(&mut self) -> Option<PhyIdent> { ... }
fn set_autonegotiation_advertisement(
&mut self,
ad: AutoNegotiationAdvertisement,
) { ... }
fn get_autonegotiation_caps(
&mut self,
) -> Option<AutoNegotiationAdvertisement> { ... }
fn get_autonegotiation_partner_caps(
&mut self,
) -> Option<AutoNegotiationAdvertisement> { ... }
fn ane(&mut self) -> Option<Ane> { ... }
fn mmd_read(&mut self, mmd_address: u8, reg_address: u16) -> u16
where Self: Sized { ... }
fn mmd_write(
&mut self,
device_address: u8,
reg_address: u16,
reg_value: u16,
)
where Self: Sized { ... }
}
Expand description
An IEEE 802.3 compatible PHY
Required Methods§
Sourcefn best_supported_advertisement(&self) -> AutoNegotiationAdvertisement
fn best_supported_advertisement(&self) -> AutoNegotiationAdvertisement
The best advertisement this PHY can send out.
“Best”, in this case, means largest amount of supported features
Sourcefn get_miim(&mut self) -> &mut M
fn get_miim(&mut self) -> &mut M
Get a mutable reference to the Media Independent Interface (Miim
) for this PHY
Sourcefn get_phy_addr(&self) -> u8
fn get_phy_addr(&self) -> u8
Get the address of this PHY
Provided Methods§
Sourcefn modify_bcr<F>(&mut self, f: F)
fn modify_bcr<F>(&mut self, f: F)
Modify the Base Control Register of this PHY
Sourcefn is_resetting(&mut self) -> bool
fn is_resetting(&mut self) -> bool
Check if the PHY is currently resetting
Sourcefn reset(&mut self)
fn reset(&mut self)
Reset the PHY. Verify that the reset by checking
Self::is_resetting
== false before continuing usage
Sourcefn blocking_reset(&mut self)
fn blocking_reset(&mut self)
Perform a reset, blocking until the reset is completed
Sourcefn phy_link_up(&mut self) -> bool
fn phy_link_up(&mut self) -> bool
Check if the PHY reports its link as being up
Sourcefn autoneg_completed(&mut self) -> bool
fn autoneg_completed(&mut self) -> bool
Check if the PHY reports its autonegotiation process as having completed
Sourcefn esr(&mut self) -> Option<Esr>
fn esr(&mut self) -> Option<Esr>
Read the ESR for this PHY. Will return None
if
extended_status
in Self::status
is false.
Sourcefn extended_status(&mut self) -> Option<ExtendedPhyStatus>
fn extended_status(&mut self) -> Option<ExtendedPhyStatus>
Read the Extended Status Register for this PHY.
Returns None
if extended_status
in Self::status
is false.
Sourcefn phy_ident(&mut self) -> Option<PhyIdent>
fn phy_ident(&mut self) -> Option<PhyIdent>
Read the PHY identifier for this PHY.
Returns None
if extended_capabilities
in Self::status
is false
Sourcefn set_autonegotiation_advertisement(
&mut self,
ad: AutoNegotiationAdvertisement,
)
fn set_autonegotiation_advertisement( &mut self, ad: AutoNegotiationAdvertisement, )
Set the autonegotiation advertisement and restarts the autonegotiation process
This is a no-op if extended_caps
in Self::status
is false
Sourcefn get_autonegotiation_caps(&mut self) -> Option<AutoNegotiationAdvertisement>
fn get_autonegotiation_caps(&mut self) -> Option<AutoNegotiationAdvertisement>
Get the advertised capabilities of this PHY
This is a no-op if extended_caps
in Self::status
is false
Sourcefn get_autonegotiation_partner_caps(
&mut self,
) -> Option<AutoNegotiationAdvertisement>
fn get_autonegotiation_partner_caps( &mut self, ) -> Option<AutoNegotiationAdvertisement>
Get the capabilites of the autonegotiation partner of this PHY
This is a no-op if extended_caps
in Self::status
is false
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.