31#ifndef _ENC28J60_DRIVER_H
32#define _ENC28J60_DRIVER_H
38#ifndef ENC28J60_FULL_DUPLEX_SUPPORT
39 #define ENC28J60_FULL_DUPLEX_SUPPORT ENABLED
40#elif (ENC28J60_FULL_DUPLEX_SUPPORT != ENABLED && ENC28J60_FULL_DUPLEX_SUPPORT != DISABLED)
41 #error ENC28J60_FULL_DUPLEX_SUPPORT parameter is not valid
45#ifndef ENC28J60_ETH_RX_BUFFER_SIZE
46 #define ENC28J60_ETH_RX_BUFFER_SIZE 1536
47#elif (ENC28J60_ETH_RX_BUFFER_SIZE != 1536)
48 #error ENC28J60_ETH_RX_BUFFER_SIZE parameter is not valid
52#define ENC28J60_RX_BUFFER_START 0x0000
53#define ENC28J60_RX_BUFFER_STOP 0x17FF
54#define ENC28J60_TX_BUFFER_START 0x1800
55#define ENC28J60_TX_BUFFER_STOP 0x1FFF
58#define ENC28J60_CMD_RCR 0x00
59#define ENC28J60_CMD_RBM 0x3A
60#define ENC28J60_CMD_WCR 0x40
61#define ENC28J60_CMD_WBM 0x7A
62#define ENC28J60_CMD_BFS 0x80
63#define ENC28J60_CMD_BFC 0xA0
64#define ENC28J60_CMD_SRC 0xFF
67#define ETH_REG_TYPE 0x0000
68#define MAC_REG_TYPE 0x1000
69#define MII_REG_TYPE 0x2000
70#define PHY_REG_TYPE 0x3000
79#define REG_TYPE_MASK 0xF000
80#define REG_BANK_MASK 0x0F00
81#define REG_ADDR_MASK 0x001F
84#define ENC28J60_ERDPTL (ETH_REG_TYPE | BANK_0 | 0x00)
85#define ENC28J60_ERDPTH (ETH_REG_TYPE | BANK_0 | 0x01)
86#define ENC28J60_EWRPTL (ETH_REG_TYPE | BANK_0 | 0x02)
87#define ENC28J60_EWRPTH (ETH_REG_TYPE | BANK_0 | 0x03)
88#define ENC28J60_ETXSTL (ETH_REG_TYPE | BANK_0 | 0x04)
89#define ENC28J60_ETXSTH (ETH_REG_TYPE | BANK_0 | 0x05)
90#define ENC28J60_ETXNDL (ETH_REG_TYPE | BANK_0 | 0x06)
91#define ENC28J60_ETXNDH (ETH_REG_TYPE | BANK_0 | 0x07)
92#define ENC28J60_ERXSTL (ETH_REG_TYPE | BANK_0 | 0x08)
93#define ENC28J60_ERXSTH (ETH_REG_TYPE | BANK_0 | 0x09)
94#define ENC28J60_ERXNDL (ETH_REG_TYPE | BANK_0 | 0x0A)
95#define ENC28J60_ERXNDH (ETH_REG_TYPE | BANK_0 | 0x0B)
96#define ENC28J60_ERXRDPTL (ETH_REG_TYPE | BANK_0 | 0x0C)
97#define ENC28J60_ERXRDPTH (ETH_REG_TYPE | BANK_0 | 0x0D)
98#define ENC28J60_ERXWRPTL (ETH_REG_TYPE | BANK_0 | 0x0E)
99#define ENC28J60_ERXWRPTH (ETH_REG_TYPE | BANK_0 | 0x0F)
100#define ENC28J60_EDMASTL (ETH_REG_TYPE | BANK_0 | 0x10)
101#define ENC28J60_EDMASTH (ETH_REG_TYPE | BANK_0 | 0x11)
102#define ENC28J60_EDMANDL (ETH_REG_TYPE | BANK_0 | 0x12)
103#define ENC28J60_EDMANDH (ETH_REG_TYPE | BANK_0 | 0x13)
104#define ENC28J60_EDMADSTL (ETH_REG_TYPE | BANK_0 | 0x14)
105#define ENC28J60_EDMADSTH (ETH_REG_TYPE | BANK_0 | 0x15)
106#define ENC28J60_EDMACSL (ETH_REG_TYPE | BANK_0 | 0x16)
107#define ENC28J60_EDMACSH (ETH_REG_TYPE | BANK_0 | 0x17)
108#define ENC28J60_EIE (ETH_REG_TYPE | BANK_0 | 0x1B)
109#define ENC28J60_EIR (ETH_REG_TYPE | BANK_0 | 0x1C)
110#define ENC28J60_ESTAT (ETH_REG_TYPE | BANK_0 | 0x1D)
111#define ENC28J60_ECON2 (ETH_REG_TYPE | BANK_0 | 0x1E)
112#define ENC28J60_ECON1 (ETH_REG_TYPE | BANK_0 | 0x1F)
113#define ENC28J60_EHT0 (ETH_REG_TYPE | BANK_1 | 0x00)
114#define ENC28J60_EHT1 (ETH_REG_TYPE | BANK_1 | 0x01)
115#define ENC28J60_EHT2 (ETH_REG_TYPE | BANK_1 | 0x02)
116#define ENC28J60_EHT3 (ETH_REG_TYPE | BANK_1 | 0x03)
117#define ENC28J60_EHT4 (ETH_REG_TYPE | BANK_1 | 0x04)
118#define ENC28J60_EHT5 (ETH_REG_TYPE | BANK_1 | 0x05)
119#define ENC28J60_EHT6 (ETH_REG_TYPE | BANK_1 | 0x06)
120#define ENC28J60_EHT7 (ETH_REG_TYPE | BANK_1 | 0x07)
121#define ENC28J60_EPMM0 (ETH_REG_TYPE | BANK_1 | 0x08)
122#define ENC28J60_EPMM1 (ETH_REG_TYPE | BANK_1 | 0x09)
123#define ENC28J60_EPMM2 (ETH_REG_TYPE | BANK_1 | 0x0A)
124#define ENC28J60_EPMM3 (ETH_REG_TYPE | BANK_1 | 0x0B)
125#define ENC28J60_EPMM4 (ETH_REG_TYPE | BANK_1 | 0x0C)
126#define ENC28J60_EPMM5 (ETH_REG_TYPE | BANK_1 | 0x0D)
127#define ENC28J60_EPMM6 (ETH_REG_TYPE | BANK_1 | 0x0E)
128#define ENC28J60_EPMM7 (ETH_REG_TYPE | BANK_1 | 0x0F)
129#define ENC28J60_EPMCSL (ETH_REG_TYPE | BANK_1 | 0x10)
130#define ENC28J60_EPMCSH (ETH_REG_TYPE | BANK_1 | 0x11)
131#define ENC28J60_EPMOL (ETH_REG_TYPE | BANK_1 | 0x14)
132#define ENC28J60_EPMOH (ETH_REG_TYPE | BANK_1 | 0x15)
133#define ENC28J60_EWOLIE (ETH_REG_TYPE | BANK_1 | 0x16)
134#define ENC28J60_EWOLIR (ETH_REG_TYPE | BANK_1 | 0x17)
135#define ENC28J60_ERXFCON (ETH_REG_TYPE | BANK_1 | 0x18)
136#define ENC28J60_EPKTCNT (ETH_REG_TYPE | BANK_1 | 0x19)
137#define ENC28J60_MACON1 (MAC_REG_TYPE | BANK_2 | 0x00)
138#define ENC28J60_MACON2 (MAC_REG_TYPE | BANK_2 | 0x01)
139#define ENC28J60_MACON3 (MAC_REG_TYPE | BANK_2 | 0x02)
140#define ENC28J60_MACON4 (MAC_REG_TYPE | BANK_2 | 0x03)
141#define ENC28J60_MABBIPG (MAC_REG_TYPE | BANK_2 | 0x04)
142#define ENC28J60_MAIPGL (MAC_REG_TYPE | BANK_2 | 0x06)
143#define ENC28J60_MAIPGH (MAC_REG_TYPE | BANK_2 | 0x07)
144#define ENC28J60_MACLCON1 (MAC_REG_TYPE | BANK_2 | 0x08)
145#define ENC28J60_MACLCON2 (MAC_REG_TYPE | BANK_2 | 0x09)
146#define ENC28J60_MAMXFLL (MAC_REG_TYPE | BANK_2 | 0x0A)
147#define ENC28J60_MAMXFLH (MAC_REG_TYPE | BANK_2 | 0x0B)
148#define ENC28J60_MAPHSUP (MAC_REG_TYPE | BANK_2 | 0x0D)
149#define ENC28J60_MICON (MII_REG_TYPE | BANK_2 | 0x11)
150#define ENC28J60_MICMD (MII_REG_TYPE | BANK_2 | 0x12)
151#define ENC28J60_MIREGADR (MII_REG_TYPE | BANK_2 | 0x14)
152#define ENC28J60_MIWRL (MII_REG_TYPE | BANK_2 | 0x16)
153#define ENC28J60_MIWRH (MII_REG_TYPE | BANK_2 | 0x17)
154#define ENC28J60_MIRDL (MII_REG_TYPE | BANK_2 | 0x18)
155#define ENC28J60_MIRDH (MII_REG_TYPE | BANK_2 | 0x19)
156#define ENC28J60_MAADR1 (MAC_REG_TYPE | BANK_3 | 0x00)
157#define ENC28J60_MAADR0 (MAC_REG_TYPE | BANK_3 | 0x01)
158#define ENC28J60_MAADR3 (MAC_REG_TYPE | BANK_3 | 0x02)
159#define ENC28J60_MAADR2 (MAC_REG_TYPE | BANK_3 | 0x03)
160#define ENC28J60_MAADR5 (MAC_REG_TYPE | BANK_3 | 0x04)
161#define ENC28J60_MAADR4 (MAC_REG_TYPE | BANK_3 | 0x05)
162#define ENC28J60_EBSTSD (ETH_REG_TYPE | BANK_3 | 0x06)
163#define ENC28J60_EBSTCON (ETH_REG_TYPE | BANK_3 | 0x07)
164#define ENC28J60_EBSTCSL (ETH_REG_TYPE | BANK_3 | 0x08)
165#define ENC28J60_EBSTCSH (ETH_REG_TYPE | BANK_3 | 0x09)
166#define ENC28J60_MISTAT (MII_REG_TYPE | BANK_3 | 0x0A)
167#define ENC28J60_EREVID (ETH_REG_TYPE | BANK_3 | 0x12)
168#define ENC28J60_ECOCON (ETH_REG_TYPE | BANK_3 | 0x15)
169#define ENC28J60_EFLOCON (ETH_REG_TYPE | BANK_3 | 0x17)
170#define ENC28J60_EPAUSL (ETH_REG_TYPE | BANK_3 | 0x18)
171#define ENC28J60_EPAUSH (ETH_REG_TYPE | BANK_3 | 0x19)
174#define ENC28J60_PHCON1 (PHY_REG_TYPE | 0x00)
175#define ENC28J60_PHSTAT1 (PHY_REG_TYPE | 0x01)
176#define ENC28J60_PHID1 (PHY_REG_TYPE | 0x02)
177#define ENC28J60_PHID2 (PHY_REG_TYPE | 0x03)
178#define ENC28J60_PHCON2 (PHY_REG_TYPE | 0x10)
179#define ENC28J60_PHSTAT2 (PHY_REG_TYPE | 0x11)
180#define ENC28J60_PHIE (PHY_REG_TYPE | 0x12)
181#define ENC28J60_PHIR (PHY_REG_TYPE | 0x13)
182#define ENC28J60_PHLCON (PHY_REG_TYPE | 0x14)
185#define ENC28J60_EIE_INTIE 0x80
186#define ENC28J60_EIE_PKTIE 0x40
187#define ENC28J60_EIE_DMAIE 0x20
188#define ENC28J60_EIE_LINKIE 0x10
189#define ENC28J60_EIE_TXIE 0x08
190#define ENC28J60_EIE_WOLIE 0x04
191#define ENC28J60_EIE_TXERIE 0x02
192#define ENC28J60_EIE_RXERIE 0x01
195#define ENC28J60_EIR_PKTIF 0x40
196#define ENC28J60_EIR_DMAIF 0x20
197#define ENC28J60_EIR_LINKIF 0x10
198#define ENC28J60_EIR_TXIF 0x08
199#define ENC28J60_EIR_WOLIF 0x04
200#define ENC28J60_EIR_TXERIF 0x02
201#define ENC28J60_EIR_RXERIF 0x01
204#define ENC28J60_ESTAT_INT 0x80
205#define ENC28J60_ESTAT_R6 0x40
206#define ENC28J60_ESTAT_R5 0x20
207#define ENC28J60_ESTAT_LATECOL 0x10
208#define ENC28J60_ESTAT_RXBUSY 0x04
209#define ENC28J60_ESTAT_TXABRT 0x02
210#define ENC28J60_ESTAT_CLKRDY 0x01
213#define ENC28J60_ECON2_AUTOINC 0x80
214#define ENC28J60_ECON2_PKTDEC 0x40
215#define ENC28J60_ECON2_PWRSV 0x20
216#define ENC28J60_ECON2_VRPS 0x08
219#define ENC28J60_ECON1_TXRST 0x80
220#define ENC28J60_ECON1_RXRST 0x40
221#define ENC28J60_ECON1_DMAST 0x20
222#define ENC28J60_ECON1_CSUMEN 0x10
223#define ENC28J60_ECON1_TXRTS 0x08
224#define ENC28J60_ECON1_RXEN 0x04
225#define ENC28J60_ECON1_BSEL1 0x02
226#define ENC28J60_ECON1_BSEL0 0x01
229#define ENC28J60_EWOLIE_UCWOLIE 0x80
230#define ENC28J60_EWOLIE_AWOLIE 0x40
231#define ENC28J60_EWOLIE_PMWOLIE 0x10
232#define ENC28J60_EWOLIE_MPWOLIE 0x08
233#define ENC28J60_EWOLIE_HTWOLIE 0x04
234#define ENC28J60_EWOLIE_MCWOLIE 0x02
235#define ENC28J60_EWOLIE_BCWOLIE 0x01
238#define ENC28J60_EWOLIR_UCWOLIF 0x80
239#define ENC28J60_EWOLIR_AWOLIF 0x40
240#define ENC28J60_EWOLIR_PMWOLIF 0x10
241#define ENC28J60_EWOLIR_MPWOLIF 0x08
242#define ENC28J60_EWOLIR_HTWOLIF 0x04
243#define ENC28J60_EWOLIR_MCWOLIF 0x02
244#define ENC28J60_EWOLIR_BCWOLIF 0x01
247#define ENC28J60_ERXFCON_UCEN 0x80
248#define ENC28J60_ERXFCON_ANDOR 0x40
249#define ENC28J60_ERXFCON_CRCEN 0x20
250#define ENC28J60_ERXFCON_PMEN 0x10
251#define ENC28J60_ERXFCON_MPEN 0x08
252#define ENC28J60_ERXFCON_HTEN 0x04
253#define ENC28J60_ERXFCON_MCEN 0x02
254#define ENC28J60_ERXFCON_BCEN 0x01
257#define ENC28J60_MACON1_LOOPBK 0x10
258#define ENC28J60_MACON1_TXPAUS 0x08
259#define ENC28J60_MACON1_RXPAUS 0x04
260#define ENC28J60_MACON1_PASSALL 0x02
261#define ENC28J60_MACON1_MARXEN 0x01
264#define ENC28J60_MACON2_MARST 0x80
265#define ENC28J60_MACON2_RNDRST 0x40
266#define ENC28J60_MACON2_MARXRST 0x08
267#define ENC28J60_MACON2_RFUNRST 0x04
268#define ENC28J60_MACON2_MATXRST 0x02
269#define ENC28J60_MACON2_TFUNRST 0x01
272#define ENC28J60_MACON3_PADCFG 0xE0
273#define ENC28J60_MACON3_PADCFG_NO 0x00
274#define ENC28J60_MACON3_PADCFG_60_BYTES 0x20
275#define ENC28J60_MACON3_PADCFG_64_BYTES 0x60
276#define ENC28J60_MACON3_PADCFG_AUTO 0xA0
277#define ENC28J60_MACON3_TXCRCEN 0x10
278#define ENC28J60_MACON3_PHDRLEN 0x08
279#define ENC28J60_MACON3_HFRMEN 0x04
280#define ENC28J60_MACON3_FRMLNEN 0x02
281#define ENC28J60_MACON3_FULDPX 0x01
284#define ENC28J60_MACON4_DEFER 0x40
285#define ENC28J60_MACON4_BPEN 0x20
286#define ENC28J60_MACON4_NOBKOFF 0x10
287#define ENC28J60_MACON4_LONGPRE 0x02
288#define ENC28J60_MACON4_PUREPRE 0x01
291#define ENC28J60_MABBIPG_DEFAULT_HD 0x12
292#define ENC28J60_MABBIPG_DEFAULT_FD 0x15
295#define ENC28J60_MAIPGL_DEFAULT 0x12
298#define ENC28J60_MAIPGH_DEFAULT 0x0C
301#define ENC28J60_MACLCON1_RETMAX 0x0F
304#define ENC28J60_MACLCON2_COLWIN 0x3F
305#define ENC28J60_MACLCON2_COLWIN_DEFAULT 0x37
308#define ENC28J60_MAPHSUP_RSTINTFC 0x80
309#define ENC28J60_MAPHSUP_R4 0x10
310#define ENC28J60_MAPHSUP_RSTRMII 0x08
311#define ENC28J60_MAPHSUP_R0 0x01
314#define ENC28J60_MICON_RSTMII 0x80
317#define ENC28J60_MICMD_MIISCAN 0x02
318#define ENC28J60_MICMD_MIIRD 0x01
321#define ENC28J60_MIREGADR_VAL 0x1F
324#define ENC28J60_EBSTCON_PSV 0xE0
325#define ENC28J60_EBSTCON_PSEL 0x10
326#define ENC28J60_EBSTCON_TMSEL 0x0C
327#define ENC28J60_EBSTCON_TMSEL_RANDOM 0x00
328#define ENC28J60_EBSTCON_TMSEL_ADDR 0x04
329#define ENC28J60_EBSTCON_TMSEL_PATTERN_SHIFT 0x08
330#define ENC28J60_EBSTCON_TMSEL_RACE_MODE 0x0C
331#define ENC28J60_EBSTCON_TME 0x02
332#define ENC28J60_EBSTCON_BISTST 0x01
335#define ENC28J60_MISTAT_R3 0x08
336#define ENC28J60_MISTAT_NVALID 0x04
337#define ENC28J60_MISTAT_SCAN 0x02
338#define ENC28J60_MISTAT_BUSY 0x01
341#define ENC28J60_EREVID_REV 0x1F
342#define ENC28J60_EREVID_REV_B1 0x02
343#define ENC28J60_EREVID_REV_B4 0x04
344#define ENC28J60_EREVID_REV_B5 0x05
345#define ENC28J60_EREVID_REV_B7 0x06
348#define ENC28J60_ECOCON_COCON 0x07
349#define ENC28J60_ECOCON_COCON_DISABLED 0x00
350#define ENC28J60_ECOCON_COCON_DIV1 0x01
351#define ENC28J60_ECOCON_COCON_DIV2 0x02
352#define ENC28J60_ECOCON_COCON_DIV3 0x03
353#define ENC28J60_ECOCON_COCON_DIV4 0x04
354#define ENC28J60_ECOCON_COCON_DIV8 0x05
357#define ENC28J60_EFLOCON_FULDPXS 0x04
358#define ENC28J60_EFLOCON_FCEN 0x03
359#define ENC28J60_EFLOCON_FCEN_OFF 0x00
360#define ENC28J60_EFLOCON_FCEN_ON_HD 0x01
361#define ENC28J60_EFLOCON_FCEN_ON_FD 0x02
362#define ENC28J60_EFLOCON_FCEN_SEND_PAUSE 0x03
365#define ENC28J60_PHCON1_PRST 0x8000
366#define ENC28J60_PHCON1_PLOOPBK 0x4000
367#define ENC28J60_PHCON1_PPWRSV 0x0800
368#define ENC28J60_PHCON1_PDPXMD 0x0100
371#define ENC28J60_PHSTAT1_PFDPX 0x1000
372#define ENC28J60_PHSTAT1_PHDPX 0x0800
373#define ENC28J60_PHSTAT1_LLSTAT 0x0004
374#define ENC28J60_PHSTAT1_JBRSTAT 0x0002
377#define ENC28J60_PHID1_PIDH 0xFFFF
378#define ENC28J60_PHID1_PIDH_DEFAULT 0x0083
381#define ENC28J60_PHID2_PIDL 0xFC00
382#define ENC28J60_PHID2_PIDL_DEFAULT 0x1400
383#define ENC28J60_PHID2_PPN 0x03F0
384#define ENC28J60_PHID2_PPN_DEFAULT 0x0000
385#define ENC28J60_PHID2_PREV 0x000F
388#define ENC28J60_PHCON2_FRCLNK 0x4000
389#define ENC28J60_PHCON2_TXDIS 0x2000
390#define ENC28J60_PHCON2_JABBER 0x0400
391#define ENC28J60_PHCON2_HDLDIS 0x0100
394#define ENC28J60_PHSTAT2_TXSTAT 0x2000
395#define ENC28J60_PHSTAT2_RXSTAT 0x1000
396#define ENC28J60_PHSTAT2_COLSTAT 0x0800
397#define ENC28J60_PHSTAT2_LSTAT 0x0400
398#define ENC28J60_PHSTAT2_DPXSTAT 0x0200
399#define ENC28J60_PHSTAT2_PLRITY 0x0010
402#define ENC28J60_PHIE_PLNKIE 0x0010
403#define ENC28J60_PHIE_PGEIE 0x0002
406#define ENC28J60_PHIR_PLNKIF 0x0010
407#define ENC28J60_PHIR_PGIF 0x0004
410#define ENC28J60_PHLCON_LACFG 0x0F00
411#define ENC28J60_PHLCON_LACFG_TX 0x0100
412#define ENC28J60_PHLCON_LACFG_RX 0x0200
413#define ENC28J60_PHLCON_LACFG_COL 0x0300
414#define ENC28J60_PHLCON_LACFG_LINK 0x0400
415#define ENC28J60_PHLCON_LACFG_DUPLEX 0x0500
416#define ENC28J60_PHLCON_LACFG_TX_RX 0x0700
417#define ENC28J60_PHLCON_LACFG_ON 0x0800
418#define ENC28J60_PHLCON_LACFG_OFF 0x0900
419#define ENC28J60_PHLCON_LACFG_BLINK_FAST 0x0A00
420#define ENC28J60_PHLCON_LACFG_BLINK_SLOW 0x0B00
421#define ENC28J60_PHLCON_LACFG_LINK_RX 0x0C00
422#define ENC28J60_PHLCON_LACFG_LINK_TX_RX 0x0D00
423#define ENC28J60_PHLCON_LACFG_DUPLEX_COL 0x0E00
424#define ENC28J60_PHLCON_LBCFG 0x00F0
425#define ENC28J60_PHLCON_LBCFG_TX 0x0010
426#define ENC28J60_PHLCON_LBCFG_RX 0x0020
427#define ENC28J60_PHLCON_LBCFG_COL 0x0030
428#define ENC28J60_PHLCON_LBCFG_LINK 0x0040
429#define ENC28J60_PHLCON_LBCFG_DUPLEX 0x0050
430#define ENC28J60_PHLCON_LBCFG_TX_RX 0x0070
431#define ENC28J60_PHLCON_LBCFG_ON 0x0080
432#define ENC28J60_PHLCON_LBCFG_OFF 0x0090
433#define ENC28J60_PHLCON_LBCFG_BLINK_FAST 0x00A0
434#define ENC28J60_PHLCON_LBCFG_BLINK_SLOW 0x00B0
435#define ENC28J60_PHLCON_LBCFG_LINK_RX 0x00C0
436#define ENC28J60_PHLCON_LBCFG_LINK_TX_RX 0x00D0
437#define ENC28J60_PHLCON_LBCFG_DUPLEX_COL 0x00E0
438#define ENC28J60_PHLCON_LFRQ 0x000C
439#define ENC28J60_PHLCON_LFRQ_40_MS 0x0000
440#define ENC28J60_PHLCON_LFRQ_73_MS 0x0004
441#define ENC28J60_PHLCON_LFRQ_139_MS 0x0008
442#define ENC28J60_PHLCON_STRCH 0x0002
445#define ENC28J60_TX_CTRL_PHUGEEN 0x08
446#define ENC28J60_TX_CTRL_PPADEN 0x04
447#define ENC28J60_TX_CTRL_PCRCEN 0x02
448#define ENC28J60_TX_CTRL_POVERRIDE 0x01
451#define ENC28J60_RSV_VLAN_TYPE 0x4000
452#define ENC28J60_RSV_UNKNOWN_OPCODE 0x2000
453#define ENC28J60_RSV_PAUSE_CONTROL_FRAME 0x1000
454#define ENC28J60_RSV_CONTROL_FRAME 0x0800
455#define ENC28J60_RSV_DRIBBLE_NIBBLE 0x0400
456#define ENC28J60_RSV_BROADCAST_PACKET 0x0200
457#define ENC28J60_RSV_MULTICAST_PACKET 0x0100
458#define ENC28J60_RSV_RECEIVED_OK 0x0080
459#define ENC28J60_RSV_LENGTH_OUT_OF_RANGE 0x0040
460#define ENC28J60_RSV_LENGTH_CHECK_ERROR 0x0020
461#define ENC28J60_RSV_CRC_ERROR 0x0010
462#define ENC28J60_RSV_CARRIER_EVENT 0x0004
463#define ENC28J60_RSV_DROP_EVENT 0x0001
486error_t enc28j60Init(NetInterface *interface);
488void enc28j60Tick(NetInterface *interface);
490void enc28j60EnableIrq(NetInterface *interface);
491void enc28j60DisableIrq(NetInterface *interface);
492bool_t enc28j60IrqHandler(NetInterface *interface);
493void enc28j60EventHandler(NetInterface *interface);
495error_t enc28j60SendPacket(NetInterface *interface,
496 const NetBuffer *buffer,
size_t offset, NetTxAncillary *ancillary);
498error_t enc28j60ReceivePacket(NetInterface *interface);
500error_t enc28j60UpdateMacAddrFilter(NetInterface *interface);
502void enc28j60SoftReset(NetInterface *interface);
503void enc28j60SelectBank(NetInterface *interface, uint16_t address);
505void enc28j60WriteReg(NetInterface *interface, uint16_t address, uint8_t data);
506uint8_t enc28j60ReadReg(NetInterface *interface, uint16_t address);
508void enc28j60WritePhyReg(NetInterface *interface, uint16_t address,
511uint16_t enc28j60ReadPhyReg(NetInterface *interface, uint16_t address);
513void enc28j60WriteBuffer(NetInterface *interface,
516void enc28j60ReadBuffer(NetInterface *interface,
517 uint8_t *data,
size_t length);
519void enc28j60SetBit(NetInterface *interface, uint16_t address, uint16_t mask);
520void enc28j60ClearBit(NetInterface *interface, uint16_t address, uint16_t mask);
522uint32_t enc28j60CalcCrc(
const void *data,
size_t length);
524void enc28j60DumpReg(NetInterface *interface);
525void enc28j60DumpPhyReg(NetInterface *interface);
error_t
Error codes.
Definition error.h:43
Network interface controller abstraction layer.
ENC28J60 driver context.
Definition enc28j60_driver.h:476
uint16_t currentBank
Current bank.
Definition enc28j60_driver.h:477
uint16_t nextPacket
Next packet in the receive buffer.
Definition enc28j60_driver.h:478
Structure describing a buffer that spans multiple chunks.
Definition net_mem.h:89
NIC driver.
Definition nic.h:283