Wiznet W5500 driver and TCP/UDP loopback

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

DATA TYPE

Data Structures

struct  __WIZCHIP
 The set of callback functions for W5500:WIZCHIP I/O functions W5200:WIZCHIP_IO_Functions_W5200. More...
struct  wiz_PhyConf_t
 It configures PHY configuration when CW_SET PHYCONF or CW_GET_PHYCONF in W5500, and it indicates the real PHY status configured by HW or SW in all WIZCHIP. More...
struct  wiz_NetInfo_t
 Network Information for WIZCHIP. More...
struct  wiz_NetTimeout_t
 Used in CN_SET_TIMEOUT or CN_GET_TIMEOUT of ctlwizchip() for timeout configruation. More...

Typedefs

typedef struct __WIZCHIP _WIZCHIP
 The set of callback functions for W5500:WIZCHIP I/O functions W5200:WIZCHIP_IO_Functions_W5200.
typedef struct wiz_PhyConf_t wiz_PhyConf
 It configures PHY configuration when CW_SET PHYCONF or CW_GET_PHYCONF in W5500, and it indicates the real PHY status configured by HW or SW in all WIZCHIP.
typedef struct wiz_NetInfo_t wiz_NetInfo
 Network Information for WIZCHIP.
typedef struct wiz_NetTimeout_t wiz_NetTimeout
 Used in CN_SET_TIMEOUT or CN_GET_TIMEOUT of ctlwizchip() for timeout configruation.

Enumerations

enum  sockint_kind {
  SIK_CONNECTED = (1 << 0), SIK_DISCONNECTED = (1 << 1), SIK_RECEIVED = (1 << 2), SIK_TIMEOUT = (1 << 3),
  SIK_SENT = (1 << 4), SIK_ALL = 0x1F
}
 

The kind of Socket Interrupt.

More...
enum  ctlsock_type {
  CS_SET_IOMODE, CS_GET_IOMODE, CS_GET_MAXTXBUF, CS_GET_MAXRXBUF,
  CS_CLR_INTERRUPT, CS_GET_INTERRUPT, CS_SET_INTMASK, CS_GET_INTMASK
}
 

The type of ctlsocket().

More...
enum  sockopt_type {
  SO_FLAG, SO_TTL, SO_TOS, SO_MSS,
  SO_DESTIP, SO_DESTPORT, SO_KEEPALIVESEND, SO_KEEPALIVEAUTO,
  SO_SENDBUF, SO_RECVBUF, SO_STATUS, SO_REMAINSIZE
}
 

The type of socket option in setsockopt() or getsockopt()

More...
enum  ctlwizchip_type {
  CW_RESET_WIZCHIP, CW_INIT_WIZCHIP, CW_GET_INTERRUPT, CW_CLR_INTERRUPT,
  CW_SET_INTRMASK, CW_GET_INTRMASK, CW_SET_INTRTIME, CW_GET_INTRTIME,
  CW_GET_ID, CW_RESET_PHY, CW_SET_PHYCONF, CW_GET_PHYCONF,
  CW_GET_PHYSTATUS, CW_SET_PHYPOWMODE, CW_GET_PHYPOWMODE, CW_GET_PHYLINK
}
 

WIZCHIP control type enumration used in ctlwizchip().

More...
enum  ctlnetwork_type {
  CN_SET_NETINFO, CN_GET_NETINFO, CN_SET_NETMODE, CN_GET_NETMODE,
  CN_SET_TIMEOUT, CN_GET_TIMEOUT
}
 

Network control type enumration used in ctlnetwork().

More...
enum  intr_kind {
  IK_WOL = (1 << 4), IK_PPPOE_TERMINATED = (1 << 5), IK_DEST_UNREACH = (1 << 6), IK_IP_CONFLICT = (1 << 7),
  IK_SOCK_0 = (1 << 8), IK_SOCK_1 = (1 << 9), IK_SOCK_2 = (1 << 10), IK_SOCK_3 = (1 << 11),
  IK_SOCK_4 = (1 << 12), IK_SOCK_5 = (1 << 13), IK_SOCK_6 = (1 << 14), IK_SOCK_7 = (1 << 15),
  IK_SOCK_ALL = (0xFF << 8)
}
 

