29#include "bitbang_spi.h"
71#define CR_SUBR0 0x0005
72#define CR_SUBR1 0x0006
73#define CR_SUBR2 0x0007
74#define CR_SUBR3 0x0008
75#define CR_SHAR0 0x0009
76#define CR_SHAR1 0x000A
77#define CR_SHAR2 0x000B
78#define CR_SHAR3 0x000C
79#define CR_SHAR4 0x000D
80#define CR_SHAR5 0x000E
81#define CR_SIPR0 0x000F
82#define CR_SIPR1 0x0010
83#define CR_SIPR2 0x0011
84#define CR_SIPR3 0x0012
85#define CR_INTLEVEL0 0x0013
86#define CR_INTLEVEL1 0x0014
94#define CR_PTIMER 0x001C
95#define CR_PMAGIC 0x001D
96#define CR_PHAR0 0x001E
97#define CR_PHAR1 0x001F
98#define CR_PHAR2 0x0020
99#define CR_PHAR3 0x0021
100#define CR_PHAR4 0x0022
101#define CR_PHAR5 0x0023
102#define CR_PSID0 0x0024
103#define CR_PSID1 0x0025
104#define CR_PMRU0 0x0026
105#define CR_PMRU1 0x0027
106#define CR_UIPR0 0x0028
107#define CR_UIPR1 0x0029
108#define CR_UIPR2 0x002A
109#define CR_UIPR3 0x002B
110#define CR_UPORTR0 0x002C
111#define CR_UPORTR1 0x002D
112#define CR_PHYCFGR 0x002E
115#define CR_VERSIONR 0x0039
122#define Sn_PORT0 0x0004
123#define Sn_PORT1 0x0005
124#define Sn_DHAR0 0x0006
125#define Sn_DHAR1 0x0007
126#define Sn_DHAR2 0x0008
127#define Sn_DHAR3 0x0009
128#define Sn_DHAR4 0x000A
129#define Sn_DHAR5 0x000B
130#define Sn_DIPR0 0x000C
131#define Sn_DIPR1 0x000D
132#define Sn_DIPR2 0x000E
133#define Sn_DIPR3 0x000F
134#define Sn_DPORT0 0x0010
135#define Sn_DPORT1 0x0011
136#define Sn_MSSR0 0x0012
137#define Sn_MSSR1 0x0013
143#define Sn_RXBUF_SIZE 0x001E
144#define Sn_TXBUF_SIZE 0x001F
145#define Sn_TX_FSR0 0x0020
146#define Sn_TX_FSR1 0x0021
147#define Sn_TX_RD0 0x0022
148#define Sn_TX_RD1 0x0023
149#define Sn_TX_WR0 0x0024
150#define Sn_TX_WR1 0x0025
151#define Sn_RX_RSR0 0x0026
152#define Sn_RX_RSR1 0x0027
153#define Sn_RX_RD0 0x0028
154#define Sn_RX_RD1 0x0029
155#define Sn_RX_WR0 0x002A
156#define Sn_RX_WR1 0x002B
158#define Sn_FRAG0 0x002D
159#define Sn_FRAG1 0x002E
160#define Sn_KPALVTR 0x002F
164#define Sn_MR_CLOSE 0x00
165#define Sn_MR_TCP 0x01
166#define Sn_MR_UDP 0x02
167#define S0_MR_MACRAW 0x04
176#define SEND_KEEP 0x22
179#define SOCK_CLOSED 0x00
180#define SOCK_INIT 0x13
181#define SOCK_LISTEN 0x14
182#define SOCK_SYNSENT 0x15
183#define SOCK_ESTABLISHED 0x17
184#define SOCK_CLOSE_WAIT 0x1C
186#define SOCK_MACRAW 0x42
198 unsigned char active;
201 unsigned char control;
202 unsigned char Common[0x40];
203 unsigned char Socket[8][0x30];
206 unsigned short listenfd_port[8];
207 unsigned char listenfd_map[8];
208 unsigned char RX_Mem[0x4000];
209 unsigned char TX_Mem[0x4000];
210 unsigned short RX_ptr[8];
211 unsigned short TX_ptr[8];
212 unsigned short RX_size[8];
213 unsigned short TX_size[8];
214 unsigned short RX_mask[8];
215 unsigned short TX_mask[8];
216 unsigned char status[8];
217 unsigned short bindp[8];
221void eth_w5500_init(
eth_w5500_t* eth,
unsigned char linkon = 1);
224void eth_w5500_set_link(
eth_w5500_t* eth,
unsigned char on);
227unsigned short eth_w5500_io(
eth_w5500_t* eth,
unsigned char mosi,
unsigned char sclk,
unsigned char scs,
Definition bitbang_spi.h:35
Definition eth_w5500.h:196