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:
- Auto negotiation support
- Flow control support
- Link status check support
◆ 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
Functions implemented at the HAL layer will follow this API.
◆ open
Open driver.
- Parameters
-
[in] | p_ctrl | Pointer to control structure. |
[in] | p_cfg | Pointer to pin configuration structure. |
◆ close
Close driver.
- Parameters
-
[in] | p_ctrl | Pointer to control structure. |
◆ chipInit
Initialize PHY-LSI.
- Parameters
-
[in] | p_ctrl | Pointer to control structure. |
[in] | p_cfg | Pointer to pin configuration structure. |
◆ read
Read register value of PHY-LSI.
- Parameters
-
[in] | p_ctrl | Pointer to control structure. |
[in] | reg_addr | Register address. |
[out] | p_data | Pointer to the location to store read data. |
◆ write
Write data to register of PHY-LSI.
- Parameters
-
[in] | p_ctrl | Pointer to control structure. |
[in] | reg_addr | Register address. |
[in] | data | Data written to register. |
◆ startAutoNegotiate
Start auto negotiation.
- Parameters
-
[in] | p_ctrl | Pointer 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_ctrl | Pointer to control structure. |
[out] | p_line_speed_duplex | Pointer to the location of both the line speed and the duplex. |
[out] | p_local_pause | Pointer to the location to store the local pause bits. |
[out] | p_partner_pause | Pointer to the location to store the partner pause bits. |
◆ linkStatusGet
Get Link status from PHY-LSI interface.
- Parameters
-
[in] | p_ctrl | Pointer 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. |
◆ ether_phy_ctrl_t
Control block. Allocate an instance specific control block to pass into the API calls.
◆ 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_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_KSZ9131RNXI | Select configuration for KSZ9131RNXI.
|
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.
|