The library provides the Ethernet PHY-related interface APIs for the Ethernet connection manager library to enable the completion of Ethernet-based applications on supported platforms.The current version of ethernet-phy-driver library has Ethernet PHY-related interface APIs implemented for PHY chip DP83867IR.
The library contains the necessary ethernet PHY interface APIs implemented for PHY chip DP83867IR.
Other features:
This library and its features are supported on the following Infineon platforms:
The ethernet PHY driver library disables all the debug log messages by default. To enable log messages, the application must perform the following:
ENABLE_ETH_PHY_DRIVER_LOGS
macro to the DEFINES in the code example's Makefile. The Makefile entry would look like as follows: cy_log_init()
function provided by the cy-log module. cy-log is part of the connectivity-utilities library. See *connectivity-utilities library API documentation.cy_eth_phy_driver_init()
- To ensure synchronization, the ethernet-phy-driver library initializes mutex, semaphore, or any relevant global variable.
Application is expected to call this API once before registering ethernet phy callbacks.
cy_rslt_t cy_eth_phy_driver_init(void);
cy_eth_phy_init()
- Initializes the ethernet port pins and initializes the ethernet PHY object.
The current implementation initializes the required ethernet ports of the given PHY hardware and creates a PHY object. Subsequently, this same PHY object will be utilized to perform other ethernet PHY operations.
cy_rslt_t cy_eth_phy_init(uint8_t eth_idx, ETH_Type *reg_base);
cy_eth_phy_configure()
- Configures ethernet PHY.
Configures ethernet PHY with given duplex mode and PHY speed.
cy_rslt_t cy_eth_phy_configure(uint8_t eth_idx, uint32_t duplex, uint32_t speed);
cy_eth_phy_reset()
- Resets the ethernet PHY.
Performs a full reset of ethernet PHY, including all ethernet PHY registers.
cy_rslt_t cy_eth_phy_reset(uint8_t eth_idx, ETH_Type *reg_base);
cy_eth_phy_discover()
- Discovers connected ethernet PHY.
Discovers connected ethernet PHY at address zero.
cy_rslt_t cy_eth_phy_discover(uint8_t eth_idx);
cy_eth_phy_enable_ext_reg()
- Configures ethernet PHY extended Registers.
For the selected ethernet PHY chip, this API configures and enables extended registers according to the type of PHY interface and the PHY speed.
cy_rslt_t cy_eth_phy_enable_ext_reg(ETH_Type *reg_base, uint32_t phy_speed);
cy_eth_phy_get_linkspeed()
- Get configured ethernet PHY link speed.
Gets the configured PHY duplex mode and PHY speed of selected ethernet interface.
cy_rslt_t cy_eth_phy_get_linkspeed(uint8_t eth_idx, uint32_t *duplex, uint32_t *speed);
cy_eth_phy_get_linkstatus()
- Get ethernet PHY link status.
Gets the ethernet PHY link status of selected ethernet interface.
cy_rslt_t cy_eth_phy_get_linkstatus(uint8_t eth_idx, uint32_t *link_status);
cy_eth_phy_get_auto_neg_status()
- Get current Auto-Negotiation status (completed or In-progress)..
Gets the current Auto-Negotiation status (completed or In-progress) of selected ethernet interface.
cy_rslt_t cy_eth_phy_get_auto_neg_status(uint8_t eth_idx, uint32_t *neg_status);
cy_eth_phy_get_link_partner_cap()
- Gets Link partner capabilities (speed and duplex).
Gets the Link partner capabilities (speed and duplex) of selected ethernet interface.
cy_rslt_t cy_eth_phy_get_link_partner_cap(uint8_t eth_idx, uint32_t *duplex, uint32_t *speed);
cy_eth_phy_lib_deinit()
- The ethernet-phy-driver library deinitializes mutex, semaphore, and resets any relevant global variable.
The current implementation deinitializes the required ethernet ports of the given PHY hardware and resets a PHY object.
cy_rslt_t cy_eth_phy_lib_deinit(void);
This code snippet demonstrates the initialization ethernet-phy-driver library. The ethernet-phy-driver library initializes mutex, semaphore, or any relevant global variable which are required for handling ethernet PHY operations.
The following code snippet demonstrates an example for initializing the cy_ecm_phy_callbacks_t structure which is required to start the ethernet-connection-manager.
This code snippet demonstrates the initialization ethernet-phy-driver library.