io6Library
WIZnet Dual Stack TCP/IP Ethernet Controller Driver
Macros
Socket register

Socket register group
. More...

Macros

#define _Sn_MR_(N)   (_W6100_IO_BASE_ + (0x0000 << 8) + WIZCHIP_SREG_BLOCK(N))
 Socket Mode Register Address [R=W][0x00]. More...
 
#define _Sn_PSR_(N)   (_W6100_IO_BASE_ + (0x0004 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKET n Prefer Source IPv6 Address Register Address [R=W][0x00]. More...
 
#define _Sn_CR_(N)   (_W6100_IO_BASE_ + (0x0010 << 8) + WIZCHIP_SREG_BLOCK(N))
 Socket Command Register Address [RW,AC][0x00]. More...
 
#define _Sn_IR_(N)   (_W6100_IO_BASE_ + (0x0020 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn Interrupt Register Address [RO][0x00]. More...
 
#define _Sn_IMR_(N)   (_W6100_IO_BASE_ + (0x0024 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn Interrupt Mask Register Address [R=W][0xFF]. More...
 
#define _Sn_IRCLR_(N)   (_W6100_IO_BASE_ + (0x0028 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn Interrupt Clear Register Address [WO][0x00]. More...
 
#define _Sn_SR_(N)   (_W6100_IO_BASE_ + (0x0030 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn Status Register Address [RO][0x00]. More...
 
#define _Sn_ESR_(N)   (_W6100_IO_BASE_ + (0x0031 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn Extension Status Register Address [RO][0x00]. More...
 
#define _Sn_PNR_(N)   (_W6100_IO_BASE_ + (0x0100 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn IP Protocol Number(PN) Register Address [R/W][0x0000]. More...
 
#define _Sn_NHR_(N)   (_Sn_PNR_(N))
 Refer to _Sn_PNR_. More...
 
#define _Sn_TOSR_(N)   (_W6100_IO_BASE_ + (0x0104 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn IPv4 Type of Service(TOS) Register Address [R=W][0x00]. More...
 
#define _Sn_TTLR_(N)   (_W6100_IO_BASE_ + (0x0108 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn IP Time to live(TTL) Register Address [R=W][0x80]. More...
 
#define _Sn_HOPR_(N)   (_Sn_TTLR_(N))
 Refer to _Sn_TTLR_. More...
 
#define _Sn_FRGR_(N)   (_W6100_IO_BASE_ + (0x010C << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn Fragment Register Address [R=W][0x4000]. More...
 
#define _Sn_MSSR_(N)   (_W6100_IO_BASE_ + (0x0110 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn Maximum Segment Size(MSS) Register Address [RW][0x0000]. More...
 
#define _Sn_PORTR_(N)   (_W6100_IO_BASE_ + (0x0114 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn Source Port Register Address [R=W][0x0000]. More...
 
#define _Sn_DHAR_(N)   (_W6100_IO_BASE_ + (0x0118 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn Destination Hardware Address Register Address [RW][00:00:00:00:00:00]. More...
 
#define _Sn_DIPR_(N)   (_W6100_IO_BASE_ + (0x0120 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn Destination IPv4 Address Register Address [RW][0.0.0.0]. More...
 
#define _Sn_DIP4R_(N)   (_Sn_DIPR_(N))
 Refer to _Sn_DIPR_. More...
 
#define _Sn_DIP6R_(N)   (_W6100_IO_BASE_ + (0x0130 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn Destination IPv6 Address Register Address [RW][::]. More...
 
#define _Sn_DPORTR_(N)   (_W6100_IO_BASE_ + (0x0140 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn Destination Port Register Address [RW][0x0000]. More...
 
#define _Sn_MR2_(N)   (_W6100_IO_BASE_ + (0x0144 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn Mode Register 2 Address [R=W][0x00]. More...
 
#define _Sn_RTR_(N)   (_W6100_IO_BASE_ + (0x0180 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn Retransmission Time Register Address [R=W][0x0000]. More...
 
#define _Sn_RCR_(N)   (_W6100_IO_BASE_ + (0x0184 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn Retransmission Count Register Address [R=W][0x00]. More...
 
