Mistake on this page?
Report an issue in GitHub or email us
Functions
lpc_phy.h File Reference

Common PHY definitions used with all PHYs. More...

Go to the source code of this file.

Functions

int32_t lpc_phy_sts_sm (LPC17_EMAC *lpc17_emac)
 Phy status update state machine. More...
 
bool lpc_phy_init (LPC17_EMAC *lpc17_emac, int rmii)
 Initialize the PHY. More...
 
void lpc_mii_write_noblock (uint32_t PhyReg, uint32_t Value)
 Write a value via the MII link (non-blocking) More...
 
bool lpc_mii_write (uint32_t PhyReg, uint32_t Value)
 Write a value via the MII link (blocking) More...
 
uint32_t lpc_mii_is_busy (void)
 Reads current MII link busy status. More...
 
uint32_t lpc_mii_read_data (void)
 Starts a read operation via the MII link (non-blocking) More...
 
bool lpc_mii_read (uint32_t PhyReg, uint32_t *data)
 Starts a read operation via the MII link (non-blocking) More...
 
void lpc_mii_read_noblock (uint32_t PhyReg)
 Read a value via the MII link (blocking) More...
 
void lpc_emac_set_duplex (int full_duplex)
 This function provides a method for the PHY to setup the EMAC for the PHY negotiated duplex mode. More...
 
void lpc_emac_set_speed (int mbs_100)
 This function provides a method for the PHY to setup the EMAC for the PHY negotiated bit rate. More...
 

Detailed Description

Common PHY definitions used with all PHYs.

Version
1.0
Date
20 Nov. 2011
Author
NXP MCU SW Application Team

Copyright(C) 2011, NXP Semiconductor All rights reserved.

Software that is described herein is for illustrative purposes only which provides customers with programming information regarding the products. This software is supplied "AS IS" without any warranties. NXP Semiconductors assumes no responsibility or liability for the use of the software, conveys no license or title under any patent, copyright, or mask work right to the product. NXP Semiconductors reserves the right to make changes in the software without notification. NXP Semiconductors also make no representation or warranty that such application will be suitable for the specified use without further testing or modification.

Definition in file lpc_phy.h.

Function Documentation

void lpc_emac_set_duplex ( int  full_duplex)

This function provides a method for the PHY to setup the EMAC for the PHY negotiated duplex mode.

Parameters
[in]full_duplex0 = half duplex, 1 = full duplex
void lpc_emac_set_speed ( int  mbs_100)

This function provides a method for the PHY to setup the EMAC for the PHY negotiated bit rate.

Parameters
[in]mbs_1000 = 10mbs mode, 1 = 100mbs mode
uint32_t lpc_mii_is_busy ( void  )

Reads current MII link busy status.

This function will return the current MII link busy status and is meant to be used with non-blocking functions for monitor PHY status such as connection state.

Returns
!0 if the MII link is busy, otherwise 0
bool lpc_mii_read ( uint32_t  PhyReg,
uint32_t *  data 
)

Starts a read operation via the MII link (non-blocking)

This function will start a read operation on the MII link interface from a PHY or a connected device. The function will not block and the status mist be polled until complete. Once complete, the data can be read.

Parameters
[in]PhyRegPHY register to read from
[in]dataPointer to where to save data read via MII
Returns
0 if the read was successful, otherwise !0
uint32_t lpc_mii_read_data ( void  )

Starts a read operation via the MII link (non-blocking)

This function returns the current value in the MII data register. It is meant to be used with the non-blocking oeprations. This value should only be read after a non-block read command has been issued and the MII status has been determined to be good.

Returns
The current value in the MII value register
void lpc_mii_read_noblock ( uint32_t  PhyReg)

Read a value via the MII link (blocking)

This function will read a value on the MII link interface from a PHY or a connected device. The function will block until complete.

Parameters
[in]PhyRegPHY register to read from
bool lpc_mii_write ( uint32_t  PhyReg,
uint32_t  Value 
)

Write a value via the MII link (blocking)

This function will write a value on the MII link interface to a PHY or a connected device. The function will block until complete.

Parameters
[in]PhyRegPHY register to write to
[in]ValueValue to write
Returns
0 if the write was successful, otherwise !0
void lpc_mii_write_noblock ( uint32_t  PhyReg,
uint32_t  Value 
)

Write a value via the MII link (non-blocking)

This function will write a value on the MII link interface to a PHY or a connected device. The function will return immediately without a status. Status needs to be polled later to determine if the write was successful.

Parameters
[in]PhyRegPHY register to write to
[in]ValueValue to write
bool lpc_phy_init ( LPC17_EMAC lpc17_emac,
int  rmii 
)

Initialize the PHY.

This function initializes the 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]lpc17_emacLPC17 EMAC
[in]rmiiIf set, configures the PHY for RMII mode
Returns
ERR_OK if the setup was successful, otherwise ERR_TIMEOUT
int32_t lpc_phy_sts_sm ( LPC17_EMAC lpc17_emac)

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]lpc17_emacLPC17 EMAC
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.