pub struct Ethernet<'d, T: Instance, P: Phy> { /* private fields */ }Expand description
Ethernet driver.
Implementations§
Source§impl<'d, T: Instance, SMA: Instance> Ethernet<'d, T, GenericPhy<Sma<'d, SMA>>>
impl<'d, T: Instance, SMA: Instance> Ethernet<'d, T, GenericPhy<Sma<'d, SMA>>>
Sourcepub fn new<const TX: usize, const RX: usize>(
queue: &'d mut PacketQueue<TX, RX>,
peri: Peri<'d, T>,
ref_clk: Peri<'d, impl RefClkPin<T>>,
crs: Peri<'d, impl CRSPin<T>>,
rx_d0: Peri<'d, impl RXD0Pin<T>>,
rx_d1: Peri<'d, impl RXD1Pin<T>>,
tx_d0: Peri<'d, impl TXD0Pin<T>>,
tx_d1: Peri<'d, impl TXD1Pin<T>>,
tx_en: Peri<'d, impl TXEnPin<T>>,
mac_addr: [u8; 6],
sma: Peri<'d, SMA>,
mdio: Peri<'d, impl MDIOPin<SMA>>,
mdc: Peri<'d, impl MDCPin<SMA>>,
irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
) -> Result<Self, Error>
pub fn new<const TX: usize, const RX: usize>( queue: &'d mut PacketQueue<TX, RX>, peri: Peri<'d, T>, ref_clk: Peri<'d, impl RefClkPin<T>>, crs: Peri<'d, impl CRSPin<T>>, rx_d0: Peri<'d, impl RXD0Pin<T>>, rx_d1: Peri<'d, impl RXD1Pin<T>>, tx_d0: Peri<'d, impl TXD0Pin<T>>, tx_d1: Peri<'d, impl TXD1Pin<T>>, tx_en: Peri<'d, impl TXEnPin<T>>, mac_addr: [u8; 6], sma: Peri<'d, SMA>, mdio: Peri<'d, impl MDIOPin<SMA>>, mdc: Peri<'d, impl MDCPin<SMA>>, irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, ) -> Result<Self, Error>
Create a new RMII ethernet driver using 7 pins.
This function uses a GenericPhy::new_auto as PHY, created using the
provided SMA, and MDIO and MDC pins.
See Ethernet::new_with_phy for creating an RMII ethernet
river with a non-standard PHY.
Returns an error if the MAC reset, MDIO transaction, or PHY initialization times out, or if no PHY responds during detection.
Sourcepub fn new_mii<const TX: usize, const RX: usize>(
queue: &'d mut PacketQueue<TX, RX>,
peri: Peri<'d, T>,
rx_clk: Peri<'d, impl RXClkPin<T>>,
tx_clk: Peri<'d, impl TXClkPin<T>>,
rxdv: Peri<'d, impl RXDVPin<T>>,
rx_d0: Peri<'d, impl RXD0Pin<T>>,
rx_d1: Peri<'d, impl RXD1Pin<T>>,
rx_d2: Peri<'d, impl RXD2Pin<T>>,
rx_d3: Peri<'d, impl RXD3Pin<T>>,
tx_d0: Peri<'d, impl TXD0Pin<T>>,
tx_d1: Peri<'d, impl TXD1Pin<T>>,
tx_d2: Peri<'d, impl TXD2Pin<T>>,
tx_d3: Peri<'d, impl TXD3Pin<T>>,
tx_en: Peri<'d, impl TXEnPin<T>>,
mac_addr: [u8; 6],
sma: Peri<'d, SMA>,
mdio: Peri<'d, impl MDIOPin<SMA>>,
mdc: Peri<'d, impl MDCPin<SMA>>,
irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
) -> Result<Self, Error>
pub fn new_mii<const TX: usize, const RX: usize>( queue: &'d mut PacketQueue<TX, RX>, peri: Peri<'d, T>, rx_clk: Peri<'d, impl RXClkPin<T>>, tx_clk: Peri<'d, impl TXClkPin<T>>, rxdv: Peri<'d, impl RXDVPin<T>>, rx_d0: Peri<'d, impl RXD0Pin<T>>, rx_d1: Peri<'d, impl RXD1Pin<T>>, rx_d2: Peri<'d, impl RXD2Pin<T>>, rx_d3: Peri<'d, impl RXD3Pin<T>>, tx_d0: Peri<'d, impl TXD0Pin<T>>, tx_d1: Peri<'d, impl TXD1Pin<T>>, tx_d2: Peri<'d, impl TXD2Pin<T>>, tx_d3: Peri<'d, impl TXD3Pin<T>>, tx_en: Peri<'d, impl TXEnPin<T>>, mac_addr: [u8; 6], sma: Peri<'d, SMA>, mdio: Peri<'d, impl MDIOPin<SMA>>, mdc: Peri<'d, impl MDCPin<SMA>>, irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, ) -> Result<Self, Error>
Create a new MII ethernet driver using 14 pins.
This function uses a GenericPhy::new_auto as PHY, created using the
provided SMA, and MDIO and MDC pins.
See Ethernet::new_mii_with_phy for creating an RMII ethernet
river with a non-standard PHY.
Returns an error if the MAC reset, MDIO transaction, or PHY initialization times out, or if no PHY responds during detection.
Source§impl<'d, T: Instance, P: Phy> Ethernet<'d, T, P>
impl<'d, T: Instance, P: Phy> Ethernet<'d, T, P>
Sourcepub fn new_with_phy<const TX: usize, const RX: usize>(
queue: &'d mut PacketQueue<TX, RX>,
peri: Peri<'d, T>,
ref_clk: Peri<'d, impl RefClkPin<T>>,
crs: Peri<'d, impl CRSPin<T>>,
rx_d0: Peri<'d, impl RXD0Pin<T>>,
rx_d1: Peri<'d, impl RXD1Pin<T>>,
tx_d0: Peri<'d, impl TXD0Pin<T>>,
tx_d1: Peri<'d, impl TXD1Pin<T>>,
tx_en: Peri<'d, impl TXEnPin<T>>,
irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
mac_addr: [u8; 6],
phy: P,
) -> Result<Self, Error>
pub fn new_with_phy<const TX: usize, const RX: usize>( queue: &'d mut PacketQueue<TX, RX>, peri: Peri<'d, T>, ref_clk: Peri<'d, impl RefClkPin<T>>, crs: Peri<'d, impl CRSPin<T>>, rx_d0: Peri<'d, impl RXD0Pin<T>>, rx_d1: Peri<'d, impl RXD1Pin<T>>, tx_d0: Peri<'d, impl TXD0Pin<T>>, tx_d1: Peri<'d, impl TXD1Pin<T>>, tx_en: Peri<'d, impl TXEnPin<T>>, irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, mac_addr: [u8; 6], phy: P, ) -> Result<Self, Error>
Create a new RMII ethernet driver using 7 pins.
Returns an error if the MAC reset or PHY initialization fails.
Sourcepub fn new_mii_with_phy<const TX: usize, const RX: usize>(
queue: &'d mut PacketQueue<TX, RX>,
peri: Peri<'d, T>,
rx_clk: Peri<'d, impl RXClkPin<T>>,
tx_clk: Peri<'d, impl TXClkPin<T>>,
rxdv: Peri<'d, impl RXDVPin<T>>,
rx_d0: Peri<'d, impl RXD0Pin<T>>,
rx_d1: Peri<'d, impl RXD1Pin<T>>,
rx_d2: Peri<'d, impl RXD2Pin<T>>,
rx_d3: Peri<'d, impl RXD3Pin<T>>,
tx_d0: Peri<'d, impl TXD0Pin<T>>,
tx_d1: Peri<'d, impl TXD1Pin<T>>,
tx_d2: Peri<'d, impl TXD2Pin<T>>,
tx_d3: Peri<'d, impl TXD3Pin<T>>,
tx_en: Peri<'d, impl TXEnPin<T>>,
irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
mac_addr: [u8; 6],
phy: P,
) -> Result<Self, Error>
pub fn new_mii_with_phy<const TX: usize, const RX: usize>( queue: &'d mut PacketQueue<TX, RX>, peri: Peri<'d, T>, rx_clk: Peri<'d, impl RXClkPin<T>>, tx_clk: Peri<'d, impl TXClkPin<T>>, rxdv: Peri<'d, impl RXDVPin<T>>, rx_d0: Peri<'d, impl RXD0Pin<T>>, rx_d1: Peri<'d, impl RXD1Pin<T>>, rx_d2: Peri<'d, impl RXD2Pin<T>>, rx_d3: Peri<'d, impl RXD3Pin<T>>, tx_d0: Peri<'d, impl TXD0Pin<T>>, tx_d1: Peri<'d, impl TXD1Pin<T>>, tx_d2: Peri<'d, impl TXD2Pin<T>>, tx_d3: Peri<'d, impl TXD3Pin<T>>, tx_en: Peri<'d, impl TXEnPin<T>>, irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, mac_addr: [u8; 6], phy: P, ) -> Result<Self, Error>
Create a new MII ethernet driver using 12 pins.
Returns an error if the MAC reset or PHY initialization fails.