#define _Sn_KPALVTR_(N)   (_W6100_IO_BASE_ + (0x0188 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn Keep Alive Time Register Address [R=W][0x00]. More...
 
#define _Sn_TX_BSR_(N)   (_W6100_IO_BASE_ + (0x0200 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn TX Buffer Size Register Address [R=W][0x02]. More...
 
#define _Sn_TX_FSR_(N)   (_W6100_IO_BASE_ + (0x0204 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn TX Free Buffer Size Register Address [RO][0x0800]. More...
 
#define _Sn_TX_RD_(N)   (_W6100_IO_BASE_ + (0x0208 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKET TX Memory Read Pointer Register Address[R][0x0000]. More...
 
#define _Sn_TX_WR_(N)   (_W6100_IO_BASE_ + (0x020C << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn TX Memory Write Pointer Register Address [RW][0x0000]. More...
 
#define _Sn_RX_BSR_(N)   (_W6100_IO_BASE_ + (0x0220 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn RX Buffer Size Register Address [R=W][0x02]. More...
 
#define _Sn_RX_RSR_(N)   (_W6100_IO_BASE_ + (0x0224 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn RX Received Size Register Address [RO][0x0000]. More...
 
#define _Sn_RX_RD_(N)   (_W6100_IO_BASE_ + (0x0228 << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKET RX Memory Read Pointer Register Address[R][0x0000]. More...
 
#define _Sn_RX_WR_(N)   (_W6100_IO_BASE_ + (0x022C << 8) + WIZCHIP_SREG_BLOCK(N))
 SOCKETn TX Memory Write Pointer Register Address [RW][0x0000]. More...
 

Detailed Description

Socket register group
.

SOCKETn registers configure and control SOCKETn which is necessary to data communication.

See also
SOCKETn Control : _Sn_MR_, _Sn_MR2_, _Sn_CR_, _Sn_IR_, _Sn_IRCLR_, _Sn_IMR_, _Sn_PSR_
SOCKETn Information : _Sn_SR_, _Sn_ESR_, _Sn_PORTR_, _Sn_DHAR_, _Sn_DIPR_, _Sn_DIP6R_, _Sn_DPORTR_
SOCKETn Retransmission : _Sn_RTR_, _Sn_RCR_
Internet protocol : _Sn_MSSR_, _Sn_TOSR_, _Sn_TTLR_, _Sn_FRGR_
Data communication : _Sn_RX_BSR_, _Sn_TX_BSR_, _Sn_TX_FSR_, _Sn_TX_RD_, _Sn_TX_WR_, _Sn_RX_RSR_, _Sn_RX_RD_, _Sn_RX_WR_

Macro Definition Documentation

◆ _Sn_MR_

#define _Sn_MR_ (   N)    (_W6100_IO_BASE_ + (0x0000 << 8) + WIZCHIP_SREG_BLOCK(N))

Socket Mode Register Address [R=W][0x00].

_Sn_MR_ sets the option or protocol type of SOCKETn before Sn_CR_OPEN is performed.

Each bit of _Sn_MR_ is defined as the following.

7 6 5 4 3 ~ 0
MULTI/MF BRDB/FPSH ND/MC/SMB/MMB UNIB/MMB6 P[3:0]
Note
MACRAW mode should be only used in Socket 0.
See also
_Sn_CR_, Sn_CR_OPEN, _Sn_SR_, _Sn_MR2_
getSn_MR(), setSn_MR(), getSn_CR(), setSn_CR(), getSn_SR(), getSn_MR2(), setSn_MR2()

Definition at line 987 of file w6100.h.

◆ _Sn_PSR_

#define _Sn_PSR_ (   N)    (_W6100_IO_BASE_ + (0x0004 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKET n Prefer Source IPv6 Address Register Address [R=W][0x00].

_Sn_PSR_ select the Source IPv6 Address to transmit a packet by _Sn_CR_. This function is same as _SLPSR_.

Definition at line 999 of file w6100.h.

◆ _Sn_CR_

