From cb3f09485dd913ec4133707fe4511c38ce3d80b3 Mon Sep 17 00:00:00 2001 From: Frank Sautter Date: Thu, 8 Feb 2018 00:54:10 +0100 Subject: [PATCH] Set direction of SMI pins MDC and MDIO correctly. Merges https://github.com/espressif/esp-idf/pull/1594 --- components/ethernet/eth_phy/phy_common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/ethernet/eth_phy/phy_common.c b/components/ethernet/eth_phy/phy_common.c index 88e5d0c73..26a7a304d 100644 --- a/components/ethernet/eth_phy/phy_common.c +++ b/components/ethernet/eth_phy/phy_common.c @@ -40,8 +40,12 @@ void phy_rmii_configure_data_interface_pins(void) void phy_rmii_smi_configure_pins(uint8_t mdc_gpio, uint8_t mdio_gpio) { + // setup SMI MDC pin + gpio_set_direction(mdc_gpio, GPIO_MODE_OUTPUT); gpio_matrix_out(mdc_gpio, EMAC_MDC_O_IDX, 0, 0); PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[mdc_gpio], PIN_FUNC_GPIO); + // setup SMI MDIO pin + gpio_set_direction(mdio_gpio, GPIO_MODE_INPUT_OUTPUT); gpio_matrix_out(mdio_gpio, EMAC_MDO_O_IDX, 0, 0); gpio_matrix_in(mdio_gpio, EMAC_MDI_I_IDX, 0); PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[mdio_gpio], PIN_FUNC_GPIO);