dp83tc811_driver.h
Go to the documentation of this file.
1 /**
2  * @file dp83tc811_driver.h
3  * @brief DP83TC811 Ethernet PHY transceiver
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2019 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneTCP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 1.9.6
29  **/
30 
31 #ifndef _DP83TC811_DRIVER_H
32 #define _DP83TC811_DRIVER_H
33 
34 //Dependencies
35 #include "core/nic.h"
36 
37 //PHY address
38 #ifndef DP83TC811_PHY_ADDR
39  #define DP83TC811_PHY_ADDR 0
40 #elif (DP83TC811_PHY_ADDR < 0 || DP83TC811_PHY_ADDR > 31)
41  #error DP83TC811_PHY_ADDR parameter is not valid
42 #endif
43 
44 //DP83TC811 PHY registers
45 #define DP83TC811_BMCR 0x00
46 #define DP83TC811_BMSR 0x01
47 #define DP83TC811_PHYID1 0x02
48 #define DP83TC811_PHYID2 0x03
49 #define DP83TC811_TDR_AUTO 0x09
50 #define DP83TC811_REGCR 0x0D
51 #define DP83TC811_ADDAR 0x0E
52 #define DP83TC811_INT_TEST 0x11
53 #define DP83TC811_INT_STAT1 0x12
54 #define DP83TC811_INT_STAT2 0x13
55 #define DP83TC811_FCSCR 0x14
56 #define DP83TC811_RECR 0x15
57 #define DP83TC811_BISTCR 0x16
58 #define DP83TC811_XMII_CTRL 0x17
59 #define DP83TC811_INT_STAT3 0x18
60 #define DP83TC811_BICTSR1 0x1B
61 #define DP83TC811_BICTSR2 0x1C
62 #define DP83TC811_TDR 0x1E
63 #define DP83TC811_PHYRCR 0x1F
64 
65 //DP83TC811 MMD registers
66 #define DP83TC811_LSR 0x0133
67 #define DP83TC811_TDRR 0x016B
68 #define DP83TC811_TDRLR1 0x0180
69 #define DP83TC811_TDRLR2 0x0181
70 #define DP83TC811_TDRPT 0x018A
71 #define DP83TC811_AUTO_PHY 0x018B
72 #define DP83TC811_PWRM 0x018C
73 #define DP83TC811_SNR 0x0197
74 #define DP83TC811_SQI 0x0198
75 #define DP83TC811_LD_CTRL 0x0400
76 #define DP83TC811_LDG_CTRL1 0x0401
77 #define DP83TC811_DLL_CTRL 0x0446
78 #define DP83TC811_ESDS 0x0448
79 #define DP83TC811_LED_CFG1 0x0460
80 #define DP83TC811_XMII_IMP_CTRL 0x0461
81 #define DP83TC811_IO_CTRL1 0x0462
82 #define DP83TC811_IO_CTRL2 0x0463
83 #define DP83TC811_STRAP 0x0467
84 #define DP83TC811_LED_CFG2 0x0469
85 #define DP83TC811_PLR_CFG 0x0475
86 #define DP83TC811_MON_CFG1 0x0480
87 #define DP83TC811_MON_CFG2 0x0481
88 #define DP83TC811_MON_CFG3 0x0482
89 #define DP83TC811_MON_STAT1 0x0483
90 #define DP83TC811_MON_STAT2 0x0484
91 #define DP83TC811_PCS_CTRL1 0x0485
92 #define DP83TC811_PCS_CTRL2 0x0486
93 #define DP83TC811_LPS_CTRL2 0x0487
94 #define DP83TC811_INTER_CFG 0x0489
95 #define DP83TC811_LPS_CTRL3 0x0493
96 #define DP83TC811_LPS_CTRL3 0x0493
97 #define DP83TC811_JAB_CFG 0x0496
98 #define DP83TC811_TEST_MODE_CTRL 0x0497
99 #define DP83TC811_WOL_CFG 0x04A0
100 #define DP83TC811_WOL_STAT 0x04A1
101 #define DP83TC811_WOL_DA1 0x04A2
102 #define DP83TC811_WOL_DA2 0x04A3
103 #define DP83TC811_WOL_DA3 0x04A4
104 #define DP83TC811_RXSOP1 0x04A5
105 #define DP83TC811_RXSOP2 0x04A6
106 #define DP83TC811_RXSOP3 0x04A7
107 #define DP83TC811_RXPAT1 0x04A8
108 #define DP83TC811_RXPAT2 0x04A9
109 #define DP83TC811_RXPAT3 0x04AA
110 #define DP83TC811_RXPAT4 0x04AB
111 #define DP83TC811_RXPAT5 0x04AC
112 #define DP83TC811_RXPAT6 0x04AD
113 #define DP83TC811_RXPAT7 0x04AE
114 #define DP83TC811_RXPAT8 0x04AF
115 #define DP83TC811_RXPAT9 0x04B0
116 #define DP83TC811_RXPAT10 0x04B1
117 #define DP83TC811_RXPAT11 0x04B2
118 #define DP83TC811_RXPAT12 0x04B3
119 #define DP83TC811_RXPAT13 0x04B4
120 #define DP83TC811_RXPAT14 0x04B5
121 #define DP83TC811_RXPAT15 0x04B6
122 #define DP83TC811_RXPAT16 0x04B7
123 #define DP83TC811_RXPAT17 0x04B8
124 #define DP83TC811_RXPAT18 0x04B9
125 #define DP83TC811_RXPAT19 0x04BA
126 #define DP83TC811_RXPAT20 0x04BB
127 #define DP83TC811_RXPAT21 0x04BC
128 #define DP83TC811_RXPAT22 0x04BD
129 #define DP83TC811_RXPAT23 0x04BE
130 #define DP83TC811_RXPAT24 0x04BF
131 #define DP83TC811_RXPAT25 0x04C0
132 #define DP83TC811_RXPAT26 0x04C1
133 #define DP83TC811_RXPAT27 0x04C2
134 #define DP83TC811_RXPAT28 0x04C3
135 #define DP83TC811_RXPAT29 0x04C4
136 #define DP83TC811_RXPAT30 0x04C5
137 #define DP83TC811_RXPAT31 0x04C6
138 #define DP83TC811_RXPAT32 0x04C7
139 #define DP83TC811_RXPBM1 0x04C8
140 #define DP83TC811_RXPBM2 0x04C9
141 #define DP83TC811_RXPBM3 0x04CA
142 #define DP83TC811_RXPBM4 0x04CB
143 #define DP83TC811_RXPATC 0x04CC
144 #define DP83TC811_RXD3CLK 0x04E0
145 #define DP83TC811_LPS_CFG 0x04E5
146 
147 //DP83TC811 MMD1 registers
148 #define DP83TC811_PMA_CTRL1 0x0007
149 #define DP83TC811_PMA_EXT1 0x000B
150 #define DP83TC811_PMA_EXT2 0x0012
151 #define DP83TC811_PMA_CTRL2 0x0834
152 #define DP83TC811_TEST_CTRL 0x0836
153 
154 //Basic Mode Control register
155 #define DP83TC811_BMCR_RESET 0x8000
156 #define DP83TC811_BMCR_LOOPBACK 0x4000
157 #define DP83TC811_BMCR_SPEED_SEL 0x2000
158 #define DP83TC811_BMCR_AN_EN 0x1000
159 #define DP83TC811_BMCR_POWER_DOWN 0x0800
160 #define DP83TC811_BMCR_ISOLATE 0x0400
161 
162 //Basic Mode Status register
163 #define DP83TC811_BMSR_100BT4 0x8000
164 #define DP83TC811_BMSR_100BTX_FD 0x4000
165 #define DP83TC811_BMSR_100BTX_HD 0x2000
166 #define DP83TC811_BMSR_10BT_FD 0x1000
167 #define DP83TC811_BMSR_10BT_HD 0x0800
168 #define DP83TC811_BMSR_SMI_PREAMBLE_SUPPR 0x0040
169 #define DP83TC811_BMSR_AN_COMPLETE 0x0020
170 #define DP83TC811_BMSR_REMOTE_FAULT 0x0010
171 #define DP83TC811_BMSR_AN_CAPABLE 0x0008
172 #define DP83TC811_BMSR_LINK_STATUS 0x0004
173 #define DP83TC811_BMSR_JABBER_DETECT 0x0002
174 #define DP83TC811_BMSR_EXTENDED_CAPABLE 0x0001
175 
176 //PHY Identifier 1 register
177 #define DP83TC811_PHYID1_OUI_MSB 0xFFFF
178 #define DP83TC811_PHYID1_OUI_MSB_DEFAULT 0x2000
179 
180 //PHY Identifier 2 register
181 #define DP83TC811_PHYID2_OUI_LSB 0xFC00
182 #define DP83TC811_PHYID2_OUI_LSB_DEFAULT 0xA000
183 #define DP83TC811_PHYID2_MODEL_NUM 0x03F0
184 #define DP83TC811_PHYID2_MODEL_NUM_DEFAULT 0x0250
185 #define DP83TC811_PHYID2_REVISION_NUM 0x000F
186 
187 //TDR Auto-Run register
188 #define DP83TC811_TDR_AUTO_TDR_AUTO_RUN 0x0100
189 
190 //Register Control register
191 #define DP83TC811_REGCR_COMMAND 0xC000
192 #define DP83TC811_REGCR_COMMAND_ADDR 0x0000
193 #define DP83TC811_REGCR_COMMAND_DATA_NO_POST_INC 0x4000
194 #define DP83TC811_REGCR_COMMAND_DATA_POST_INC_RW 0x8000
195 #define DP83TC811_REGCR_COMMAND_DATA_POST_INC_W 0xC000
196 #define DP83TC811_REGCR_DEVAD 0x001F
197 #define DP83TC811_REGCR_DEVAD_1 0x0001
198 #define DP83TC811_REGCR_DEVAD_31 0x001F
199 
200 //Interrupt Test register
201 #define DP83TC811_INT_TEST_INTERRUPT_POLARITY 0x0008
202 #define DP83TC811_INT_TEST_TEST_INTERRUPT 0x0004
203 
204 //Interrupt Status 1 register
205 #define DP83TC811_INT_STAT1_LINK_QUALITY_IF 0x8000
206 #define DP83TC811_INT_STAT1_ENERGY_DETECT_IF 0x4000
207 #define DP83TC811_INT_STAT1_LINK_STATUS_CHANGED_IF 0x2000
208 #define DP83TC811_INT_STAT1_WOL_IF 0x1000
209 #define DP83TC811_INT_STAT1_ESD_EVENT_IF 0x0800
210 #define DP83TC811_INT_STAT1_MS_TRAINING_COMPLETE_IF 0x0400
211 #define DP83TC811_INT_STAT1_FALSE_CARRIER_CNT_HF_IF 0x0200
212 #define DP83TC811_INT_STAT1_RECEIVE_ERROR_CNT_HF_IF 0x0100
213 #define DP83TC811_INT_STAT1_LINK_QUALITY_IE 0x0080
214 #define DP83TC811_INT_STAT1_ENERGY_DETECT_IE 0x0040
215 #define DP83TC811_INT_STAT1_LINK_STATUS_CHANGED_IE 0x0020
216 #define DP83TC811_INT_STAT1_WOL_IE 0x0010
217 #define DP83TC811_INT_STAT1_ESD_EVENT_IE 0x0008
218 #define DP83TC811_INT_STAT1_MS_TRAINING_COMPLETE_IE 0x0004
219 #define DP83TC811_INT_STAT1_FALSE_CARRIER_CNT_HF_IE 0x0002
220 #define DP83TC811_INT_STAT1_RECEIVE_ERROR_CNT_HF_IE 0x0001
221 
222 //Interrupt Status 2 register
223 #define DP83TC811_INT_STAT2_UNDERVOLTAGE_IF 0x8000
224 #define DP83TC811_INT_STAT2_OVERVOLTAGE_IF 0x4000
225 #define DP83TC811_INT_STAT2_OVERTEMPERATURE_IF 0x0800
226 #define DP83TC811_INT_STAT2_SLEEP_MODE_IF 0x0400
227 #define DP83TC811_INT_STAT2_POLARITY_CHANGE_IF 0x0200
228 #define DP83TC811_INT_STAT2_JABBER_DETECT_IF 0x0100
229 #define DP83TC811_INT_STAT2_UNDERVOLTAGE_IE 0x0080
230 #define DP83TC811_INT_STAT2_OVERVOLTAGE_IE 0x0040
231 #define DP83TC811_INT_STAT2_OVERTEMPERATURE_IE 0x0008
232 #define DP83TC811_INT_STAT2_SLEEP_MODE_IE 0x0004
233 #define DP83TC811_INT_STAT2_POLARITY_CHANGE_IE 0x0002
234 #define DP83TC811_INT_STAT2_JABBER_DETECT_IE 0x0001
235 
236 //False Carrier Sense Counter register
237 #define DP83TC811_FCSCR_FALSE_CARRIER_EVENT_CNT 0x00FF
238 
239 //BIST Control register
240 #define DP83TC811_BISTCR_BIST_ERROR_COUNTER_MODE 0x4000
241 #define DP83TC811_BISTCR_PRBS_PACKET_TYPE 0x2000
242 #define DP83TC811_BISTCR_PACKET_GENERATION_EN 0x1000
243 #define DP83TC811_BISTCR_PRBS_CHECKER_LOCK_SYNC 0x0800
244 #define DP83TC811_BISTCR_PRBS_CHECKER_SYNC_LOSS 0x0400
245 #define DP83TC811_BISTCR_PACKET_GENERATOR_STATUS 0x0200
246 #define DP83TC811_BISTCR_LOOPBACK_SELECT 0x007C
247 
248 //xMII Control register
249 #define DP83TC811_XMII_CTRL_RGMII_RX_CLOCK_DELAY 0x1000
250 #define DP83TC811_XMII_CTRL_RGMII_TX_CLOCK_DELAY 0x0800
251 #define DP83TC811_XMII_CTRL_RGMII_MODE 0x0200
252 #define DP83TC811_XMII_CTRL_CLOCK_SELECT 0x0080
253 #define DP83TC811_XMII_CTRL_RMII_MODE 0x0020
254 #define DP83TC811_XMII_CTRL_RMII_REV_SELECT 0x0010
255 #define DP83TC811_XMII_CTRL_RMII_OVERFLOW_STATUS 0x0008
256 #define DP83TC811_XMII_CTRL_RMII_UNDERFLOW_STATUS 0x0004
257 #define DP83TC811_XMII_CTRL_RMII_RX_ELASTICITY_BUFFER_SIZE 0x0002
258 
259 //Interrupt Status 3 register
260 #define DP83TC811_INT_STAT3_POR_DONE_IF 0x1000
261 #define DP83TC811_INT_STAT3_NO_FRAME_DETECTED_IF 0x0800
262 #define DP83TC811_INT_STAT3_LPS_IF 0x0100
263 #define DP83TC811_INT_STAT3_POR_DONE_IE 0x0010
264 #define DP83TC811_INT_STAT3_NO_FRAME_DETECTED_IE 0x0008
265 #define DP83TC811_INT_STAT3_LPS_IE 0x0001
266 
267 //BIST Control and Status 1 register
268 #define DP83TC811_BICTSR1_BIST_ERROR_CNT 0xFF00
269 #define DP83TC811_BICTSR1_BIST_IPG_LENGTH 0x00FF
270 
271 //BIST Control and Status 2 register
272 #define DP83TC811_BICTSR2_BIST_PACKET_LENGTH 0x07FF
273 
274 //Time Domain Reflectometry register
275 #define DP83TC811_TDR_START 0x8000
276 #define DP83TC811_TDR_STATUS 0x0002
277 #define DP83TC811_TDR_TEST_FAIL 0x0001
278 
279 //PHY Reset Control register
280 #define DP83TC811_PHYRCR_HARDWARE_RESET 0x8000
281 #define DP83TC811_PHYRCR_SOFTWARE_RESET 0x4000
282 #define DP83TC811_PHYRCR_STANDBY_MODE 0x0080
283 
284 //Link Status Results register
285 #define DP83TC811_LSR_LINK_STATUS 0x1000
286 #define DP83TC811_LSR_SCRAMBLER_LOCK 0x0004
287 #define DP83TC811_LSR_LOCAL_RECEIVER_STATUS 0x0002
288 #define DP83TC811_LSR_REMOTE_RECEIVER_STATUS 0x0001
289 
290 //TDR Results register
291 #define DP83TC811_TDRR_FAULT_STATUS 0x0200
292 #define DP83TC811_TDRR_FAULT_TYPE 0x0100
293 #define DP83TC811_TDRR_FAULT_LOCATION 0x00FF
294 
295 //TDR Location Result 1 register
296 #define DP83TC811_TDRLR1_LOCATION_2 0xFF00
297 #define DP83TC811_TDRLR1_LOCATION_1 0x00FF
298 
299 //TDR Location Result 2 register
300 #define DP83TC811_TDRLR2_LOCATION_4 0xFF00
301 #define DP83TC811_TDRLR2_LOCATION_3 0x00FF
302 
303 //TDR Peak Type register
304 #define DP83TC811_TDRPT_PEAK_4_TYPE 0x4000
305 #define DP83TC811_TDRPT_PEAK_3_TYPE 0x2000
306 #define DP83TC811_TDRPT_PEAK_2_TYPE 0x1000
307 #define DP83TC811_TDRPT_PEAK_1_TYPE 0x0800
308 
309 //Autonomous PHY Control register
310 #define DP83TC811_AUTO_PHY_AUTONOMOUS_COMMAND 0x0040
311 #define DP83TC811_AUTO_PHY_SLEEP_EN 0x0002
312 #define DP83TC811_AUTO_PHY_LPS_TRANSMISSION_EN 0x0001
313 
314 //Power Mode Register register
315 #define DP83TC811_PWRM_SLEEP_REQUEST_COMMAND 0x0002
316 #define DP83TC811_PWRM_NORMAL_COMMAND 0x0001
317 
318 //Signal-to-Noise Ratio Result register
319 #define DP83TC811_SNR_SNR 0x01FF
320 
321 //Signal Quality Indication register
322 #define DP83TC811_SQI_SQS 0x0300
323 #define DP83TC811_SQI_SQI 0x00FF
324 
325 //Line Driver Control register
326 #define DP83TC811_LD_CTRL_LINE_DRIVER_SERIES_TERM 0x1F00
327 
328 //Line Driver Gain Control 1 register
329 #define DP83TC811_LDG_CTRL1_FINE_GAIN_CONTROL_MDI 0x000F
330 
331 //RGMII DLL Control register
332 #define DP83TC811_DLL_CTRL_DLL_TX_DELAY_CONTROL 0x00F0
333 #define DP83TC811_DLL_CTRL_DLL_RX_DELAY_CONTROL 0x000F
334 
335 //Electrostatic Discharge Status register
336 #define DP83TC811_ESDS_XMII_ESD_EVENT_CNT 0x3F00
337 #define DP83TC811_ESDS_MDI_ESD_EVENT_CNT 0x003F
338 
339 //LED Configuration 1 register
340 #define DP83TC811_LED_CFG1_LED_BLINK_RATE_CTRL 0x3000
341 #define DP83TC811_LED_CFG1_LED_BLINK_RATE_CTRL_20HZ 0x0000
342 #define DP83TC811_LED_CFG1_LED_BLINK_RATE_CTRL_10HZ 0x1000
343 #define DP83TC811_LED_CFG1_LED_BLINK_RATE_CTRL_5HZ 0x2000
344 #define DP83TC811_LED_CFG1_LED_BLINK_RATE_CTRL_2HZ 0x3000
345 #define DP83TC811_LED_CFG1_LED_2_CTRL 0x0F00
346 #define DP83TC811_LED_CFG1_LED_2_CTRL_LINK_OK 0x0000
347 #define DP83TC811_LED_CFG1_LED_2_CTRL_LINK_OK_TX_RX_ACT 0x0100
348 #define DP83TC811_LED_CFG1_LED_2_CTRL_LINK_OK_TX_ACT 0x0200
349 #define DP83TC811_LED_CFG1_LED_2_CTRL_LINK_OK_RX_ACT 0x0300
350 #define DP83TC811_LED_CFG1_LED_2_CTRL_LINK_OK_MASTER 0x0400
351 #define DP83TC811_LED_CFG1_LED_2_CTRL_LINK_OK_SLAVE 0x0500
352 #define DP83TC811_LED_CFG1_LED_2_CTRL_TX_RX_ACT 0x0600
353 #define DP83TC811_LED_CFG1_LED_2_CTRL_LINK_LOST 0x0900
354 #define DP83TC811_LED_CFG1_LED_2_CTRL_PRBS_ERR 0x0A00
355 #define DP83TC811_LED_CFG1_LED_1_CTRL 0x00F0
356 #define DP83TC811_LED_CFG1_LED_1_CTRL_LINK_OK 0x0000
357 #define DP83TC811_LED_CFG1_LED_1_CTRL_LINK_OK_TX_RX_ACT 0x0010
358 #define DP83TC811_LED_CFG1_LED_1_CTRL_LINK_OK_TX_ACT 0x0020
359 #define DP83TC811_LED_CFG1_LED_1_CTRL_LINK_OK_RX_ACT 0x0030
360 #define DP83TC811_LED_CFG1_LED_1_CTRL_LINK_OK_MASTER 0x0040
361 #define DP83TC811_LED_CFG1_LED_1_CTRL_LINK_OK_SLAVE 0x0050
362 #define DP83TC811_LED_CFG1_LED_1_CTRL_TX_RX_ACT 0x0060
363 #define DP83TC811_LED_CFG1_LED_1_CTRL_LINK_LOST 0x0090
364 #define DP83TC811_LED_CFG1_LED_1_CTRL_PRBS_ERR 0x00A0
365 #define DP83TC811_LED_CFG1_LED_0_CTRL 0x000F
366 #define DP83TC811_LED_CFG1_LED_0_CTRL_LINK_OK 0x0000
367 #define DP83TC811_LED_CFG1_LED_0_CTRL_LINK_OK_TX_RX_ACT 0x0001
368 #define DP83TC811_LED_CFG1_LED_0_CTRL_LINK_OK_TX_ACT 0x0002
369 #define DP83TC811_LED_CFG1_LED_0_CTRL_LINK_OK_RX_ACT 0x0003
370 #define DP83TC811_LED_CFG1_LED_0_CTRL_LINK_OK_MASTER 0x0004
371 #define DP83TC811_LED_CFG1_LED_0_CTRL_LINK_OK_SLAVE 0x0005
372 #define DP83TC811_LED_CFG1_LED_0_CTRL_TX_RX_ACT 0x0006
373 #define DP83TC811_LED_CFG1_LED_0_CTRL_LINK_LOST 0x0009
374 #define DP83TC811_LED_CFG1_LED_0_CTRL_PRBS_ERR 0x000A
375 
376 //xMII Impedance Control register
377 #define DP83TC811_XMII_IMP_CTRL_IMP_CTRL 0x001E
378 #define DP83TC811_XMII_IMP_CTRL_IMP_CTRL_99R 0x0000
379 #define DP83TC811_XMII_IMP_CTRL_IMP_CTRL_91R 0x0002
380 #define DP83TC811_XMII_IMP_CTRL_IMP_CTRL_84R 0x0004
381 #define DP83TC811_XMII_IMP_CTRL_IMP_CTRL_78R 0x0006
382 #define DP83TC811_XMII_IMP_CTRL_IMP_CTRL_73R 0x0008
383 #define DP83TC811_XMII_IMP_CTRL_IMP_CTRL_69R 0x000A
384 #define DP83TC811_XMII_IMP_CTRL_IMP_CTRL_65R 0x000C
385 #define DP83TC811_XMII_IMP_CTRL_IMP_CTRL_61R 0x000E
386 #define DP83TC811_XMII_IMP_CTRL_IMP_CTRL_58R 0x0010
387 #define DP83TC811_XMII_IMP_CTRL_IMP_CTRL_55R 0x0012
388 #define DP83TC811_XMII_IMP_CTRL_IMP_CTRL_53R 0x0014
389 #define DP83TC811_XMII_IMP_CTRL_IMP_CTRL_50R 0x0016
390 #define DP83TC811_XMII_IMP_CTRL_IMP_CTRL_48R 0x0018
391 #define DP83TC811_XMII_IMP_CTRL_IMP_CTRL_46R 0x001A
392 #define DP83TC811_XMII_IMP_CTRL_IMP_CTRL_44R 0x001C
393 #define DP83TC811_XMII_IMP_CTRL_IMP_CTRL_42R 0x001E
394 
395 //GPIO Control 1 register
396 #define DP83TC811_IO_CTRL1_LED_1_CLOCK_SEL 0x7000
397 #define DP83TC811_IO_CTRL1_LED_1_CLOCK_SEL_XI 0x0000
398 #define DP83TC811_IO_CTRL1_LED_1_CLOCK_SEL_TX_TCLK 0x1000
399 #define DP83TC811_IO_CTRL1_LED_1_GPIO_SEL 0x0700
400 #define DP83TC811_IO_CTRL1_LED_1_GPIO_SEL_LED_1 0x0000
401 #define DP83TC811_IO_CTRL1_LED_1_GPIO_SEL_CLOCK 0x0100
402 #define DP83TC811_IO_CTRL1_LED_1_GPIO_SEL_WOL 0x0200
403 #define DP83TC811_IO_CTRL1_LED_1_GPIO_SEL_UNDERVOLTAGE 0x0300
404 #define DP83TC811_IO_CTRL1_LED_1_GPIO_SEL_TRANSMIT 0x0400
405 #define DP83TC811_IO_CTRL1_LED_1_GPIO_SEL_RECEIVE 0x0500
406 #define DP83TC811_IO_CTRL1_LED_1_GPIO_SEL_CONST_LOW 0x0600
407 #define DP83TC811_IO_CTRL1_LED_1_GPIO_SEL_CONST_HIGH 0x0700
408 #define DP83TC811_IO_CTRL1_LED_0_CLOCK_SEL 0x0070
409 #define DP83TC811_IO_CTRL1_LED_0_CLOCK_SEL_XI 0x0000
410 #define DP83TC811_IO_CTRL1_LED_0_CLOCK_SEL_TX_TCLK 0x0010
411 #define DP83TC811_IO_CTRL1_LED_0_GPIO_SEL 0x0007
412 #define DP83TC811_IO_CTRL1_LED_0_GPIO_SEL_LED_0 0x0000
413 #define DP83TC811_IO_CTRL1_LED_0_GPIO_SEL_CLOCK 0x0001
414 #define DP83TC811_IO_CTRL1_LED_0_GPIO_SEL_WOL 0x0002
415 #define DP83TC811_IO_CTRL1_LED_0_GPIO_SEL_UNDERVOLTAGE 0x0003
416 #define DP83TC811_IO_CTRL1_LED_0_GPIO_SEL_TRANSMIT 0x0004
417 #define DP83TC811_IO_CTRL1_LED_0_GPIO_SEL_RECEIVE 0x0005
418 #define DP83TC811_IO_CTRL1_LED_0_GPIO_SEL_CONST_LOW 0x0006
419 #define DP83TC811_IO_CTRL1_LED_0_GPIO_SEL_CONST_HIGH 0x0007
420 
421 //GPIO Control 2 register
422 #define DP83TC811_IO_CTRL2_CLKOUT_CLOCK_SEL 0x00F0
423 #define DP83TC811_IO_CTRL2_CLKOUT_CLOCK_SEL_XI 0x0000
424 #define DP83TC811_IO_CTRL2_CLKOUT_CLOCK_SEL_TX_TCLK 0x0010
425 #define DP83TC811_IO_CTRL2_CLKOUT_GPIO_SEL 0x0007
426 #define DP83TC811_IO_CTRL2_CLKOUT_GPIO_SEL_LED_2 0x0000
427 #define DP83TC811_IO_CTRL2_CLKOUT_GPIO_SEL_CLOCK 0x0001
428 #define DP83TC811_IO_CTRL2_CLKOUT_GPIO_SEL_WOL 0x0002
429 #define DP83TC811_IO_CTRL2_CLKOUT_GPIO_SEL_UNDERVOLTAGE 0x0003
430 #define DP83TC811_IO_CTRL2_CLKOUT_GPIO_SEL_TRANSMIT 0x0004
431 #define DP83TC811_IO_CTRL2_CLKOUT_GPIO_SEL_RECEIVE 0x0005
432 #define DP83TC811_IO_CTRL2_CLKOUT_GPIO_SEL_CONST_LOW 0x0006
433 #define DP83TC811_IO_CTRL2_CLKOUT_GPIO_SEL_CONST_HIGH 0x0007
434 
435 //Strap Configuration register
436 #define DP83TC811_STRAP_LED_1 0xC000
437 #define DP83TC811_STRAP_LED_1_MODE1 0x0000
438 #define DP83TC811_STRAP_LED_1_MODE2 0x4000
439 #define DP83TC811_STRAP_LED_1_MODE3 0x8000
440 #define DP83TC811_STRAP_LED_1_MODE4 0xC000
441 #define DP83TC811_STRAP_RX_DV 0x3000
442 #define DP83TC811_STRAP_RX_DV_MODE1 0x0000
443 #define DP83TC811_STRAP_RX_DV_MODE2 0x1000
444 #define DP83TC811_STRAP_RX_DV_MODE3 0x2000
445 #define DP83TC811_STRAP_RX_DV_MODE4 0x3000
446 #define DP83TC811_STRAP_RX_ER 0x0C00
447 #define DP83TC811_STRAP_RX_ER_MODE1 0x0000
448 #define DP83TC811_STRAP_RX_ER_MODE2 0x0400
449 #define DP83TC811_STRAP_RX_ER_MODE3 0x0800
450 #define DP83TC811_STRAP_RX_ER_MODE4 0x0C00
451 #define DP83TC811_STRAP_LED_0 0x0300
452 #define DP83TC811_STRAP_LED_0_MODE1 0x0000
453 #define DP83TC811_STRAP_LED_0_MODE2 0x0100
454 #define DP83TC811_STRAP_LED_0_MODE3 0x0200
455 #define DP83TC811_STRAP_LED_0_MODE4 0x0300
456 #define DP83TC811_STRAP_RX_D0 0x00C0
457 #define DP83TC811_STRAP_RX_D0_MODE1 0x0000
458 #define DP83TC811_STRAP_RX_D0_MODE2 0x0040
459 #define DP83TC811_STRAP_RX_D0_MODE3 0x0080
460 #define DP83TC811_STRAP_RX_D0_MODE4 0x00C0
461 #define DP83TC811_STRAP_RX_D1 0x0030
462 #define DP83TC811_STRAP_RX_D1_MODE1 0x0000
463 #define DP83TC811_STRAP_RX_D1_MODE2 0x0010
464 #define DP83TC811_STRAP_RX_D1_MODE3 0x0020
465 #define DP83TC811_STRAP_RX_D1_MODE4 0x0030
466 #define DP83TC811_STRAP_RX_D2 0x000C
467 #define DP83TC811_STRAP_RX_D2_MODE1 0x0000
468 #define DP83TC811_STRAP_RX_D2_MODE2 0x0004
469 #define DP83TC811_STRAP_RX_D2_MODE3 0x0008
470 #define DP83TC811_STRAP_RX_D2_MODE4 0x000C
471 #define DP83TC811_STRAP_RX_D3 0x0003
472 #define DP83TC811_STRAP_RX_D3_MODE1 0x0000
473 #define DP83TC811_STRAP_RX_D3_MODE2 0x0001
474 #define DP83TC811_STRAP_RX_D3_MODE3 0x0002
475 #define DP83TC811_STRAP_RX_D3_MODE4 0x0003
476 
477 //LED Configuration 2 register
478 #define DP83TC811_LED_CFG2_LED_2_POL 0x0400
479 #define DP83TC811_LED_CFG2_LED_2_OVERRIDE_VAL 0x0200
480 #define DP83TC811_LED_CFG2_LED_2_OVERRIDE_EN 0x0100
481 #define DP83TC811_LED_CFG2_LED_1_POL 0x0040
482 #define DP83TC811_LED_CFG2_LED_1_OVERRIDE_VAL 0x0020
483 #define DP83TC811_LED_CFG2_LED_1_OVERRIDE_EN 0x0010
484 #define DP83TC811_LED_CFG2_LED_0_POL 0x0004
485 #define DP83TC811_LED_CFG2_LED_0_OVERRIDE_VAL 0x0002
486 #define DP83TC811_LED_CFG2_LED_0_OVERRIDE_EN 0x0001
487 
488 //Polarity Auto-Correction Configuration register
489 #define DP83TC811_PLR_CFG_POL_VALUE 0x2000
490 #define DP83TC811_PLR_CFG_FORCE_POL_EN 0x1000
491 
492 //C++ guard
493 #ifdef __cplusplus
494 extern "C" {
495 #endif
496 
497 //DP83TC811 Ethernet PHY driver
498 extern const PhyDriver dp83tc811PhyDriver;
499 
500 //DP83TC811 related functions
502 
503 void dp83tc811Tick(NetInterface *interface);
504 
505 void dp83tc811EnableIrq(NetInterface *interface);
506 void dp83tc811DisableIrq(NetInterface *interface);
507 
508 void dp83tc811EventHandler(NetInterface *interface);
509 
510 void dp83tc811WritePhyReg(NetInterface *interface, uint8_t address,
511  uint16_t data);
512 
513 uint16_t dp83tc811ReadPhyReg(NetInterface *interface, uint8_t address);
514 
515 void dp83tc811DumpPhyReg(NetInterface *interface);
516 
517 void dp83tc811WriteMmdReg(NetInterface *interface, uint16_t address,
518  uint16_t data);
519 
520 uint16_t dp83tc811ReadMmdReg(NetInterface *interface, uint16_t address);
521 
522 void dp83tc811WriteMmd1Reg(NetInterface *interface, uint16_t address,
523  uint16_t data);
524 
525 uint16_t dp83tc811ReadMmd1Reg(NetInterface *interface, uint16_t address);
526 
527 //C++ guard
528 #ifdef __cplusplus
529 }
530 #endif
531 
532 #endif
const PhyDriver dp83tc811PhyDriver
DP83TC811 Ethernet PHY driver.
PHY driver.
Definition: nic.h:214
void dp83tc811WriteMmd1Reg(NetInterface *interface, uint16_t address, uint16_t data)
Write MMD1 extended register.
uint16_t dp83tc811ReadMmdReg(NetInterface *interface, uint16_t address)
Read MMD extended register.
void dp83tc811DumpPhyReg(NetInterface *interface)
Dump PHY registers for debugging purpose.
error_t
Error codes.
Definition: error.h:42
void dp83tc811WriteMmdReg(NetInterface *interface, uint16_t address, uint16_t data)
Write MMD extended register.
void dp83tc811DisableIrq(NetInterface *interface)
Disable interrupts.
#define NetInterface
Definition: net.h:36
void dp83tc811Tick(NetInterface *interface)
DP83TC811 timer handler.
uint16_t dp83tc811ReadPhyReg(NetInterface *interface, uint8_t address)
Read PHY register.
void dp83tc811EventHandler(NetInterface *interface)
DP83TC811 event handler.
Network interface controller abstraction layer.
error_t dp83tc811Init(NetInterface *interface)
DP83TC811 PHY transceiver initialization.
Ipv6Addr address
uint16_t dp83tc811ReadMmd1Reg(NetInterface *interface, uint16_t address)
Read MMD1 extended register.
uint8_t data[]
Definition: dtls_misc.h:176
void dp83tc811EnableIrq(NetInterface *interface)
Enable interrupts.
void dp83tc811WritePhyReg(NetInterface *interface, uint8_t address, uint16_t data)
Write PHY register.