[][src]Struct mdio::bb::Mdio

pub struct Mdio<MdioPin, MdcPin, Clk> { /* fields omitted */ }

A type providing a "bit-banged" MDIO implementation around two given GPIO pins.

Read

The mdio::Read implementation works as follows:

  • Writes the 32-bit preamble.
  • Writes the 14 most significant bits of the given ctrl_bits in MSB order.
  • Waits for 2 bit times for the turn around.
  • Reads the 16-bit data using u16::from_be_bytes.

Write

The mdio::Write implementation works as follows:

  • Writes the 32-bit preamble.
  • Writes the 16-bit ctrl value in MSB order.
  • Writes the 16-bit data in MSB order.

Implementations

impl<MdioPin, MdcPin, Clk, E> Mdio<MdioPin, MdcPin, Clk> where
    MdcPin: OutputPin<Error = E>,
    MdioPin: InputPin<Error = E> + OutputPin<Error = E>,
    Clk: CountDown + Periodic
[src]

pub fn new(mdio: MdioPin, mdc: MdcPin, clk: Clk) -> Self[src]

Create the bit-banged MDIO instance.

pub fn into_parts(self) -> (MdioPin, MdcPin, Clk)[src]

Split the MDIO bit-banged implementation into its parts.

Trait Implementations

impl<MdioPin, MdcPin, Clk, E> Read for Mdio<MdioPin, MdcPin, Clk> where
    MdcPin: OutputPin<Error = E>,
    MdioPin: InputPin<Error = E> + OutputPin<Error = E>,
    Clk: CountDown + Periodic
[src]

type Error = E

Errors that might occur during MDIO operation.

impl<MdioPin, MdcPin, Clk, E> Write for Mdio<MdioPin, MdcPin, Clk> where
    MdcPin: OutputPin<Error = E>,
    MdioPin: InputPin<Error = E> + OutputPin<Error = E>,
    Clk: CountDown + Periodic
[src]

type Error = E

Errors that might occur during MDIO operation.

Auto Trait Implementations

impl<MdioPin, MdcPin, Clk> Send for Mdio<MdioPin, MdcPin, Clk> where
    Clk: Send,
    MdcPin: Send,
    MdioPin: Send
[src]

impl<MdioPin, MdcPin, Clk> Sync for Mdio<MdioPin, MdcPin, Clk> where
    Clk: Sync,
    MdcPin: Sync,
    MdioPin: Sync
[src]

impl<MdioPin, MdcPin, Clk> Unpin for Mdio<MdioPin, MdcPin, Clk> where
    Clk: Unpin,
    MdcPin: Unpin,
    MdioPin: Unpin
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Read for T where
    T: Read
[src]

type Error = <T as Read>::Error

Errors that might occur on the MIIM interface.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Write for T where
    T: Write
[src]

type Error = <T as Write>::Error

Errors that might occur on the MIIM interface.