45 #define FNET_MAC_ADDR_STR_SIZE (18) 52 #define FNET_ETH_MTU (1500u) 70 #define FNET_MAC_ADDR_INIT(a, b, c, d, e, f) { (a), (b), (c), (d), (e), (f) } 73 #define FNET_MAC_ADDR_IS_MULTICAST(a) ((((a)[0]) == 0x01U)?FNET_TRUE:FNET_FALSE) 76 #define FNET_MAC_ADDR_IS_BROADCAST(a) (((((a)[0]) == 0xFFU) && \ 77 (((a)[1]) == 0xFFU)&& \ 78 (((a)[1]) == 0xFFU)&& \ 79 (((a)[1]) == 0xFFU)&& \ 80 (((a)[1]) == 0xFFU)&& \ 81 (((a)[1]) == 0xFFU))? FNET_TRUE:FNET_FALSE) 83 #define FNET_MAC_ADDR_COPY(from_addr, to_addr) \ 84 (fnet_memcpy(&to_addr[0], &from_addr[0], sizeof(fnet_mac_addr_t))) 93 #define FNET_ETH_MII_REG_CR (0x0000U) 94 #define FNET_ETH_MII_REG_SR (0x0001U) 95 #define FNET_ETH_MII_REG_IDR1 (0x0002U) 96 #define FNET_ETH_MII_REG_IDR2 (0x0003U) 97 #define FNET_ETH_MII_REG_ANAR (0x0004U) 98 #define FNET_ETH_MII_REG_ANLPAR (0x0005U) 99 #define FNET_ETH_MII_REG_ANER (0x0006U) 100 #define FNET_ETH_MII_REG_ANNPTR (0x0007U) 103 #define FNET_ETH_MII_REG_SR_LINK_STATUS (0x0004U) 104 #define FNET_ETH_MII_REG_SR_AN_ABILITY (0x0008U) 105 #define FNET_ETH_MII_REG_SR_AN_COMPLETE (0x0020U) 108 #define FNET_ETH_MII_REG_CR_RESET (0x8000U) 109 #define FNET_ETH_MII_REG_CR_LOOPBACK (0x4000U) 110 #define FNET_ETH_MII_REG_CR_DATARATE (0x2000U) 111 #define FNET_ETH_MII_REG_CR_ANE (0x1000U) 112 #define FNET_ETH_MII_REG_CR_PDWN (0x0800U) 113 #define FNET_ETH_MII_REG_CR_ISOL (0x0400U) 114 #define FNET_ETH_MII_REG_CR_ANE_RESTART (0x0200U) 115 #define FNET_ETH_MII_REG_CR_DPLX (0x0100U) 118 #define FNET_ETH_MII_REG_ANAR_100_FULLDUPLEX (0x0100U) 119 #define FNET_ETH_MII_REG_ANAR_100_HALFDUPLEX (0x0080U) 120 #define FNET_ETH_MII_REG_ANAR_10_FULLDUPLEX (0x0040U) 121 #define FNET_ETH_MII_REG_ANAR_10_HALFDUPLEX (0x0020U) 122 #define FNET_ETH_MII_REG_ANAR_IEEE8023 (0x0001U) 129 #if defined(__cplusplus) 273 #if defined(__cplusplus) fnet_return_t
General return codes, used by most of API functions.
fnet_char_t * fnet_mac_to_str(const fnet_mac_addr_t addr, fnet_char_t *str_mac)
Converts a 6 byte MAC address into a null terminated string.
fnet_return_t fnet_eth_phy_read(fnet_netif_desc_t netif_desc, fnet_uint32_t reg_addr, fnet_uint16_t *reg_data)
Read a value from an Ethernet PHY's MII register.
fnet_return_t fnet_str_to_mac(const fnet_char_t *str_mac, fnet_mac_addr_t addr)
Converts a null terminated string to a 6 byte MAC address.
fnet_uint8_t fnet_eth_phy_get_addr(fnet_netif_desc_t netif_desc)
Get a PHY address number of the specified Ethernet interface.
fnet_return_t fnet_eth_phy_write(fnet_netif_desc_t netif_desc, fnet_uint32_t reg_addr, fnet_uint16_t reg_data)
Write Ethernet PHY's MII register.
fnet_return_t fnet_eth_phy_set_addr(fnet_netif_desc_t netif_desc, fnet_uint8_t phy_addr)
Set the PHY address number of the specified Ethernet interface.
char fnet_char_t
Type representing the charecter.
void * fnet_netif_desc_t
Network interface descriptor.
fnet_uint8_t fnet_mac_addr_t[6]
Media Access Control (MAC) address type.