LAN8720 Ethernet PHY driver header file. More...
Go to the source code of this file.
Data Structures | |
| struct | lan8720_config_t |
| LAN8720 PHY configuration structure. More... | |
Macros | |
| #define | LAN8720_ADDR (0U) |
| Default PHY address for LAN8720. More... | |
| #define | LAN8720_ID1 (0x0007U) |
| LAN8720 PHY ID register 1 value (OUI MSB) More... | |
| #define | LAN8720_ID2 (0x30U) |
| LAN8720 PHY ID register 2 value (OUI LSB) More... | |
Enumerations | |
| enum | lan8720_config_refclk_direction_t { lan8720_config_refclk_output = 0 , lan8720_config_refclk_input } |
| LAN8720 reference clock direction configuration. More... | |
Functions | |
| bool | lan8720_reset (ENET_Type *ptr, uint32_t phy_addr) |
| Reset LAN8720 PHY chip. More... | |
| void | lan8720_basic_mode_default_config (ENET_Type *ptr, lan8720_config_t *config) |
| Set default configuration for LAN8720 PHY basic mode. More... | |
| bool | lan8720_basic_mode_init (ENET_Type *ptr, uint32_t phy_addr, lan8720_config_t *config) |
| Initialize LAN8720 PHY chip in basic mode. More... | |
| void | lan8720_get_phy_status (ENET_Type *ptr, uint32_t phy_addr, enet_phy_status_t *status) |
| Get LAN8720 PHY status. More... | |
LAN8720 Ethernet PHY driver header file.
This file provides the API definitions for the LAN8720 Ethernet PHY chip driver. The LAN8720 is a single-port 10/100-Mbps Ethernet physical layer transceiver.
| #define LAN8720_ADDR (0U) |
Default PHY address for LAN8720.
| #define LAN8720_ID1 (0x0007U) |
LAN8720 PHY ID register 1 value (OUI MSB)
| #define LAN8720_ID2 (0x30U) |
LAN8720 PHY ID register 2 value (OUI LSB)
| void lan8720_basic_mode_default_config | ( | ENET_Type * | ptr, |
| lan8720_config_t * | config | ||
| ) |
Set default configuration for LAN8720 PHY basic mode.
| [in] | ptr | Pointer to the ENET peripheral base address |
| [out] | config | Pointer to the configuration structure to be initialized |
This function initializes the configuration structure with default values:
| bool lan8720_basic_mode_init | ( | ENET_Type * | ptr, |
| uint32_t | phy_addr, | ||
| lan8720_config_t * | config | ||
| ) |
Initialize LAN8720 PHY chip in basic mode.
| [in] | ptr | Pointer to the ENET peripheral base address |
| [in] | phy_addr | PHY address |
| [in] | config | Pointer to the PHY configuration structure |
| true | Initialization completed successfully |
| false | Initialization failed (PHY ID check failed) |
This function performs the following operations:
| void lan8720_get_phy_status | ( | ENET_Type * | ptr, |
| uint32_t | phy_addr, | ||
| enet_phy_status_t * | status | ||
| ) |
Get LAN8720 PHY status.
| [in] | ptr | Pointer to the ENET peripheral base address |
| [in] | phy_addr | PHY address |
| [out] | status | Pointer to the status structure to store PHY status |
This function reads the PHY status register and extracts:
| bool lan8720_reset | ( | ENET_Type * | ptr, |
| uint32_t | phy_addr | ||
| ) |
Reset LAN8720 PHY chip.
| [in] | ptr | Pointer to the ENET peripheral base address |
| [in] | phy_addr | PHY address |
| true | Reset operation completed successfully |
| false | Reset operation failed (timeout) |