#define _Sn_CR_ (   N)    (_W6100_IO_BASE_ + (0x0010 << 8) + WIZCHIP_SREG_BLOCK(N))

Socket Command Register Address [RW,AC][0x00].

_Sn_CR_ is used to set the command for SOCKET n such as OPEN, CLOSE, CONNECT, LISTEN, SEND, and RECEIVE.
It is automatically cleared to 0x00 after the command is recognized by _WIZCHIP_.
Even though _Sn_CR_ is cleared to 0x00, the command is still being processed.
To check whether the command is completed or not, please check the _Sn_IR_ or _Sn_SR_.

Note
These commands should be exclusive executed.
That is, the other command can not executed when one command is not cleared yet.
See also
_Sn_IR_, _Sn_IRCLR_, Sn_IMR_, _SIR_, _Sn_SR_
getSn_CR(), setSn_CR(), getSn_IR(), setSn_IRCLR(), getSn_IMR(), setSn_IMR(), getSIR(), getSn_SR()

Definition at line 1022 of file w6100.h.

◆ _Sn_IR_

#define _Sn_IR_ (   N)    (_W6100_IO_BASE_ + (0x0020 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn Interrupt Register Address [RO][0x00].

_Sn_IR_ gets the status of SOCKETn interrupt such as establishment, termination, receiving data, timeout.
If SOCKETn interrupt occurs and the n-th bit of _SIMR_ is set, then SIR_INT(n) is set.
In order to clear the _Sn_IR_ bit, Set the corresponding bit of _Sn_IRCLR_ to 1.
If all _Sn_IR_ bits are cleared, the SIR_INT(n) is automatically cleared.

7 ~ 5 4 3 2 1 0
Reserved SENDOK TIMEOUT RECV DISCON CON
See also
_Sn_IRCLR_, _Sn_IMR_, _SIR_, _SIMR_
getSn_IR(), setSn_IRCLR(), getSn_IMR(), setSn_IMR(), getSIR(), getSIMR(), setSIMR()

Definition at line 1043 of file w6100.h.

◆ _Sn_IMR_

#define _Sn_IMR_ (   N)    (_W6100_IO_BASE_ + (0x0024 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn Interrupt Mask Register Address [R=W][0xFF].

_Sn_IMR_ is used to mask interrupts of _Sn_IR_.

See also
_Sn_IR_, _Sn_IRCR_, _SIR_, _SIMR_
getSn_IMR(), setSn_IMR(), getSn_IR(), setSn_IRCLR(), getSIR(), getSIMR(), setSIMR()

Definition at line 1051 of file w6100.h.

◆ _Sn_IRCLR_

#define _Sn_IRCLR_ (   N)    (_W6100_IO_BASE_ + (0x0028 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn Interrupt Clear Register Address [WO][0x00].

_Sn_IRCLR_ clears _Sn_IR_

See also
_Sn_IR_, _SIR_, _SIMR_
setSn_IRCLR(), getSn_IR(), getSIR(), getSIMR(), setSIMR()

Definition at line 1059 of file w6100.h.

◆ _Sn_SR_

#define _Sn_SR_ (   N)    (_W6100_IO_BASE_ + (0x0030 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn Status Register Address [RO][0x00].

_Sn_SR_ indicates the status of SOCKETn.
The status of SOCKETn can be changed by _Sn_CR_, some TCP packets such as SYN, FIN, RST packet, or Sn_IR_TIMEOUT.

See also
_Sn_CR_, _Sn_IR_, _Sn_IRCLR_, Sn_IR_TIMEOUT
getSn_SR(), getSn_CR(), setSn_CR(), getSn_IR(), setSn_IRCLR()
<SOCKETn Status Transition>

Definition at line 1092 of file w6100.h.

◆ _Sn_ESR_

#define _Sn_ESR_ (   N)    (_W6100_IO_BASE_ + (0x0031 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn Extension Status Register Address [RO][0x00].

_Sn_ESR_ indicates the connected client IP address information such as IP version, IPv6 address type(LLA or GUA),
and TCP operation mode such as TCP SERVER and TCP CLIENT

