[−][src]Struct mdio::bb::Mdio
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]
MdcPin: OutputPin<Error = E>,
MdioPin: InputPin<Error = E> + OutputPin<Error = E>,
Clk: CountDown + Periodic,
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]
MdcPin: OutputPin<Error = E>,
MdioPin: InputPin<Error = E> + OutputPin<Error = E>,
Clk: CountDown + Periodic,
type Error = E
Errors that might occur during MDIO operation.
pub fn read(&mut self, ctrl_bits: u16) -> Result<u16, Self::Error>
[src]
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]
MdcPin: OutputPin<Error = E>,
MdioPin: InputPin<Error = E> + OutputPin<Error = E>,
Clk: CountDown + Periodic,
Auto Trait Implementations
impl<MdioPin, MdcPin, Clk> Send for Mdio<MdioPin, MdcPin, Clk> where
Clk: Send,
MdcPin: Send,
MdioPin: Send,
[src]
Clk: Send,
MdcPin: Send,
MdioPin: Send,
impl<MdioPin, MdcPin, Clk> Sync for Mdio<MdioPin, MdcPin, Clk> where
Clk: Sync,
MdcPin: Sync,
MdioPin: Sync,
[src]
Clk: Sync,
MdcPin: Sync,
MdioPin: Sync,
impl<MdioPin, MdcPin, Clk> Unpin for Mdio<MdioPin, MdcPin, Clk> where
Clk: Unpin,
MdcPin: Unpin,
MdioPin: Unpin,
[src]
Clk: Unpin,
MdcPin: Unpin,
MdioPin: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Read for T where
T: Read,
[src]
T: Read,
type Error = <T as Read>::Error
Errors that might occur on the MIIM interface.
pub fn read(&mut Self, u8, u8) -> Result<u16, <T as Read>::Error>
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Write for T where
T: Write,
[src]
T: Write,