RZA Flexible Software Package Documentation  Release v1.1.0

 
Ethernet PHY Interface

Detailed Description

Interface for Ethernet PHY functions.

Summary

The Ethernet PHY module (r_ether_phy) provides an API for standard Ethernet PHY communications applications that use the ETHERC peripheral.

The Ethernet PHY interface supports the following features:

Implemented by:

Data Structures

struct  ether_phy_cfg_t
 
struct  ether_phy_api_t
 
struct  ether_phy_instance_t
 

Typedefs

typedef void ether_phy_ctrl_t
 

Enumerations

enum  ether_phy_flow_control_t
 
enum  ether_phy_link_speed_t
 
enum  ether_phy_mii_type_t
 

Data Structure Documentation

◆ ether_phy_cfg_t

struct ether_phy_cfg_t

Configuration parameters.

Data Fields
uint8_t channel Channel.
uint8_t phy_lsi_address Address of PHY-LSI.
uint32_t phy_reset_wait_time Wait time for PHY-LSI reboot.
int32_t mii_bit_access_wait_time Wait time for MII/RMII access.
ether_phy_flow_control_t flow_control Flow control functionally enable or disable.
ether_phy_mii_type_t mii_type Interface type is MII or RMII.
void const * p_context

Placeholder for user data. Passed to the user callback in ether_phy_callback_args_t.

void const * p_extend Placeholder for user extension.

◆ ether_phy_api_t

struct ether_phy_api_t

Functions implemented at the HAL layer will follow this API.

Data Fields

fsp_err_t(* open )(ether_phy_ctrl_t *const p_api_ctrl, ether_phy_cfg_t const *const p_cfg)
 
fsp_err_t(* close )(ether_phy_ctrl_t *const p_api_ctrl)
 
fsp_err_t(* startAutoNegotiate )(ether_phy_ctrl_t *const p_api_ctrl)
 
fsp_err_t(* linkPartnerAbilityGet )(ether_phy_ctrl_t *const p_api_ctrl, uint32_t *const p_line_speed_duplex, uint32_t *const p_local_pause, uint32_t *const p_partner_pause)
 
fsp_err_t(* linkStatusGet )(ether_phy_ctrl_t *const p_api_ctrl)
 

Field Documentation

◆ open

fsp_err_t(* ether_phy_api_t::open) (ether_phy_ctrl_t *const p_api_ctrl, ether_phy_cfg_t const *const p_cfg)

Open driver.

Implemented as
Parameters
[in]p_api_ctrlPointer to control structure.
[in]p_cfgPointer to pin configuration structure.

◆ close

fsp_err_t(* ether_phy_api_t::close) (ether_phy_ctrl_t *const p_api_ctrl)

Close driver.

Implemented as
Parameters
[in]p_api_ctrlPointer to control structure.

◆ startAutoNegotiate

fsp_err_t(* ether_phy_api_t::startAutoNegotiate) (ether_phy_ctrl_t *const p_api_ctrl)

Start auto negotiation.

Implemented as
Parameters
[in]p_api_ctrlPointer to control structure.

◆ linkPartnerAbilityGet

fsp_err_t(* ether_phy_api_t::linkPartnerAbilityGet) (ether_phy_ctrl_t *const p_api_ctrl, uint32_t *const p_line_speed_duplex, uint32_t *const p_local_pause, uint32_t *const p_partner_pause)

Get the partner ability.

Implemented as
Parameters
[in]p_api_ctrlPointer to control structure.
[out]p_line_speed_duplexPointer to the location of both the line speed and the duplex.
[out]p_local_pausePointer to the location to store the local pause bits.
[out]p_partner_pausePointer to the location to store the partner pause bits.

◆ linkStatusGet

fsp_err_t(* ether_phy_api_t::linkStatusGet) (ether_phy_ctrl_t *const p_api_ctrl)

Get Link status from PHY-LSI interface.

Implemented as
Parameters
[in]p_api_ctrlPointer to control structure.

◆ ether_phy_instance_t

struct ether_phy_instance_t

This structure encompasses everything that is needed to use an instance of this interface.

Data Fields
ether_phy_ctrl_t * p_ctrl Pointer to the control structure for this instance.
ether_phy_cfg_t const * p_cfg Pointer to the configuration structure for this instance.
ether_phy_api_t const * p_api Pointer to the API structure for this instance.

Typedef Documentation

◆ ether_phy_ctrl_t

typedef void ether_phy_ctrl_t

Control block. Allocate an instance specific control block to pass into the API calls.

Implemented as

Enumeration Type Documentation

◆ ether_phy_flow_control_t

Flow control functionality

Enumerator
ETHER_PHY_FLOW_CONTROL_DISABLE 

Disable flow control functionality.

ETHER_PHY_FLOW_CONTROL_ENABLE 

Enable flow control functionality with pause frames.

◆ ether_phy_link_speed_t

Link speed

Enumerator
ETHER_PHY_LINK_SPEED_NO_LINK 

Link is not established.

ETHER_PHY_LINK_SPEED_10H 

Link status is 10Mbit/s and half duplex.

ETHER_PHY_LINK_SPEED_10F 

Link status is 10Mbit/s and full duplex.

ETHER_PHY_LINK_SPEED_100H 

Link status is 100Mbit/s and half duplex.

ETHER_PHY_LINK_SPEED_100F 

Link status is 100Mbit/s and full duplex.

ETHER_PHY_LINK_SPEED_1000H 

Link status is 1000Mbit/s and half duplex.

ETHER_PHY_LINK_SPEED_1000F 

Link status is 1000Mbit/s and full duplex.

◆ ether_phy_mii_type_t

Media-independent interface

Enumerator
ETHER_PHY_MII_TYPE_MII 

MII.

ETHER_PHY_MII_TYPE_RMII 

RMII.