7 ~ 3 2 1 0
Reserved TCPM TCPOP IP6T
Note
It is valid only on TCP mode such as Sn_MR_TCP4, Sn_MR_TCP6, and Sn_MR_TCPD.
See also
_Sn_MR_, _Sn_PSR_
getSn_ESR(), getSn_MR(), setSn_MR(), getSn_PSR(), setSn_PSR()

Definition at line 1110 of file w6100.h.

◆ _Sn_PNR_

#define _Sn_PNR_ (   N)    (_W6100_IO_BASE_ + (0x0100 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn IP Protocol Number(PN) Register Address [R/W][0x0000].

_Sn_PNR_ that sets the protocol number/next header field of the IPv4/IPv6 header at the IP layer.

Note
It is valid only in IPRAW mode such as Sn_MR_IPRAW4 and Sn_MR_IPRAW6.
It is set before Sn_CR_OPEN is performed.
See also
_Sn_NHR_, _Sn_MR_, Sn_CR_OPEN
getSn_PNR(), setSn_PNR(), getSn_NHR(), setSn_NHR(), getSn_MR(), setSn_MR(), getSn_CR(), setSn_CR()

Definition at line 1120 of file w6100.h.

◆ _Sn_NHR_

#define _Sn_NHR_ (   N)    (_Sn_PNR_(N))

Refer to _Sn_PNR_.

Definition at line 1121 of file w6100.h.

◆ _Sn_TOSR_

#define _Sn_TOSR_ (   N)    (_W6100_IO_BASE_ + (0x0104 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn IPv4 Type of Service(TOS) Register Address [R=W][0x00].

_Sn_TOSR_ sets the TOS(Type Of Service) field in IPv4 Header.

See also
getSn_TOSR(), setSn_TOSR()

Definition at line 1128 of file w6100.h.

◆ _Sn_TTLR_

#define _Sn_TTLR_ (   N)    (_W6100_IO_BASE_ + (0x0108 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn IP Time to live(TTL) Register Address [R=W][0x80].

_Sn_TTLR_ sets the TTL(Time To Live)/HOP(Hop Limit) field in IPv4/IPv6 header at the IP layer.

See also
_Sn_HOPR_
getSn_TTLR(), setSn_TTLR(), getSn_HOPR(), setSn_HOPR()

Definition at line 1136 of file w6100.h.

◆ _Sn_HOPR_

#define _Sn_HOPR_ (   N)    (_Sn_TTLR_(N))

Refer to _Sn_TTLR_.

Definition at line 1137 of file w6100.h.

◆ _Sn_FRGR_

#define _Sn_FRGR_ (   N)    (_W6100_IO_BASE_ + (0x010C << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn Fragment Register Address [R=W][0x4000].

_Sn_FRGR_ sets the fragment flag & offset in IPv4 header.

Note
_WIZCHIP_ can not support IP fragment & re-assembly.
So It is not recommended to set _Sn_FRGR_ to any other value.
See also
getSn_FRGR(), setSn_FRGR()

Definition at line 1145 of file w6100.h.

◆ _Sn_MSSR_

#define _Sn_MSSR_ (   N)    (_W6100_IO_BASE_ + (0x0110 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn Maximum Segment Size(MSS) Register Address [RW][0x0000].

_Sn_MSSR_ sets or gets the MTU(Maximum Transfer Unit) of SOCKETn.
The MTU of each protocol is as following.

_Sn_MR_[3:0] NETMR2_PPPoE = 0 NETMR2_PPPoE = '1'
Sn_MR_TCP4 1 ~ 1460 1 ~ 1452
Sn_MR_TCP6 1 ~ 1440 1 ~ 1432
Sn_MR_UDP4 1 ~ 1472 1 ~ 1464
Sn_MR_UDP6 1 ~ 1452 1 ~ 1444
Sn_MR_IPRAW4 1 ~ 1480 1 ~ 1472
Sn_MR_IPRAW6 1 ~ 1460 1 ~ 1452
Sn_MR_MACRAW 1 ~ 1514
Note
It is not set exceeding the MTU for each protocol of SOCKETn even if _Sn_MSSR_ is set over the MTU.
See also
_Sn_MR_, NETMR2_PPPoE
getSn_MSSR(), setSn_MSSR(), getSn_MR(), setSn_MR(), getNETMR2(), setNETMR2()

