Embassy
embassy-net-adin1110

Crates

git

Versions

default

Flavors

Trait embassy_net_adin1110::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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<SPI: SpiDevice> MdioBus for ADIN1110<SPI>

§

type Error = AdinError<<SPI as ErrorType>::Error>