new_with_mii

Function new_with_mii 

Source
pub fn new_with_mii<'rx, 'tx, REFCLK, CRS, TXEN, TXD0, TXD1, RXD0, RXD1, MDIO, MDC>(
    parts: PartsIn,
    rx_buffer: &'rx mut [RxRingEntry],
    tx_buffer: &'tx mut [TxRingEntry],
    clocks: Clocks,
    pins: EthPins<REFCLK, CRS, TXEN, TXD0, TXD1, RXD0, RXD1>,
    mdio: MDIO,
    mdc: MDC,
) -> Result<Parts<'rx, 'tx, EthernetMACWithMii<MDIO, MDC>>, WrongClock>
Expand description

Create and initialise the ethernet driver.

Initialize and start tx and rx DMA engines. Sets up the peripheral clocks and GPIO configuration, and configures the ETH MAC and DMA peripherals. Automatically sets slew rate to VeryHigh.

This method does not initialise the external PHY.

The speed of the MAC is set to Speed::FullDuplexBase100Tx. This can be changed using EthernetMAC::set_speed.

The MII for the external PHY can be accessed through the returned EthernetMACWithMii, .

ยงNote

  • Make sure that the buffers reside in a memory region that is accessible by the peripheral. Core-Coupled Memory (CCM) is usually not accessible.
  • HCLK must be at least 25 MHz.