Synergy Software Package User's Manual

Interface between SF_EL_NX Ethernet framework and PHY driver. More...

Functions

int16_t bsp_ethernet_phy_init (uint32_t channel)
 bsp_ethernet_phy_init - Initialize Ethernet PHY device. More...
 
void bsp_ethernet_phy_start_autonegotiate (uint32_t channel, uint8_t pause)
 Sets Auto-Negotiation advertisement and starts auto-negotiation. More...
 
int16_t bsp_ethernet_phy_get_autonegotiate (uint32_t channel, uint16_t *p_line_speed_duplex, uint16_t *p_local_pause, uint16_t *p_partner_pause)
 Gets capabilities of an Ethernet PHY device. More...
 
int16_t bsp_ethernet_phy_get_link_status (uint32_t channel)
 bsp_ethernet_phy_get_link_status - Returns the status of the physical link. More...
 

Detailed Description

Interface between SF_EL_NX Ethernet framework and PHY driver.

Function Documentation

◆ bsp_ethernet_phy_get_autonegotiate()

int16_t bsp_ethernet_phy_get_autonegotiate ( uint32_t  channel,
uint16_t *  p_line_speed_duplex,
uint16_t *  p_local_pause,
uint16_t *  p_partner_pause 
)

Gets capabilities of an Ethernet PHY device.

Parameters
[in]channelEthernet channel number
[in]p_line_speed_duplexA pointer to the location of both the line speed and the duplex
[in]p_local_pauseA pointer to the location to store the local pause bits
[in]p_partner_pauseA pointer to the location to store the partner pause bits
Return values
R_PHY_OKGot information successfully
R_PHY_ERRORPHY device is yet to be initialized
Note
Validating parameters is not required by this function as it by design is only called by sf_el_nx framework with valid parameters.

Reads the status register. Because reading the first time shows the previous state, the Link status bit should be read twice.

Checks the link status

Check the auto-negotiation status

Gets local pause capability

◆ bsp_ethernet_phy_get_link_status()

int16_t bsp_ethernet_phy_get_link_status ( uint32_t  channel)

bsp_ethernet_phy_get_link_status - Returns the status of the physical link.

Parameters
[in]channelEthernet channel number
Return values
R_PHY_OKPHY device is initialized successfully
R_PHY_ERRORPHY device is not initialized successfully

◆ bsp_ethernet_phy_init()

int16_t bsp_ethernet_phy_init ( uint32_t  channel)

bsp_ethernet_phy_init - Initialize Ethernet PHY device.

Parameters
[in]channelEthernet channel number
Return values
R_PHY_OKPHY device is initialized successfully
R_PHY_ERRORPHY device is not initialized successfully or Validation of PHY chip fails.
Note
Refer HW manual for valid channels for a target MCU

Read the PHY Identifier register and compare read value with the PHY chip OUI identifier number

Resets PHY device

Waits the reset completion, PHY_CONTROL_RESET bit is self-cleared after 1 is written to it.

When MICREL_KSZ8091RNB of the Micrel, Inc. is used, the pin that outputs the state of LINK is used combinedly with ACTIVITY in default. The setting of the pin is changed so that only the state of LINK is output. Set Clock Mode to 50MHz

Sets Duplex Mode as Full-duplex

◆ bsp_ethernet_phy_start_autonegotiate()

void bsp_ethernet_phy_start_autonegotiate ( uint32_t  channel,
uint8_t  pause 
)

Sets Auto-Negotiation advertisement and starts auto-negotiation.

Parameters
[in]channelEthernet channel number
[in]pauseUsing state of pause frames