Definition at line 1166 of file w6100.h.

◆ _Sn_PORTR_

#define _Sn_PORTR_ (   N)    (_W6100_IO_BASE_ + (0x0114 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn Source Port Register Address [R=W][0x0000].

_Sn_PORTR_ sets the source port number of SOCKETn .

Note
It is valid in TCP(Sn_MR_TCP4, Sn_MR_TCP6, Sn_MR_TCPD) and UDP(Sn_MR_UDP4, Sn_MR_UDP6, Sn_MR_UDPD) mode.
It should be set before Sn_CR_OPEN is performed.
See also
_Sn_MR_, Sn_CR_OPEN
getSn_PORTR(), getSn_PORTR(), getSn_MR(), setSn_MR(), getSn_CR(), setSn_CR()

Definition at line 1176 of file w6100.h.

◆ _Sn_DHAR_

#define _Sn_DHAR_ (   N)    (_W6100_IO_BASE_ + (0x0118 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn Destination Hardware Address Register Address [RW][00:00:00:00:00:00].

_Sn_DHAR_ sets or gets the destination hardware address of SOCKETn.

Definition at line 1190 of file w6100.h.

◆ _Sn_DIPR_

#define _Sn_DIPR_ (   N)    (_W6100_IO_BASE_ + (0x0120 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn Destination IPv4 Address Register Address [RW][0.0.0.0].

_Sn_DIPR_(= _Sn_DIP4R_) sets or gets the destination IPv4 address of SOCKETn.

Definition at line 1204 of file w6100.h.

◆ _Sn_DIP4R_

#define _Sn_DIP4R_ (   N)    (_Sn_DIPR_(N))

Refer to _Sn_DIPR_.

Definition at line 1205 of file w6100.h.

◆ _Sn_DIP6R_

#define _Sn_DIP6R_ (   N)    (_W6100_IO_BASE_ + (0x0130 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn Destination IPv6 Address Register Address [RW][::].

_Sn_DIP6R_ sets or gets the destination IPv6 address of SOCKETn.

Definition at line 1219 of file w6100.h.

◆ _Sn_DPORTR_

#define _Sn_DPORTR_ (   N)    (_W6100_IO_BASE_ + (0x0140 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn Destination Port Register Address [RW][0x0000].

_Sn_DPORTR_ sets or gets the destination port number of SOCKETn.

Note
It is valid SOCKETn is opened with Sn_MR_TCP4, Sn_MR_TCP6, Sn_MR_TCPD, Sn_MR_UDP4, Sn_MR_UDP4, and Sn_MR_UDPD.
It should be set before OPEN command is ordered.
See also
_Sn_MR_, _Sn_CR_, _Sn_SR_
getSn_DPORTR(), getSn_DPORTR(), getSn_MR(), setSn_MR(), getSn_CR(), setSn_CR(), getSn_SR()

Definition at line 1236 of file w6100.h.

◆ _Sn_MR2_

#define _Sn_MR2_ (   N)    (_W6100_IO_BASE_ + (0x0144 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn Mode Register 2 Address [R=W][0x00].

_Sn_MR2_ sets the option of SOCKETn with _Sn_MR_, before Sn_CR_OPEN is performed.
Each bit of _Sn_MR2_ is defined as the following.

7 ~ 2 1 0
Reserved DHAM FARP

Definition at line 1251 of file w6100.h.

◆ _Sn_RTR_

#define _Sn_RTR_ (   N)    (_W6100_IO_BASE_ + (0x0180 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn Retransmission Time Register Address [R=W][0x0000].

_Sn_RTR_ sets the timeout value of packet to be retransmitted by _SLCR_.

Note
It should be set before Sn_CR_OPEN is performed.
It is initialized as _RTR_ if you do not set it to none-zero value.
See also
_RTR_, _Sn_CR_
getSn_RTR(), setSn_RTR(), getSn_CR(), setSn_CR()

