RZT Flexible Software Package Documentation  Release v2.2.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:

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_lsi_type_t
 
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_lsi_type_t phy_lsi_type Phy LSI type.
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_ctrl, ether_phy_cfg_t const *const p_cfg)
 
fsp_err_t(* close )(ether_phy_ctrl_t *const p_ctrl)
 
fsp_err_t(* chipInit )(ether_phy_ctrl_t *const p_ctrl, ether_phy_cfg_t const *const p_cfg)
 
fsp_err_t(* read )(ether_phy_ctrl_t *const p_ctrl, uint32_t reg_addr, uint32_t *const p_data)
 
fsp_err_t(* write )(ether_phy_ctrl_t *const p_ctrl, uint32_t reg_addr, uint32_t data)
 
fsp_err_t(* startAutoNegotiate )(ether_phy_ctrl_t *const p_ctrl)
 
fsp_err_t(* linkPartnerAbilityGet )(ether_phy_ctrl_t *const p_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_ctrl)
 

Field Documentation

◆ open

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

Open driver.

Parameters
[in]p_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_ctrl)

Close driver.

Parameters
[in]p_ctrlPointer to control structure.

◆ chipInit

fsp_err_t(* ether_phy_api_t::chipInit) (ether_phy_ctrl_t *const p_ctrl, ether_phy_cfg_t const *const p_cfg)

Initialize PHY-LSI.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_cfgPointer to pin configuration structure.

◆ read

fsp_err_t(* ether_phy_api_t::read) (ether_phy_ctrl_t *const p_ctrl, uint32_t reg_addr, uint32_t *const p_data)

Read register value of PHY-LSI.

Parameters
[in]p_ctrlPointer to control structure.
[in]reg_addrRegister address.
[out]p_dataPointer to the location to store read data.

◆ write

fsp_err_t(* ether_phy_api_t::write) (ether_phy_ctrl_t *const p_ctrl, uint32_t reg_addr, uint32_t data)

Write data to register of PHY-LSI.

Parameters
[in]p_ctrlPointer to control structure.
[in]reg_addrRegister address.
[in]dataData written to register.

◆ startAutoNegotiate

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

Start auto negotiation.

Parameters
[in]p_ctrlPointer to control structure.

◆ linkPartnerAbilityGet

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

Get the partner ability.

Parameters
[in]p_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_ctrl)

Get Link status from PHY-LSI interface.

Parameters
[in]p_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.

Enumeration Type Documentation

◆ ether_phy_lsi_type_t

Phy LSI

Enumerator
ETHER_PHY_LSI_TYPE_DEFAULT 

Select default configuration. This type dose not change Phy LSI default setting by strapping option.

ETHER_PHY_LSI_TYPE_KSZ8091RNB 

Select configuration for KSZ8091RNB.

ETHER_PHY_LSI_TYPE_KSZ8041 

Select configuration for KSZ8041.

ETHER_PHY_LSI_TYPE_DP83620 

Select configuration for DP83620.

ETHER_PHY_LSI_TYPE_ICS1894 

Select configuration for ICS1894.

ETHER_PHY_LSI_TYPE_CUSTOM 

Select configuration for User custom.

ETHER_PHY_LSI_TYPE_DEFAULT 

Select default configuration. This type dose not change Phy LSI default setting by strapping option.

ETHER_PHY_LSI_TYPE_VSC8541 

Select configuration forVSC8541.

ETHER_PHY_LSI_TYPE_KSZ9131 

Select configuration forKSZ9131.

ETHER_PHY_LSI_TYPE_KSZ9031 

Select configuration forKSZ9031.

ETHER_PHY_LSI_TYPE_KSZ8081 

Select configuration forKSZ8081.

ETHER_PHY_LSI_TYPE_KSZ8041 

Select configuration forKSZ8041.

ETHER_PHY_LSI_TYPE_CUSTOM 

Select configuration for User custom.

ETHER_PHY_LSI_TYPE_DEFAULT 

Select default configuration. This type dose not change Phy LSI default setting by strapping option.

ETHER_PHY_LSI_TYPE_VSC8541 

Select configuration forVSC8541.

ETHER_PHY_LSI_TYPE_KSZ9131 

Select configuration forKSZ9131.

ETHER_PHY_LSI_TYPE_KSZ9031 

Select configuration forKSZ9031.

ETHER_PHY_LSI_TYPE_KSZ8081 

Select configuration forKSZ8081.

ETHER_PHY_LSI_TYPE_KSZ8041 

Select configuration forKSZ8041.

ETHER_PHY_LSI_TYPE_CUSTOM 

Select configuration for User custom.

ETHER_PHY_LSI_TYPE_DEFAULT 

Select default configuration. This type dose not change Phy LSI default setting by strapping option.

ETHER_PHY_LSI_TYPE_VSC8541 

Select configuration forVSC8541.

ETHER_PHY_LSI_TYPE_KSZ9131 

Select configuration forKSZ9131.

ETHER_PHY_LSI_TYPE_KSZ9031 

Select configuration forKSZ9031.

ETHER_PHY_LSI_TYPE_KSZ8081 

Select configuration forKSZ8081.

ETHER_PHY_LSI_TYPE_KSZ8041 

Select configuration forKSZ8041.

ETHER_PHY_LSI_TYPE_CUSTOM 

Select configuration for User custom.

ETHER_PHY_LSI_TYPE_DEFAULT 

Select default configuration. This type dose not change Phy LSI default setting by strapping option.

ETHER_PHY_LSI_TYPE_VSC8541 

Select configuration forVSC8541.

ETHER_PHY_LSI_TYPE_KSZ9131 

Select configuration forKSZ9131.

ETHER_PHY_LSI_TYPE_KSZ9031 

Select configuration forKSZ9031.

ETHER_PHY_LSI_TYPE_KSZ8081 

Select configuration forKSZ8081.

ETHER_PHY_LSI_TYPE_KSZ8041 

Select configuration forKSZ8041.

ETHER_PHY_LSI_TYPE_CUSTOM 

Select configuration for User custom.

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

ETHER_PHY_MII_TYPE_GMII 

GMII.

ETHER_PHY_MII_TYPE_RGMII 

RGMII.