Struct KSZ8081R

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

A KSZ8081R

Implementations§

Source§

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

A mask for determining if the Link Up Interrupt occurred

A mask for determining if the Link Down Interrupt occurred

Source

pub fn new(miim: MIIM, phy_addr: u8) -> KSZ8081R<MIIM>

Create a new Ksz8081r at phy_addr, backed by the given miim,

Source

pub fn interrupt_enable(&mut self)

Enable the link up and link down interrupts

Get the link speed at which the PHY is currently operating

Source

pub fn get_interrupt_reg_val(&mut self) -> u16

Get the value of the interrupt register.

Use Self::INTERRUPT_REG_INT_LINK_UP and Self::INTERRUPT_REG_INT_LINK_DOWN to determine the type of interrupt that occurred

Check whether a link is established or not

Source

pub fn release(self) -> MIIM

Release the underlying Miim

Trait Implementations§

Source§

impl<MIIM> Debug for KSZ8081R<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 KSZ8081R<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 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 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 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> PhyWithSpeed<MIIM> for KSZ8081R<MIIM>
where MIIM: Miim,

Get the link speed at which this PHY is currently operating.
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.

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<MIIM> UnwindSafe for KSZ8081R<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.