31#ifndef _LAN8830_DRIVER_H
32#define _LAN8830_DRIVER_H
38#ifndef LAN8830_PHY_ADDR
39 #define LAN8830_PHY_ADDR 3
40#elif (LAN8830_PHY_ADDR < 0 || LAN8830_PHY_ADDR > 31)
41 #error LAN8830_PHY_ADDR parameter is not valid
45#define LAN8830_BMCR 0x00
46#define LAN8830_BMSR 0x01
47#define LAN8830_PHYID1 0x02
48#define LAN8830_PHYID2 0x03
49#define LAN8830_ANAR 0x04
50#define LAN8830_ANLPAR 0x05
51#define LAN8830_ANER 0x06
52#define LAN8830_ANNPR 0x07
53#define LAN8830_ANLPNPR 0x08
54#define LAN8830_GBCR 0x09
55#define LAN8830_GBSR 0x0A
56#define LAN8830_MMDACR 0x0D
57#define LAN8830_MMDAADR 0x0E
58#define LAN8830_GBESR 0x0F
59#define LAN8830_RLB 0x11
60#define LAN8830_LINKMD 0x12
61#define LAN8830_DPMAPCSS 0x13
62#define LAN8830_RXERCTR 0x15
63#define LAN8830_LED_MODE_SEL 0x16
64#define LAN8830_LED_BEHAVIOR 0x17
65#define LAN8830_OUT_CTRL 0x19
66#define LAN8830_LEGACY_LED_MODE 0x1A
67#define LAN8830_ISR 0x1B
68#define LAN8830_AUTOMDI 0x1C
69#define LAN8830_SPDC 0x1D
70#define LAN8830_EXT_LOOPBACK 0x1E
71#define LAN8830_PHYCON 0x1F
74#define LAN8830_MEAN_SLICER_ERROR 0x01, 0xE1
75#define LAN8830_DCQ_MEAN_SQUARE_ERROR 0x01, 0xE2
76#define LAN8830_DCQ_MEAN_SQUARE_ERROR_WORST_CASE 0x01, 0xE3
77#define LAN8830_DCQ_SQI 0x01, 0xE4
78#define LAN8830_DCQ_PEAK_MSE 0x01, 0xE5
79#define LAN8830_DCQ_CTRL 0x01, 0xE6
80#define LAN8830_DCQ_CONFIG 0x01, 0xE7
81#define LAN8830_DCQ_SQI_TABLE 0x01, 0xE8
82#define LAN8830_COMMON_CTRL 0x02, 0x00
83#define LAN8830_STRAP_STAT 0x02, 0x01
84#define LAN8830_OP_MODE_STRAP_OVERRIDE 0x02, 0x02
85#define LAN8830_OP_MODE_STRAP 0x02, 0x03
86#define LAN8830_CLOCK_INV_CTRL_SIGNAL_PAD_SKEW 0x02, 0x04
87#define LAN8830_RGMII_RX_DATA_PAD_SKEW 0x02, 0x05
88#define LAN8830_RGMII_TX_DATA_PAD_SKEW 0x02, 0x06
89#define LAN8830_CLK_PAD_SKEW 0x02, 0x08
90#define LAN8830_SELF_TEST_PKT_COUNT_LO 0x02, 0x09
91#define LAN8830_SELF_TEST_PKT_COUNT_HI 0x02, 0x0A
92#define LAN8830_SELF_TEST_STAT 0x02, 0x0B
93#define LAN8830_SELF_TEST_FRAME_COUNT_EN 0x02, 0x0C
94#define LAN8830_SELF_TEST_PGEN_EN 0x02, 0x0D
95#define LAN8830_SELF_TEST_EN 0x02, 0x0E
96#define LAN8830_WOL_CTRL 0x02, 0x10
97#define LAN8830_WOL_MAC_LO 0x02, 0x11
98#define LAN8830_WOL_MAC_MI 0x02, 0x12
99#define LAN8830_WOL_MAC_HI 0x02, 0x13
100#define LAN8830_CUSTOM_PKT0_CRC_LO 0x02, 0x14
101#define LAN8830_CUSTOM_PKT0_CRC_HI 0x02, 0x15
102#define LAN8830_CUSTOM_PKT1_CRC_LO 0x02, 0x16
103#define LAN8830_CUSTOM_PKT1_CRC_HI 0x02, 0x17
104#define LAN8830_CUSTOM_PKT2_CRC_LO 0x02, 0x18
105#define LAN8830_CUSTOM_PKT2_CRC_HI 0x02, 0x19
106#define LAN8830_CUSTOM_PKT3_CRC_LO 0x02, 0x1A
107#define LAN8830_CUSTOM_PKT3_CRC_HI 0x02, 0x1B
108#define LAN8830_CUSTOM_PKT0_MASK_LL 0x02, 0x1C
109#define LAN8830_CUSTOM_PKT0_MASK_LH 0x02, 0x1D
110#define LAN8830_CUSTOM_PKT0_MASK_HL 0x02, 0x1E
111#define LAN8830_CUSTOM_PKT0_MASK_HH 0x02, 0x1F
112#define LAN8830_CUSTOM_PKT1_MASK_LL 0x02, 0x20
113#define LAN8830_CUSTOM_PKT1_MASK_LH 0x02, 0x21
114#define LAN8830_CUSTOM_PKT1_MASK_HL 0x02, 0x22
115#define LAN8830_CUSTOM_PKT1_MASK_HH 0x02, 0x23
116#define LAN8830_CUSTOM_PKT2_MASK_LL 0x02, 0x24
117#define LAN8830_CUSTOM_PKT2_MASK_LH 0x02, 0x25
118#define LAN8830_CUSTOM_PKT2_MASK_HL 0x02, 0x26
119#define LAN8830_CUSTOM_PKT2_MASK_HH 0x02, 0x27
120#define LAN8830_CUSTOM_PKT3_MASK_LL 0x02, 0x28
121#define LAN8830_CUSTOM_PKT3_MASK_LH 0x02, 0x29
122#define LAN8830_CUSTOM_PKT3_MASK_HL 0x02, 0x2A
123#define LAN8830_CUSTOM_PKT3_MASK_HH 0x02, 0x2B
124#define LAN8830_WOL_CTRL_STAT 0x02, 0x2C
125#define LAN8830_WOL_CUSTOM_PKT_RECEIVE_STAT 0x02, 0x2D
126#define LAN8830_WOL_MAGIC_PKT_RECEIVE_STAT 0x02, 0x2E
127#define LAN8830_WOL_DATA_MODULE_STAT 0x02, 0x2F
128#define LAN8830_CUSTOM_PKT0_RCVD_CRC_L 0x02, 0x30
129#define LAN8830_CUSTOM_PKT0_RCVD_CRC_H 0x02, 0x31
130#define LAN8830_CUSTOM_PKT1_RCVD_CRC_L 0x02, 0x32
131#define LAN8830_CUSTOM_PKT1_RCVD_CRC_H 0x02, 0x33
132#define LAN8830_CUSTOM_PKT2_RCVD_CRC_L 0x02, 0x34
133#define LAN8830_CUSTOM_PKT2_RCVD_CRC_H 0x02, 0x35
134#define LAN8830_CUSTOM_PKT3_RCVD_CRC_L 0x02, 0x36
135#define LAN8830_CUSTOM_PKT3_RCVD_CRC_H 0x02, 0x37
136#define LAN8830_SELF_TEST_CORRECT_COUNT_LO 0x02, 0x3C
137#define LAN8830_SELF_TEST_CORRECT_COUNT_HI 0x02, 0x3D
138#define LAN8830_SELF_TEST_ERROR_COUNT_LO 0x02, 0x3E
139#define LAN8830_SELF_TEST_ERROR_COUNT_HI 0x02, 0x3F
140#define LAN8830_RX_DLL_CTRL 0x02, 0x4C
141#define LAN8830_TX_DLL_CTRL 0x02, 0x4D
142#define LAN8830_DRIVING_STRENGTH 0x02, 0x6F
143#define LAN8830_GPIO_EN 0x02, 0x80
144#define LAN8830_GPIO_DIR 0x02, 0x81
145#define LAN8830_GPIO_BUF 0x02, 0x82
146#define LAN8830_GPIO_DATA_SEL1 0x02, 0x83
147#define LAN8830_GPIO_DATA_SEL2 0x02, 0x84
148#define LAN8830_GPIO_DATA 0x02, 0x85
149#define LAN8830_GPIO_INT_STS 0x02, 0x86
150#define LAN8830_GPIO_INT_EN 0x02, 0x87
151#define LAN8830_GPIO_INT_POL 0x02, 0x88
152#define LAN8830_PCS_CTRL1 0x03, 0x00
153#define LAN8830_PCS_STAT1 0x03, 0x01
154#define LAN8830_EEE_QUIET_TIMER 0x03, 0x08
155#define LAN8830_EEE_UPDATE_TIMER 0x03, 0x09
156#define LAN8830_EEE_LINK_FAIL_TIMER 0x03, 0x0A
157#define LAN8830_EEE_POST_UPDATE_TIMER 0x03, 0x0B
158#define LAN8830_EEE_WAIT_WQ_TIMER 0x03, 0x0C
159#define LAN8830_EEE_WAKE_TIMER 0x03, 0x0D
160#define LAN8830_EEE_WAKE_TX_TIMER 0x03, 0x0E
161#define LAN8830_EEE_WAKE_MZ_TIMER 0x03, 0x0F
162#define LAN8830_EEE_CTRL_CAPABILITY 0x03, 0x14
163#define LAN8830_EEE_WAKE_ERROR_COUNTER 0x03, 0x16
164#define LAN8830_EEE_100_TIMER0 0x03, 0x18
165#define LAN8830_EEE_100_TIMER1 0x03, 0x19
166#define LAN8830_EEE_100_TIMER2 0x03, 0x1A
167#define LAN8830_EEE_100_TIMER3 0x03, 0x1B
168#define LAN8830_EEE_ADV 0x07, 0x3C
169#define LAN8830_EEE_LP_ABILITY 0x07, 0x3D
170#define LAN8830_EEE_LP_ABILITY_OVERRIDE 0x07, 0x3E
171#define LAN8830_EEE_MSG_CODE 0x07, 0x3F
172#define LAN8830_XTAL_CTRL 0x1C, 0x01
173#define LAN8830_AFED_CTRL 0x1C, 0x09
174#define LAN8830_LDO_CTRL 0x1C, 0x0E
175#define LAN8830_EDPD_CTRL 0x1C, 0x24
176#define LAN8830_EMITX_CTRL 0x1C, 0x25
177#define LAN8830_EMITX_COEFF 0x1C, 0x26
180#define LAN8830_BMCR_RESET 0x8000
181#define LAN8830_BMCR_LOOPBACK 0x4000
182#define LAN8830_BMCR_SPEED_SEL_LSB 0x2000
183#define LAN8830_BMCR_AN_EN 0x1000
184#define LAN8830_BMCR_POWER_DOWN 0x0800
185#define LAN8830_BMCR_ISOLATE 0x0400
186#define LAN8830_BMCR_RESTART_AN 0x0200
187#define LAN8830_BMCR_DUPLEX_MODE 0x0100
188#define LAN8830_BMCR_COL_TEST 0x0080
189#define LAN8830_BMCR_SPEED_SEL_MSB 0x0040
192#define LAN8830_BMSR_100BT4 0x8000
193#define LAN8830_BMSR_100BTX_FD 0x4000
194#define LAN8830_BMSR_100BTX_HD 0x2000
195#define LAN8830_BMSR_10BT_FD 0x1000
196#define LAN8830_BMSR_10BT_HD 0x0800
197#define LAN8830_BMSR_100BT2_FD 0x0400
198#define LAN8830_BMSR_100BT2_HD 0x0200
199#define LAN8830_BMSR_EXTENDED_STATUS 0x0100
200#define LAN8830_BMSR_UNIDIRECTIONAL_ABLE 0x0080
201#define LAN8830_BMSR_MF_PREAMBLE_SUPPR 0x0040
202#define LAN8830_BMSR_AN_COMPLETE 0x0020
203#define LAN8830_BMSR_REMOTE_FAULT 0x0010
204#define LAN8830_BMSR_AN_CAPABLE 0x0008
205#define LAN8830_BMSR_LINK_STATUS 0x0004
206#define LAN8830_BMSR_JABBER_DETECT 0x0002
207#define LAN8830_BMSR_EXTENDED_CAPABLE 0x0001
210#define LAN8830_PHYID1_PHY_ID_MSB 0xFFFF
211#define LAN8830_PHYID1_PHY_ID_MSB_DEFAULT 0x0022
214#define LAN8830_PHYID2_PHY_ID_LSB 0xFC00
215#define LAN8830_PHYID2_PHY_ID_LSB_DEFAULT 0x1400
216#define LAN8830_PHYID2_MODEL_NUM 0x03F0
217#define LAN8830_PHYID2_MODEL_NUM_DEFAULT 0x0250
218#define LAN8830_PHYID2_REVISION_NUM 0x000F
221#define LAN8830_ANAR_NEXT_PAGE 0x8000
222#define LAN8830_ANAR_REMOTE_FAULT 0x2000
223#define LAN8830_ANAR_EXTENDED_NEXT_PAGE 0x1000
224#define LAN8830_ANAR_ASYM_PAUSE 0x0800
225#define LAN8830_ANAR_SYM_PAUSE 0x0400
226#define LAN8830_ANAR_100BT4 0x0200
227#define LAN8830_ANAR_100BTX_FD 0x0100
228#define LAN8830_ANAR_100BTX_HD 0x0080
229#define LAN8830_ANAR_10BT_FD 0x0040
230#define LAN8830_ANAR_10BT_HD 0x0020
231#define LAN8830_ANAR_SELECTOR 0x001F
232#define LAN8830_ANAR_SELECTOR_DEFAULT 0x0001
235#define LAN8830_ANLPAR_NEXT_PAGE 0x8000
236#define LAN8830_ANLPAR_ACK 0x4000
237#define LAN8830_ANLPAR_REMOTE_FAULT 0x2000
238#define LAN8830_ANLPAR_EXTENDED_NEXT_PAGE 0x1000
239#define LAN8830_ANLPAR_ASYM_PAUSE 0x0800
240#define LAN8830_ANLPAR_PAUSE 0x0400
241#define LAN8830_ANLPAR_100BT4 0x0200
242#define LAN8830_ANLPAR_100BTX_FD 0x0100
243#define LAN8830_ANLPAR_100BTX_HD 0x0080
244#define LAN8830_ANLPAR_10BT_FD 0x0040
245#define LAN8830_ANLPAR_10BT_HD 0x0020
246#define LAN8830_ANLPAR_SELECTOR 0x001F
247#define LAN8830_ANLPAR_SELECTOR_DEFAULT 0x0001
250#define LAN8830_ANER_RECEIVE_NP_LOC_ABLE 0x0040
251#define LAN8830_ANER_RECEIVE_NP_STOR_LOC 0x0020
252#define LAN8830_ANER_PAR_DETECT_FAULT 0x0010
253#define LAN8830_ANER_LP_NEXT_PAGE_ABLE 0x0008
254#define LAN8830_ANER_NEXT_PAGE_ABLE 0x0004
255#define LAN8830_ANER_PAGE_RECEIVED 0x0002
256#define LAN8830_ANER_LP_AN_ABLE 0x0001
259#define LAN8830_ANNPR_NEXT_PAGE 0x8000
260#define LAN8830_ANNPR_MSG_PAGE 0x2000
261#define LAN8830_ANNPR_ACK2 0x1000
262#define LAN8830_ANNPR_TOGGLE 0x0800
263#define LAN8830_ANNPR_MESSAGE 0x07FF
266#define LAN8830_ANLPNPR_NEXT_PAGE 0x8000
267#define LAN8830_ANLPNPR_ACK 0x4000
268#define LAN8830_ANLPNPR_MSG_PAGE 0x2000
269#define LAN8830_ANLPNPR_ACK2 0x1000
270#define LAN8830_ANLPNPR_TOGGLE 0x0800
271#define LAN8830_ANLPNPR_MESSAGE 0x07FF
274#define LAN8830_GBCR_TEST_MODE 0xE000
275#define LAN8830_GBCR_MS_MAN_CONF_EN 0x1000
276#define LAN8830_GBCR_MS_MAN_CONF_VAL 0x0800
277#define LAN8830_GBCR_PORT_TYPE 0x0400
278#define LAN8830_GBCR_1000BT_FD 0x0200
279#define LAN8830_GBCR_1000BT_HD 0x0100
282#define LAN8830_GBSR_MS_CONF_FAULT 0x8000
283#define LAN8830_GBSR_MS_CONF_RES 0x4000
284#define LAN8830_GBSR_LOCAL_RECEIVER_STATUS 0x2000
285#define LAN8830_GBSR_REMOTE_RECEIVER_STATUS 0x1000
286#define LAN8830_GBSR_LP_1000BT_FD 0x0800
287#define LAN8830_GBSR_LP_1000BT_HD 0x0400
288#define LAN8830_GBSR_IDLE_ERR_COUNT 0x00FF
291#define LAN8830_MMDACR_FUNC 0xC000
292#define LAN8830_MMDACR_FUNC_ADDR 0x0000
293#define LAN8830_MMDACR_FUNC_DATA_NO_POST_INC 0x4000
294#define LAN8830_MMDACR_FUNC_DATA_POST_INC_RW 0x8000
295#define LAN8830_MMDACR_FUNC_DATA_POST_INC_W 0xC000
296#define LAN8830_MMDACR_DEVAD 0x001F
299#define LAN8830_GBESR_1000BX_FD 0x8000
300#define LAN8830_GBESR_1000BX_HD 0x4000
301#define LAN8830_GBESR_1000BT_FD 0x2000
302#define LAN8830_GBESR_1000BT_HD 0x1000
305#define LAN8830_RLB_REMOTE_LOOPBACK 0x0100
308#define LAN8830_LINKMD_TEST_EN 0x8000
309#define LAN8830_LINKMD_TX_DIS 0x4000
310#define LAN8830_LINKMD_PAIR 0x3000
311#define LAN8830_LINKMD_PAIR_A 0x0000
312#define LAN8830_LINKMD_PAIR_B 0x1000
313#define LAN8830_LINKMD_PAIR_C 0x2000
314#define LAN8830_LINKMD_PAIR_D 0x3000
315#define LAN8830_LINKMD_SEL 0x0C00
316#define LAN8830_LINKMD_STATUS 0x0300
317#define LAN8830_LINKMD_STATUS_NORMAL 0x0000
318#define LAN8830_LINKMD_STATUS_OPEN 0x0100
319#define LAN8830_LINKMD_STATUS_SHORT 0x0200
320#define LAN8830_LINKMD_STATUS_TEST_FAILED 0x0300
321#define LAN8830_LINKMD_FAULT_DATA 0x00FF
324#define LAN8830_DPMAPCSS_1000BT_LINK_STATUS 0x0002
325#define LAN8830_DPMAPCSS_100BTX_LINK_STATUS 0x0001
328#define LAN8830_LED_MODE_SEL_LED4_CONFIG 0xF000
329#define LAN8830_LED_MODE_SEL_LED4_CONFIG_LINK_ACT 0x0000
330#define LAN8830_LED_MODE_SEL_LED4_CONFIG_LINK_1000_ACT 0x1000
331#define LAN8830_LED_MODE_SEL_LED4_CONFIG_LINK_100_ACT 0x2000
332#define LAN8830_LED_MODE_SEL_LED4_CONFIG_LINK_10_ACT 0x3000
333#define LAN8830_LED_MODE_SEL_LED4_CONFIG_LINK_100_1000_ACT 0x4000
334#define LAN8830_LED_MODE_SEL_LED4_CONFIG_LINK_10_1000_ACT 0x5000
335#define LAN8830_LED_MODE_SEL_LED4_CONFIG_LINK_10_100_ACT 0x6000
336#define LAN8830_LED_MODE_SEL_LED4_CONFIG_DUPLEX_COL 0x8000
337#define LAN8830_LED_MODE_SEL_LED4_CONFIG_COL 0x9000
338#define LAN8830_LED_MODE_SEL_LED4_CONFIG_ACT 0xA000
339#define LAN8830_LED_MODE_SEL_LED4_CONFIG_AN_FAULT 0xC000
340#define LAN8830_LED_MODE_SEL_LED4_CONFIG_OFF 0xE000
341#define LAN8830_LED_MODE_SEL_LED4_CONFIG_ON 0xF000
342#define LAN8830_LED_MODE_SEL_LED3_CONFIG 0x0F00
343#define LAN8830_LED_MODE_SEL_LED3_CONFIG_LINK_ACT 0x0000
344#define LAN8830_LED_MODE_SEL_LED3_CONFIG_LINK_1000_ACT 0x0100
345#define LAN8830_LED_MODE_SEL_LED3_CONFIG_LINK_100_ACT 0x0200
346#define LAN8830_LED_MODE_SEL_LED3_CONFIG_LINK_10_ACT 0x0300
347#define LAN8830_LED_MODE_SEL_LED3_CONFIG_LINK_100_1000_ACT 0x0400
348#define LAN8830_LED_MODE_SEL_LED3_CONFIG_LINK_10_1000_ACT 0x0500
349#define LAN8830_LED_MODE_SEL_LED3_CONFIG_LINK_10_100_ACT 0x0600
350#define LAN8830_LED_MODE_SEL_LED3_CONFIG_DUPLEX_COL 0x0800
351#define LAN8830_LED_MODE_SEL_LED3_CONFIG_COL 0x0900
352#define LAN8830_LED_MODE_SEL_LED3_CONFIG_ACT 0x0A00
353#define LAN8830_LED_MODE_SEL_LED3_CONFIG_AN_FAULT 0x0C00
354#define LAN8830_LED_MODE_SEL_LED3_CONFIG_OFF 0x0E00
355#define LAN8830_LED_MODE_SEL_LED3_CONFIG_ON 0x0F00
356#define LAN8830_LED_MODE_SEL_LED2_CONFIG 0x00F0
357#define LAN8830_LED_MODE_SEL_LED2_CONFIG_LINK_ACT 0x0000
358#define LAN8830_LED_MODE_SEL_LED2_CONFIG_LINK_1000_ACT 0x0010
359#define LAN8830_LED_MODE_SEL_LED2_CONFIG_LINK_100_ACT 0x0020
360#define LAN8830_LED_MODE_SEL_LED2_CONFIG_LINK_10_ACT 0x0030
361#define LAN8830_LED_MODE_SEL_LED2_CONFIG_LINK_100_1000_ACT 0x0040
362#define LAN8830_LED_MODE_SEL_LED2_CONFIG_LINK_10_1000_ACT 0x0050
363#define LAN8830_LED_MODE_SEL_LED2_CONFIG_LINK_10_100_ACT 0x0060
364#define LAN8830_LED_MODE_SEL_LED2_CONFIG_DUPLEX_COL 0x0080
365#define LAN8830_LED_MODE_SEL_LED2_CONFIG_COL 0x0090
366#define LAN8830_LED_MODE_SEL_LED2_CONFIG_ACT 0x00A0
367#define LAN8830_LED_MODE_SEL_LED2_CONFIG_AN_FAULT 0x00C0
368#define LAN8830_LED_MODE_SEL_LED2_CONFIG_OFF 0x00E0
369#define LAN8830_LED_MODE_SEL_LED2_CONFIG_ON 0x00F0
370#define LAN8830_LED_MODE_SEL_LED1_CONFIG 0x000F
371#define LAN8830_LED_MODE_SEL_LED1_CONFIG_LINK_ACT 0x0000
372#define LAN8830_LED_MODE_SEL_LED1_CONFIG_LINK_1000_ACT 0x0001
373#define LAN8830_LED_MODE_SEL_LED1_CONFIG_LINK_100_ACT 0x0002
374#define LAN8830_LED_MODE_SEL_LED1_CONFIG_LINK_10_ACT 0x0003
375#define LAN8830_LED_MODE_SEL_LED1_CONFIG_LINK_100_1000_ACT 0x0004
376#define LAN8830_LED_MODE_SEL_LED1_CONFIG_LINK_10_1000_ACT 0x0005
377#define LAN8830_LED_MODE_SEL_LED1_CONFIG_LINK_10_100_ACT 0x0006
378#define LAN8830_LED_MODE_SEL_LED1_CONFIG_DUPLEX_COL 0x0008
379#define LAN8830_LED_MODE_SEL_LED1_CONFIG_COL 0x0009
380#define LAN8830_LED_MODE_SEL_LED1_CONFIG_ACT 0x000A
381#define LAN8830_LED_MODE_SEL_LED1_CONFIG_AN_FAULT 0x000C
382#define LAN8830_LED_MODE_SEL_LED1_CONFIG_OFF 0x000E
383#define LAN8830_LED_MODE_SEL_LED1_CONFIG_ON 0x000F
386#define LAN8830_LED_BEHAVIOR_LED_ACT_OUT_SEL 0x4000
387#define LAN8830_LED_BEHAVIOR_LED_PULSING_EN 0x1000
388#define LAN8830_LED_BEHAVIOR_LED_BLINK_RATE 0x0C00
389#define LAN8830_LED_BEHAVIOR_LED_BLINK_RATE_2_5HZ 0x0000
390#define LAN8830_LED_BEHAVIOR_LED_BLINK_RATE_5HZ 0x0400
391#define LAN8830_LED_BEHAVIOR_LED_BLINK_RATE_10HZ 0x0800
392#define LAN8830_LED_BEHAVIOR_LED_BLINK_RATE_20HZ 0x0C00
393#define LAN8830_LED_BEHAVIOR_LED_PULSE_STRECH_EN 0x01E0
394#define LAN8830_LED_BEHAVIOR_LED_PULSE_STRECH_EN_LED4 0x0100
395#define LAN8830_LED_BEHAVIOR_LED_PULSE_STRECH_EN_LED3 0x0080
396#define LAN8830_LED_BEHAVIOR_LED_PULSE_STRECH_EN_LED2 0x0040
397#define LAN8830_LED_BEHAVIOR_LED_PULSE_STRECH_EN_LED1 0x0020
398#define LAN8830_LED_BEHAVIOR_LED_COMBINATION_DIS 0x000F
399#define LAN8830_LED_BEHAVIOR_LED_COMBINATION_DIS_LED4 0x0008
400#define LAN8830_LED_BEHAVIOR_LED_COMBINATION_DIS_LED3 0x0004
401#define LAN8830_LED_BEHAVIOR_LED_COMBINATION_DIS_LED2 0x0002
402#define LAN8830_LED_BEHAVIOR_LED_COMBINATION_DIS_LED1 0x0001
405#define LAN8830_OUT_CTRL_MDIO_BUFFER_TYPE 0x8000
406#define LAN8830_OUT_CTRL_INT_BUFFER_TYPE 0x4000
407#define LAN8830_OUT_CTRL_LED_BUFFER_TYPE 0x3F00
408#define LAN8830_OUT_CTRL_LED_BUFFER_TYPE_LED4 0x0800
409#define LAN8830_OUT_CTRL_LED_BUFFER_TYPE_LED3 0x0400
410#define LAN8830_OUT_CTRL_LED_BUFFER_TYPE_LED2 0x0200
411#define LAN8830_OUT_CTRL_LED_BUFFER_TYPE_LED1 0x0100
412#define LAN8830_OUT_CTRL_PME_POLARITY 0x0080
413#define LAN8830_OUT_CTRL_LED_POLARITY 0x003F
414#define LAN8830_OUT_CTRL_LED_POLARITY_LED4 0x0008
415#define LAN8830_OUT_CTRL_LED_POLARITY_LED3 0x0004
416#define LAN8830_OUT_CTRL_LED_POLARITY_LED2 0x0002
417#define LAN8830_OUT_CTRL_LED_POLARITY_LED1 0x0001
420#define LAN8830_LEGACY_LED_MODE_KSZ9031_LED_MODE 0x4000
423#define LAN8830_ISR_ENERGY_NOT_DETECT 0x0800
424#define LAN8830_ISR_ENERGY_DETECT 0x0400
425#define LAN8830_ISR_GPIO 0x0100
426#define LAN8830_ISR_JABBER 0x0080
427#define LAN8830_ISR_RECEIVE_ERROR 0x0040
428#define LAN8830_ISR_PAGE_RECEIVED 0x0020
429#define LAN8830_ISR_PAR_DETECT_FAULT 0x0010
430#define LAN8830_ISR_LP_ACK 0x0008
431#define LAN8830_ISR_LINK_DOWN 0x0004
432#define LAN8830_ISR_ADC_FIFO_ERROR 0x0002
433#define LAN8830_ISR_LINK_UP 0x0001
436#define LAN8830_AUTOMDI_MDI_SET 0x0080
437#define LAN8830_AUTOMDI_SWAP_OFF 0x0040
440#define LAN8830_SPDC_CLK_GATE_OVERRIDE 0x0800
441#define LAN8830_SPDC_PLL_DIS 0x0400
442#define LAN8830_SPDC_IO_DC_TEST_EN 0x0080
443#define LAN8830_SPDC_VOH 0x0040
446#define LAN8830_EXT_LOOPBACK_EXT_LPBK 0x0008
449#define LAN8830_PHYCON_INT_POL_INVERT 0x4000
450#define LAN8830_PHYCON_JABBER_EN 0x0200
451#define LAN8830_PHYCON_SQE_TEST_EN 0x0100
452#define LAN8830_PHYCON_SPEED_1000BT 0x0040
453#define LAN8830_PHYCON_SPEED_100BTX 0x0020
454#define LAN8830_PHYCON_SPEED_10BT 0x0010
455#define LAN8830_PHYCON_DUPLEX_STATUS 0x0008
456#define LAN8830_PHYCON_1000BT_MS_STATUS 0x0004
457#define LAN8830_PHYCON_SOFT_RESET 0x0002
458#define LAN8830_PHYCON_LINK_STATUS_CHECK_FAIL 0x0001
461#define LAN8830_RX_DLL_CTRL_RXDLL_TUNE_DIS 0x8000
462#define LAN8830_RX_DLL_CTRL_BYPASS_RXDLL 0x4000
463#define LAN8830_RX_DLL_CTRL_RXDLL_TAP_SEL 0x3F80
464#define LAN8830_RX_DLL_CTRL_RXDLL_TAP_SEL_DEFAULT 0x0D80
465#define LAN8830_RX_DLL_CTRL_RXDLL_TAP_ADJ 0x007F
466#define LAN8830_RX_DLL_CTRL_RXDLL_TAP_ADJ_DEFAULT 0x001B
469#define LAN8830_TX_DLL_CTRL_TXDLL_TUNE_DIS 0x8000
470#define LAN8830_TX_DLL_CTRL_BYPASS_TXDLL 0x4000
471#define LAN8830_TX_DLL_CTRL_TXDLL_TAP_SEL 0x3F80
472#define LAN8830_TX_DLL_CTRL_TXDLL_TAP_SEL_DEFAULT 0x0D80
473#define LAN8830_TX_DLL_CTRL_TXDLL_TAP_ADJ 0x007F
474#define LAN8830_TX_DLL_CTRL_TXDLL_TAP_ADJ_DEFAULT 0x001B
485error_t lan8830Init(NetInterface *interface);
486void lan8830InitHook(NetInterface *interface);
488void lan8830Tick(NetInterface *interface);
490void lan8830EnableIrq(NetInterface *interface);
491void lan8830DisableIrq(NetInterface *interface);
493void lan8830EventHandler(NetInterface *interface);
495void lan8830WritePhyReg(NetInterface *interface, uint8_t address,
498uint16_t lan8830ReadPhyReg(NetInterface *interface, uint8_t address);
500void lan8830DumpPhyReg(NetInterface *interface);
502void lan8830WriteMmdReg(NetInterface *interface, uint8_t devAddr,
503 uint16_t regAddr, uint16_t data);
505uint16_t lan8830ReadMmdReg(NetInterface *interface, uint8_t devAddr,
error_t
Error codes.
Definition error.h:43
Network interface controller abstraction layer.
Ethernet PHY driver.
Definition nic.h:308