forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drivers: wifi: Add ESP8266 and ESP32 wifi modem driver
This adds support for the Espressif ESP8266 and ESP32 devices to be used as peripherals on a UART. There are two main AT command versions that can be selected, 1.7 and 2.0. Since they behave a bit different it is important to select the one that matches the used in the firmware on your device. When downloading large amounts of data it is highly recommended to enable CONFIG_ESP_PASSIVE_TCP and flow control on the UART so that data is not lost due to UART speed or receive buffer size. Currently unsupported: - Changing UDP endpoint with a sendto() - Bind to a specific local port - Server socket operations, ie listen() and accept() Official AT firmware for ESP8266 and ESP32 can be found at: https://github.com/espressif/esp-at Signed-off-by: Tobias Svehagen <[email protected]>
- Loading branch information
Showing
9 changed files
with
1,967 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if(CONFIG_WIFI_ESP) | ||
zephyr_include_directories(./) | ||
|
||
zephyr_library_include_directories( | ||
${ZEPHYR_BASE}/drivers/modem | ||
) | ||
|
||
zephyr_sources( | ||
esp.c | ||
esp_socket.c | ||
esp_offload.c | ||
) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Copyright (c) 2019 Tobias Svehagen | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
menuconfig WIFI_ESP | ||
bool "Espressif ESP8266 and ESP32 support" | ||
select MODEM | ||
select MODEM_CONTEXT | ||
select MODEM_CMD_HANDLER | ||
select MODEM_IFACE_UART | ||
select NET_L2_WIFI_MGMT | ||
select WIFI_OFFLOAD | ||
|
||
if WIFI_ESP | ||
|
||
config WIFI_ESP_NAME | ||
string "Driver name" | ||
default "esp-wifi-modem" | ||
|
||
config WIFI_ESP_RX_STACK_SIZE | ||
int "Stack size for the Espressif esp wifi driver RX thread" | ||
default 1024 | ||
help | ||
This stack is used by the Espressif ESP RX thread. | ||
|
||
config WIFI_ESP_RX_THREAD_PRIORITY | ||
int "Priority of RX thread" | ||
default 7 | ||
help | ||
Priority of thread used for processing RX data. | ||
|
||
config WIFI_ESP_WORKQ_STACK_SIZE | ||
int "Stack size for the esp driver work queue" | ||
default 2048 | ||
help | ||
This stack is used by the work queue to pass off net_pkt data | ||
to the rest of the network stack, letting the rx thread continue | ||
processing data. | ||
|
||
config WIFI_ESP_WORKQ_THREAD_PRIORITY | ||
int "Priority of work queue thread" | ||
default 7 | ||
help | ||
Priority of thread used for processing driver work queue items. | ||
|
||
config WIFI_ESP_PASSIVE_TCP | ||
bool "Use passive TCP" | ||
help | ||
This lets the ESP handle the TCP window so that data can flow | ||
at a rate that the driver can handle. Without this, data might get | ||
lost if the driver cannot empty the device buffer quickly enough. | ||
|
||
choice | ||
prompt "AT version" | ||
default WIFI_ESP_AT_VERSION_2_0 | ||
help | ||
Select which version of AT command set should be used. | ||
|
||
config WIFI_ESP_AT_VERSION_1_7 | ||
bool "AT version 1.7" | ||
help | ||
Use AT command set version 1.7. | ||
|
||
config WIFI_ESP_AT_VERSION_2_0 | ||
bool "AT version 2.0" | ||
help | ||
Use AT command set version 2.0. | ||
|
||
endchoice | ||
|
||
endif # WIFI_ESP |
Oops, something went wrong.