ethernet: update spi-ethernet api

This commit is contained in:
suda-morris
2019-09-18 18:28:55 +08:00
committed by bot
parent dc5b8a9a8f
commit 546ac64a9e
7 changed files with 41 additions and 29 deletions

View File

@@ -104,9 +104,9 @@ void app_main(void)
.queue_size = 20
};
ESP_ERROR_CHECK(spi_bus_add_device(CONFIG_EXAMPLE_ETH_SPI_HOST, &devcfg, &spi_handle));
/* dm9051 ethernet driver is based on spi driver, so need to specify the spi handle */
mac_config.spi_hdl = spi_handle;
esp_eth_mac_t *mac = esp_eth_mac_new_dm9051(&mac_config);
/* dm9051 ethernet driver is based on spi driver */
eth_dm9051_config_t dm9051_config = ETH_DM9051_DEFAULT_CONFIG(spi_handle);
esp_eth_mac_t *mac = esp_eth_mac_new_dm9051(&dm9051_config, &mac_config);
esp_eth_phy_t *phy = esp_eth_phy_new_dm9051(&phy_config);
#endif
esp_eth_config_t config = ETH_DEFAULT_CONFIG(mac, phy);