Skip to main content

GenericPhy

Struct GenericPhy 

Source
pub struct GenericPhy { /* private fields */ }
Expand description

Generic PHY driver that works with IEEE 802.3 compliant PHYs.

For the CH32V307 built-in 10M PHY, use InternalPhy instead.

Implementations§

Source§

impl GenericPhy

Source

pub fn new(phy_addr: u8) -> Self

Create a new generic PHY driver.

phy_addr is the SMI address of the PHY (0-31).

Trait Implementations§

Source§

impl Phy for GenericPhy

Source§

fn phy_reset(&mut self, smi: &mut Smi) -> Result<(), SmiError>

Reset the PHY and wait for it to come out of reset.
Source§

fn phy_init(&mut self, smi: &mut Smi) -> Result<(), SmiError>

Initialize the PHY (enable autonegotiation, etc).
Poll the link state. Returns true if link is up.
Source§

fn full_duplex(&mut self, _smi: &mut Smi) -> Result<bool, SmiError>

Duplex mode of the established link (called on each link-up). Returns true for full duplex. The default keeps the MAC in full duplex.
Source§

fn speed_100m(&mut self, _smi: &mut Smi) -> Result<bool, SmiError>

Speed of the established link (called on each link-up). Returns true for 100 Mbit/s. The default keeps the MAC at 100 Mbit/s.
Source§

fn next_polarity(&mut self, _smi: &mut Smi) -> Result<bool, SmiError>

Switch to the next receive-pair polarity and restart auto-negotiation. Read more

Auto Trait Implementations§

§

impl Freeze for GenericPhy

§

impl RefUnwindSafe for GenericPhy

§

impl Send for GenericPhy

§

impl Sync for GenericPhy

§

impl Unpin for GenericPhy

§

impl UnsafeUnpin for GenericPhy

§

impl UnwindSafe for GenericPhy

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.