Struct BarePhy

Source
pub struct BarePhy<MIIM>
where MIIM: Miim,
{ /* private fields */ }
Expand description

A base phy

Implementations§

Source§

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

Source

pub fn new(miim: MIIM, phy_address: u8, pause: Pause) -> BarePhy<MIIM>

Create a new bare PHY with the given MIIM, at the given PHY address, using pause as the advertised pause mode.

The PHY will calculate it’s best supported advertisement on the fly from details acquired through miim.

Source

pub fn release(self) -> MIIM

Release the underlying MIIM

Source

pub fn set_phy_addr(&mut self, phy_address: u8)

Change the PHY address

Trait Implementations§

Source§

impl<MIIM> Debug for BarePhy<MIIM>
where MIIM: Debug + Miim,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

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

Source§

fn best_supported_advertisement(&self) -> AutoNegotiationAdvertisement

The best advertisement this PHY can send out. Read more
Source§

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

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
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. Read more
Source§

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

Read the PHY identifier for this PHY. Read more
Source§

fn set_autonegotiation_advertisement( &mut self, ad: AutoNegotiationAdvertisement, )

Set the autonegotiation advertisement and restarts the autonegotiation process Read more
Source§

fn get_autonegotiation_caps(&mut self) -> Option<AutoNegotiationAdvertisement>

Get the advertised capabilities of this PHY Read more
Source§

fn get_autonegotiation_partner_caps( &mut self, ) -> Option<AutoNegotiationAdvertisement>

Get the capabilites of the autonegotiation partner of this PHY Read more
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
Source§

impl<MIIM> TryFrom<BarePhy<MIIM>> for KSZ8081R<MIIM>
where MIIM: Miim,

Source§

type Error = IdentPhyError

The type returned in the event of a conversion error.
Source§

fn try_from( value: BarePhy<MIIM>, ) -> Result<KSZ8081R<MIIM>, <KSZ8081R<MIIM> as TryFrom<BarePhy<MIIM>>>::Error>

Performs the conversion.
Source§

impl<MIIM> TryFrom<BarePhy<MIIM>> for LAN87xxA<MIIM, false>
where MIIM: Miim,

Source§

type Error = IdentPhyError

The type returned in the event of a conversion error.
Source§

fn try_from( value: BarePhy<MIIM>, ) -> Result<LAN87xxA<MIIM, false>, <LAN87xxA<MIIM, false> as TryFrom<BarePhy<MIIM>>>::Error>

Performs the conversion.
Source§

impl<MIIM> TryFrom<BarePhy<MIIM>> for LAN87xxA<MIIM, true>
where MIIM: Miim,

Source§

type Error = IdentPhyError

The type returned in the event of a conversion error.
Source§

fn try_from( value: BarePhy<MIIM>, ) -> Result<LAN87xxA<MIIM, true>, <LAN87xxA<MIIM, true> as TryFrom<BarePhy<MIIM>>>::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<MIIM> Freeze for BarePhy<MIIM>
where MIIM: Freeze,

§

impl<MIIM> RefUnwindSafe for BarePhy<MIIM>
where MIIM: RefUnwindSafe,

§

impl<MIIM> Send for BarePhy<MIIM>
where MIIM: Send,

§

impl<MIIM> Sync for BarePhy<MIIM>
where MIIM: Sync,

§

impl<MIIM> Unpin for BarePhy<MIIM>
where MIIM: Unpin,

§

impl<MIIM> UnwindSafe for BarePhy<MIIM>
where MIIM: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.