A web server for monitoring and controlling a MakerBot Replicator over the USB host and ethernet.

Dependencies:   IAP NTPClient RTC mbed-rtos mbed Socket lwip-sys lwip BurstSPI

Fork of LPC1768_Mini-DK by Frank Vannieuwkerke

Embed: (wiki syntax)

« Back to documentation index

PHY status and control for the LAN8720.

PHY status and control for the LAN8720.

Various functions for controlling and monitoring the status of the LAN8720 PHY. More...

Functions

static s32_t lpc_update_phy_sts (struct netif *netif, u32_t linksts, u32_t sdsts)
 Update PHY status from passed value.
err_t lpc_phy_init (struct netif *netif, int rmii)
 Initialize the LAN8720 PHY.
s32_t lpc_phy_sts_sm (struct netif *netif)
 Phy status update state machine.

Variables

static PHY_STATUS_TYPE physts
 PHY update flags.
static PHY_STATUS_TYPE olddphysts
 Last PHY update flags, used for determing if something has changed.
static s32_t phyustate
 PHY update counter for state machine.

Detailed Description

Various functions for controlling and monitoring the status of the LAN8720 PHY.

In polled (standalone) systems, the PHY state must be monitored as part of the application. In a threaded (RTOS) system, the PHY state is monitored by the PHY handler thread. The MAC driver will not transmit unless the PHY link is active.


Function Documentation

err_t lpc_phy_init ( struct netif *  netif,
int  rmii 
)

Initialize the LAN8720 PHY.

Initialize the PHY.

This function initializes the LAN8720 PHY. It will block until complete. This function is called as part of the EMAC driver initialization. Configuration of the PHY at startup is controlled by setting up configuration defines in lpc_emac_config.h.

Parameters:
[in]netifNETIF structure
[in]rmiiIf set, configures the PHY for RMII mode
Returns:
ERR_OK if the setup was successful, otherwise ERR_TIMEOUT

Definition at line 212 of file lpc_phy_lan8720.c.

s32_t lpc_phy_sts_sm ( struct netif *  netif )

Phy status update state machine.

This function provides a state machine for maintaining the PHY status without blocking. It must be occasionally called for the PHY status to be maintained.

Parameters:
[in]netifNETIF structure

Definition at line 262 of file lpc_phy_lan8720.c.

static s32_t lpc_update_phy_sts ( struct netif *  netif,
u32_t  linksts,
u32_t  sdsts 
) [static]

Update PHY status from passed value.

This function updates the current PHY status based on the passed PHY status word. The PHY status indicate if the link is active, the connection speed, and duplex.

Parameters:
[in]netifNETIF structure
[in]linkstsStatus word with link state
[in]sdstsStatus word with speed and duplex states
Returns:
1 if the status has changed, otherwise 0

Definition at line 117 of file lpc_phy_lan8720.c.


Variable Documentation

PHY_STATUS_TYPE olddphysts [static]

Last PHY update flags, used for determing if something has changed.

Definition at line 101 of file lpc_phy_lan8720.c.

PHY_STATUS_TYPE physts [static]

PHY update flags.

Definition at line 98 of file lpc_phy_lan8720.c.

s32_t phyustate [static]

PHY update counter for state machine.

Definition at line 104 of file lpc_phy_lan8720.c.