Definition at line 1262 of file w6100.h.

◆ _Sn_RCR_

#define _Sn_RCR_ (   N)    (_W6100_IO_BASE_ + (0x0184 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn Retransmission Count Register Address [R=W][0x00].

_Sn_RCR_ sets the retry count value of packet to be retransmitted by _SLCR_.

Note
It should be set before Sn_CR_OPEN is performed.
It is initialized as _RTR_ if you do not set it to any none-zero value.
See also
_RTR_, _Sn_CR_
getSn_RTR(), setSn_RTR(), getSn_CR(), setSn_CR()

Definition at line 1272 of file w6100.h.

◆ _Sn_KPALVTR_

#define _Sn_KPALVTR_ (   N)    (_W6100_IO_BASE_ + (0x0188 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn Keep Alive Time Register Address [R=W][0x00].

_Sn_KPALVTR_ sets the auto-retransmission time of KA(Keep Alive) packet.
If the destination can not respond to the KA packet during the time set by _Sn_KPALVTR_,
the connection is terminated, Sn_IR_TIMEOUT is set and then _Sn_SR_ is changed SOCK_CLOSED.
Before the time is expierd, if the destination sends a KA/ACK packet or any packet, the connection is still valid,
_Sn_SR_ remained at SOCK_ESTABLISHED.

Note
It is valid only after sending data over 1 byte in TCP mode such as Sn_MR_TCP4, Sn_MR_TCP6, and Sn_MR_TCPD.
If it is set to 0, KA packet can be sent by Sn_CR_SEND_KEEP.
See also
Sn_CR_SEND_KEEP, Sn_IR_TIMEOUT, Sn_IRCLR, Sn_SR, Sn_MR
getSn_KPALVTR(), setSn_KPALVTR(), getSn_IR(), setSn_IRCLR(), getSn_SR(), getSn_MR(), setSn_MR()

Definition at line 1286 of file w6100.h.

◆ _Sn_TX_BSR_

#define _Sn_TX_BSR_ (   N)    (_W6100_IO_BASE_ + (0x0200 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn TX Buffer Size Register Address [R=W][0x02].

_Sn_TX_BSR_ sets the TX buffer size of SOCKETn in the 16KB TX memory.
It can be set only with 0,1,2,4,8, and 16K bytes.

Note
The 16KB TX memory is allocated as many as _Sn_TX_BSR_ sequentially from SOCKET0 to SOCKETn(Here, 0 <= n <= _WIZCHIP_SOCK_NUM_ - 1).
The total sum of Sn_TX_BSR can not be exceed 16KB of TX memory.
If the total size is exceeded, SOCKETn can't be normally sent data to a destination.
See also
_Sn_RX_BSR_
getSn_TX_BSR(), setSn_TX_BSR(), getSn_TXBUF_SIZE(), setSn_TXBUF_SIZE(), getSn_TxMAX(), setSn_TX_BSR(), getSn_RX_BSR(), setSn_RX_BSR()

Definition at line 1298 of file w6100.h.

◆ _Sn_TX_FSR_

#define _Sn_TX_FSR_ (   N)    (_W6100_IO_BASE_ + (0x0204 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn TX Free Buffer Size Register Address [RO][0x0800].

_Sn_TX_FSR_ gets the transmittable free size of SOCKETn TX buffer.

Note
Data should not be saved bigger than it because the data overwrites the previous saved data not to be sent yet.
Therefore, Check it before saving the data to the SOCKETn TX buffer.
If the data size is equal or smaller than it, transmit the data with Sn_CR_SEND / Sn_CR_SEND6 after saving the data in SOCKETn TX buffer.
If the data size is greater than it, transmit the data after dividing into it and saving in the SOCKETn TX buffer.

See also
_Sn_RX_RSR_, _Sn_TX_WR_, _Sn_TX_RD_, _Sn_CR_
getSn_TX_FSR(), getSn_TX_WR(), getSn_TX_WR(), getSn_TX_RD(), getSn_CR(), setSn_CR()

