1menu "Example Connection Configuration"
2
3    config EXAMPLE_GPIO_RANGE_MIN
4        int
5        default 0
6
7    config EXAMPLE_GPIO_RANGE_MAX
8        int
9        default 33 if IDF_TARGET_ESP32
10        default 46 if IDF_TARGET_ESP32S2
11        default 19 if IDF_TARGET_ESP32C3
12        default 48 if IDF_TARGET_ESP32S3
13
14    config EXAMPLE_CONNECT_WIFI
15        bool "connect using WiFi interface"
16        default y
17        help
18            Protocol examples can use Wi-Fi and/or Ethernet to connect to the network.
19            Choose this option to connect with WiFi
20
21    if EXAMPLE_CONNECT_WIFI
22        config EXAMPLE_WIFI_SSID
23            string "WiFi SSID"
24            default "myssid"
25            help
26                SSID (network name) for the example to connect to.
27
28        config EXAMPLE_WIFI_PASSWORD
29            string "WiFi Password"
30            default "mypassword"
31            help
32                WiFi password (WPA or WPA2) for the example to use.
33                Can be left blank if the network has no security set.
34
35        choice EXAMPLE_WIFI_SCAN_METHOD
36            prompt "WiFi Scan Method"
37            default EXAMPLE_WIFI_SCAN_METHOD_ALL_CHANNEL
38            help
39                WiFi scan method:
40
41                If "Fast" is selected, scan will end after find SSID match AP.
42
43                If "All Channel" is selected, scan will end after scan all the channel.
44
45            config EXAMPLE_WIFI_SCAN_METHOD_FAST
46                bool "Fast"
47            config EXAMPLE_WIFI_SCAN_METHOD_ALL_CHANNEL
48                bool "All Channel"
49        endchoice
50
51        menu "WiFi Scan threshold"
52            config EXAMPLE_WIFI_SCAN_RSSI_THRESHOLD
53                int "WiFi minimum rssi"
54                range -127 0
55
56                default -127
57                help
58                    The minimum rssi to accept in the scan mode.
59
60            choice EXAMPLE_WIFI_SCAN_AUTH_MODE_THRESHOLD
61                prompt "WiFi Scan auth mode threshold"
62                default EXAMPLE_WIFI_AUTH_OPEN
63                help
64                    The weakest authmode to accept in the scan mode.
65
66                config EXAMPLE_WIFI_AUTH_OPEN
67                    bool "OPEN"
68                config EXAMPLE_WIFI_AUTH_WEP
69                    bool "WEP"
70                config EXAMPLE_WIFI_AUTH_WPA_PSK
71                    bool "WPA PSK"
72                config EXAMPLE_WIFI_AUTH_WPA2_PSK
73                    bool "WPA2 PSK"
74                config EXAMPLE_WIFI_AUTH_WPA_WPA2_PSK
75                    bool "WPA WPA2 PSK"
76                config EXAMPLE_WIFI_AUTH_WPA2_ENTERPRISE
77                    bool "WPA2 ENTERPRISE"
78                config EXAMPLE_WIFI_AUTH_WPA3_PSK
79                    bool "WPA3 PSK"
80                config EXAMPLE_WIFI_AUTH_WPA2_WPA3_PSK
81                    bool "WPA2 WPA3 PSK"
82                config EXAMPLE_WIFI_AUTH_WAPI_PSK
83                    bool "WAPI PSK"
84            endchoice
85        endmenu
86
87        choice EXAMPLE_WIFI_CONNECT_AP_SORT_METHOD
88            prompt "WiFi Connect AP Sort Method"
89            default EXAMPLE_WIFI_CONNECT_AP_BY_SIGNAL
90            help
91                WiFi connect AP sort method:
92
93                If "Signal" is selected, Sort matched APs in scan list by RSSI.
94
95                If "Security" is selected, Sort matched APs in scan list by security mode.
96
97            config EXAMPLE_WIFI_CONNECT_AP_BY_SIGNAL
98                bool "Signal"
99            config EXAMPLE_WIFI_CONNECT_AP_BY_SECURITY
100                bool "Security"
101        endchoice
102    endif
103
104    config EXAMPLE_CONNECT_ETHERNET
105        bool "connect using Ethernet interface"
106        default n
107        help
108            Protocol examples can use Wi-Fi and/or Ethernet to connect to the network.
109            Choose this option to connect with Ethernet
110
111    if EXAMPLE_CONNECT_ETHERNET
112        config EXAMPLE_USE_SPI_ETHERNET
113            bool
114
115        choice EXAMPLE_ETHERNET_TYPE
116            prompt "Ethernet Type"
117            default EXAMPLE_USE_INTERNAL_ETHERNET if IDF_TARGET_ESP32
118            default EXAMPLE_USE_W5500
119            help
120                Select which kind of Ethernet will be used in the example.
121
122            config EXAMPLE_USE_INTERNAL_ETHERNET
123                depends on IDF_TARGET_ESP32
124                select ETH_USE_ESP32_EMAC
125                bool "Internal EMAC"
126                help
127                    Select internal Ethernet MAC controller.
128
129            config EXAMPLE_USE_DM9051
130                bool "DM9051 Module"
131                select EXAMPLE_USE_SPI_ETHERNET
132                select ETH_USE_SPI_ETHERNET
133                select ETH_SPI_ETHERNET_DM9051
134                help
135                    Select external SPI-Ethernet module.
136
137            config EXAMPLE_USE_W5500
138                bool "W5500 Module"
139                select EXAMPLE_USE_SPI_ETHERNET
140                select ETH_USE_SPI_ETHERNET
141                select ETH_SPI_ETHERNET_W5500
142                help
143                    Select external SPI-Ethernet module (W5500).
144
145            config EXAMPLE_USE_OPENETH
146                bool "OpenCores Ethernet MAC (EXPERIMENTAL)"
147                select ETH_USE_OPENETH
148                help
149                    When this option is enabled, the example is built with support for
150                    OpenCores Ethernet MAC, which allows testing the example in QEMU.
151                    Note that this option is used for internal testing purposes, and
152                    not officially supported. Examples built with this option enabled
153                    will not run on a real ESP32 chip.
154
155        endchoice # EXAMPLE_ETHERNET_TYPE
156
157        if EXAMPLE_USE_INTERNAL_ETHERNET
158            choice EXAMPLE_ETH_PHY_MODEL
159                prompt "Ethernet PHY Device"
160                default EXAMPLE_ETH_PHY_IP101
161                help
162                    Select the Ethernet PHY device to use in the example.
163
164                config EXAMPLE_ETH_PHY_IP101
165                    bool "IP101"
166                    help
167                        IP101 is a single port 10/100 MII/RMII/TP/Fiber Fast Ethernet Transceiver.
168                        Goto http://www.icplus.com.tw/pp-IP101G.html for more information about it.
169
170                config EXAMPLE_ETH_PHY_RTL8201
171                    bool "RTL8201/SR8201"
172                    help
173                        RTL8201F/SR8201F is a single port 10/100Mb Ethernet Transceiver with auto MDIX.
174                        Goto http://www.corechip-sz.com/productsview.asp?id=22 for more information about it.
175
176                config EXAMPLE_ETH_PHY_LAN87XX
177                    bool "LAN87xx"
178                    help
179                        Below chips are supported:
180                        LAN8710A is a small footprint MII/RMII 10/100 Ethernet Transceiver with HP Auto-MDIX and
181                            flexPWR® Technology.
182                        LAN8720A is a small footprint RMII 10/100 Ethernet Transceiver with HP Auto-MDIX Support.
183                        LAN8740A/LAN8741A is a small footprint MII/RMII 10/100 Energy Efficient Ethernet Transceiver
184                            with HP Auto-MDIX and flexPWR® Technology.
185                        LAN8742A is a small footprint RMII 10/100 Ethernet Transceiver with HP Auto-MDIX and
186                            flexPWR® Technology.
187                        Goto https://www.microchip.com for more information about them.
188
189                config EXAMPLE_ETH_PHY_DP83848
190                    bool "DP83848"
191                    help
192                        DP83848 is a single port 10/100Mb/s Ethernet Physical Layer Transceiver.
193                        Goto http://www.ti.com/product/DP83848J for more information about it.
194            endchoice
195
196            config EXAMPLE_ETH_MDC_GPIO
197                int "SMI MDC GPIO number"
198                range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX
199                default 23
200                help
201                    Set the GPIO number used by SMI MDC.
202
203            config EXAMPLE_ETH_MDIO_GPIO
204                int "SMI MDIO GPIO number"
205                range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX
206                default 18
207                help
208                    Set the GPIO number used by SMI MDIO.
209        endif
210
211        if EXAMPLE_USE_SPI_ETHERNET
212            config EXAMPLE_ETH_SPI_HOST
213                int "SPI Host Number"
214                range 0 2
215                default 1
216                help
217                    Set the SPI host used to communicate with the SPI Ethernet Controller.
218
219            config EXAMPLE_ETH_SPI_SCLK_GPIO
220                int "SPI SCLK GPIO number"
221                range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX
222                default 14
223                help
224                    Set the GPIO number used by SPI SCLK.
225
226            config EXAMPLE_ETH_SPI_MOSI_GPIO
227                int "SPI MOSI GPIO number"
228                range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX
229                default 13
230                help
231                    Set the GPIO number used by SPI MOSI.
232
233            config EXAMPLE_ETH_SPI_MISO_GPIO
234                int "SPI MISO GPIO number"
235                range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX
236                default 12
237                help
238                    Set the GPIO number used by SPI MISO.
239
240            config EXAMPLE_ETH_SPI_CS_GPIO
241                int "SPI CS GPIO number"
242                range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX
243                default 15
244                help
245                    Set the GPIO number used by SPI CS.
246
247            config EXAMPLE_ETH_SPI_CLOCK_MHZ
248                int "SPI clock speed (MHz)"
249                range 5 80
250                default 36
251                help
252                    Set the clock speed (MHz) of SPI interface.
253
254            config EXAMPLE_ETH_SPI_INT_GPIO
255                int "Interrupt GPIO number"
256                range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX
257                default 4
258                help
259                    Set the GPIO number used by the SPI Ethernet module interrupt line.
260        endif # EXAMPLE_USE_SPI_ETHERNET
261
262        config EXAMPLE_ETH_PHY_RST_GPIO
263            int "PHY Reset GPIO number"
264            range -1 EXAMPLE_GPIO_RANGE_MAX
265            default 5
266            help
267                Set the GPIO number used to reset PHY chip.
268                Set to -1 to disable PHY chip hardware reset.
269
270        config EXAMPLE_ETH_PHY_ADDR
271            int "PHY Address"
272            range 0 31 if EXAMPLE_USE_INTERNAL_ETHERNET
273            default 1
274            help
275                Set PHY address according your board schematic.
276    endif # EXAMPLE_CONNECT_ETHERNET
277
278    config EXAMPLE_CONNECT_IPV6
279        bool "Obtain IPv6 address"
280        default y
281        depends on EXAMPLE_CONNECT_WIFI || EXAMPLE_CONNECT_ETHERNET
282        select LWIP_IPV6
283        help
284            By default, examples will wait until IPv4 and IPv6 local link addresses are obtained.
285            Disable this option if the network does not support IPv6.
286            Choose the preferred IPv6 address type if the connection code should wait until other than
287            the local link address gets assigned.
288            Consider enabling IPv6 stateless address autoconfiguration (SLAAC) in the LWIP component.
289
290    if EXAMPLE_CONNECT_IPV6
291        choice EXAMPLE_CONNECT_PREFERRED_IPV6
292            prompt "Preferred IPv6 Type"
293            default EXAMPLE_CONNECT_IPV6_PREF_LOCAL_LINK
294            help
295                Select which kind of IPv6 address the connect logic waits for.
296
297            config EXAMPLE_CONNECT_IPV6_PREF_LOCAL_LINK
298                bool "Local Link Address"
299                help
300                    Blocks until Local link address assigned.
301
302            config EXAMPLE_CONNECT_IPV6_PREF_GLOBAL
303                bool "Global Address"
304                help
305                    Blocks until Global address assigned.
306
307            config EXAMPLE_CONNECT_IPV6_PREF_SITE_LOCAL
308                bool "Site Local Address"
309                help
310                    Blocks until Site link address assigned.
311
312            config EXAMPLE_CONNECT_IPV6_PREF_UNIQUE_LOCAL
313                bool "Unique Local Link Address"
314                help
315                    Blocks until Unique local address assigned.
316
317        endchoice
318
319    endif
320
321
322endmenu
323