Skip to main content

Write

Trait Write 

Source
pub trait Write {
    type Error;

    // Required method
    fn write(
        &mut self,
        ctrl_bits: u16,
        data_bits: u16,
    ) -> Result<(), Self::Error>;
}
Expand description

Performing write operations via an MDIO interface.

Required Associated Types§

Source

type Error

Errors that might occur during MDIO operation.

Required Methods§

Source

fn write(&mut self, ctrl_bits: u16, data_bits: u16) -> Result<(), Self::Error>

Given the 16 control bits and 16 bits of data, perform an MDIO write operation.

§MIIM

In the standard MIIM protocol, the ctrl_bits should contain the following in order:

  • Start of frame (2 bits) 01.
  • Op code (2 bits) 01.
  • PHY address (5 bits)
  • Register address (5 bits)
  • Turn around (2 bits) 10.

See the miim::Write trait.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, T> Write for &'a mut T
where T: Write,

Source§

type Error = <T as Write>::Error

Source§

fn write(&mut self, ctrl_bits: u16, data_bits: u16) -> Result<(), Self::Error>

Implementors§

Source§

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,

Source§

type Error = E