Definition at line 1315 of file w6100.h.

◆ _Sn_TX_RD_

#define _Sn_TX_RD_ (   N)    (_W6100_IO_BASE_ + (0x0208 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKET TX Memory Read Pointer Register Address[R][0x0000].

_Sn_TX_RD_ gets the start pointer of data to be sent by Sn_CR_SEND.
Sn_CR_SEND / Sn_CR_SEND6 starts to transmit the saved data from _Sn_TX_RD_ to _Sn_TX_WR_ in the SOCKETn TX Buffer,
and when Sn_IR_SENDOK is set, It is automatically increased to equal _Sn_TX_WR_.

Note
It is initialized by Sn_CR_OPEN, But, In TCP mode such as Sn_MR_TCP4, Sn_MR_TCP6, and Sn_MR_TCPD,
it is re-initialized when the TCP connection is completed.
If it exceeds the maximum value 0xFFFF, (that is, it is greater than 0x10000 and the carry bit occurs),
then the carry bit is ignored and it automatically is updated with its the lower 16bits value.
See also
_Sn_TX_WR_, _Sn_TX_FSR_, _Sn_CR_, _Sn_IR_, _Sn_IRCLR_, _Sn_MR_
getSn_TX_RD(), getSn_TX_WR(), setSn_TX_WR(), getSn_TX_FSR(), getSn_CR(), setSn_CR(), getSn_IR(), setSn_IRCLR(), getSn_MR(), setSn_MR()

Definition at line 1329 of file w6100.h.

◆ _Sn_TX_WR_

#define _Sn_TX_WR_ (   N)    (_W6100_IO_BASE_ + (0x020C << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn TX Memory Write Pointer Register Address [RW][0x0000].

_Sn_TX_WR_ gets the start pointer of data to be saved in the SOCKETn TX buffer,
or sets the end pointer of data to be sent by Sn_CR_SEND.
If you have completed to save the data to be sent in the SOCKETn TX buffer, increase it as many as the saved size of data before Sn_CR_SEND is performed.
Sn_CR_SEND starts to transmit the saved data from _Sn_TX_RD_ to _Sn_TX_WR_ in the SOCKETn TX Buffer,
and when Sn_IR_SENDOK is set, _Sn_TX_RD_ is automatically increased to equal it.

Note
It is initialized by Sn_CR_OPEN.
But, In TCP mode such as Sn_MR_TCP4, Sn_MR_TCP6, and Sn_MR_TCPD,
it is re-initialized when the TCP connection is completed.
The size of data to be saved can't exceed _Sn_TX_FSR_.
If it exceeds the maximum value 0xFFFF(that is, it is greater than 0x10000 and the carry bit occurs),
then ignore the carry bit and update it with its lower 16bits value.
See also
_Sn_TX_RD_, _Sn_TX_FSR_, _Sn_CR_, _Sn_IR_, _Sn_IRCLR_, _Sn_MR_
getSn_TX_WR(), setSn_TX_WR(), getSn_TX_RD(), getSn_TX_FSR(), getSn_CR(), setSn_CR(), getSn_IR(), setSn_IRCLR(), getSn_MR(), setSn_MR()

Definition at line 1349 of file w6100.h.

◆ _Sn_RX_BSR_

#define _Sn_RX_BSR_ (   N)    (_W6100_IO_BASE_ + (0x0220 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn RX Buffer Size Register Address [R=W][0x02].

_Sn_RX_BSR_ sets the RX buffer size of SOCKETn in the 16KB RX memory.
It can be set only with 0,1,2,4,8, and 16K bytes.

Note
The 16KB RX memory is allocated as many as _Sn_RX_BSR_ sequentially from SOCKET0 to SOCKETn(Here, 0 <= n <= _WIZCHIP_SOCK_NUM_ - 1).
The total sum of _Sn_RX_BSR_ can not be exceed 16KB of RX memory.
If the total size is exceeded, SOCKETn can't be normally received data from a destination.
See also
_Sn_RX_BSR_
getSn_TX_BSR(), setSn_TX_BSR(), getSn_RXBUF_SIZE(), setSn_RXBUF_SIZE(), getSn_RxMAX(), getSn_RX_BSR(), setSn_RX_BSR()

