Control a robot over the internet using UDP and a Ethernet interface.

Dependencies:   EthernetInterface Motor TextLCD mbed-rtos mbed Socket lwip-eth lwip-sys lwip

Embed: (wiki syntax)

« Back to documentation index

PHY status and control for the DP83848.

PHY status and control for the DP83848.

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

Functions

static s32_t lpc_update_phy_sts (struct netif *netif, u32_t linksts)
 Update PHY status from passed value.
err_t lpc_phy_init (struct netif *netif, int rmii)
 Initialize the DP83848 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.
static u32_t phy_id
 Holds the PHY ID.
static u32_t phy_lan7420_sts_tmp
 Temporary holder of link status for LAN7420.

Detailed Description

Various functions for controlling and monitoring the status of the DP83848 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 DP83848 PHY.

Initialize the PHY.

This function initializes the DP83848 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_phy.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 226 of file lpc_phy_dp83848.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 286 of file lpc_phy_dp83848.c.

static s32_t lpc_update_phy_sts ( struct netif netif,
u32_t  linksts 
) [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 from PHY
Returns:
1 if the status has changed, otherwise 0

Definition at line 143 of file lpc_phy_dp83848.c.


Variable Documentation

PHY_STATUS_TYPE olddphysts [static]

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

Definition at line 122 of file lpc_phy_dp83848.c.

u32_t phy_id [static]

Holds the PHY ID.

Definition at line 128 of file lpc_phy_dp83848.c.

u32_t phy_lan7420_sts_tmp [static]

Temporary holder of link status for LAN7420.

Definition at line 131 of file lpc_phy_dp83848.c.

PHY_STATUS_TYPE physts [static]

PHY update flags.

Definition at line 119 of file lpc_phy_dp83848.c.

s32_t phyustate [static]

PHY update counter for state machine.

Definition at line 125 of file lpc_phy_dp83848.c.