mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
Merge branch 'feature/spi_eth_no_int_v5.2' into 'release/v5.2'
feat(esp_eth): added SPI Ethernet module polling mode (v5.2) See merge request espressif/esp-idf!29044
This commit is contained in:
@@ -80,6 +80,12 @@ menu "esp_eth TEST_APPS Configuration"
|
||||
help
|
||||
Set the clock speed (MHz) of SPI interface.
|
||||
|
||||
config TARGET_ETH_SPI_POLL_MS
|
||||
int "SPI Ethernet Polling period in msec"
|
||||
default 0
|
||||
help
|
||||
SPI Ethernet module polling period.
|
||||
|
||||
endif # TARGET_USE_SPI_ETHERNET
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -63,19 +63,30 @@ esp_eth_mac_t *mac_init(void *vendor_emac_config, eth_mac_config_t *mac_config)
|
||||
};
|
||||
#if CONFIG_TARGET_ETH_PHY_DEVICE_W5500
|
||||
eth_w5500_config_t w5500_config = ETH_W5500_DEFAULT_CONFIG(DEFAULT_TARGET_SPI_HOST, &devcfg);
|
||||
#if CONFIG_TARGET_ETH_SPI_POLL_MS > 0
|
||||
w5500_config.int_gpio_num = -1;
|
||||
w5500_config.poll_period_ms = CONFIG_TARGET_ETH_SPI_POLL_MS;
|
||||
#endif
|
||||
if (vendor_emac_config == NULL) {
|
||||
vendor_emac_config = &w5500_config;
|
||||
}
|
||||
mac = esp_eth_mac_new_w5500(vendor_emac_config, mac_config);
|
||||
#elif CONFIG_TARGET_ETH_PHY_DEVICE_KSZ8851SNL
|
||||
eth_ksz8851snl_config_t ksz8851snl_config = ETH_KSZ8851SNL_DEFAULT_CONFIG(DEFAULT_TARGET_SPI_HOST, &devcfg);
|
||||
ksz8851snl_config.int_gpio_num = 4;
|
||||
#if CONFIG_TARGET_ETH_SPI_POLL_MS > 0
|
||||
ksz8851snl_config.int_gpio_num = -1;
|
||||
ksz8851snl_config.poll_period_ms = CONFIG_TARGET_ETH_SPI_POLL_MS;
|
||||
#endif
|
||||
if (vendor_emac_config == NULL) {
|
||||
vendor_emac_config = &ksz8851snl_config;
|
||||
}
|
||||
mac = esp_eth_mac_new_ksz8851snl(vendor_emac_config, mac_config);
|
||||
#elif CONFIG_TARGET_ETH_PHY_DEVICE_DM9051
|
||||
eth_dm9051_config_t dm9051_config = ETH_DM9051_DEFAULT_CONFIG(DEFAULT_TARGET_SPI_HOST, &devcfg);
|
||||
#if CONFIG_TARGET_ETH_SPI_POLL_MS > 0
|
||||
dm9051_config.int_gpio_num = -1;
|
||||
dm9051_config.poll_period_ms = CONFIG_TARGET_ETH_SPI_POLL_MS;
|
||||
#endif
|
||||
if (vendor_emac_config == NULL) {
|
||||
vendor_emac_config = &dm9051_config ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user