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 #188 background imageLoading...
Page #188 background image
Chapter 2. API Reference
ESP_FAIL: stop esp_eth driver failed because some other error occurred
Parameters
[in] hdl: handle of Ethernet driver
esp_err_t esp_eth_update_input_path(esp_eth_handle_t hdl, esp_err_t
(*stack_input))esp_eth_handle_t hdl, uint8_t *buffer,
uint32_t length, void *priv
, void *privUpdate Ethernet data input path (i.e. specify where to pass the input buffer)
Note After install driver, Ethernet still dont know where to deliver the input buffer. In fact, this API registers
a callback function which get invoked when Ethernet received new packets.
Return
ESP_OK: update input path successfully
ESP_ERR_INVALID_ARG: update input path failed because of some invalid argument
ESP_FAIL: update input path failed because some other error occurred
Parameters
[in] hdl: handle of Ethernet driver
[in] stack_input: function pointer, which does the actual process on incoming packets
[in] priv: private resource, which gets passed to stack_input callback without any modi-
fication
esp_err_t esp_eth_transmit(esp_eth_handle_t hdl, void *buf, size_t length)
General Transmit.
Return
ESP_OK: transmit frame buffer successfully
ESP_ERR_INVALID_ARG: transmit frame buffer failed because of some invalid argument
ESP_FAIL: transmit frame buffer failed because some other error occurred
Parameters
[in] hdl: handle of Ethernet driver
[in] buf: buffer of the packet to transfer
[in] length: length of the buffer to transfer
esp_err_t esp_eth_receive(esp_eth_handle_t hdl, uint8_t *buf, uint32_t *length)
General Receive is deprecated and shall not be accessed from app code, as polling is not supported by Ethernet.
Note Before this function got invoked, the value of lengthshould set by user, equals the size of buffer.
After the function returned, the value of lengthmeans the real length of received data.
Note This API was exposed by accident, users should not use this API in their applications. Ethernet driver
is interrupt driven, and doesnt support polling mode. Instead, users should register input callback with
esp_eth_update_input_path.
Return
ESP_OK: receive frame buffer successfully
ESP_ERR_INVALID_ARG: receive frame buffer failed because of some invalid argument
ESP_ERR_INVALID_SIZE: input buffer size is not enough to hold the incoming data. in this case,
value of returned lengthindicates the real size of incoming data.
ESP_FAIL: receive frame buffer failed because some other error occurred
Parameters
[in] hdl: handle of Ethernet driver
[out] buf: buffer to preserve the received packet
[out] length: length of the received packet
esp_err_t esp_eth_ioctl(esp_eth_handle_t hdl, esp_eth_io_cmd_t cmd, void *data)
Misc IO function of Etherent driver.
The following IO control commands are supported:
ETH_CMD_S_MAC_ADDR sets Ethernet interface MAC address. data argument is pointer to MAC
address buffer with expected size of 6 bytes.
ETH_CMD_G_MAC_ADDR gets Ethernet interface MAC address. data argument is pointer to a buffer
to which MAC address is to be copied. The buffer size must be at least 6 bytes.
ETH_CMD_S_PHY_ADDR sets PHY address in range of <0-31>. data argument is pointer to memory
of uint32_t datatype from where the configuration option is read.
Espressif Systems 177
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