mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-07-01 04:50:58 +02:00
IDF master c13afea63 (#5214)
esp-dsp: master 7cc5073 esp-face: master 420fc7e esp-rainmaker: f1b82c7 esp32-camera: master 6f8489e esp_littlefs: master b58f00c
This commit is contained in:
@ -86,6 +86,47 @@ typedef struct {
|
||||
*/
|
||||
esp_err_t (*on_lowlevel_deinit_done)(esp_eth_handle_t eth_handle);
|
||||
|
||||
/**
|
||||
* @brief Read PHY register
|
||||
*
|
||||
* @note Usually the PHY register read/write function is provided by MAC (SMI interface),
|
||||
* but if the PHY device is managed by other interface (e.g. I2C), then user needs to
|
||||
* implement the corresponding read/write.
|
||||
* Setting this to NULL means your PHY device is managed by MAC's SMI interface.
|
||||
*
|
||||
* @param[in] eth_handle: handle of Ethernet driver
|
||||
* @param[in] phy_addr: PHY chip address (0~31)
|
||||
* @param[in] phy_reg: PHY register index code
|
||||
* @param[out] reg_value: PHY register value
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: read PHY register successfully
|
||||
* - ESP_ERR_INVALID_ARG: read PHY register failed because of invalid argument
|
||||
* - ESP_ERR_TIMEOUT: read PHY register failed because of timeout
|
||||
* - ESP_FAIL: read PHY register failed because some other error occurred
|
||||
*/
|
||||
esp_err_t (*read_phy_reg)(esp_eth_handle_t eth_handle, uint32_t phy_addr, uint32_t phy_reg, uint32_t *reg_value);
|
||||
|
||||
/**
|
||||
* @brief Write PHY register
|
||||
*
|
||||
* @note Usually the PHY register read/write function is provided by MAC (SMI interface),
|
||||
* but if the PHY device is managed by other interface (e.g. I2C), then user needs to
|
||||
* implement the corresponding read/write.
|
||||
* Setting this to NULL means your PHY device is managed by MAC's SMI interface.
|
||||
*
|
||||
* @param[in] eth_handle: handle of Ethernet driver
|
||||
* @param[in] phy_addr: PHY chip address (0~31)
|
||||
* @param[in] phy_reg: PHY register index code
|
||||
* @param[in] reg_value: PHY register value
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: write PHY register successfully
|
||||
* - ESP_ERR_INVALID_ARG: read PHY register failed because of invalid argument
|
||||
* - ESP_ERR_TIMEOUT: write PHY register failed because of timeout
|
||||
* - ESP_FAIL: write PHY register failed because some other error occurred
|
||||
*/
|
||||
esp_err_t (*write_phy_reg)(esp_eth_handle_t eth_handle, uint32_t phy_addr, uint32_t phy_reg, uint32_t reg_value);
|
||||
} esp_eth_config_t;
|
||||
|
||||
/**
|
||||
@ -100,6 +141,8 @@ typedef struct {
|
||||
.stack_input = NULL, \
|
||||
.on_lowlevel_init_done = NULL, \
|
||||
.on_lowlevel_deinit_done = NULL, \
|
||||
.read_phy_reg = NULL, \
|
||||
.write_phy_reg = NULL, \
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -396,6 +396,39 @@ typedef struct {
|
||||
esp_eth_mac_t *esp_eth_mac_new_w5500(const eth_w5500_config_t *w5500_config, const eth_mac_config_t *mac_config);
|
||||
#endif // CONFIG_ETH_SPI_ETHERNET_W5500
|
||||
|
||||
#if CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL
|
||||
/**
|
||||
* @brief KSZ8851SNL specific configuration
|
||||
*
|
||||
*/
|
||||
typedef struct {
|
||||
void *spi_hdl; /*!< Handle of SPI device driver */
|
||||
int int_gpio_num; /*!< Interrupt GPIO number */
|
||||
} eth_ksz8851snl_config_t;
|
||||
|
||||
/**
|
||||
* @brief Default KSZ8851SNL specific configuration
|
||||
*
|
||||
*/
|
||||
#define ETH_KSZ8851SNL_DEFAULT_CONFIG(spi_device) \
|
||||
{ \
|
||||
.spi_hdl = spi_device, \
|
||||
.int_gpio_num = 14, \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Create KSZ8851SNL Ethernet MAC instance
|
||||
*
|
||||
* @param ksz8851snl_config: KSZ8851SNL specific configuration
|
||||
* @param mac_config: Ethernet MAC configuration
|
||||
*
|
||||
* @return
|
||||
* - instance: create MAC instance successfully
|
||||
* - NULL: create MAC instance failed because some error occurred
|
||||
*/
|
||||
esp_eth_mac_t *esp_eth_mac_new_ksz8851snl(const eth_ksz8851snl_config_t *ksz8851snl_config, const eth_mac_config_t *mac_config);
|
||||
#endif // CONFIG_ETH_SPI_ETHERNET_KSZ8851
|
||||
|
||||
#if CONFIG_ETH_USE_OPENETH
|
||||
/**
|
||||
* @brief Create OpenCores Ethernet MAC instance
|
||||
|
@ -300,6 +300,19 @@ esp_eth_phy_t *esp_eth_phy_new_dm9051(const eth_phy_config_t *config);
|
||||
*/
|
||||
esp_eth_phy_t *esp_eth_phy_new_w5500(const eth_phy_config_t *config);
|
||||
#endif
|
||||
|
||||
#if CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL
|
||||
/**
|
||||
* @brief Create a PHY instance of KSZ8851SNL
|
||||
*
|
||||
* @param[in] config: configuration of PHY
|
||||
*
|
||||
* @return
|
||||
* - instance: create PHY instance successfully
|
||||
* - NULL: create PHY instance failed because some error occurred
|
||||
*/
|
||||
esp_eth_phy_t *esp_eth_phy_new_ksz8851snl(const eth_phy_config_t *config);
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user