Espressif ESP32-S2 Programming Manual page 188

Table of Contents

Advertisement

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
, void *privUpdate Ethernet data input path (i.e. specify where to pass the input buffer)
Note After install driver, Ethernet still don' t 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
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
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 "length"should set by user, equals the size of buffer.
After the function returned, the value of "length"means 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 doesn't 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 "length"indicates 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
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
(*stack_input))esp_eth_handle_t
uint32_t length, void *priv
hdl, void *buf, size_t length)
hdl, uint8_t *buf, uint32_t *length)
hdl,
esp_eth_io_cmd_t
177
Submit Document Feedback
hdl,
hdl,
uint8_t *buffer,
cmd, void *data)
esp_err_t
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Table of Contents

Save PDF