Struct Stm32Mii

Source
pub struct Stm32Mii<'mac, 'pins, Mdio, Mdc> { /* private fields */ }
Expand description

Serial Management Interface

Borrows an EthernetMAC and holds a mutable borrow to the SMI pins.

Implementations§

Source§

impl<'mac, 'pins, Mdio, Mdc> Stm32Mii<'mac, 'pins, Mdio, Mdc>
where Mdio: MdioPin, Mdc: MdcPin,

Source

pub fn read(&mut self, phy: u8, reg: u8) -> u16

Read MII register reg from the PHY at address phy

Source

pub fn write(&mut self, phy: u8, reg: u8, data: u16)

Write the value data to MII register reg to the PHY at address phy

Source§

impl<'eth, 'pins, Mdio, Mdc> Stm32Mii<'eth, 'pins, Mdio, Mdc>
where Mdio: MdioPin, Mdc: MdcPin,

Source

pub fn new( mac: &'eth mut EthernetMAC, _mdio: &'pins mut Mdio, _mdc: &'pins mut Mdc, ) -> Self

Create a temporary Stm32Mii instance.

Temporarily take exclusive access to the MDIO and MDC pins to ensure they are not used elsewhere for the duration of SMI communication.

Trait Implementations§

Source§

impl<'eth, 'pins, Mdio, Mdc> Miim for Stm32Mii<'eth, 'pins, Mdio, Mdc>
where Mdio: MdioPin, Mdc: MdcPin,

Source§

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

Read an MII register Read more
Source§

fn write(&mut self, phy: u8, reg: u8, data: u16)

Write to an MII register

Auto Trait Implementations§

§

impl<'mac, 'pins, Mdio, Mdc> Freeze for Stm32Mii<'mac, 'pins, Mdio, Mdc>

§

impl<'mac, 'pins, Mdio, Mdc> RefUnwindSafe for Stm32Mii<'mac, 'pins, Mdio, Mdc>
where Mdio: RefUnwindSafe, Mdc: RefUnwindSafe,

§

impl<'mac, 'pins, Mdio, Mdc> Send for Stm32Mii<'mac, 'pins, Mdio, Mdc>
where Mdio: Send, Mdc: Send,

§

impl<'mac, 'pins, Mdio, Mdc> !Sync for Stm32Mii<'mac, 'pins, Mdio, Mdc>

§

impl<'mac, 'pins, Mdio, Mdc> Unpin for Stm32Mii<'mac, 'pins, Mdio, Mdc>

§

impl<'mac, 'pins, Mdio, Mdc> !UnwindSafe for Stm32Mii<'mac, 'pins, Mdio, Mdc>

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.