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)
|
2019-11-26 09:48:38 +00:00
|
|
|
set(priv_requires)
|
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)
|
2019-12-23 09:06:02 +00:00
|
|
|
set(srcs "src/esp_eth.c" "src/esp_eth_phy.c")
|
2019-08-13 05:11:46 +00:00
|
|
|
set(include "include")
|
2019-11-26 09:48:38 +00:00
|
|
|
set(priv_requires "driver" "log") # require "driver" for using some GPIO APIs
|
|
|
|
|
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")
|
|
|
|
list(APPEND priv_requires "esp_netif")
|
|
|
|
endif()
|
2019-11-26 09:48:38 +00:00
|
|
|
endif()
|
2019-08-13 05:11:46 +00:00
|
|
|
|
|
|
|
if(CONFIG_ETH_USE_ESP32_EMAC)
|
|
|
|
list(APPEND srcs "src/esp_eth_mac_esp32.c"
|
2019-11-14 04:03:14 +00:00
|
|
|
"src/esp_eth_phy_dp83848.c"
|
|
|
|
"src/esp_eth_phy_ip101.c"
|
2020-06-15 01:59:20 +00:00
|
|
|
"src/esp_eth_phy_ksz8041.c"
|
2019-11-14 04:03:14 +00:00
|
|
|
"src/esp_eth_phy_lan8720.c"
|
|
|
|
"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
|
|
|
|
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}
|
2019-11-26 09:48:38 +00:00
|
|
|
REQUIRES "esp_event" # For using "ESP_EVENT_DECLARE_BASE" in header file
|
|
|
|
PRIV_REQUIRES ${priv_requires})
|
|
|
|
|
|
|
|
# uses C11 atomic feature
|
|
|
|
set_source_files_properties(src/esp_eth.c PROPERTIES COMPILE_FLAGS -std=gnu11)
|