encx24j600_defines.h
5.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
/*
* Copyright (C) 2015 Ell-i open source co-operative
* Kaspar Schleiser <kaspar@schleiser.de>
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License v2.1. See the file LICENSE in the top level directory for more
* details.
*/
/**
* @ingroup driver_encx24j600
* @{
*
* @file
* @brief Register definitions for the ENCX24J600 Ethernet device
*
* @author Kaspar Schleiser <kaspar@schleiser.de>
*/
#ifndef ENCX24J600_REGS_H
#define ENCX24J600_REGS_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name SPI instruction set
* @{
*/
#define ENC_RCR 0x00 /* read control register */
#define ENC_WCR 0x04 /* write control register */
#define ENC_RCRU 0x20 /* read control register unbanked */
#define ENC_WCRU 0x22 /* write control register unbanked */
#define ENC_BFSU 0x24 /* set bits unbanked */
#define ENC_BFCU 0x26 /* clear bits unbanked */
#define ENC_RGPDATA 0x28 /* Read EGPDATA */
#define ENC_WGPDATA 0x2a /* Write EGPDATA */
#define ENC_RRXDATA 0x2c /* Read ERXDATA */
#define ENC_WRXDATA 0x2e /* Write ERXDATA */
#define ENC_RUDADATA 0x30 /* Read EUDADATA */
#define ENC_WUDADATA 0x32 /* Write EUDADATA */
#define ENC_BFS 0x80 /* Bit Field Set */
#define ENC_BFC 0xa0 /* Bit Field Clear */
#define ENC_SETETHRST 0xca /* System Reset */
#define ENC_SETPKTDEC 0xcc /* Decrements PKTCNT by setting PKTDEC (ECON1<5>) */
#define ENC_ENABLERX 0xe8 /* Enables packet reception by setting RXEN (ECON1<0>) */
#define ENC_DISABLERX 0xea /* Disable packet reception by clearing RXEN (ECON1<0>) */
#define ENC_SETEIE 0xec /* Enable Ethernet Interrupts by setting INT (ESTAT<16>) */
#define ENC_CLREIE 0xee /* Disable Ethernet Interrupts by clearing INT (ESTAT<16>) */
#define ENC_B0SEL 0xc0 /* select bank 0 */
#define ENC_B1SEL 0xc2 /* select bank 0 */
#define ENC_B2SEL 0xc4 /* select bank 0 */
#define ENC_B3SEL 0xc6 /* select bank 0 */
#define ENC_RBSEL 0xc8 /* Read Bank Select */
#define ENC_SETTXRTS 0xd4 /* Sets TXRTS (ECON1<1>), sends an Ethernet packet */
/** @} */
/**
* @name 16bit Registers
* @{
*/
#define ENC_ETXST 0x00
#define ENC_ETXLEN 0x02
#define ENC_ERXST 0x04
#define ENC_ERXTAIL 0x06
#define ENC_ERXHEAD 0x08
#define ENC_ETXSTAT 0x12
#define ENC_ETXWIRE 0x14
#define ENC_EUDAST 0x16
#define ENC_ESTAT 0x1a
#define ENC_EIR 0x1c /* Interrupt Flag Register */
#define ENC_ECON1 0x1e
#define ENC_ERXFCON 0x34 /* Receive filter control register */
#define ENC_MACON2 0x42
#define ENC_MAMXFL 0x4a /* MAC maximum frame length */
#define ENC_MAADR3 0x60 /* MAC address byte 5&6 */
#define ENC_MAADR2 0x62 /* MAC address byte 3&4 */
#define ENC_MAADR1 0x64 /* MAC address byte 1&2 */
#define ENC_MIWR 0x66
#define ENC_MIREGADR 0x54
#define ENC_ECON2 0x6e
#define ENC_EIE 0x72 /* Interrupt Enable Register */
#define ENC_EGPRDPT 0x86 /* General Purpose SRAM read pointer */
#define ENC_EGPWRPT 0x88 /* General Purpose SRAM write pointer */
#define ENC_ERXRDPT 0x8a /* RX buffer read pointer */
#define ENC_ERXWRPT 0x8c /* RX buffer write pointer */
/** @} */
/**
* @name PHY Registers
*
* (access with phy_reg_* functions)
*
* @{
*/
#define ENC_PHCON1 0x00
#define ENC_PHSTAT1 0x01
#define ENC_PHANA 0x04
#define ENC_PHANLPA 0x05
#define ENC_PHANE 0x06
#define ENC_PHCON2 0x11
#define ENC_PHSTAT2 0x1b
#define ENC_PHSTAT3 0x1f
/** @} */
/**
* @name ESTAT bits
* @{
*/
#define ENC_PHYLNK (1<<8)
#define ENC_CLKRDY (1<<12)
/** @} */
/**
* @name ECON1 bits
* @{
*/
#define ENC_RXEN (1<<0)
#define ENC_TXRTS (1<<1)
#define ENC_DMANOCS (1<<2)
#define ENC_DMACSSD (1<<3)
#define ENC_DMACPY (1<<4)
#define ENC_DMAST (1<<5)
#define ENC_FCOP0 (1<<6)
#define ENC_FCOP1 (1<<7)
#define ENC_PKTDEC (1<<8)
#define ENC_AESOP0 (1<<9)
#define ENC_AESOP1 (1<<10)
#define ENC_AESST (1<<11)
#define ENC_HASHLST (1<<12)
#define ENC_HASHOP (1<<13)
#define ENC_HASHEN (1<<14)
#define ENC_MODEXST (1<<15)
/** @} */
/**
* @name ECON2 bits
* @{
*/
#define ENC_ETHRST (1<<4)
#define ENC_AUTOFC (1<<7) /* automatic flow control enable bit */
/** @} */
/**
* @name EIR bits
* @{
*/
#define ENC_PCFULIE (1<<0)
#define ENC_RXABTIE (1<<1)
#define ENC_TXABTIE (1<<2)
#define ENC_TXIE (1<<3)
#define ENC_DMAIE (1<<5)
#define ENC_PKTIE (1<<6)
#define ENC_LINKIE (1<<11)
#define ENC_AESIE (1<<12)
#define ENC_HASHIE (1<<13)
#define ENC_MODEXIE (1<<14)
#define ENC_INTIE (1<<15)
/** @} */
/**
* @name EIR bits
* @{
*/
#define ENC_PCFULIF (1<<0)
#define ENC_RXABTIF (1<<1)
#define ENC_TXABTIF (1<<2)
#define ENC_TXIF (1<<3)
#define ENC_DMAIF (1<<5)
#define ENC_PKTIF (1<<6)
#define ENC_LINKIF (1<<11)
#define ENC_AESIF (1<<12)
#define ENC_HASHIF (1<<13)
#define ENC_MODEXIF (1<<14)
#define ENC_CRYPTEN (1<<15)
/** @} */
/**
* @name ERXFCON bits
*/
#define ENC_MCEN (1<<1)
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ENCX24J600_REGS_H */
/** @} */