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... | |
Common PHY definitions used with all PHYs.
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.
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.
[in] | full_duplex | 0 = 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.
[in] | mbs_100 | 0 = 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.
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.
[in] | PhyReg | PHY register to read from |
[in] | data | Pointer to where to save data read via MII |
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.
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.
[in] | PhyReg | PHY 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.
[in] | PhyReg | PHY register to write to |
[in] | Value | Value to write |
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.
[in] | PhyReg | PHY register to write to |
[in] | Value | Value 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.
[in] | lpc17_emac | LPC17 EMAC |
[in] | rmii | If set, configures the PHY for RMII mode |
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.
[in] | lpc17_emac | LPC17 EMAC |