Definition at line 1361 of file w6100.h.

◆ _Sn_RX_RSR_

#define _Sn_RX_RSR_ (   N)    (_W6100_IO_BASE_ + (0x0224 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn RX Received Size Register Address [RO][0x0000].

_Sn_RX_RSR_ gets the received data size of SOCKETn RX buffer.

Note
The real received data size maybe smaller than it,
because it maybe included the size of 'PACKET NFO' such like as
the destination IP address, destination port number and data size of the received DATA PACKET.
Do not read bigger data than _Sn_RX_RSR_.
It is automatically increased by the absolute difference between _Sn_RX_WR_ and _Sn_RX_RD_
after Sn_CR_RECV is performed.
See also
_Sn_RX_RSR_, _Sn_TX_WR_, _Sn_TX_RD_, _Sn_CR_, _Sn_TX_FSR_
getSn_RX_RSR(), getSn_TX_WR(), getSn_TX_WR(), getSn_CR(), setSn_CR(), getSn_TX_FSR()

Definition at line 1375 of file w6100.h.

◆ _Sn_RX_RD_

#define _Sn_RX_RD_ (   N)    (_W6100_IO_BASE_ + (0x0228 << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKET RX Memory Read Pointer Register Address[R][0x0000].

_Sn_RX_RD_ gets the start pointer of the received data in the SOCKETn RX buffer,
or sets the end data pointer of the read completed data by Sn_CR_RECV.
You can read the received data from it to _Sn_RX_WR_ in the SOCKET RX buffer.
After completing to read data, you should increase it as many as the read size before Sn_CR_RECV is performed.

Note
It is initialized by Sn_CR_OPEN, But, In TCP mode such as Sn_MR_TCP4, Sn_MR_TCP6, and Sn_MR_TCPD,
it is re-initialized when the TCP connection is completed.
If it exceeds the maximum value 0xFFFF, (that is, it is greater than 0x10000 and the carry bit occurs),
Ignore the carry bit and update with its the lower 16bits value.
See also
_Sn_RX_WR_, _Sn_RX_RSR_, _Sn_CR_, _Sn_IR_, _Sn_IRCLR_, _Sn_MR_
getSn_RX_WR(), setSn_RX_RD(), getSn_RX_WR(), getSn_TX_FSR(), getSn_CR(), setSn_CR(), getSn_IR(), setSn_IRCLR(), getSn_MR(), setSn_MR()

Definition at line 1390 of file w6100.h.

◆ _Sn_RX_WR_

#define _Sn_RX_WR_ (   N)    (_W6100_IO_BASE_ + (0x022C << 8) + WIZCHIP_SREG_BLOCK(N))

SOCKETn TX Memory Write Pointer Register Address [RW][0x0000].

_Sn_TX_WR_ gets the end pointer of the data that has been completely received in the SOCKETn RX buffer.
Whenever a data has been completely received from a destination,
It is automatically increased as many as the sum size of the received data and the 'PACKET INFO'.
You can read the recevied data from _Sn_RX_RD_ to it in the SOCKET RX buffer.

Note
It is initialized by Sn_CR_OPEN. But, In TCP mode such as Sn_MR_TCP4, Sn_MR_TCP6, and Sn_MR_TCPD,
it is re-initialized when the TCP connection is completed.
If it exceeds the maximum value 0xFFFF(that is, it is greater than 0x10000 and the carry bit occurs),
then ignore the carry bit and update it with its lower 16bits value.
See also
_Sn_TX_RD_, _Sn_TX_FSR_, _Sn_CR_, _Sn_IR_, Sn_IRCLR_, _Sn_MR_
getSn_TX_WR(), setSn_TX_WR(), getSn_TX_RD(), getSn_TX_FSR(), getSn_CR(), setSn_CR(), getSn_IR(), setSn_IRCLR(), getSn_MR(), setSn_MR()

Definition at line 1405 of file w6100.h.