Interrupt kind when CW_SET_INTRRUPT, CW_GET_INTERRUPT, CW_SET_INTRMASK and CW_GET_INTRMASK is used in ctlnetwork().

More...
enum  dhcp_mode { NETINFO_STATIC = 1, NETINFO_DHCP }
 

It used in setting dhcp_mode of wiz_NetInfo.

More...
enum  netmode_type { NM_FORCEARP = (1<<1), NM_WAKEONLAN = (1<<5), NM_PINGBLOCK = (1<<4), NM_PPPOE = (1<<3) }
 

Network mode.

More...

Typedef Documentation

typedef struct __WIZCHIP _WIZCHIP

The set of callback functions for W5500:WIZCHIP I/O functions W5200:WIZCHIP_IO_Functions_W5200.

typedef struct wiz_NetInfo_t wiz_NetInfo

Network Information for WIZCHIP.

Used in CN_SET_TIMEOUT or CN_GET_TIMEOUT of ctlwizchip() for timeout configruation.

typedef struct wiz_PhyConf_t wiz_PhyConf

It configures PHY configuration when CW_SET PHYCONF or CW_GET_PHYCONF in W5500, and it indicates the real PHY status configured by HW or SW in all WIZCHIP.


Valid only in W5500.


Enumeration Type Documentation

Network control type enumration used in ctlnetwork().

Enumerator:
CN_SET_NETINFO 

Set Network with wiz_NetInfo.

CN_GET_NETINFO 

Get Network with wiz_NetInfo.

CN_SET_NETMODE 

Set network mode as WOL, PPPoE, Ping Block, and Force ARP mode.

CN_GET_NETMODE 

Get network mode as WOL, PPPoE, Ping Block, and Force ARP mode.

CN_SET_TIMEOUT 

Set network timeout as retry count and time.

CN_GET_TIMEOUT 

Get network timeout as retry count and time.

Definition at line 110 of file wizchip_conf.h.

The type of ctlsocket().

Enumerator:
CS_SET_IOMODE 

set socket IO mode with SOCK_IO_BLOCK or SOCK_IO_NONBLOCK

CS_GET_IOMODE 

get socket IO mode

CS_GET_MAXTXBUF 

get the size of socket buffer allocated in TX memory

CS_GET_MAXRXBUF 

get the size of socket buffer allocated in RX memory

CS_CLR_INTERRUPT 

clear the interrupt of socket with sockint_kind

CS_GET_INTERRUPT 

get the socket interrupt. refer to sockint_kind

CS_SET_INTMASK 

set the interrupt mask of socket with sockint_kind

CS_GET_INTMASK 

get the masked interrupt of socket. refer to sockint_kind

Definition at line 322 of file socket.h.

WIZCHIP control type enumration used in ctlwizchip().

Enumerator:
CW_RESET_WIZCHIP 

Resets WIZCHIP by softly.

CW_INIT_WIZCHIP 

Inializes to WIZCHIP with SOCKET buffer size 2 or 1 dimension array typed uint8_t.

CW_GET_INTERRUPT 

Get Interrupt status of WIZCHIP.

CW_CLR_INTERRUPT 

Clears interrupt.

CW_SET_INTRMASK 

Masks interrupt.

CW_GET_INTRMASK 

Get interrupt mask.

CW_SET_INTRTIME 

Set interval time between the current and next interrupt.

CW_GET_INTRTIME 

Set interval time between the current and next interrupt.

CW_GET_ID 

Gets WIZCHIP name.

CW_RESET_PHY 

Resets internal PHY. Valid Only W5000.

CW_SET_PHYCONF 

When PHY configured by interal register, PHY operation mode (Manual/Auto, 10/100, Half/Full). Valid Only W5000.

CW_GET_PHYCONF 

Get PHY operation mode in interal register. Valid Only W5000.

CW_GET_PHYSTATUS 

Get real PHY status on operating. Valid Only W5000.

CW_SET_PHYPOWMODE 

Set PHY power mode as noraml and down when PHYSTATUS.OPMD == 1. Valid Only W5000.

