Go to the documentation of this file.
31 #ifndef _LAN8710_DRIVER_H
32 #define _LAN8710_DRIVER_H
38 #ifndef LAN8710_PHY_ADDR
39 #define LAN8710_PHY_ADDR 0
40 #elif (LAN8710_PHY_ADDR < 0 || LAN8710_PHY_ADDR > 31)
41 #error LAN8710_PHY_ADDR parameter is not valid
45 #define LAN8710_BMCR 0x00
46 #define LAN8710_BMSR 0x01
47 #define LAN8710_PHYID1 0x02
48 #define LAN8710_PHYID2 0x03
49 #define LAN8710_ANAR 0x04
50 #define LAN8710_ANLPAR 0x05
51 #define LAN8710_ANER 0x06
52 #define LAN8710_MCSR 0x11
53 #define LAN8710_SMR 0x12
54 #define LAN8710_SECR 0x1A
55 #define LAN8710_SCSIR 0x1B
56 #define LAN8710_ISR 0x1D
57 #define LAN8710_IMR 0x1E
58 #define LAN8710_PSCSR 0x1F
61 #define LAN8710_BMCR_RESET 0x8000
62 #define LAN8710_BMCR_LOOPBACK 0x4000
63 #define LAN8710_BMCR_SPEED_SEL 0x2000
64 #define LAN8710_BMCR_AN_EN 0x1000
65 #define LAN8710_BMCR_POWER_DOWN 0x0800
66 #define LAN8710_BMCR_ISOLATE 0x0400
67 #define LAN8710_BMCR_RESTART_AN 0x0200
68 #define LAN8710_BMCR_DUPLEX_MODE 0x0100
69 #define LAN8710_BMCR_COL_TEST 0x0080
72 #define LAN8710_BMSR_100BT4 0x8000
73 #define LAN8710_BMSR_100BTX_FD 0x4000
74 #define LAN8710_BMSR_100BTX_HD 0x2000
75 #define LAN8710_BMSR_10BT_FD 0x1000
76 #define LAN8710_BMSR_10BT_HD 0x0800
77 #define LAN8710_BMSR_100BT2_FD 0x0400
78 #define LAN8710_BMSR_100BT2_HD 0x0200
79 #define LAN8710_BMSR_EXTENDED_STATUS 0x0100
80 #define LAN8710_BMSR_AN_COMPLETE 0x0020
81 #define LAN8710_BMSR_REMOTE_FAULT 0x0010
82 #define LAN8710_BMSR_AN_CAPABLE 0x0008
83 #define LAN8710_BMSR_LINK_STATUS 0x0004
84 #define LAN8710_BMSR_JABBER_DETECT 0x0002
85 #define LAN8710_BMSR_EXTENDED_CAPABLE 0x0001
88 #define LAN8710_PHYID1_PHY_ID_MSB 0xFFFF
89 #define LAN8710_PHYID1_PHY_ID_MSB_DEFAULT 0x0007
92 #define LAN8710_PHYID2_PHY_ID_LSB 0xFC00
93 #define LAN8710_PHYID2_PHY_ID_LSB_DEFAULT 0xC000
94 #define LAN8710_PHYID2_MODEL_NUM 0x03F0
95 #define LAN8710_PHYID2_MODEL_NUM_DEFAULT 0x00F0
96 #define LAN8710_PHYID2_REVISION_NUM 0x000F
99 #define LAN8710_ANAR_REMOTE_FAULT 0x2000
100 #define LAN8710_ANAR_PAUSE 0x0C00
101 #define LAN8710_ANAR_100BTX_FD 0x0100
102 #define LAN8710_ANAR_100BTX_HD 0x0080
103 #define LAN8710_ANAR_10BT_FD 0x0040
104 #define LAN8710_ANAR_10BT_HD 0x0020
105 #define LAN8710_ANAR_SELECTOR 0x001F
106 #define LAN8710_ANAR_SELECTOR_DEFAULT 0x0001
109 #define LAN8710_ANLPAR_NEXT_PAGE 0x8000
110 #define LAN8710_ANLPAR_ACK 0x4000
111 #define LAN8710_ANLPAR_REMOTE_FAULT 0x2000
112 #define LAN8710_ANLPAR_PAUSE 0x0400
113 #define LAN8710_ANLPAR_100BT4 0x0200
114 #define LAN8710_ANLPAR_100BTX_FD 0x0100
115 #define LAN8710_ANLPAR_100BTX_HD 0x0080
116 #define LAN8710_ANLPAR_10BT_FD 0x0040
117 #define LAN8710_ANLPAR_10BT_HD 0x0020
118 #define LAN8710_ANLPAR_SELECTOR 0x001F
119 #define LAN8710_ANLPAR_SELECTOR_DEFAULT 0x0001
122 #define LAN8710_ANER_PAR_DETECT_FAULT 0x0010
123 #define LAN8710_ANER_LP_NEXT_PAGE_ABLE 0x0008
124 #define LAN8710_ANER_NEXT_PAGE_ABLE 0x0004
125 #define LAN8710_ANER_PAGE_RECEIVED 0x0002
126 #define LAN8710_ANER_LP_AN_ABLE 0x0001
129 #define LAN8710_MCSR_EDPWRDOWN 0x2000
130 #define LAN8710_MCSR_FARLOOPBACK 0x0200
131 #define LAN8710_MCSR_ALTINT 0x0040
132 #define LAN8710_MCSR_ENERGYON 0x0002
135 #define LAN8710_SMR_MIIMODE 0x4000
136 #define LAN8710_SMR_MODE 0x00E0
137 #define LAN8710_SMR_PHYAD 0x001F
140 #define LAN8710_SECR_SYM_ERR_CNT 0xFFFF
143 #define LAN8710_SCSIR_AMDIXCTRL 0x8000
144 #define LAN8710_SCSIR_CH_SELECT 0x2000
145 #define LAN8710_SCSIR_SQEOFF 0x0800
146 #define LAN8710_SCSIR_XPOL 0x0010
149 #define LAN8710_ISR_ENERGYON 0x0080
150 #define LAN8710_ISR_AN_COMPLETE 0x0040
151 #define LAN8710_ISR_REMOTE_FAULT 0x0020
152 #define LAN8710_ISR_LINK_DOWN 0x0010
153 #define LAN8710_ISR_AN_LP_ACK 0x0008
154 #define LAN8710_ISR_PAR_DETECT_FAULT 0x0004
155 #define LAN8710_ISR_AN_PAGE_RECEIVED 0x0002
158 #define LAN8710_IMR_ENERGYON 0x0080
159 #define LAN8710_IMR_AN_COMPLETE 0x0040
160 #define LAN8710_IMR_REMOTE_FAULT 0x0020
161 #define LAN8710_IMR_LINK_DOWN 0x0010
162 #define LAN8710_IMR_AN_LP_ACK 0x0008
163 #define LAN8710_IMR_PAR_DETECT_FAULT 0x0004
164 #define LAN8710_IMR_AN_PAGE_RECEIVED 0x0002
167 #define LAN8710_PSCSR_AUTODONE 0x1000
168 #define LAN8710_PSCSR_HCDSPEED 0x001C
169 #define LAN8710_PSCSR_HCDSPEED_10BT_HD 0x0004
170 #define LAN8710_PSCSR_HCDSPEED_100BTX_HD 0x0008
171 #define LAN8710_PSCSR_HCDSPEED_10BT_FD 0x0014
172 #define LAN8710_PSCSR_HCDSPEED_100BTX_FD 0x0018
void lan8710DumpPhyReg(NetInterface *interface)
Dump PHY registers for debugging purpose.
const PhyDriver lan8710PhyDriver
LAN8710 Ethernet PHY driver.
void lan8710InitHook(NetInterface *interface)
LAN8710 custom configuration.
void lan8710WritePhyReg(NetInterface *interface, uint8_t address, uint16_t data)
Write PHY register.
uint16_t lan8710ReadPhyReg(NetInterface *interface, uint8_t address)
Read PHY register.
void lan8710Tick(NetInterface *interface)
LAN8710 timer handler.
void lan8710EventHandler(NetInterface *interface)
LAN8710 event handler.
void lan8710DisableIrq(NetInterface *interface)
Disable interrupts.
Network interface controller abstraction layer.
error_t lan8710Init(NetInterface *interface)
LAN8710 PHY transceiver initialization.
void lan8710EnableIrq(NetInterface *interface)
Enable interrupts.