Ethernet PHY Driver
Group_eth_phy_driver_functions

General Description

Functions

cy_rslt_t cy_eth_phy_driver_init (void)
 Does general allocation and initialization of resources needed for the library. More...
 
cy_rslt_t cy_eth_phy_init (uint8_t eth_idx, ETH_Type *reg_base)
 Ethernet PHY driver Initialization. More...
 
cy_rslt_t cy_eth_phy_configure (uint8_t eth_idx, uint32_t duplex, uint32_t speed)
 Ethernet PHY driver Configure. More...
 
cy_rslt_t cy_eth_phy_reset (uint8_t eth_idx, ETH_Type *reg_base)
 Ethernet PHY driver reset. More...
 
cy_rslt_t cy_eth_phy_discover (uint8_t eth_idx)
 Ethernet PHY driver discover. More...
 
cy_rslt_t cy_eth_phy_enable_ext_reg (ETH_Type *reg_base, uint32_t phy_speed)
 Enable extended Ethernet PHY driver Registers. More...
 
cy_rslt_t cy_eth_phy_get_linkspeed (uint8_t eth_idx, uint32_t *duplex, uint32_t *speed)
 Ethernet PHY driver get link speed. More...
 
cy_rslt_t cy_eth_phy_get_linkstatus (uint8_t eth_idx, uint32_t *link_status)
 Ethernet PHY driver get link status. More...
 
cy_rslt_t cy_eth_phy_get_auto_neg_status (uint8_t eth_idx, uint32_t *neg_status)
 Get Ethernet PHY Auto Negotiation Status. More...
 
cy_rslt_t cy_eth_phy_get_link_partner_cap (uint8_t eth_idx, uint32_t *duplex, uint32_t *speed)
 Get Ethernet PHY Link Partner Capabilities. More...
 
cy_rslt_t cy_eth_phy_driver_deinit (void)
 Releases the resources allocated in the cy_eth_phy_driver_init function. More...
 

Function Documentation

◆ cy_eth_phy_driver_init()

cy_rslt_t cy_eth_phy_driver_init ( void  )

Does general allocation and initialization of resources needed for the library.

This API function must be called before using any other Ethernet PHY Driver API.

Note
cy_eth_phy_driver_init and cy_eth_phy_driver_deinit API functions are not thread-safe. The caller must ensure that these two API functions are not invoked simultaneously from different threads.
Returns
CY_RSLT_SUCCESS if Ethernet PHY Driver library initialization was successful; an error code on failure.

◆ cy_eth_phy_init()

cy_rslt_t cy_eth_phy_init ( uint8_t  eth_idx,
ETH_Type *  reg_base 
)

Ethernet PHY driver Initialization.

API 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.

Parameters
[in]eth_idx: Ethernet interface to be initialized
[in]reg_base: Register base address of the ethernet interface
Returns
CY_RSLT_SUCCESS if ethernet PHY driver initialization was successful; an error code on failure.

◆ cy_eth_phy_configure()

cy_rslt_t cy_eth_phy_configure ( uint8_t  eth_idx,
uint32_t  duplex,
uint32_t  speed 
)

Ethernet PHY driver Configure.

Configures ethernet PHY with given duplex mode and PHY speed.

Parameters
[in]eth_idx: Ethernet port to be initialized
[in]duplex: PHY duplex mode
[in]speed: PHY speed
Returns
CY_RSLT_SUCCESS if ethernet PHY Configure was successful; an error code on failure.

◆ cy_eth_phy_reset()

cy_rslt_t cy_eth_phy_reset ( uint8_t  eth_idx,
ETH_Type *  reg_base 
)

Ethernet PHY driver reset.

Performs a full reset of ethernet PHY, including all ethernet PHY registers.

Parameters
[in]eth_idx: Ethernet interface number
[in]reg_base: Register base address of the ethernet interface
Returns
CY_RSLT_SUCCESS if ethernet PHY driver reset was successful; an error code on failure.

◆ cy_eth_phy_discover()

cy_rslt_t cy_eth_phy_discover ( uint8_t  eth_idx)

Ethernet PHY driver discover.

Discovers connected ethernet PHY at address zero.

Parameters
[in]eth_idx: Ethernet interface number
Returns
CY_RSLT_SUCCESS if ethernet PHY driver discover was successful; an error code on failure.

◆ cy_eth_phy_enable_ext_reg()

cy_rslt_t cy_eth_phy_enable_ext_reg ( ETH_Type *  reg_base,
uint32_t  phy_speed 
)

Enable extended Ethernet PHY driver 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.

Parameters
[in]reg_base: Register base address of the ethernet interface
[in]phy_speed: PHY speed
Returns
CY_RSLT_SUCCESS if ethernet PHY driver enabling extended registors was successful; an error code on failure.

◆ cy_eth_phy_get_linkspeed()

cy_rslt_t cy_eth_phy_get_linkspeed ( uint8_t  eth_idx,
uint32_t *  duplex,
uint32_t *  speed 
)

Ethernet PHY driver get link speed.

Gets the configured PHY duplex mode and PHY speed of selected ethernet interface.

Parameters
[in]eth_idx: Ethernet interface number
[out]duplex: PHY duplex mode
[out]speed: PHY speed
Returns
CY_RSLT_SUCCESS if ethernet PHY driver get link speed was successful; an error code on failure.

◆ cy_eth_phy_get_linkstatus()

cy_rslt_t cy_eth_phy_get_linkstatus ( uint8_t  eth_idx,
uint32_t *  link_status 
)

Ethernet PHY driver get link status.

Gets the ethernet PHY link status of selected ethernet interface.

Parameters
[in]eth_idx: Ethernet interface number
[out]link_status: PHY duplex mode
Returns
CY_RSLT_SUCCESS if ethernet PHY driver get link status was successful; an error code on failure.

◆ cy_eth_phy_get_auto_neg_status()

cy_rslt_t cy_eth_phy_get_auto_neg_status ( uint8_t  eth_idx,
uint32_t *  neg_status 
)

Get Ethernet PHY Auto Negotiation Status.

Gets the current Auto-Negotiation status (completed or In-progress) of selected ethernet interface.

Parameters
[in]eth_idx: Ethernet interface number
[out]neg_status: PHY duplex mode
Returns
CY_RSLT_SUCCESS if ethernet PHY driver reset was successful; an error code on failure.

◆ cy_eth_phy_get_link_partner_cap()

cy_rslt_t cy_eth_phy_get_link_partner_cap ( uint8_t  eth_idx,
uint32_t *  duplex,
uint32_t *  speed 
)

Get Ethernet PHY Link Partner Capabilities.

Gets the Link partner capabilities (speed and duplex) of selected ethernet interface.

Parameters
[in]eth_idx: Ethernet interface number
[out]duplex: PHY duplex mode
[out]speed: PHY speed
Returns
CY_RSLT_SUCCESS if ethernet PHY driver get link partner capabilities was successful; an error code on failure.

◆ cy_eth_phy_driver_deinit()

cy_rslt_t cy_eth_phy_driver_deinit ( void  )

Releases the resources allocated in the cy_eth_phy_driver_init function.

Note
cy_eth_phy_driver_init and cy_eth_phy_driver_deinit API functions are not thread-safe. The caller must ensure that these two API functions are not invoked simultaneously from different threads.
Returns
CY_RSLT_SUCCESS if Ethernet PHY Driver library deinitialization was successful; an error code on failure.