RTL8201 Ethernet PHY driver header file. More...
Go to the source code of this file.
Data Structures | |
| struct | rtl8201_config_t |
| RTL8201 PHY configuration structure. More... | |
Macros | |
| #define | RTL8201_ADDR (2U) |
| Default PHY address for RTL8201. More... | |
| #define | RTL8201_ID1 (0x001CU) |
| RTL8201 PHY ID register 1 value (OUI MSB) More... | |
| #define | RTL8201_ID2 (0x32U) |
| RTL8201 PHY ID register 2 value (OUI LSB) More... | |
Enumerations | |
| enum | rtl8201_config_refclk_direction_t { rtl8201_config_refclk_output = 0 , rtl8201_config_refclk_input } |
| RTL8201 reference clock direction configuration. More... | |
Functions | |
| bool | rtl8201_reset (ENET_Type *ptr, uint32_t phy_addr) |
| Reset RTL8201 PHY chip. More... | |
| void | rtl8201_basic_mode_default_config (ENET_Type *ptr, rtl8201_config_t *config) |
| Set default configuration for RTL8201 PHY basic mode. More... | |
| bool | rtl8201_basic_mode_init (ENET_Type *ptr, uint32_t phy_addr, rtl8201_config_t *config) |
| Initialize RTL8201 PHY chip in basic mode. More... | |
| void | rtl8201_get_phy_status (ENET_Type *ptr, uint32_t phy_addr, enet_phy_status_t *status) |
| Get RTL8201 PHY status. More... | |
| void | rtl8201_set_rmii_refclk_direction (ENET_Type *ptr, uint32_t phy_addr, uint8_t dir) |
| Set RMII reference clock direction for RTL8201 PHY. More... | |
RTL8201 Ethernet PHY driver header file.
This file provides the API definitions for the RTL8201 Ethernet PHY chip driver. The RTL8201 is a single-port 10/100-Mbps Ethernet physical layer transceiver.
| #define RTL8201_ADDR (2U) |
Default PHY address for RTL8201.
| #define RTL8201_ID1 (0x001CU) |
RTL8201 PHY ID register 1 value (OUI MSB)
| #define RTL8201_ID2 (0x32U) |
RTL8201 PHY ID register 2 value (OUI LSB)
| void rtl8201_basic_mode_default_config | ( | ENET_Type * | ptr, |
| rtl8201_config_t * | config | ||
| ) |
Set default configuration for RTL8201 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 rtl8201_basic_mode_init | ( | ENET_Type * | ptr, |
| uint32_t | phy_addr, | ||
| rtl8201_config_t * | config | ||
| ) |
Initialize RTL8201 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 rtl8201_get_phy_status | ( | ENET_Type * | ptr, |
| uint32_t | phy_addr, | ||
| enet_phy_status_t * | status | ||
| ) |
Get RTL8201 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 rtl8201_reset | ( | ENET_Type * | ptr, |
| uint32_t | phy_addr | ||
| ) |
Reset RTL8201 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) |
| void rtl8201_set_rmii_refclk_direction | ( | ENET_Type * | ptr, |
| uint32_t | phy_addr, | ||
| uint8_t | dir | ||
| ) |
Set RMII reference clock direction for RTL8201 PHY.
| [in] | ptr | Pointer to the ENET peripheral base address |
| [in] | phy_addr | PHY address |
| [in] | dir | Reference clock direction: rtl8201_config_refclk_direction_t |
This function configures whether the RTL8201 PHY provides the reference clock (output mode) or receives it (input mode) for RMII interface.