Struct stm32_eth::mac::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> RefUnwindSafe for Stm32Mii<'mac, 'pins, Mdio, Mdc>where Mdc: RefUnwindSafe, Mdio: RefUnwindSafe,

§

impl<'mac, 'pins, Mdio, Mdc> Send for Stm32Mii<'mac, 'pins, Mdio, Mdc>where Mdc: Send, Mdio: 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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.