libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
|
Defined Constants and Types for the Ethernet PHY More...
Macros | |
#define | PHY_REG_BCR 0x00 |
#define | PHY_REG_BSR 0x01 |
#define | PHY_REG_ID1 0x02 |
#define | PHY_REG_ID2 0x03 |
#define | PHY_REG_ANTX 0x04 |
#define | PHY_REG_ANRX 0x05 |
#define | PHY_REG_ANEXP 0x06 |
#define | PHY_REG_ANNPTX 0x07 |
#define | PHY_REG_ANNPRX 0x08 |
#define | PHY_REG_BCR_COLTEST (1 << 7) |
#define | PHY_REG_BCR_FD (1 << 8) |
#define | PHY_REG_BCR_ANRST (1 << 9) |
#define | PHY_REG_BCR_ISOLATE (1 << 10) |
#define | PHY_REG_BCR_POWERDN (1 << 11) |
#define | PHY_REG_BCR_AN (1 << 12) |
#define | PHY_REG_BCR_100M (1 << 13) |
#define | PHY_REG_BCR_LOOPBACK (1 << 14) |
#define | PHY_REG_BCR_RESET (1 << 15) |
#define | PHY_REG_BSR_JABBER (1 << 1) |
#define | PHY_REG_BSR_UP (1 << 2) |
#define | PHY_REG_BSR_FAULT (1 << 4) |
#define | PHY_REG_BSR_ANDONE (1 << 5) |
#define | PHY0 0 |
#define | PHY1 1 |
Enumerations | |
enum | phy_status { LINK_DOWN , LINK_HD_10M , LINK_HD_100M , LINK_HD_1000M , LINK_HD_10000M , LINK_FD_10M , LINK_FD_100M , LINK_FD_1000M , LINK_FD_10000M } |
Functions | |
void | phy_reset (uint8_t phy) |
Reset the PHY. More... | |
bool | phy_link_isup (uint8_t phy) |
Is the link up ? More... | |
enum phy_status | phy_link_status (uint8_t phy) |
Get the current link status. More... | |
void | phy_autoneg_force (uint8_t phy, enum phy_status mode) |
Force autonegotiation. More... | |
void | phy_autoneg_enable (uint8_t phy) |
Enable the autonegotiation. More... | |
Defined Constants and Types for the Ethernet PHY
LGPL License Terms libopencm3 License
enum phy_status |
void phy_autoneg_enable | ( | uint8_t | phy | ) |
Enable the autonegotiation.
Enable the autonegotiation of the link speed and duplex mode
[in] | phy | uint8_t phy ID of the PHY |
Definition at line 86 of file phy_ksz80x1.c.
References eth_smi_bit_set(), PHY_REG_BCR, PHY_REG_BCR_AN, and PHY_REG_BCR_ANRST.
void phy_autoneg_force | ( | uint8_t | phy, |
enum phy_status | mode | ||
) |
Force autonegotiation.
Force the autonegotiation and set link speed and duplex mode of the link
[in] | phy | uint8_t phy ID of the PHY |
[in] | mode | enum phy_status Desired link status |
Definition at line 62 of file phy_ksz80x1.c.
References eth_smi_bit_op(), LINK_FD_10000M, LINK_FD_1000M, LINK_FD_100M, LINK_FD_10M, LINK_HD_100M, PHY_REG_BCR, PHY_REG_BCR_100M, PHY_REG_BCR_AN, and PHY_REG_BCR_FD.
bool phy_link_isup | ( | uint8_t | phy | ) |
Is the link up ?
[in] | phy | uint8_t phy ID of the PHY |
Definition at line 46 of file phy.c.
References eth_smi_read(), PHY_REG_BSR, and PHY_REG_BSR_UP.
enum phy_status phy_link_status | ( | uint8_t | phy | ) |
Get the current link status.
Retrieve the link speed and duplex status of the link.
[in] | phy | uint8_t phy ID of the PHY |
Definition at line 49 of file phy_ksz80x1.c.
References eth_smi_read(), and KSZ80X1_CR1.
void phy_reset | ( | uint8_t | phy | ) |
Reset the PHY.
Reset the PHY chip and wait for done
[in] | phy | uint8_t phy ID of the PHY |
Definition at line 57 of file phy.c.
References eth_smi_read(), eth_smi_write(), PHY_REG_BCR, and PHY_REG_BCR_RESET.
Referenced by eth_init().