diff --git a/include/libopencm3/ethernet/mac_stm32fxx7.h b/include/libopencm3/ethernet/mac_stm32fxx7.h index a14a9111..2d7546af 100644 --- a/include/libopencm3/ethernet/mac_stm32fxx7.h +++ b/include/libopencm3/ethernet/mac_stm32fxx7.h @@ -719,7 +719,7 @@ void eth_desc_init(uint8_t *buf, uint32_t nTx, uint32_t nRx, uint32_t cTx, bool eth_tx(uint8_t *ppkt, uint32_t n); bool eth_rx(uint8_t *ppkt, uint32_t *len, uint32_t maxlen); -void eth_init(enum eth_clk clock); +void eth_init(uint8_t phy,enum eth_clk clock); void eth_start(void); void eth_enable_checksum_offload(void); @@ -737,8 +737,8 @@ END_DECLS * rcc_periph_reset_pulse(RCC_ETHMAC); * [ init gpio pins ] * rcc_periph_reset_pulse(RCC_ETHMAC); - * phy_init(); - * eth_init(); + * phy_init(0); + * eth_init(0, ETH_CLK_025_035MHZ); * eth_set_mac(mac); * eth_desc_init(buffer, ð_buffer[0], ETH_TXBUFNB, ETH_RXBUFNB, * ETH_TX_BUF_SIZE, ETH_RX_BUF_SIZE, false); diff --git a/lib/ethernet/mac_stm32fxx7.c b/lib/ethernet/mac_stm32fxx7.c index 16f76a84..2ed1b00e 100644 --- a/lib/ethernet/mac_stm32fxx7.c +++ b/lib/ethernet/mac_stm32fxx7.c @@ -200,10 +200,10 @@ void eth_start(void) * * @param[in] clock enum eth_clk Core clock speed */ -void eth_init(enum eth_clk clock) +void eth_init(uint8_t phy, enum eth_clk clock) { ETH_MACMIIAR = clock; - phy_reset(); + phy_reset(phy); ETH_MACCR = ETH_MACCR_CSTF | ETH_MACCR_FES | ETH_MACCR_DM | ETH_MACCR_APCS | ETH_MACCR_RD;