EasyManua.ls Logo

Espressif ESP32-S2 - Page 189

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
Loading...
Chapter 2. API Reference
ETH_CMD_G_PHY_ADDR gets PHY address. data argument is pointer to memory of uint32_t
datatype to which the PHY address is to be stored.
ETH_CMD_G_SPEED gets current Ethernet link speed. data argument is pointer to memory of
eth_speed_t datatype to which the speed is to be stored.
ETH_CMD_S_PROMISCUOUS sets/resets Ethernet interface promiscuous mode. data argument is
pointer to memory of bool datatype from which the configuration option is read.
ETH_CMD_S_FLOW_CTRL sets/resets Ethernet interface flow control. data argument is pointer to
memory of bool datatype from which the configuration option is read.
ETH_CMD_G_DUPLEX_MODE gets current Ethernet link duplex mode. data argument is pointer to
memory of eth_duplex_t datatype to which the duplex mode is to be stored.
ETH_CMD_S_PHY_LOOPBACK sets/resets PHY to/from loopback mode. data argument is pointer
to memory of bool datatype from which the configuration option is read.
Return
ESP_OK: process io command successfully
ESP_ERR_INVALID_ARG: process io command failed because of some invalid argument
ESP_FAIL: process io command failed because some other error occurred
Parameters
[in] hdl: handle of Ethernet driver
[in] cmd: IO control command
[inout] data: address of data for set command or address where to store the data when used
with get command
esp_err_t esp_eth_increase_reference(esp_eth_handle_t hdl)
Increase Ethernet driver reference.
Note Ethernet driver handle can be obtained by os timer, netif, etc. Its dangerous when thread A is us-
ing Ethernet but thread B uninstall the driver. Using reference counter can prevent such risk, but care
should be taken, when you obtain Ethernet driver, this API must be invoked so that the driver wont be
uninstalled during your using time.
Return
ESP_OK: increase reference successfully
ESP_ERR_INVALID_ARG: increase reference failed because of some invalid argument
Parameters
[in] hdl: handle of Ethernet driver
esp_err_t esp_eth_decrease_reference(esp_eth_handle_t hdl)
Decrease Ethernet driver reference.
Return
ESP_OK: increase reference successfully
ESP_ERR_INVALID_ARG: increase reference failed because of some invalid argument
Parameters
[in] hdl: handle of Ethernet driver
Structures
struct esp_eth_config_t
Configuration of Ethernet driver.
Public Members
esp_eth_mac_t *mac
Ethernet MAC object.
esp_eth_phy_t *phy
Ethernet PHY object.
uint32_t check_link_period_ms
Period time of checking Ethernet link status.
Espressif Systems 178
Submit Document Feedback
Release v4.4

Table of Contents