embassy-net-adin1110

Crates

git

Versions

default

Flavors

embassy_net_adin1110

Trait MdioBus

Source
pub trait MdioBus {
    type Error;

    // Required methods
    async fn read_cl22(
        &mut self,
        phy_id: u8,
        reg: u8,
    ) -> Result<u16, Self::Error>;
    async fn write_cl22(
        &mut self,
        phy_id: u8,
        reg: u8,
        reg_val: u16,
    ) -> Result<(), Self::Error>;

    // Provided methods
    async fn read_cl45(
        &mut self,
        phy_id: u8,
        regc45: (u8, u16),
    ) -> Result<u16, Self::Error> { ... }
    async fn write_cl45(
        &mut self,
        phy_id: u8,
        regc45: (u8, u16),
        reg_val: u16,
    ) -> Result<(), Self::Error> { ... }
}
Expand description

MdioBus trait Driver needs to implement the Clause 22 Optional Clause 45 is the device supports this.

Clause 45 methodes are bases on https://www.ieee802.org/3/efm/public/nov02/oam/pannell_oam_1_1102.pdf

Required Associated Types§

Source

type Error

Error type.

Required Methods§

Source

async fn read_cl22(&mut self, phy_id: u8, reg: u8) -> Result<u16, Self::Error>

Read, Clause 22

Source

async fn write_cl22( &mut self, phy_id: u8, reg: u8, reg_val: u16, ) -> Result<(), Self::Error>

Write, Clause 22

Provided Methods§

Source

async fn read_cl45( &mut self, phy_id: u8, regc45: (u8, u16), ) -> Result<u16, Self::Error>

Read, Clause 45 This is the default implementation. Many hardware these days support direct Clause 45 operations. Implement this function when your hardware supports it.

Source

async fn write_cl45( &mut self, phy_id: u8, regc45: (u8, u16), reg_val: u16, ) -> Result<(), Self::Error>

Write, Clause 45 This is the default implementation. Many hardware these days support direct Clause 45 operations. Implement this function when your hardware supports it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§