Kconfig.projbuild 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. menu "Example Ethernet Configuration"
  2. orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps"
  3. config EXAMPLE_USE_INTERNAL_ETHERNET
  4. depends on SOC_EMAC_SUPPORTED
  5. select ETH_USE_ESP32_EMAC
  6. default y
  7. bool "Internal EMAC"
  8. help
  9. Use internal Ethernet MAC controller.
  10. if EXAMPLE_USE_INTERNAL_ETHERNET
  11. choice EXAMPLE_ETH_PHY_MODEL
  12. prompt "Ethernet PHY Device"
  13. default EXAMPLE_ETH_PHY_IP101
  14. help
  15. Select the Ethernet PHY device to use in the example.
  16. config EXAMPLE_ETH_PHY_IP101
  17. bool "IP101"
  18. help
  19. IP101 is a single port 10/100 MII/RMII/TP/Fiber Fast Ethernet Transceiver.
  20. Goto http://www.icplus.com.tw/pp-IP101G.html for more information about it.
  21. config EXAMPLE_ETH_PHY_RTL8201
  22. bool "RTL8201/SR8201"
  23. help
  24. RTL8201F/SR8201F is a single port 10/100Mb Ethernet Transceiver with auto MDIX.
  25. Goto http://www.corechip-sz.com/productsview.asp?id=22 for more information about it.
  26. config EXAMPLE_ETH_PHY_LAN87XX
  27. bool "LAN87xx"
  28. help
  29. Below chips are supported:
  30. LAN8710A is a small footprint MII/RMII 10/100 Ethernet Transceiver with HP Auto-MDIX and
  31. flexPWR® Technology.
  32. LAN8720A is a small footprint RMII 10/100 Ethernet Transceiver with HP Auto-MDIX Support.
  33. LAN8740A/LAN8741A is a small footprint MII/RMII 10/100 Energy Efficient Ethernet Transceiver
  34. with HP Auto-MDIX and flexPWR® Technology.
  35. LAN8742A is a small footprint RMII 10/100 Ethernet Transceiver with HP Auto-MDIX and
  36. flexPWR® Technology.
  37. Goto https://www.microchip.com for more information about them.
  38. config EXAMPLE_ETH_PHY_DP83848
  39. bool "DP83848"
  40. help
  41. DP83848 is a single port 10/100Mb/s Ethernet Physical Layer Transceiver.
  42. Goto http://www.ti.com/product/DP83848J for more information about it.
  43. config EXAMPLE_ETH_PHY_KSZ80XX
  44. bool "KSZ80xx"
  45. help
  46. With the KSZ80xx series, Microchip offers single-chip 10BASE-T/100BASE-TX
  47. Ethernet Physical Layer Tranceivers (PHY).
  48. The following chips are supported: KSZ8001, KSZ8021, KSZ8031, KSZ8041,
  49. KSZ8051, KSZ8061, KSZ8081, KSZ8091
  50. Goto https://www.microchip.com for more information about them.
  51. endchoice # EXAMPLE_ETH_PHY_MODEL
  52. config EXAMPLE_ETH_MDC_GPIO
  53. int "SMI MDC GPIO number"
  54. range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
  55. default 23
  56. help
  57. Set the GPIO number used by SMI MDC.
  58. config EXAMPLE_ETH_MDIO_GPIO
  59. int "SMI MDIO GPIO number"
  60. range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
  61. default 18
  62. help
  63. Set the GPIO number used by SMI MDIO.
  64. config EXAMPLE_ETH_PHY_RST_GPIO
  65. int "PHY Reset GPIO number"
  66. range -1 ENV_GPIO_OUT_RANGE_MAX
  67. default 5
  68. help
  69. Set the GPIO number used to reset PHY chip.
  70. Set to -1 to disable PHY chip hardware reset.
  71. config EXAMPLE_ETH_PHY_ADDR
  72. int "PHY Address"
  73. range 0 31
  74. default 1
  75. help
  76. Set PHY address according your board schematic.
  77. endif # EXAMPLE_USE_INTERNAL_ETHERNET
  78. config EXAMPLE_USE_SPI_ETHERNET
  79. bool "SPI Ethernet"
  80. default n
  81. select ETH_USE_SPI_ETHERNET
  82. help
  83. Use external SPI-Ethernet module(s).
  84. if EXAMPLE_USE_SPI_ETHERNET
  85. config EXAMPLE_SPI_ETHERNETS_NUM
  86. int "Number of SPI Ethernet modules to use at a time"
  87. range 1 2
  88. default 1
  89. help
  90. Set the number of SPI Ethernet modules you want to use at a time. Multiple SPI modules can be connected
  91. to one SPI interface and can be separately accessed based on state of associated Chip Select (CS).
  92. choice EXAMPLE_ETHERNET_TYPE_SPI
  93. prompt "Ethernet SPI"
  94. default EXAMPLE_USE_W5500
  95. help
  96. Select which kind of Ethernet will be used in the example.
  97. config EXAMPLE_USE_DM9051
  98. bool "DM9051 Module"
  99. select ETH_SPI_ETHERNET_DM9051
  100. help
  101. Select external SPI-Ethernet module (DM9051).
  102. config EXAMPLE_USE_KSZ8851SNL
  103. bool "KSZ8851SNL Module"
  104. select ETH_SPI_ETHERNET_KSZ8851SNL
  105. help
  106. Select external SPI-Ethernet module (KSZ8851SNL).
  107. config EXAMPLE_USE_W5500
  108. bool "W5500 Module"
  109. select ETH_SPI_ETHERNET_W5500
  110. help
  111. Select external SPI-Ethernet module (W5500).
  112. endchoice
  113. config EXAMPLE_ETH_SPI_HOST
  114. int "SPI Host Number"
  115. range 0 2
  116. default 1
  117. help
  118. Set the SPI host used to communicate with the SPI Ethernet Controller.
  119. config EXAMPLE_ETH_SPI_SCLK_GPIO
  120. int "SPI SCLK GPIO number"
  121. range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
  122. default 14 if IDF_TARGET_ESP32
  123. default 12 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
  124. default 6 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C6
  125. default 4 if IDF_TARGET_ESP32H2
  126. help
  127. Set the GPIO number used by SPI SCLK.
  128. config EXAMPLE_ETH_SPI_MOSI_GPIO
  129. int "SPI MOSI GPIO number"
  130. range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
  131. default 13 if IDF_TARGET_ESP32
  132. default 11 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
  133. default 7 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C6
  134. default 5 if IDF_TARGET_ESP32H2
  135. help
  136. Set the GPIO number used by SPI MOSI.
  137. config EXAMPLE_ETH_SPI_MISO_GPIO
  138. int "SPI MISO GPIO number"
  139. range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX
  140. default 12 if IDF_TARGET_ESP32
  141. default 13 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
  142. default 2 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C6
  143. default 0 if IDF_TARGET_ESP32H2
  144. help
  145. Set the GPIO number used by SPI MISO.
  146. config EXAMPLE_ETH_SPI_CLOCK_MHZ
  147. int "SPI clock speed (MHz)"
  148. range 5 80
  149. default 16
  150. help
  151. Set the clock speed (MHz) of SPI interface.
  152. config EXAMPLE_ETH_SPI_CS0_GPIO
  153. int "SPI CS0 GPIO number for SPI Ethernet module #1"
  154. range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
  155. default 15 if IDF_TARGET_ESP32
  156. default 10 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32C2
  157. default 3 if IDF_TARGET_ESP32C6
  158. default 1 if IDF_TARGET_ESP32H2
  159. help
  160. Set the GPIO number used by SPI CS0, i.e. Chip Select associated with the first SPI Eth module).
  161. config EXAMPLE_ETH_SPI_CS1_GPIO
  162. depends on EXAMPLE_SPI_ETHERNETS_NUM > 1
  163. int "SPI CS1 GPIO number for SPI Ethernet module #2"
  164. range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
  165. default 32 if IDF_TARGET_ESP32
  166. default 7 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
  167. default 8 if IDF_TARGET_ESP32C3
  168. default 21 if IDF_TARGET_ESP32C6
  169. default 3 if IDF_TARGET_ESP32C2
  170. default 11 if IDF_TARGET_ESP32H2
  171. help
  172. Set the GPIO number used by SPI CS1, i.e. Chip Select associated with the second SPI Eth module.
  173. config EXAMPLE_ETH_SPI_INT0_GPIO
  174. int "Interrupt GPIO number SPI Ethernet module #1"
  175. range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX
  176. default 4 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3
  177. default 4 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C6
  178. default 10 if IDF_TARGET_ESP32H2
  179. help
  180. Set the GPIO number used by the first SPI Ethernet module interrupt line.
  181. config EXAMPLE_ETH_SPI_INT1_GPIO
  182. depends on EXAMPLE_SPI_ETHERNETS_NUM > 1
  183. int "Interrupt GPIO number SPI Ethernet module #2"
  184. range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX
  185. default 33 if IDF_TARGET_ESP32
  186. default 5 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32C2
  187. default 5 if IDF_TARGET_ESP32C6
  188. default 9 if IDF_TARGET_ESP32H2
  189. help
  190. Set the GPIO number used by the second SPI Ethernet module interrupt line.
  191. config EXAMPLE_ETH_SPI_PHY_RST0_GPIO
  192. int "PHY Reset GPIO number of SPI Ethernet Module #1"
  193. range -1 ENV_GPIO_OUT_RANGE_MAX
  194. default -1
  195. help
  196. Set the GPIO number used to reset PHY chip on the first SPI Ethernet module.
  197. Set to -1 to disable PHY chip hardware reset.
  198. config EXAMPLE_ETH_SPI_PHY_RST1_GPIO
  199. depends on EXAMPLE_SPI_ETHERNETS_NUM > 1
  200. int "PHY Reset GPIO number of SPI Ethernet Module #2"
  201. range -1 ENV_GPIO_OUT_RANGE_MAX
  202. default -1
  203. help
  204. Set the GPIO number used to reset PHY chip on the second SPI Ethernet module.
  205. Set to -1 to disable PHY chip hardware reset.
  206. config EXAMPLE_ETH_SPI_PHY_ADDR0
  207. int "PHY Address of SPI Ethernet Module #1"
  208. range 0 31
  209. default 1
  210. help
  211. Set the first SPI Ethernet module PHY address according your board schematic.
  212. config EXAMPLE_ETH_SPI_PHY_ADDR1
  213. depends on EXAMPLE_SPI_ETHERNETS_NUM > 1
  214. int "PHY Address of SPI Ethernet Module #2"
  215. range 0 31
  216. default 1
  217. help
  218. Set the second SPI Ethernet module PHY address according your board schematic.
  219. endif # EXAMPLE_USE_SPI_ETHERNET
  220. endmenu