Trait Phy

Source
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§

Source

fn best_supported_advertisement(&self) -> AutoNegotiationAdvertisement

The best advertisement this PHY can send out.

“Best”, in this case, means largest amount of supported features

Source

fn get_miim(&mut self) -> &mut M

Get a mutable reference to the Media Independent Interface (Miim) for this PHY

Source

fn get_phy_addr(&self) -> u8

Get the address of this PHY

Provided Methods§

Source

fn read(&mut self, address: u8) -> u16

Read a PHY register over MIIM

Source

fn write(&mut self, address: u8, value: u16)

Write a PHY register over MIIM

Source

fn bcr(&mut self) -> Bcr

Get the raw value of the Base Control Register of this PHY

Source

fn modify_bcr<F>(&mut self, f: F)
where F: FnOnce(&mut Bcr),

Modify the Base Control Register of this PHY

Source

fn is_resetting(&mut self) -> bool

Check if the PHY is currently resetting

Source

fn reset(&mut self)

Reset the PHY. Verify that the reset by checking Self::is_resetting == false before continuing usage

Source

fn blocking_reset(&mut self)

Perform a reset, blocking until the reset is completed

Source

fn bsr(&mut self) -> Bsr

Get the raw value of the Base Status Register of this PHY

Check if the PHY reports its link as being up

Source

fn autoneg_completed(&mut self) -> bool

Check if the PHY reports its autonegotiation process as having completed

Source

fn status(&mut self) -> PhyStatus

Read the status register for this PHY

Source

fn esr(&mut self) -> Option<Esr>

Read the ESR for this PHY. Will return None if extended_status in Self::status is false.

Source

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.

Source

fn phy_ident(&mut self) -> Option<PhyIdent>

Read the PHY identifier for this PHY.

Returns None if extended_capabilities in Self::status is false

Source

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

Source

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

Source

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

Source

fn ane(&mut self) -> Option<Ane>

This returns None if extended_caps in Self::status is false

Source

fn mmd_read(&mut self, mmd_address: u8, reg_address: u16) -> u16
where Self: Sized,

Read an MMD register

Source

fn mmd_write(&mut self, device_address: u8, reg_address: u16, reg_value: u16)
where Self: Sized,

Write an MMD register

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.

Implementors§

Source§

impl<M, const E: bool> Phy<M> for LAN87xxA<M, E>
where M: Miim,

Source§

impl<MIIM> Phy<MIIM> for BarePhy<MIIM>
where MIIM: Miim,

Source§

impl<MIIM> Phy<MIIM> for KSZ8081R<MIIM>
where MIIM: Miim,