EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #187 background imageLoading...
Page #187 background image
Chapter 2. API Reference
Application Example
Ethernet basic example: ethernet/basic.
Ethernet iperf example: ethernet/iperf.
Ethernet to Wi-Fi AP router: ethernet/eth2ap.
Most of protocol examples should also work for Ethernet: protocols.
API Reference
Header File
components/esp_eth/include/esp_eth.h
Functions
esp_err_t esp_eth_driver_install(const esp_eth_config_t *config, esp_eth_handle_t *out_hdl)
Install Ethernet driver.
Return
ESP_OK: install esp_eth driver successfully
ESP_ERR_INVALID_ARG: install esp_eth driver failed because of some invalid argument
ESP_ERR_NO_MEM: install esp_eth driver failed because theres no memory for driver
ESP_FAIL: install esp_eth driver failed because some other error occurred
Parameters
[in] config: configuration of the Ethernet driver
[out] out_hdl: handle of Ethernet driver
esp_err_t esp_eth_driver_uninstall(esp_eth_handle_t hdl)
Uninstall Ethernet driver.
Note Its not recommended to uninstall Ethernet driver unless it wont get used any more in application code.
To uninstall Ethernet driver, you have to make sure, all references to the driver are released. Ethernet
driver can only be uninstalled successfully when reference counter equals to one.
Return
ESP_OK: uninstall esp_eth driver successfully
ESP_ERR_INVALID_ARG: uninstall esp_eth driver failed because of some invalid argument
ESP_ERR_INVALID_STATE: uninstall esp_eth driver failed because it has more than one refer-
ence
ESP_FAIL: uninstall esp_eth driver failed because some other error occurred
Parameters
[in] hdl: handle of Ethernet driver
esp_err_t esp_eth_start(esp_eth_handle_t hdl)
Start Ethernet driver ONLY in standalone mode (i.e. without TCP/IP stack)
Note This API will start driver state machine and internal software timer (for checking link status).
Return
ESP_OK: start esp_eth driver successfully
ESP_ERR_INVALID_ARG: start esp_eth driver failed because of some invalid argument
ESP_ERR_INVALID_STATE: start esp_eth driver failed because driver has started already
ESP_FAIL: start esp_eth driver failed because some other error occurred
Parameters
[in] hdl: handle of Ethernet driver
esp_err_t esp_eth_stop(esp_eth_handle_t hdl)
Stop Ethernet driver.
Note This function does the oppsite operation of esp_eth_start.
Return
ESP_OK: stop esp_eth driver successfully
ESP_ERR_INVALID_ARG: stop esp_eth driver failed because of some invalid argument
ESP_ERR_INVALID_STATE: stop esp_eth driver failed because driver has not started yet
Espressif Systems 176
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish