Socket APIs: Common register

Wiznet Socket API

Common register

Common register group
It set the basic for the networking
It set the configuration such as interrupt, network information, ICMP, etc. More...

Macros

#define MR   (_WIZCHIP_IO_BASE_)
 Mode Register address(R/W)
MR is used for S/W reset, ping block mode, PPPoE mode and etc. More...
 
#define IR   (_W5300_IO_BASE_ + 0x02)
 Interrupt Register(R/W) More...
 
#define _IMR_   (_W5300_IO_BASE_ + 0x04)
 Socket Interrupt Mask Register(R/W) More...
 
#define SHAR   (_W5300_IO_BASE_ + 0x08)
 Source MAC Register address(R/W) More...
 
#define GAR   (_W5300_IO_BASE_ + 0x10)
 Gateway IP Register address(R/W) More...
 
#define SUBR   (_W5300_IO_BASE_ + 0x14)
 Subnet mask Register address(R/W) More...
 
#define SIPR   (_W5300_IO_BASE_ + 0x18)
 Source IP Register address(R/W) More...
 
#define _RTR_   (_W5300_IO_BASE_ + 0x1C)
 Timeout register address( 1 is 100us )(R/W) More...
 
#define _RCR_   (_W5300_IO_BASE_ + 0x1E)
 Retry count register(R/W) More...
 
#define TMS01R   (_W5300_IO_BASE_ + 0x20)
 TX memory size of SOCKET 0 & 1. More...
 
#define TMS23R   (TMS01R + 2)
 TX memory size of SOCKET 2 & 3. More...
 
#define TMS45R   (TMS01R + 4)
 TX memory size of SOCKET 4 & 5. More...
 
#define TMS67R   (TMS01R + 6)
 TX memory size of SOCKET 6 & 7. More...
 
#define TMSR0   TMS01R
 TX memory size of SOCKET 0. More...
 
#define TMSR1   (TMSR0 + 1)
 TX memory size of SOCKET 1. More...
 
#define TMSR2   (TMSR0 + 2)
 TX memory size of SOCKET 2. More...
 
#define TMSR3   (TMSR0 + 3)
 TX memory size of SOCKET 3. More...
 
#define TMSR4   (TMSR0 + 4)
 TX memory size of SOCKET 4. More...
 
#define TMSR5   (TMSR0 + 5)
 TX memory size of SOCKET 5. More...
 
#define TMSR6   (TMSR0 + 6)
 TX memory size of SOCKET 6. More...
 
#define TMSR7   (TMSR0 + 7)
 TX memory size of SOCKET 7. More...
 
#define RMS01R   (_W5300_IO_BASE_ + 0x28)
 RX memory size of SOCKET 0 & 1. More...
 
#define RMS23R   (RMS01R + 2)
 RX memory size of SOCKET 2 & 3. More...
 
#define RMS45R   (RMS01R + 4)
 RX memory size of SOCKET 4 & 5. More...
 
#define RMS67R   (RMS01R + 6)
 RX memory size of SOCKET 6 & 7. More...
 
#define RMSR0   RMS01R
 RX memory size of SOCKET 0. More...
 
#define RMSR1   (RMSR0 + 1)
 RX memory size of SOCKET 1. More...
 
#define RMSR3   (RMSR0 + 3)
 RX memory size of SOCKET 3. More...
 
#define RMSR4   (RMSR0 + 4)
 RX memory size of SOCKET 4. More...
 
#define RMSR5   (RMSR0 + 5)
 RX memory size of SOCKET 5. More...
 
#define RMSR6   (RMSR0 + 6)
 RX memory size of SOCKET 6. More...
 
#define RMSR7   (RMSR0 + 7)
 RX memory size of SOCKET 7. More...
 
#define MTYPER   (_W5300_IO_BASE_ + 0x30)
 Memory Type Register. More...
 
#define PATR   (_W5300_IO_BASE_ + 0x32)
 PPPoE Authentication Type register. More...
 
#define PTIMER   (_W5300_IO_BASE_ + 0x36)
 PPP Link Control Protocol Request Timer Register. More...
 
#define PMAGICR   (_W5300_IO_BASE_ + 0x38)
 PPP LCP magic number register. More...
 
#define PSIDR   (_W5300_IO_BASE_ + 0x3C)
 PPPoE session ID register. More...
 
#define PDHAR   (_W5300_IO_BASE_ + 0x40)
 PPPoE destination hardware address register. More...
 
#define UIPR   (_W5300_IO_BASE_ + 0x48)
 Unreachable IP address register. More...
 
#define UPORTR   (_W5300_IO_BASE_ + 0x4C)
 Unreachable port number register. More...
 
#define FMTUR   (_W5300_IO_BASE_ + 0x4E)
 Fragment MTU register. More...
 
#define Pn_BRDYR(n)   (_W5300_IO_BASE_ + 0x60 + n*4)
 PIN 'BRDYn' configure register. More...
 
#define Pn_BDPTHR(n)   (_W5300_IO_BASE_ + 0x60 + n*4 + 2)
 PIN 'BRDYn' buffer depth Register. More...
 
#define IDR   (_W5300_IO_BASE_ + 0xFE)
 W5300 identification register. More...
 

Detailed Description

Common register group
It set the basic for the networking
It set the configuration such as interrupt, network information, ICMP, etc.

See also
MR : Mode register.
GAR, SUBR, SHAR, SIPR : Network Configuration
IR, IMR : Interrupt.
MTYPER, TMS01R,TMS23R, TMS45R, TMS67R,RMS01R,RMS23R, RMS45R, RMS67R : Socket TX/RX memory
RTR, RCR : Data retransmission.
PTIMER, PMAGIC, PSID, PDHAR : PPPoE.
UIPR, UPORTR, FMTUR : ICMP message.
Pn_BRDYR, Pn_BDPTHR, IDR : etc.

Macro Definition Documentation

#define MR   (_WIZCHIP_IO_BASE_)

Mode Register address(R/W)
MR is used for S/W reset, ping block mode, PPPoE mode and etc.

Each bit of MR defined as follows.

15 14 13 12 11 10 9 8
DBW MPF WDFRDF Reserved FS
7 6 5 4 3 2 1 0
RST Reserved WOL PB PPPoE Reserved FARP Reserved
  • MR_DBW : Data bus width (0 : 8 Bit, 1 : 16 Bit), Read Only
  • MR_MPF : Received a Pause Frame from MAC layer (0 : Normal Frame, 1 : Pause Frame), Read Only
  • MR_WDF : Write Data Fetch time (When CS signal is low, W5300 Fetch a written data by Host after PLL_CLK * MR_WDF)
  • MR_RDH : Read Data Hold time (0 : No use data hold time, 1 : Use data hold time, 2 PLL_CLK)
  • MR_FS : FIFO Swap (0 : Disable Swap, 1 : Enable Swap)
  • MR_RST : Reset
  • MR_WOL : Wake on LAN
  • MR_PB : Ping block
  • MR_PPPOE : PPPoE mode
  • MR_FARP : Force ARP mode

Definition at line 224 of file w5300.h.

#define IR   (_W5300_IO_BASE_ + 0x02)

Interrupt Register(R/W)

IR indicates the interrupt status. Each bit of IR will be still until the bit will be written to by the host. If IR is not equal to 0x0000 INTn PIN is asserted to low until it is 0x0000

Each bit of IR defined as follows.

15 14 13 12 11 10 9 8
IPCF DPUR PPPT FMTU Reserved Reserved Reserved Reserved
7 6 5 4 3 2 1 0
S7_INT S6_INT S5_INT S4_INT S3_INT S2_INT S1_INT S0_INT
Note
: In W5300, IR is operated same as IR and SIR in other WIZCHIP(5100,5200,W5500)

Definition at line 246 of file w5300.h.

#define _IMR_   (_W5300_IO_BASE_ + 0x04)

Socket Interrupt Mask Register(R/W)

Each bit of IMR corresponds to each bit of IR. When a bit of IMR is and the corresponding bit of IR is Interrupt will be issued. In other words, if a bit of IMR, an interrupt will be not issued even if the corresponding bit of IR is set

Note
: In W5300, IMR is operated same as IMR and SIMR in other WIZCHIP(5100,5200,W5500)

Definition at line 256 of file w5300.h.

#define SHAR   (_W5300_IO_BASE_ + 0x08)

Source MAC Register address(R/W)

SHAR configures the source hardware address.

Definition at line 267 of file w5300.h.

#define GAR   (_W5300_IO_BASE_ + 0x10)

Gateway IP Register address(R/W)

GAR configures the default gateway address.

Definition at line 275 of file w5300.h.

#define SUBR   (_W5300_IO_BASE_ + 0x14)

Subnet mask Register address(R/W)

SUBR configures the subnet mask address.

Definition at line 282 of file w5300.h.

#define SIPR   (_W5300_IO_BASE_ + 0x18)

Source IP Register address(R/W)

SIPR configures the source IP address.

Definition at line 289 of file w5300.h.

#define _RTR_   (_W5300_IO_BASE_ + 0x1C)

Timeout register address( 1 is 100us )(R/W)

RTR configures the retransmission timeout period. The unit of timeout period is 100us and the default of RTR is x07D0. And so the default timeout period is 200ms(100us X 2000). During the time configured by RTR, W5300 waits for the peer response to the packet that is transmitted by Sn_CR (CONNECT, DISCON, CLOSE, SEND, SEND_MAC, SEND_KEEP command). If the peer does not respond within the RTR time, W5300 retransmits the packet or issues timeout.

