Skip to main content

MdioBus

Trait MdioBus 

Source
pub trait MdioBus {
    // Required methods
    fn read(&mut self, phy_addr: u8, reg_addr: u8) -> u16;
    fn write(&mut self, phy_addr: u8, reg_addr: u8, value: u16);
}
Expand description

Generic MDIO bus interface for Clause 22 PHY register access.

PHY drivers are generic over this trait so they can live in external crates without depending on the concrete MdioDriver. PHY and register addresses are 5-bit Clause 22 fields (0-31).

Required Methods§

Source

fn read(&mut self, phy_addr: u8, reg_addr: u8) -> u16

Read a 16-bit PHY register.

Source

fn write(&mut self, phy_addr: u8, reg_addr: u8, value: u16)

Write a 16-bit PHY register.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<'a> MdioBus for MdioDriver<'a>

Available on crate feature unstable only.