2019-11-26 09:48:38 +00:00
|
|
|
idf_build_get_property(components_to_build BUILD_COMPONENTS)
|
|
|
|
|
2019-11-14 04:03:14 +00:00
|
|
|
set(srcs)
|
2019-08-13 05:11:46 +00:00
|
|
|
set(include)
|
2022-01-28 11:47:04 +00:00
|
|
|
# As CONFIG_ETH_ENABLED comes from Kconfig, it is not evaluated yet
|
|
|
|
# when components are being registered.
|
|
|
|
# Thus, always add the (private) requirements, regardless of Kconfig
|
|
|
|
set(priv_requires driver log esp_timer)
|
2019-04-10 08:24:50 +00:00
|
|
|
|
2019-11-14 04:03:14 +00:00
|
|
|
# If Ethernet disabled in Kconfig, this is a config-only component
|
2019-08-13 05:11:46 +00:00
|
|
|
if(CONFIG_ETH_ENABLED)
|
2022-05-13 10:03:56 +00:00
|
|
|
set(srcs "src/esp_eth.c" "src/esp_eth_phy_802_3.c")
|
2019-08-13 05:11:46 +00:00
|
|
|
set(include "include")
|
2019-11-26 09:48:38 +00:00
|
|
|
|
2020-01-09 11:32:51 +00:00
|
|
|
if(NOT CMAKE_BUILD_EARLY_EXPANSION)
|
|
|
|
# esp_netif related
|
|
|
|
if(esp_netif IN_LIST components_to_build)
|
|
|
|
list(APPEND srcs "src/esp_eth_netif_glue.c")
|
2020-07-21 09:15:19 +00:00
|
|
|
list(APPEND priv_requires esp_netif esp_pm)
|
2020-01-09 11:32:51 +00:00
|
|
|
endif()
|
2019-11-26 09:48:38 +00:00
|
|
|
endif()
|
2019-08-13 05:11:46 +00:00
|
|
|
|
|
|
|
if(CONFIG_ETH_USE_ESP32_EMAC)
|
2021-04-01 12:00:54 +00:00
|
|
|
list(APPEND srcs "src/esp_eth_mac_esp.c"
|
2019-11-14 04:03:14 +00:00
|
|
|
"src/esp_eth_phy_dp83848.c"
|
|
|
|
"src/esp_eth_phy_ip101.c"
|
2021-03-15 04:50:39 +00:00
|
|
|
"src/esp_eth_phy_ksz80xx.c"
|
2021-06-24 08:31:33 +00:00
|
|
|
"src/esp_eth_phy_lan87xx.c"
|
2019-11-14 04:03:14 +00:00
|
|
|
"src/esp_eth_phy_rtl8201.c")
|
2019-08-13 05:11:46 +00:00
|
|
|
endif()
|
2019-04-10 08:24:50 +00:00
|
|
|
|
2019-08-13 05:11:46 +00:00
|
|
|
if(CONFIG_ETH_SPI_ETHERNET_DM9051)
|
|
|
|
list(APPEND srcs "src/esp_eth_mac_dm9051.c"
|
2019-11-14 04:03:14 +00:00
|
|
|
"src/esp_eth_phy_dm9051.c")
|
2019-08-13 05:11:46 +00:00
|
|
|
endif()
|
2019-06-25 11:36:56 +00:00
|
|
|
|
2020-11-06 04:17:18 +00:00
|
|
|
if(CONFIG_ETH_SPI_ETHERNET_W5500)
|
|
|
|
list(APPEND srcs "src/esp_eth_mac_w5500.c"
|
|
|
|
"src/esp_eth_phy_w5500.c")
|
|
|
|
endif()
|
|
|
|
|
2021-03-01 03:39:23 +00:00
|
|
|
if(CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL)
|
|
|
|
list(APPEND srcs "src/esp_eth_mac_ksz8851snl.c"
|
|
|
|
"src/esp_eth_phy_ksz8851snl.c")
|
|
|
|
endif()
|
|
|
|
|
2019-11-14 04:03:14 +00:00
|
|
|
if(CONFIG_ETH_USE_OPENETH)
|
|
|
|
list(APPEND srcs "src/esp_eth_mac_openeth.c")
|
|
|
|
endif()
|
2019-10-01 16:50:34 +00:00
|
|
|
endif()
|
|
|
|
|
2019-08-13 05:11:46 +00:00
|
|
|
idf_component_register(SRCS "${srcs}"
|
2019-11-14 04:03:14 +00:00
|
|
|
INCLUDE_DIRS ${include}
|
2022-06-23 10:13:50 +00:00
|
|
|
REQUIRES esp_event # For using "ESP_EVENT_DECLARE_BASE" in header file
|
2019-11-26 09:48:38 +00:00
|
|
|
PRIV_REQUIRES ${priv_requires})
|
2022-06-23 10:13:50 +00:00
|
|
|
|
|
|
|
if(CONFIG_ETH_USE_SPI_ETHERNET)
|
|
|
|
idf_component_optional_requires(PUBLIC driver)
|
|
|
|
endif()
|