Definition at line 299 of file w5300.h.

#define _RCR_   (_W5300_IO_BASE_ + 0x1E)

Retry count register(R/W)

RCR configures the number of time of retransmission. When retransmission occurs as many as ref RCR+1 Timeout interrupt is issued (Sn_IR_TIMEOUT = '1').

Definition at line 307 of file w5300.h.

#define TMS01R   (_W5300_IO_BASE_ + 0x20)

TX memory size of SOCKET 0 & 1.

TMS01R configures the TX buffer block size of SOCKET 0 & 1. The default value is configured with 8KB and can be configure from 0 to 64KB with unit 1KB. But the sum of all SOCKET TX buffer size should be multiple of 8 and the sum of all SOCKET TX and RX memory size can't exceed 128KB. When exceeded nor multiple of 8, the data transmittion is invalid.

Definition at line 316 of file w5300.h.

#define TMS23R   (TMS01R + 2)

TX memory size of SOCKET 2 & 3.

refer to TMS01R

Definition at line 323 of file w5300.h.

#define TMS45R   (TMS01R + 4)

TX memory size of SOCKET 4 & 5.

refer to TMS01R

Definition at line 330 of file w5300.h.

#define TMS67R   (TMS01R + 6)

TX memory size of SOCKET 6 & 7.

refer to TMS01R

Definition at line 337 of file w5300.h.

#define TMSR0   TMS01R

TX memory size of SOCKET 0.

refer to TMS01R

Definition at line 344 of file w5300.h.

#define TMSR1   (TMSR0 + 1)

TX memory size of SOCKET 1.

refer to TMS01R

Definition at line 351 of file w5300.h.

#define TMSR2   (TMSR0 + 2)

TX memory size of SOCKET 2.

refer to TMS01R

Definition at line 358 of file w5300.h.

#define TMSR3   (TMSR0 + 3)

TX memory size of SOCKET 3.

refer to TMS01R

Definition at line 365 of file w5300.h.

#define TMSR4   (TMSR0 + 4)

TX memory size of SOCKET 4.

refer to TMS01R

Definition at line 372 of file w5300.h.

#define TMSR5   (TMSR0 + 5)

TX memory size of SOCKET 5.

refer to TMS01R

Definition at line 379 of file w5300.h.

#define TMSR6   (TMSR0 + 6)

TX memory size of SOCKET 6.

refer to TMS01R

Definition at line 386 of file w5300.h.

#define TMSR7   (TMSR0 + 7)

TX memory size of SOCKET 7.

refer to TMS01R

Definition at line 393 of file w5300.h.

#define RMS01R   (_W5300_IO_BASE_ + 0x28)

RX memory size of SOCKET 0 & 1.

RMS01R configures the RX buffer block size of SOCKET 0 & 1. The default value is configured with 8KB and can be configure from 0 to 64KB with unit 1KB. But the sum of all SOCKET RX buffer size should be multiple of 8 and the sum of all SOCKET RX and TX memory size can't exceed 128KB. When exceeded nor multiple of 8, the data reception is invalid.

Definition at line 403 of file w5300.h.

#define RMS23R   (RMS01R + 2)

RX memory size of SOCKET 2 & 3.

Refer to RMS01R

Definition at line 410 of file w5300.h.

#define RMS45R   (RMS01R + 4)

RX memory size of SOCKET 4 & 5.

Refer to RMS01R

Definition at line 417 of file w5300.h.

#define RMS67R   (RMS01R + 6)

RX memory size of SOCKET 6 & 7.

Refer to RMS01R

Definition at line 424 of file w5300.h.

#define RMSR0   RMS01R

RX memory size of SOCKET 0.

refer to RMS01R

Definition at line 431 of file w5300.h.

#define RMSR1   (RMSR0 + 1)

RX memory size of SOCKET 1.

refer to RMS01R

Definition at line 438 of file w5300.h.

#define RMSR3   (RMSR0 + 3)

RX memory size of SOCKET 3.

refer to RMS01R

Definition at line 452 of file w5300.h.

#define RMSR4   (RMSR0 + 4)

RX memory size of SOCKET 4.

refer to RMS01R

Definition at line 459 of file w5300.h.

#define RMSR5   (RMSR0 + 5)

RX memory size of SOCKET 5.

refer to RMS01R

Definition at line 466 of file w5300.h.

#define RMSR6   (RMSR0 + 6)

RX memory size of SOCKET 6.

refer to RMS01R

Definition at line 473 of file w5300.h.

#define RMSR7   (RMSR0 + 7)

RX memory size of SOCKET 7.

refer to RMS01R

Definition at line 480 of file w5300.h.

#define MTYPER   (_W5300_IO_BASE_ + 0x30)

Memory Type Register.