CW_GET_PHYPOWMODE 

Get PHY Power mode as down or normal.

CW_GET_PHYLINK 

Get PHY Link status.

Definition at line 84 of file wizchip_conf.h.

enum dhcp_mode

It used in setting dhcp_mode of wiz_NetInfo.

Enumerator:
NETINFO_STATIC 

Static IP configuration by manually.

NETINFO_DHCP 

Dynamic IP configruation from a DHCP sever.

Definition at line 182 of file wizchip_conf.h.

enum intr_kind

Interrupt kind when CW_SET_INTRRUPT, CW_GET_INTERRUPT, CW_SET_INTRMASK and CW_GET_INTRMASK is used in ctlnetwork().

It can be used with OR operation.

Enumerator:
IK_WOL 

Wake On Lan by receiving the magic packet. Valid in W500.

IK_PPPOE_TERMINATED 

PPPoE Disconnected.

IK_DEST_UNREACH 

Destination IP & Port Unreable, No use in W5200.

IK_IP_CONFLICT 

IP conflict occurred.

IK_SOCK_0 

Socket 0 interrupt.

IK_SOCK_1 

Socket 1 interrupt.

IK_SOCK_2 

Socket 2 interrupt.

IK_SOCK_3 

Socket 3 interrupt.

IK_SOCK_4 

Socket 4 interrupt, No use in 5100.

IK_SOCK_5 

Socket 5 interrupt, No use in 5100.

IK_SOCK_6 

Socket 6 interrupt, No use in 5100.

IK_SOCK_7 

Socket 7 interrupt, No use in 5100.

IK_SOCK_ALL 

All Socket interrpt.

Definition at line 126 of file wizchip_conf.h.

Network mode.

Enumerator:
NM_FORCEARP 

Force to APP send whenever udp data is sent. Valid only in W5500.

NM_WAKEONLAN 

Wake On Lan.

NM_PINGBLOCK 

Block ping-request.

NM_PPPOE 

PPPoE mode.

Definition at line 206 of file wizchip_conf.h.

The kind of Socket Interrupt.

See also:
Sn_IR, Sn_IMR, setSn_IR(), getSn_IR(), setSn_IMR(), getSn_IMR()
Enumerator:
SIK_CONNECTED 

conntected

SIK_DISCONNECTED 

disconnected

SIK_RECEIVED 

data received

SIK_TIMEOUT 

timeout occured

SIK_SENT 

send ok

SIK_ALL 

all interrupt

Definition at line 308 of file socket.h.

The type of socket option in setsockopt() or getsockopt()

Enumerator:
SO_FLAG 

Valid only in getsockopt(), For set flag of socket refer to flag in socket().

SO_TTL 

Set/Get TTL. Sn_TTL ( setSn_TTL(), getSn_TTL() )

SO_TOS 

Set/Get TOS. Sn_TOS ( setSn_TOS(), getSn_TOS() )

SO_MSS 

Set/Get MSS. Sn_MSSR ( setSn_MSSR(), getSn_MSSR() )

SO_DESTIP 

Set/Get the destination IP address. Sn_DIPR ( setSn_DIPR(), getSn_DIPR() )

SO_DESTPORT 

Set/Get the destionation Port number. Sn_DPORT ( setSn_DPORT(), getSn_DPORT() )

SO_KEEPALIVESEND 

Valid only in setsockopt. Manually send keep-alive packet in TCP mode.

SO_KEEPALIVEAUTO 

Set/Get keep-alive auto transimittion timer in TCP mode.

SO_SENDBUF 

Valid only in getsockopt. Get the free data size of Socekt TX buffer. Sn_TX_FSR, getSn_TX_FSR()

SO_RECVBUF 

Valid only in getsockopt. Get the received data size in socket RX buffer. Sn_RX_RSR, getSn_RX_RSR()

SO_STATUS 

Valid only in getsockopt. Get the socket status. Sn_SR, getSn_SR()

SO_REMAINSIZE 

Valid only in getsockopt. Get the remaind packet size in other then TCP mode.

Definition at line 339 of file socket.h.