62 #if ( (_WIZCHIP_IO_MODE_ == _WIZCHIP_IO_MODE_BUS_DIR_) )
63 #if(_WIZCHIP_IO_BUS_WIDTH_ == 8)
66 #elif(_WIZCHIP_IO_BUS_WIDTH_ == 16)
69 #error "Abnoraml _WIZCHIP_IO_BUS_WIDTH_. Should be 8 or 16"
71 #elif ( (_WIZCHIP_IO_MODE_ == _WIZCHIP_IO_MODE_BUS_INDIR_) )
72 #if(_WIZCHIP_IO_BUS_WIDTH_ == 8)
77 #elif(_WIZCHIP_IO_BUS_WIDTH_ == 16)
81 #error "Abnoraml _WIZCHIP_IO_BUS_WIDTH_. Should be 8 or 16"
84 #error "Unknown _WIZCHIP_IO_MODE_ in W5300. !!!"
98 #if ( (_WIZCHIP_IO_MODE_ == _WIZCHIP_IO_MODE_BUS_DIR_) )
99 #if (_WIZCHIP_IO_BUS_WIDTH_ == 8)
102 #elif(_WIZCHIP_IO_BUS_WIDTH_ == 16)
105 #error "Abnoraml _WIZCHIP_IO_BUS_WIDTH_. Should be 8 or 16"
107 #elif ( (_WIZCHIP_IO_MODE_ == _WIZCHIP_IO_MODE_BUS_INDIR_) )
108 #if(_WIZCHIP_IO_BUS_WIDTH_ == 8)
113 #elif(_WIZCHIP_IO_BUS_WIDTH_ == 16)
117 #error "Abnoraml _WIZCHIP_IO_BUS_WIDTH_. Should be 8 or 16"
120 #error "Unknown _WIZCHIP_IO_MODE_ in W5300. !!!"
129 void setTMSR(uint8_t sn,uint8_t tmsr)
133 if(sn & 0x01) tmem = (tmem & 0xFF00) | (((uint16_t)tmsr ) & 0x00FF) ;
134 else tmem = (tmem & 0x00FF) | (((uint16_t)tmsr) << 8) ;
145 void setRMSR(uint8_t sn,uint8_t rmsr)
149 if(sn & 0x01) rmem = (rmem & 0xFF00) | (((uint16_t)rmsr ) & 0x00FF) ;
150 else rmem = (rmem & 0x00FF) | (((uint16_t)rmsr) << 8) ;
163 uint32_t free_tx_size=0;
164 uint32_t free_tx_size1=1;
169 if(free_tx_size == free_tx_size1)
break;
170 free_tx_size1 = free_tx_size;
177 uint32_t received_rx_size=0;
178 uint32_t received_rx_size1=1;
183 if(received_rx_size == received_rx_size1)
break;
184 received_rx_size1 = received_rx_size;
186 return received_rx_size + (uint32_t)((
sock_pack_info[sn] & 0x02) ? 1 : 0);
190 void wiz_send_data(uint8_t sn, uint8_t *wizdata, uint32_t len)
195 for(i = 0; i < len ; i += 2)
196 setSn_TX_FIFOR(sn, (((uint16_t)wizdata[i]) << 8) | (((uint16_t)wizdata[i+1]) & 0x00FF))
199 void wiz_recv_data(uint8_t sn, uint8_t *wizdata, uint32_t len)
206 for(i = 0; i < len; i++)
211 wizdata[i] = (uint8_t)(rd >> 8);
213 else wizdata[i] = (uint8_t)rd;
215 sock_remained_byte[sn] = (uint8_t)rd;
void wiz_recv_ignore(uint8_t sn, uint16_t len)
It discard the received data in RX memory.
void(* _write_data)(uint32_t AddrSel, iodata_t wb)
uint16_t getSn_RX_RSR(uint8_t sn)
Get Sn_RX_RSR register.
void(* _select)(void)
_WIZCHIP_ selected
void wiz_recv_data(uint8_t sn, uint8_t *wizdata, uint16_t len)
It copies data to your buffer from internal RX memory.
uint8_t WIZCHIP_READ(uint32_t AddrSel)
It reads 1 byte value from a register.
void wiz_send_data(uint8_t sn, uint8_t *wizdata, uint16_t len)
It copies data to internal TX memory.
uint16_t getSn_TX_FSR(uint8_t sn)
Get Sn_TX_FSR register.
void(* _deselect)(void)
_WIZCHIP_ deselected
#define WIZCHIP_CRITICAL_ENTER()
Enter a critical section.
iodata_t(* _read_data)(uint32_t AddrSel)
#define WIZCHIP_OFFSET_INC(ADDR, N)
Increase offset address.
#define TMS01R
TX memory size of SOCKET 0 & 1.
void setTMSR(uint8_t sn, uint8_t tmsr)
Set TMSR0 ~ TMSR7 register.
#define Sn_TX_FSR(sn)
Transmit free memory size register(R)
uint8_t getTMSR(uint8_t sn)
Get TMSR0 ~ TMSR7 register.
#define setSn_TX_FIFOR(sn, txfifo)
Set Sn_TX_FIFOR register.
uint8_t sock_pack_info[_WIZCHIP_SOCK_NUM_]
#define Sn_RX_RSR(sn)
Received data size register(R)
void WIZCHIP_WRITE(uint32_t AddrSel, uint8_t wb)
It writes 1 byte value to a register.
uint8_t getRMSR(uint8_t sn)
Get RMS01R ~ RMS67R register.
void setRMSR(uint8_t sn, uint8_t rmsr)
Set RMS01R ~ RMS67R register.
#define _WIZCHIP_SOCK_NUM_
The count of independant socket of WIZCHIP.
#define WIZCHIP_CRITICAL_EXIT()
Exit a critical section.
struct __WIZCHIP::_IF::@0 BUS
#define RMS01R
RX memory size of SOCKET 0 & 1.
WIZCHIP Config Header File.
#define getSn_RX_FIFOR(sn)
Get Sn_RX_FIFOR register.