W5300’s 128Kbytes data memory (Internal TX/RX memory) is composed of 16 memory blocks of 8Kbytes. MTYPER configures type of each 8KB memory block in order to select RX or TX memory. The type of 8KB memory block corresponds to each bit of MTYPER. When the bit is ‘1’, it is used as TX memory, and the bit is ‘0’, it is used as RX memory. MTYPER is configured as TX memory type from the lower bit. The rest of the bits not configured as TX memory, should be set as ‘0’.

Definition at line 493 of file w5300.h.

#define PATR   (_W5300_IO_BASE_ + 0x32)

PPPoE Authentication Type register.

It notifies authentication method negotiated with PPPoE server. W5300 supports 2 types of authentication methods.

  • PAP : 0xC023
  • CHAP : 0xC223

Definition at line 503 of file w5300.h.

#define PTIMER   (_W5300_IO_BASE_ + 0x36)

PPP Link Control Protocol Request Timer Register.

It configures transmitting timer of link control protocol (LCP) echo request. Value 1 is about 25ms.

Definition at line 512 of file w5300.h.

#define PMAGICR   (_W5300_IO_BASE_ + 0x38)

PPP LCP magic number register.

It configures byte value to be used for 4bytes “Magic Number” during LCP negotiation with PPPoE server.

Definition at line 519 of file w5300.h.

#define PSIDR   (_W5300_IO_BASE_ + 0x3C)

PPPoE session ID register.

It notifies PPP session ID to be used for communication with PPPoE server (acquired by PPPoE-process of W5300).

Definition at line 528 of file w5300.h.

#define PDHAR   (_W5300_IO_BASE_ + 0x40)

PPPoE destination hardware address register.

It notifies hardware address of PPPoE server (acquired by PPPoE-process of W5300).

Definition at line 535 of file w5300.h.

#define UIPR   (_W5300_IO_BASE_ + 0x48)

Unreachable IP address register.

When trying to transmit UDP data to destination port number which is not open, W5300 can receive ICMP (Destination port unreachable) packet.
In this case, IR_DPUR bit of IR becomes '1'. And destination IP address and unreachable port number of ICMP packet can be acquired through UIPR and UPORTR.

Definition at line 545 of file w5300.h.

#define UPORTR   (_W5300_IO_BASE_ + 0x4C)

Unreachable port number register.

Refer to UIPR.

Definition at line 552 of file w5300.h.

#define FMTUR   (_W5300_IO_BASE_ + 0x4E)

Fragment MTU register.

When communicating with the peer having a different MTU, W5300 can receive an ICMP(Fragment MTU) packet. At this case, IR(FMTU) becomes ‘1’ and destination IP address and fragment MTU value of ICMP packet can be acquired through UIPR and FMTUR. In order to keep communicating with the peer having Fragment MTU, set the FMTUR first in Sn_MSSR of the SOCKETn, and try the next communication.

Definition at line 561 of file w5300.h.

#define Pn_BRDYR (   n)    (_W5300_IO_BASE_ + 0x60 + n*4)

PIN 'BRDYn' configure register.

It configures the PIN "BRDYn" which is monitoring TX/RX memory status of the specified SOCKET. If the free buffer size of TX memory is same or bigger than the buffer depth of Pn_BDPTHR, or received buffer size of RX memory is same or bigger than the Pn_BDPTHR, PIN "BRDYn" is signaled.

15 14 13 12 11 10 9 8
Reserved, Read as 0
7 6 5 4 3 2 1 0
PEN MT PPL Reserved SN
  • Pn_PEN Enable PIN 'BRDYn' (0 : Disable, 1 : Enable)
  • Pn_MT Monitoring Memory type (0 : RX memory, 1 : TX Memory)
  • Pn_PPL PIN Polarity bit of Pn_BRDYR. (0 : Low sensitive, 1 : High sensitive)
  • Pn_SN(n) Monitoring SOCKET number of Pn_BRDYR

Definition at line 584 of file w5300.h.

#define Pn_BDPTHR (   n)    (_W5300_IO_BASE_ + 0x60 + n*4 + 2)

PIN 'BRDYn' buffer depth Register.

It configures buffer depth of PIN "BRDYn". When monitoring TX memory and Sn_TX_FSR is same or bigger than Pn_BDPTHR, the PIN "BRDYn" is signaled. When monitoring RX memory and if Sn_RX_RSR is same or bigger than Pn_BDPTHR, PIN "BRDYn" is signaled. The value for Pn_BDPTHR can't exceed TX/RX memory size allocated by TMSR or RMSR such like as TMS01R or RMS01R.

Definition at line 594 of file w5300.h.

#define IDR   (_W5300_IO_BASE_ + 0xFE)

W5300 identification register.

Read Only. 0x5300.

Definition at line 601 of file w5300.h.

Generated on Wed May 4 2016 16:44:00 for Socket APIs by   doxygen 1.8.9.1