forked from espressif/arduino-esp32
Update IDF to a0468b2 (#2108)
* Update IDF to a0468b2 * add missing ld file * Fix PIO builds and change coex policy
This commit is contained in:
@ -28,10 +28,10 @@ typedef enum {
|
||||
ETH_MODE_MII,
|
||||
} eth_mode_t;
|
||||
|
||||
typedef enum {
|
||||
typedef enum {
|
||||
ETH_CLOCK_GPIO0_IN = 0,
|
||||
ETH_CLOCK_GPIO16_OUT = 2,
|
||||
ETH_CLOCK_GPIO17_OUT = 3,
|
||||
ETH_CLOCK_GPIO17_OUT = 3
|
||||
} eth_clock_mode_t;
|
||||
|
||||
typedef enum {
|
||||
@ -83,7 +83,7 @@ typedef bool (*eth_phy_check_link_func)(void);
|
||||
typedef void (*eth_phy_check_init_func)(void);
|
||||
typedef eth_speed_mode_t (*eth_phy_get_speed_mode_func)(void);
|
||||
typedef eth_duplex_mode_t (*eth_phy_get_duplex_mode_func)(void);
|
||||
typedef void (*eth_phy_func)(void);
|
||||
typedef esp_err_t (*eth_phy_func)(void);
|
||||
typedef esp_err_t (*eth_tcpip_input_func)(void *buffer, uint16_t len, void *eb);
|
||||
typedef void (*eth_gpio_config_func)(void);
|
||||
typedef bool (*eth_phy_get_partner_pause_enable_func)(void);
|
||||
@ -94,27 +94,26 @@ typedef void (*eth_phy_power_enable_func)(bool enable);
|
||||
*
|
||||
*/
|
||||
typedef struct {
|
||||
eth_phy_base_t phy_addr; /*!< phy base addr (0~31) */
|
||||
eth_mode_t mac_mode; /*!< mac mode only support RMII now */
|
||||
eth_clock_mode_t clock_mode; /*!< external/internal clock mode selecton */
|
||||
eth_tcpip_input_func tcpip_input; /*!< tcpip input func */
|
||||
eth_phy_func phy_init; /*!< phy init func */
|
||||
eth_phy_check_link_func phy_check_link; /*!< phy check link func */
|
||||
eth_phy_check_init_func phy_check_init; /*!< phy check init func */
|
||||
eth_phy_get_speed_mode_func phy_get_speed_mode; /*!< phy check init func */
|
||||
eth_phy_get_duplex_mode_func phy_get_duplex_mode; /*!< phy check init func */
|
||||
eth_gpio_config_func gpio_config; /*!< gpio config func */
|
||||
bool flow_ctrl_enable; /*!< flag of flow ctrl enable */
|
||||
eth_phy_get_partner_pause_enable_func phy_get_partner_pause_enable; /*!< get partner pause enable */
|
||||
eth_phy_power_enable_func phy_power_enable; /*!< enable or disable phy power */
|
||||
|
||||
eth_phy_base_t phy_addr; /*!< phy base addr (0~31) */
|
||||
eth_mode_t mac_mode; /*!< mac mode only support RMII now */
|
||||
eth_clock_mode_t clock_mode; /*!< external/internal clock mode selecton */
|
||||
eth_tcpip_input_func tcpip_input; /*!< tcpip input func */
|
||||
eth_phy_func phy_init; /*!< phy init func */
|
||||
eth_phy_check_link_func phy_check_link; /*!< phy check link func */
|
||||
eth_phy_check_init_func phy_check_init; /*!< phy check init func */
|
||||
eth_phy_get_speed_mode_func phy_get_speed_mode; /*!< phy check init func */
|
||||
eth_phy_get_duplex_mode_func phy_get_duplex_mode; /*!< phy check init func */
|
||||
eth_gpio_config_func gpio_config; /*!< gpio config func */
|
||||
bool flow_ctrl_enable; /*!< flag of flow ctrl enable */
|
||||
eth_phy_get_partner_pause_enable_func phy_get_partner_pause_enable; /*!< get partner pause enable */
|
||||
eth_phy_power_enable_func phy_power_enable; /*!< enable or disable phy power */
|
||||
uint32_t reset_timeout_ms; /*!< timeout value for reset emac */
|
||||
} eth_config_t;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Init ethernet mac
|
||||
*
|
||||
* @note config can not be NULL,and phy chip must be suitable to phy init func.
|
||||
* @note config can not be NULL, and phy chip must be suitable to phy init func.
|
||||
*
|
||||
* @param[in] config mac init data.
|
||||
*
|
||||
@ -143,7 +142,7 @@ esp_err_t esp_eth_deinit(void);
|
||||
* This function may be called, if you only need to initialize the Ethernet
|
||||
* driver without having to use the network stack on top.
|
||||
*
|
||||
* @note config can not be NULL,and phy chip must be suitable to phy init func.
|
||||
* @note config can not be NULL, and phy chip must be suitable to phy init func.
|
||||
* @param[in] config mac init data.
|
||||
*
|
||||
* @return
|
||||
@ -155,7 +154,7 @@ esp_err_t esp_eth_init_internal(eth_config_t *config);
|
||||
/**
|
||||
* @brief Send packet from tcp/ip to mac
|
||||
*
|
||||
* @note buf can not be NULL,size must be less than 1580
|
||||
* @note buf can not be NULL, size must be less than 1580
|
||||
*
|
||||
* @param[in] buf: start address of packet data.
|
||||
*
|
||||
@ -170,7 +169,7 @@ esp_err_t esp_eth_tx(uint8_t *buf, uint16_t size);
|
||||
/**
|
||||
* @brief Enable ethernet interface
|
||||
*
|
||||
* @note Shout be called after esp_eth_init
|
||||
* @note Should be called after esp_eth_init
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK
|
||||
@ -181,7 +180,7 @@ esp_err_t esp_eth_enable(void);
|
||||
/**
|
||||
* @brief Disable ethernet interface
|
||||
*
|
||||
* @note Shout be called after esp_eth_init
|
||||
* @note Should be called after esp_eth_init
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK
|
||||
@ -199,24 +198,24 @@ esp_err_t esp_eth_disable(void);
|
||||
void esp_eth_get_mac(uint8_t mac[6]);
|
||||
|
||||
/**
|
||||
* @brief Read phy reg with smi interface.
|
||||
* @brief Write PHY reg with SMI interface.
|
||||
*
|
||||
* @note phy base addr must be right.
|
||||
* @note PHY base addr must be right.
|
||||
*
|
||||
* @param[in] reg_num: phy reg num.
|
||||
* @param[in] reg_num: PHY reg num.
|
||||
*
|
||||
* @param[in] value: value which write to phy reg.
|
||||
* @param[in] value: value which is written to PHY reg.
|
||||
*/
|
||||
void esp_eth_smi_write(uint32_t reg_num, uint16_t value);
|
||||
|
||||
/**
|
||||
* @brief Read phy reg with smi interface.
|
||||
* @brief Read PHY reg with SMI interface.
|
||||
*
|
||||
* @note phy base addr must be right.
|
||||
* @note PHY base addr must be right.
|
||||
*
|
||||
* @param[in] reg_num: phy reg num.
|
||||
* @param[in] reg_num: PHY reg num.
|
||||
*
|
||||
* @return value what read from phy reg
|
||||
* @return value that is read from PHY reg
|
||||
*/
|
||||
uint16_t esp_eth_smi_read(uint32_t reg_num);
|
||||
|
||||
@ -253,9 +252,9 @@ static inline esp_err_t esp_eth_smi_wait_set(uint32_t reg_num, uint16_t value_ma
|
||||
/**
|
||||
* @brief Free emac rx buf.
|
||||
*
|
||||
* @note buf can not be null,and it is tcpip input buf.
|
||||
* @note buf can not be null, and it is tcpip input buf.
|
||||
*
|
||||
* @param[in] buf: start address of recevie packet data.
|
||||
* @param[in] buf: start address of received packet data.
|
||||
*
|
||||
*/
|
||||
void esp_eth_free_rx_buf(void *buf);
|
||||
@ -263,7 +262,7 @@ void esp_eth_free_rx_buf(void *buf);
|
||||
/**
|
||||
* @brief Set mac of ethernet interface.
|
||||
*
|
||||
* @note user can call this function after emac_init,and the new mac address will be enabled after emac_enable.
|
||||
* @note user can call this function after emac_init, and the new mac address will be enabled after emac_enable.
|
||||
*
|
||||
* @param[in] mac: the Mac address.
|
||||
*
|
||||
@ -273,6 +272,14 @@ void esp_eth_free_rx_buf(void *buf);
|
||||
*/
|
||||
esp_err_t esp_eth_set_mac(const uint8_t mac[6]);
|
||||
|
||||
/**
|
||||
* @brief Get Ethernet link speed
|
||||
*
|
||||
* @return eth_speed_mode_t ETH_SPEED_MODE_10M when link speed is 10Mbps
|
||||
* ETH_SPEED_MODE_100M when link speed is 100Mbps
|
||||
*/
|
||||
eth_speed_mode_t esp_eth_get_speed(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user