See gmac_quickstart.
Driver for the GMAC PHY (Ethernet Media Access Controller). This file contains basic functions for the GMAC PHY.
This driver does not depend on other modules.
Functions | |
uint8_t | gmac_phy_read (Gmac *p_gmac, uint8_t uc_phy_address, uint8_t uc_address, uint32_t *p_value) |
Read the PHY register. More... | |
static uint8_t | gmac_phy_wait (Gmac *p_gmac, const uint32_t ul_retry) |
Wait PHY operation to be completed. More... | |
uint8_t | gmac_phy_write (Gmac *p_gmac, uint8_t uc_phy_address, uint8_t uc_address, uint32_t ul_value) |
Write the PHY register. More... | |
uint8_t gmac_phy_read | ( | Gmac * | p_gmac, |
uint8_t | uc_phy_address, | ||
uint8_t | uc_address, | ||
uint32_t * | p_value | ||
) |
Read the PHY register.
p_gmac | Pointer to the GMAC instance. |
uc_phy_address | PHY address. |
uc_address | Register address. |
p_value | Pointer to a 32-bit location to store read data. |
GMAC_OK if successfully, GMAC_TIMEOUT if timeout.
References gmac_get_phy_data(), gmac_maintain_phy(), GMAC_OK, gmac_phy_wait(), GMAC_TIMEOUT, and MAC_PHY_RETRY_MAX.
Referenced by ethernet_phy_auto_negotiate(), ethernet_phy_find_valid(), ethernet_phy_reset(), and ethernet_phy_set_link().
|
static |
Wait PHY operation to be completed.
p_gmac | HW controller address. |
ul_retry | The retry times. |
Return GMAC_OK if the operation is completed successfully.
References gmac_is_phy_idle(), GMAC_OK, and GMAC_TIMEOUT.
Referenced by gmac_phy_read(), and gmac_phy_write().
uint8_t gmac_phy_write | ( | Gmac * | p_gmac, |
uint8_t | uc_phy_address, | ||
uint8_t | uc_address, | ||
uint32_t | ul_value | ||
) |
Write the PHY register.
p_gmac | Pointer to the GMAC instance. |
uc_phy_address | PHY Address. |
uc_address | Register Address. |
ul_value | Data to write, actually 16-bit data. |
GMAC_OK if successfully, GMAC_TIMEOUT if timeout.
References gmac_maintain_phy(), GMAC_OK, gmac_phy_wait(), GMAC_TIMEOUT, and MAC_PHY_RETRY_MAX.
Referenced by ethernet_phy_auto_negotiate(), and ethernet_phy_reset().