io6Library
WIZnet Dual Stack TCP/IP Ethernet Controller Driver
wizchip_conf.h
Go to the documentation of this file.
1 //* ****************************************************************************
31 //*****************************************************************************
32 
33 
34 
35 #ifndef _WIZCHIP_CONF_H_
36 #define _WIZCHIP_CONF_H_
37 
38 #include <stdint.h>
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
54 #define W6100 6100
55 //Add to
56 //
57 
58 #ifndef _WIZCHIP_
59 
65 #define _WIZCHIP_ W6100 // W6100
66 #endif
67 
68 #define _WIZCHIP_IO_MODE_NONE_ 0x0000
69 #define _WIZCHIP_IO_MODE_BUS_ 0x0100
70 #define _WIZCHIP_IO_MODE_SPI_ 0x0200
71 //#define _WIZCHIP_IO_MODE_IIC_ 0x0400
72 //#define _WIZCHIP_IO_MODE_SDIO_ 0x0800
73 // Add to
74 //
75 
76 #define _WIZCHIP_IO_MODE_BUS_DIR_ (_WIZCHIP_IO_MODE_BUS_ + 1)
77 #define _WIZCHIP_IO_MODE_BUS_INDIR_ (_WIZCHIP_IO_MODE_BUS_ + 2)
78 
79 #define _WIZCHIP_IO_MODE_SPI_VDM_ (_WIZCHIP_IO_MODE_SPI_ + 1)
80 
85 #define _WIZCHIP_IO_MODE_SPI_FDM_ (_WIZCHIP_IO_MODE_SPI_ + 2)
86 
87 
95 #define _PHY_IO_MODE_PHYCR_ 0x0000
96 
104 #define _PHY_IO_MODE_MII_ 0x0010
105 
112 #define _PHY_IO_MODE_ _PHY_IO_MODE_PHYCR_ //_PHY_IO_MODE_MII_
113 
114 
115 #if (_WIZCHIP_ == W6100)
116  #define _WIZCHIP_ID_ "W6100\0"
117 
124  //#define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_BUS_INDIR_
125  #define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_VDM_
126  //#define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPV_FDM_
127 
128  typedef uint8_t iodata_t;
129  typedef int16_t datasize_t;
130  #include "./W6100/w6100.h"
131  #include "../Application/Application.h"
132 
133 #else
134  #error "Unknown defined _WIZCHIP_. You should define 6100"
135 #endif
136 
137 #ifndef _WIZCHIP_IO_MODE_
138  #error "Undefined _WIZCHIP_IO_MODE_. You should define it !!!"
139 #endif
140 
148 #if _WIZCHIP_IO_MODE_ & _WIZCHIP_IO_MODE_BUS_
149  #define _WIZCHIP_IO_BASE_ 0x60000000 // for W6100 BUS
150 #elif _WIZCHIP_IO_MODE_ & _WIZCHIP_IO_MODE_SPI_
151  #define _WIZCHIP_IO_BASE_ 0x00000000 // for W6100 SPI
152 #else
153  #error "You should define _WIZCHIP_IO_BASE_ to fit your system memory map."
154 #endif
155 
156 
157 #define _WIZCHIP_SOCK_NUM_ 8
158 
159 
160 /********************************************************
161 * WIZCHIP BASIC IF functions for SPI, SDIO, I2C , ETC.
162 *********************************************************/
173 typedef struct __WIZCHIP_T__
174 {
175 
176  uint16_t if_mode;
177  uint8_t id[6];
178 
180  struct _CRIS
181  {
182  void (*_e_n_t_e_r_) (void);
183  void (*_e_x_i_t_) (void);
184  }CRIS;
185 
187  struct _CS
188  {
189  void (*_s_e_l_e_c_t_) (void);
190  void (*_d_e_s_e_l_e_c_t_)(void);
191  }CS;
192 
194  union _IF
195  {
197  struct _BUS
198  {
199  iodata_t (*_read_data) (uint32_t AddrSel);
200  void (*_write_data) (uint32_t AddrSel, iodata_t wb);
201  void (*_read_data_buf) (uint32_t AddrSel, iodata_t* pBuf, datasize_t len, uint8_t addrinc);
202  void (*_write_data_buf) (uint32_t AddrSel, iodata_t* pBuf, datasize_t len, uint8_t addrinc);
203  }BUS;
204 
206  struct _SPI
207  {
208  uint8_t (*_read_byte) (void);
209  void (*_write_byte) (uint8_t wb);
210  void (*_read_byte_buf) (uint8_t* pBuf, datasize_t len);
211  void (*_write_byte_buf) (uint8_t* pBuf, datasize_t len);
212  }SPI;
213  }IF;
214 
215 }_WIZCHIP_T_;
216 
217 
218 extern _WIZCHIP_T_ WIZCHIP;
219 
220 
239 typedef enum
240 {
244 
255 
258 
261 
270 
271 
278 typedef enum
279 {
289 
296 typedef enum
297 {
301 
311 
320 
332 typedef enum
333 {
334  IK_PPPOE_TERMINATED = (1 << 0),
335  IK_DEST_UNREACH = (1 << 1),
336  IK_IP_CONFLICT = (1 << 2),
337  IK_DEST_UNREACH6 = (1 << 4),
338  IK_WOL = (1 << 7),
339  IK_NET_ALL = (0x97),
340 
341  IK_SOCK_0 = (1 << 8),
342  IK_SOCK_1 = (1 << 9),
343  IK_SOCK_2 = (1 << 10),
344  IK_SOCK_3 = (1 << 11),
345  IK_SOCK_4 = (1 << 12),
346  IK_SOCK_5 = (1 << 13),
347  IK_SOCK_6 = (1 << 14),
348  IK_SOCK_7 = (1 << 15),
349  IK_SOCK_ALL = (0xFF << 8),
350 
351  IK_SOCKL_TOUT = (1 << 16),
352  IK_SOCKL_ARP4 = (1 << 17),
353  IK_SOCKL_PING4 = (1 << 18),
354  IK_SOCKL_ARP6 = (1 << 19),
355  IK_SOCKL_PING6 = (1 << 20),
356  IK_SOCKL_NS = (1 << 21),
357  IK_SOCKL_RS = (1 << 22),
358  IK_SOCKL_RA = (1 << 23),
359  IK_SOCKL_ALL = (0xFF << 16),
360 
361  IK_INT_ALL = (0x00FFFF97)
362 }intr_kind;
363 
364 
365 
366 #define SYS_CHIP_LOCK (1<<2)
367 #define SYS_NET_LOCK (1<<1)
368 #define SYS_PHY_LOCK (1<<0)
369 
370 #define SYSCLK_100MHZ 0
371 #define SYSCLK_25MHZ 1
372 
373 #define PHY_MODE_MANUAL 0
374 #define PHY_MODE_AUTONEGO 1
375 
381 #define PHY_MODE_TE 2
382 #define PHY_SPEED_10 0
383 #define PHY_SPEED_100 1
384 #define PHY_DUPLEX_HALF 0
385 #define PHY_DUPLEX_FULL 1
386 #define PHY_LINK_OFF 0
387 #define PHY_LINK_ON 1
388 #define PHY_POWER_NORM 0
389 #define PHY_POWER_DOWN 1
390 
391 #define IPV6_ADDR_AUTO 0x00
392 #define IPV6_ADDR_LLA 0x02
393 #define IPV6_ADDR_GUA 0x03
394 
395 
409 typedef struct wiz_PhyConf_t
410 {
411  uint8_t mode;
412  uint8_t speed;
413  uint8_t duplex;
414 }wiz_PhyConf;
415 
423 typedef enum
424 {
425  NETINFO_NONE = 0x00,
433 }ipconf_mode;
434 
442 typedef struct wiz_NetInfo_t
443 {
444  uint8_t mac[6];
445  uint8_t ip[4];
446  uint8_t sn[4];
447  uint8_t gw[4];
448  uint8_t lla[16];
449  uint8_t gua[16];
450  uint8_t sn6[16];
451  uint8_t gw6[16];
452  uint8_t dns[4];
453  uint8_t dns6[16];
455 }wiz_NetInfo;
456 
463 typedef enum
464 {
465  // NETMR Bit Values
466  NM_IPB_V4 = (1 << 0),
467  NM_IPB_V6 = (1 << 1),
468  NM_WOL = (1 << 2),
469  NM_PB6_MULTI = (1 << 4),
470  NM_PB6_ALLNODE = (1 << 5),
471  NM_MR_MASK = (0x37),
472 
473  // NETMR2 Bit Values
474  NM_PPPoE = (1 << 8),
475  NM_DHA_SELECT = (1 << 15),
476  NM_MR2_MASK = (0x09<<8),
477 
478  //NET4MR Bit Values
479  NM_PB4_ALL = (1 << 16),
480  NM_TRSTB_V4 = (1 << 17),
481  NM_PARP_V4 = (1 << 18),
482  NM_UNRB_V4 = (1 << 19),
483  NM_NET4_MASK = (0x0F << 16),
484 
485  //NET4MR Bit Values
486  NM_PB6_ALL = (1 << 24),
487  NM_TRSTB_V6 = (1 << 25),
488  NM_PARP_V6 = (1 << 26),
489  NM_UNRB_V6 = (1 << 27),
490  NM_NET6_MASK = (0x0F << 24),
491 
492  NM_MASK_ALL = (0x0F0F0937)
493 }netmode_type;
494 
502 typedef struct wiz_NetTimeout_t
503 {
504  uint8_t s_retry_cnt;
505  uint16_t s_time_100us;
506  uint8_t sl_retry_cnt;
507  uint16_t sl_time_100us;
509 
517 typedef struct wiz_IPAddress_t
518 {
519  uint8_t ip[16];
520  uint8_t len;
522 
530 typedef struct wiz_Prefix_t
531 {
532  uint8_t len;
533  uint8_t flag;
534  uint32_t valid_lifetime;
536  uint8_t prefix[16];
537 }wiz_Prefix;
538 
547 typedef struct wiz_ARP_t
548 {
550  uint8_t dha[6];
551 }wiz_ARP;
552 
560 typedef struct wiz_PING_t
561 {
562  uint16_t id;
563  uint16_t seq;
565 }wiz_PING;
566 
577 void reg_wizchip_cris_cbfunc(void(*cris_en)(void), void(*cris_ex)(void));
578 
579 
589 void reg_wizchip_cs_cbfunc(void(*cs_sel)(void), void(*cs_desel)(void));
590 
592 #if (_WIZCHIP_IO_MODE_ & _WIZCHIP_IO_MODE_BUS_)
593 
606 void reg_wizchip_bus_cbfunc(iodata_t (*bus_rd)(uint32_t addr),
607  void (*bus_wd)(uint32_t addr, iodata_t wb),
608  void (*bus_rbuf)(uint32_t addr, iodata_t* buf, datasize_t len, uint8_t inc),
609  void (*bus_wbuf)(uint32_t addr, iodata_t* buf, datasize_t len, uint8_t inc) );
611 #endif
612 
615 #if (_WIZCHIP_IO_MODE_ & _WIZCHIP_IO_MODE_SPI_)
616 
630 void reg_wizchip_spi_cbfunc(uint8_t (*spi_rb)(void),
631  void (*spi_wb)(uint8_t wb),
632  void (*spi_rbuf)(uint8_t* buf, datasize_t len),
633  void (*spi_wbuf)(uint8_t* buf, datasize_t len) );
635 #endif
636 
638 
657 int8_t ctlwizchip(ctlwizchip_type cwtype, void* arg);
658 
668 int8_t ctlnetwork(ctlnetwork_type cntype, void* arg);
669 
670 
680 int8_t ctlnetservice(ctlnetservice_type cnstype, void* arg);
681 
682 
683 /*
684  * The following functions are implemented for internal use.
685  * but You can call these functions for code size reduction instead of ctlwizchip() and ctlnetwork().
686  */
687 
695 void wizchip_sw_reset(void);
696 
707 int8_t wizchip_init(uint8_t* txsize, uint8_t* rxsize);
708 
717 
726 
735 
744 
754 int8_t wizphy_getphylink(void);
755 
767 void wizphy_reset(void);
768 
778 void wizphy_setphyconf(wiz_PhyConf* phyconf);
779 
791 void wizphy_getphyconf(wiz_PhyConf* phyconf);
792 
801 void wizphy_getphystatus(wiz_PhyConf* phyconf);
802 
815 void wizphy_setphypmode(uint8_t pmode);
816 
829 int8_t wizphy_getphypmode(void);
830 
838 void wizchip_setnetinfo(wiz_NetInfo* pnetinfo);
839 
847 void wizchip_getnetinfo(wiz_NetInfo* pnetinfo);
848 
856 void wizchip_setnetmode(netmode_type netmode);
857 
866 
874 void wizchip_settimeout(wiz_NetTimeout* nettime);
875 
883 void wizchip_gettimeout(wiz_NetTimeout* nettime);
884 
896 int8_t wizchip_arp(wiz_ARP* arp);
897 
908 int8_t wizchip_ping(wiz_PING* ping);
909 
920 int8_t wizchip_dad(uint8_t* ipv6);
921 
935 int8_t wizchip_slaac(wiz_Prefix* prefix);
936 
947 int8_t wizchip_unsolicited(void);
948 
960 int8_t wizchip_getprefix(wiz_Prefix * prefix);
961 
962 
963 #ifdef __cplusplus
964 }
965 #endif
966 
967 #endif // _WIZCHIP_CONF_H_
wiz_IPAddress_t::ip
uint8_t ip[16]
Destination IP Address. IPv4 index : 0 to 3, IPv6 index : 0 to 15.
Definition: wizchip_conf.h:519
NM_UNRB_V6
@ NM_UNRB_V6
Unreachable Destination for IPv6 Block.
Definition: wizchip_conf.h:489
NM_PB4_ALL
@ NM_PB4_ALL
All PING4 request Block.
Definition: wizchip_conf.h:479
NM_PB6_ALL
@ NM_PB6_ALL
All PING6 request Block.
Definition: wizchip_conf.h:486
ipconf_mode
ipconf_mode
IP Address Configuration Mode.
Definition: wizchip_conf.h:423
NM_TRSTB_V6
@ NM_TRSTB_V6
TCP RST packet for IPv6 Send Block.
Definition: wizchip_conf.h:487
CNS_DAD
@ CNS_DAD
Duplicated IPv6 Address Detection.
Definition: wizchip_conf.h:300
ctlnetwork_type
ctlnetwork_type
Network control type enumeration.
Definition: wizchip_conf.h:278
NETINFO_NONE
@ NETINFO_NONE
No use DHCP.
Definition: wizchip_conf.h:425
wiz_NetTimeout_t::sl_retry_cnt
uint8_t sl_retry_cnt
The retry count of SOCKET-less.
Definition: wizchip_conf.h:506
CW_SET_SYSCLK
@ CW_SET_SYSCLK
Set the system clock with SYSCLK_100MHZ or SYSCLK_10MHZ only when SYS_CHIP_LOCK is unlock.
Definition: wizchip_conf.h:259
wiz_PhyConf_t::duplex
uint8_t duplex
set by PHY_DUPLEX_HALF PHY_DUPLEX_FULL
Definition: wizchip_conf.h:413
wizchip_sw_reset
void wizchip_sw_reset(void)
Soft Reset _WIZCHIP_.
Definition: wizchip_conf.c:471
CN_SET_NETMODE
@ CN_SET_NETMODE
Set network mode with netmode_type.
Definition: wizchip_conf.h:282
IK_SOCKL_TOUT
@ IK_SOCKL_TOUT
_SLCR_ Timeout Interrupt. Refer to ctlnetservice_type.
Definition: wizchip_conf.h:351
__WIZCHIP_T__::_IF::_SPI::_write_byte_buf
void(* _write_byte_buf)(uint8_t *pBuf, datasize_t len)
Write byte data as many as len to _WIZCHIP_ through SPI.
Definition: wizchip_conf.h:213
IK_SOCKL_ARP4
@ IK_SOCKL_ARP4
_SLCR_ APR4 Interrupt. Refer to CNS_ARP.
Definition: wizchip_conf.h:352
CW_SET_PHYPOWMODE
@ CW_SET_PHYPOWMODE
Set PHY power mode with PHY_POWER_NORM or PHY_POWER_DOWN.
Definition: wizchip_conf.h:266
wiz_NetInfo_t::lla
uint8_t lla[16]
Source Link Local Address.
Definition: wizchip_conf.h:448
NETINFO_DHCP_ALL
@ NETINFO_DHCP_ALL
Dynamic IPv4 and IPv6 configuration from a DHCP sever.
Definition: wizchip_conf.h:432
wiz_NetInfo_t::gua
uint8_t gua[16]
Source Global Unicast Address.
Definition: wizchip_conf.h:449
__WIZCHIP_T__::_IF::_SPI
Definition: wizchip_conf.h:208
CN_SET_PREFER
@ CN_SET_PREFER
Set the preferred source IPv6 address of _SLCR_. Refer to IPV6_ADDR_AUTO, IPV6_ADDR_LLA,...
Definition: wizchip_conf.h:286
wiz_NetInfo_t::dns
uint8_t dns[4]
DNS server IPv4 Address.
Definition: wizchip_conf.h:452
ctlnetwork
int8_t ctlnetwork(ctlnetwork_type cntype, void *arg)
Controls to network.
Definition: wizchip_conf.c:415
wiz_PhyConf
struct wiz_PhyConf_t wiz_PhyConf
Ethernet PHY operation mode configuration.
NETINFO_DHCP_V6
@ NETINFO_DHCP_V6
Dynamic IPv6 configuration from a DHCP sever.
Definition: wizchip_conf.h:431
CW_GET_INTERRUPT
@ CW_GET_INTERRUPT
Get the interrupt status with intr_kind.
Definition: wizchip_conf.h:247
__WIZCHIP_T__::_CS::_d_e_s_e_l_e_c_t_
void(* _d_e_s_e_l_e_c_t_)(void)
_WIZCHIP_ deselected
Definition: wizchip_conf.h:192
__WIZCHIP_T__::if_mode
uint16_t if_mode
HOST Interface Mode.
Definition: wizchip_conf.h:178
wiz_PING_t
Destination Information & Destination Hardware Address for CNS_ARP.
Definition: wizchip_conf.h:560
__WIZCHIP_T__::_IF::_BUS::_read_data_buf
void(* _read_data_buf)(uint32_t AddrSel, iodata_t *pBuf, datasize_t len, uint8_t addrinc)
Read iodata_t as many as len from _WIZCHIP_ through BUS.
Definition: wizchip_conf.h:203
IK_SOCKL_ARP6
@ IK_SOCKL_ARP6
_SLCR_ ARP6 Interrupt. Refer to CNS_ARP.
Definition: wizchip_conf.h:354
NM_PARP_V4
@ NM_PARP_V4
ARP request for IPv4 before PINGv4 Replay.
Definition: wizchip_conf.h:481
CN_GET_NETINFO
@ CN_GET_NETINFO
Get Network with wiz_NetInfo.
Definition: wizchip_conf.h:281
IK_SOCK_0
@ IK_SOCK_0
Socket 0 Interrupt.
Definition: wizchip_conf.h:341
wizchip_clrinterrupt
void wizchip_clrinterrupt(intr_kind intr)
Clear Interrupt of _WIZCHIP_.
Definition: wizchip_conf.c:526
CW_GET_PHYPOWMODE
@ CW_GET_PHYPOWMODE
Get PHY Power mode with PHY_POWER_NORM or PHY_POWER_DOWN.
Definition: wizchip_conf.h:267
__WIZCHIP_T__::_CRIS::_e_n_t_e_r_
void(* _e_n_t_e_r_)(void)
critical section enter
Definition: wizchip_conf.h:184
CNS_SLAAC
@ CNS_SLAAC
Stateless Address Auto-configuration(SLAAC) with wiz_Prefix.
Definition: wizchip_conf.h:309
wiz_ARP_t::dha
uint8_t dha[6]
Destination Hardware Address when ARP-reply is received from the destination.
Definition: wizchip_conf.h:550
wiz_NetInfo_t::dns6
uint8_t dns6[16]
DNS server IPv6 Address.
Definition: wizchip_conf.h:453
wiz_PhyConf_t::mode
uint8_t mode
set by PHY_MODE_MANUAL ,PHY_MODE_AUTONEGO, or PHY_MODE_TE
Definition: wizchip_conf.h:411
NM_DHA_SELECT
@ NM_DHA_SELECT
Destination Hardware Address Select.
Definition: wizchip_conf.h:475
CNS_PING
@ CNS_PING
PING process with wiz_IPAddress.
Definition: wizchip_conf.h:299
wizphy_getphystatus
void wizphy_getphystatus(wiz_PhyConf *phyconf)
Get the real PHY operation status when link is established.
Definition: wizchip_conf.c:649
NM_IPB_V6
@ NM_IPB_V6
IPv6 Packet Block.
Definition: wizchip_conf.h:467
wiz_NetInfo_t::gw6
uint8_t gw6[16]
Gateway IPv6 Address.
Definition: wizchip_conf.h:451
CW_GET_SYSCLK
@ CW_GET_SYSCLK
Get the system clock with SYSCLK_100MHZ or SYSCLK_10MHZ.
Definition: wizchip_conf.h:260
netmode_type
netmode_type
Network mode Configuration.
Definition: wizchip_conf.h:463
IK_SOCKL_NS
@ IK_SOCKL_NS
_SLCR_ NS Interrupt. Refer to CNS_DAD.
Definition: wizchip_conf.h:356
NM_IPB_V4
@ NM_IPB_V4
IPv4 Packet Block.
Definition: wizchip_conf.h:466
wizchip_getinterrupt
intr_kind wizchip_getinterrupt(void)
Get Interrupt of _WIZCHIP_.
Definition: wizchip_conf.c:540
CW_SET_PHYCONF
@ CW_SET_PHYCONF
Set PHY operation mode (Manual/Auto, 10/100, Half/Full) with wiz_PhyConf.
Definition: wizchip_conf.h:263
CN_GET_NETMODE
@ CN_GET_NETMODE
Get network mode with netmode_type.
Definition: wizchip_conf.h:283
NM_MASK_ALL
@ NM_MASK_ALL
netmode_type all mask value
Definition: wizchip_conf.h:492
CW_GET_PHYLINK
@ CW_GET_PHYLINK
Get PHY Link status with PHY_LINK_ON or PHY_LINK_OFF.
Definition: wizchip_conf.h:268
wiz_IPAddress_t::len
uint8_t len
Destination IP Address Length. IPv4 : 4, IPv6 : 16.
Definition: wizchip_conf.h:520
wiz_Prefix_t
Prefix Information.
Definition: wizchip_conf.h:530
CW_SET_INTRMASK
@ CW_SET_INTRMASK
Set the interrupt mask with intr_kind.
Definition: wizchip_conf.h:249
ctlwizchip_type
ctlwizchip_type
_WIZCHIP_ Control Type Enumeration.
Definition: wizchip_conf.h:239
NM_PB6_MULTI
@ NM_PB6_MULTI
PING6 request from multicasting group address Block.
Definition: wizchip_conf.h:469
IK_SOCK_5
@ IK_SOCK_5
Socket 5 Interrupt.
Definition: wizchip_conf.h:346
ctlnetservice_type
ctlnetservice_type
Network Service Control Type enumeration.
Definition: wizchip_conf.h:296
CNS_ARP
@ CNS_ARP
ARP process with wiz_IPAddress.
Definition: wizchip_conf.h:298
__WIZCHIP_T__
Callback function set for _WIZCHIP_.
Definition: wizchip_conf.h:173
_WIZCHIP_T_
struct __WIZCHIP_T__ _WIZCHIP_T_
Callback function set for _WIZCHIP_.
__WIZCHIP_T__::_IF::_SPI::_read_byte
uint8_t(* _read_byte)(void)
Read 1 byte data from _WIZCHIP_ through SPI.
Definition: wizchip_conf.h:210
NETINFO_STATIC_ALL
@ NETINFO_STATIC_ALL
Static IPv4 and IPv6 configuration by manually.
Definition: wizchip_conf.h:428
IK_SOCK_7
@ IK_SOCK_7
Socket 7 Interrupt.
Definition: wizchip_conf.h:348
wizphy_getphylink
int8_t wizphy_getphylink(void)
Get the Link status of integrated PHY.
Definition: wizchip_conf.c:564
CW_INIT_WIZCHIP
@ CW_INIT_WIZCHIP
Initialize to SOCKETn buffer size with n byte array typed uint8_t.
Definition: wizchip_conf.h:246
NETINFO_DHCP_V4
@ NETINFO_DHCP_V4
Dynamic IPv4 configuration from a DHCP sever.
Definition: wizchip_conf.h:430
wizchip_init
int8_t wizchip_init(uint8_t *txsize, uint8_t *rxsize)
Initializes SOCKETn TX/RX buffer size.
Definition: wizchip_conf.c:498
IK_SOCK_6
@ IK_SOCK_6
Socket 6 Interrupt.
Definition: wizchip_conf.h:347
wiz_NetInfo_t::sn6
uint8_t sn6[16]
IPv6 Prefix.
Definition: wizchip_conf.h:450
CN_SET_TIMEOUT
@ CN_SET_TIMEOUT
Set network timeout with wiz_NetTimeout.
Definition: wizchip_conf.h:284
reg_wizchip_spi_cbfunc
void reg_wizchip_spi_cbfunc(uint8_t(*spi_rb)(void), void(*spi_wb)(uint8_t wb), void(*spi_rbuf)(uint8_t *buf, datasize_t len), void(*spi_wbuf)(uint8_t *buf, datasize_t len))
Registers call back functions for SPI interface.
CW_SYS_LOCK
@ CW_SYS_LOCK
Lock or Unlock _WIZCHIP_ with SYS_CHIP_LOCK, SYS_PHY_LOCK, and SYS_NET_LOCK.
Definition: wizchip_conf.h:241
NM_PARP_V6
@ NM_PARP_V6
ARP request for IPv6 before PINGv4 Replay.
Definition: wizchip_conf.h:488
wizchip_unsolicited
int8_t wizchip_unsolicited(void)
Unsolicited NA process.
Definition: wizchip_conf.c:834
WIZCHIP
_WIZCHIP_T_ WIZCHIP
WIZCHIP is instance of _WIZCHIP_T_ to access _WIZCHIP_.
Definition: wizchip_conf.c:214
__WIZCHIP_T__::_IF::_BUS::_write_data
void(* _write_data)(uint32_t AddrSel, iodata_t wb)
Write 1 iodata_t to _WIZCHIP_ through BUS.
Definition: wizchip_conf.h:202
wizphy_setphypmode
void wizphy_setphypmode(uint8_t pmode)
Set the power mode of integrated Ethernet PHY.
Definition: wizchip_conf.c:659
IK_SOCKL_RS
@ IK_SOCKL_RS
_SLCR_ RS Interrupt. Refer to CNS_SLAAC.
Definition: wizchip_conf.h:357
intr_kind
intr_kind
Interrupt Kind.
Definition: wizchip_conf.h:332
wiz_NetInfo
struct wiz_NetInfo_t wiz_NetInfo
Network Information for _WIZCHIP_.
IK_SOCKL_PING4
@ IK_SOCKL_PING4
_SLCR_ PING4 Interrupt. Refer to CNS_PING.
Definition: wizchip_conf.h:353
__WIZCHIP_T__::CRIS
struct __WIZCHIP_T__::_CRIS CRIS
The set of _WIZCHIP_ select control callback function.
CW_GET_PHYSTATUS
@ CW_GET_PHYSTATUS
Get real operation mode with wiz_PhyConf when PHY is linked up.
Definition: wizchip_conf.h:265
IK_SOCK_ALL
@ IK_SOCK_ALL
All Socket Interrupt.
Definition: wizchip_conf.h:349
CW_GET_ID
@ CW_GET_ID
Get _WIZCHIP_ name.
Definition: wizchip_conf.h:256
CW_RESET_PHY
@ CW_RESET_PHY
Reset PHY.
Definition: wizchip_conf.h:262
reg_wizchip_cs_cbfunc
void reg_wizchip_cs_cbfunc(void(*cs_sel)(void), void(*cs_desel)(void))
Registers call back functions for _WIZCHIP_ select & deselect.
Definition: wizchip_conf.c:264
wizchip_getnetmode
netmode_type wizchip_getnetmode(void)
Get the network mode such as WOL, PPPoE, PING Block, and etc.
Definition: wizchip_conf.c:731
CW_GET_INTRTIME
@ CW_GET_INTRTIME
Get the interrupt pending time.
Definition: wizchip_conf.h:252
IK_SOCKL_RA
@ IK_SOCKL_RA
_SLCR_ RA Interrupt. Refer to CNS_GET_PREFIX.
Definition: wizchip_conf.h:358
wiz_NetTimeout_t
Network Timeout for _WIZCHIP_.
Definition: wizchip_conf.h:502
__WIZCHIP_T__::_CRIS::_e_x_i_t_
void(* _e_x_i_t_)(void)
critical section exit
Definition: wizchip_conf.h:185
IK_SOCKL_PING6
@ IK_SOCKL_PING6
_SLCR_ PING6 Interrupt. Refer to CNS_PING.
Definition: wizchip_conf.h:355
wiz_NetInfo_t::mac
uint8_t mac[6]
Source Hardware Address.
Definition: wizchip_conf.h:444
NM_WOL
@ NM_WOL
Wake On Lan(WOL) Mode.
Definition: wizchip_conf.h:468
__WIZCHIP_T__::_IF::_BUS::_write_data_buf
void(* _write_data_buf)(uint32_t AddrSel, iodata_t *pBuf, datasize_t len, uint8_t addrinc)
Write iodata_t data as many as len to _WIZCHIP_ through BUS.
Definition: wizchip_conf.h:204
wizphy_setphyconf
void wizphy_setphyconf(wiz_PhyConf *phyconf)
Definition: wizchip_conf.c:587
__WIZCHIP_T__::_IF::BUS
struct __WIZCHIP_T__::_IF::_BUS BUS
The callback function of _WIZCHIP_IO_MODE_SPI_ such as _WIZCHIP_IO_MODE_SPI_VDM_ and _WIZCHIP_IO_MODE...
wizchip_getinterruptmask
intr_kind wizchip_getinterruptmask(void)
Get Interrupt mask of _WIZCHIP_.
Definition: wizchip_conf.c:557
CW_GET_SYSLOCK
@ CW_GET_SYSLOCK
Get the lock status of _WIZCHIP_ with SYS_CHIP_LOCK, SYS_PHY_LOCK, and SYS_NET_LOCK.
Definition: wizchip_conf.h:243
wiz_PhyConf_t::speed
uint8_t speed
set by PHY_SPEED_10 or PHY_SPEED_100
Definition: wizchip_conf.h:412
IK_IP_CONFLICT
@ IK_IP_CONFLICT
IPv4 Address Conflict Interrupt.
Definition: wizchip_conf.h:336
CW_GET_INTRMASK
@ CW_GET_INTRMASK
Get the interrupt mask with intr_kind.
Definition: wizchip_conf.h:250
wiz_PING_t::id
uint16_t id
Definition: wizchip_conf.h:562
NM_NET4_MASK
@ NM_NET4_MASK
_NET4MR_ Mask value
Definition: wizchip_conf.h:483
NETINFO_STATIC_V6
@ NETINFO_STATIC_V6
Static IPv6 configuration by manually.
Definition: wizchip_conf.h:427
wiz_NetTimeout_t::s_time_100us
uint16_t s_time_100us
The retransmission time of SOCKETn (unit 100us)
Definition: wizchip_conf.h:505
__WIZCHIP_T__::IF
union __WIZCHIP_T__::_IF IF
wiz_NetInfo_t::ipmode
ipconf_mode ipmode
IP Configuration Mode.
Definition: wizchip_conf.h:454
wiz_Prefix_t::prefix
uint8_t prefix[16]
Prefix.
Definition: wizchip_conf.h:536
wizchip_slaac
int8_t wizchip_slaac(wiz_Prefix *prefix)
Stateless Address Auto Configuration(SLAAC) process.
Definition: wizchip_conf.c:815
wizchip_dad
int8_t wizchip_dad(uint8_t *ipv6)
DAD(Duplcated Address Detection) process.
Definition: wizchip_conf.c:803
IK_NET_ALL
@ IK_NET_ALL
All Network Interrupt.
Definition: wizchip_conf.h:339
NM_PB6_ALLNODE
@ NM_PB6_ALLNODE
PING6 request from all-node multicasting address Block.
Definition: wizchip_conf.h:470
wiz_Prefix_t::preferred_lifetime
uint32_t preferred_lifetime
Preferred Lifetime.
Definition: wizchip_conf.h:535
__WIZCHIP_T__::_IF::_SPI::_write_byte
void(* _write_byte)(uint8_t wb)
Write 1 byte data to _WIZCHIP_ through SPI.
Definition: wizchip_conf.h:211
ctlwizchip
int8_t ctlwizchip(ctlwizchip_type cwtype, void *arg)
Control _WIZCHIP_.
Definition: wizchip_conf.c:313
wiz_NetInfo_t::gw
uint8_t gw[4]
Gateway IPv4 Address.
Definition: wizchip_conf.h:447
wizchip_getnetinfo
void wizchip_getnetinfo(wiz_NetInfo *pnetinfo)
Get the network information of _WIZCHIP_.
Definition: wizchip_conf.c:703
CNS_GET_PREFIX
@ CNS_GET_PREFIX
Get prefix information with wiz_Prefix.
Definition: wizchip_conf.h:318
__WIZCHIP_T__::_CS::_s_e_l_e_c_t_
void(* _s_e_l_e_c_t_)(void)
_WIZCHIP_ selected
Definition: wizchip_conf.h:191
wiz_IPAddress
struct wiz_IPAddress_t wiz_IPAddress
Destination Information for Network Service of _WIZCHIP_.
wiz_Prefix_t::flag
uint8_t flag
Prefix Flag.
Definition: wizchip_conf.h:533
__WIZCHIP_T__::_IF::_BUS::_read_data
iodata_t(* _read_data)(uint32_t AddrSel)
Read 1 iodata_t from _WIZCHIP_ through BUS.
Definition: wizchip_conf.h:201
__WIZCHIP_T__::_IF::_SPI::_read_byte_buf
void(* _read_byte_buf)(uint8_t *pBuf, datasize_t len)
Read byte data as many as len from _WIZCHIP_ through SPI.
Definition: wizchip_conf.h:212
IK_SOCK_3
@ IK_SOCK_3
Socket 3 Interrupt.
Definition: wizchip_conf.h:344
wiz_NetTimeout
struct wiz_NetTimeout_t wiz_NetTimeout
Network Timeout for _WIZCHIP_.
__WIZCHIP_T__::CS
struct __WIZCHIP_T__::_CS CS
The set of interface IO callback function.
CW_SET_INTRTIME
@ CW_SET_INTRTIME
Set the interrupt pending time.
Definition: wizchip_conf.h:251
CW_CLR_INTERRUPT
@ CW_CLR_INTERRUPT
Clear the interrupt with intr_kind.
Definition: wizchip_conf.h:248
NETINFO_STATIC_V4
@ NETINFO_STATIC_V4
Static IPv4 configuration by manually.
Definition: wizchip_conf.h:426
reg_wizchip_bus_cbfunc
void reg_wizchip_bus_cbfunc(iodata_t(*bus_rd)(uint32_t addr), void(*bus_wd)(uint32_t addr, iodata_t wb), void(*bus_rbuf)(uint32_t addr, iodata_t *buf, datasize_t len, uint8_t inc), void(*bus_wbuf)(uint32_t addr, iodata_t *buf, datasize_t len, uint8_t inc))
Registers call back functions for BUS interface.
wiz_ARP
struct wiz_ARP_t wiz_ARP
Destination Information & Destination Hardware Address for CNS_ARP.
CN_SET_NETINFO
@ CN_SET_NETINFO
Set Network with wiz_NetInfo.
Definition: wizchip_conf.h:280
NM_TRSTB_V4
@ NM_TRSTB_V4
TCP RST packet for IPv4 Send Block.
Definition: wizchip_conf.h:480
wizphy_reset
void wizphy_reset(void)
Reset the integrated PHY.
Definition: wizchip_conf.c:574
wiz_NetInfo_t::ip
uint8_t ip[4]
Source IPv4 Address.
Definition: wizchip_conf.h:445
IK_INT_ALL
@ IK_INT_ALL
All Interrupt.
Definition: wizchip_conf.h:361
CNS_UNSOL_NA
@ CNS_UNSOL_NA
Unsolicited Neighbor Advertisement for update _WIZCHIP_ network information to neighbors.
Definition: wizchip_conf.h:310
wizchip_getprefix
int8_t wizchip_getprefix(wiz_Prefix *prefix)
Get a prefix information of RA message from a router.
Definition: wizchip_conf.c:845
CW_SET_IEN
@ CW_SET_IEN
Set the global interrupt enable only when SYS_CHIP_LOCK is not set.
Definition: wizchip_conf.h:253
IK_PPPOE_TERMINATED
@ IK_PPPOE_TERMINATED
PPPoE Termination Interrupt.
Definition: wizchip_conf.h:334
wiz_PING
struct wiz_PING_t wiz_PING
Destination Information & Destination Hardware Address for CNS_ARP.
ctlnetservice
int8_t ctlnetservice(ctlnetservice_type cnstype, void *arg)
Controls to network service.
Definition: wizchip_conf.c:449
IK_SOCK_4
@ IK_SOCK_4
Socket 4 Interrupt.
Definition: wizchip_conf.h:345
wizphy_getphyconf
void wizphy_getphyconf(wiz_PhyConf *phyconf)
Get the integrated Ethernet PHY operation mode.
Definition: wizchip_conf.c:630
CN_GET_TIMEOUT
@ CN_GET_TIMEOUT
Get network timeout with wiz_NetTimeout.
Definition: wizchip_conf.h:285
IK_WOL
@ IK_WOL
WOL magic packet Interrupt.
Definition: wizchip_conf.h:338
wiz_ARP_t::destinfo
wiz_IPAddress destinfo
Destination IP address for ARP-request.
Definition: wizchip_conf.h:549
IK_SOCK_1
@ IK_SOCK_1
Socket 1 Interrupt.
Definition: wizchip_conf.h:342
wiz_NetInfo_t
Network Information for _WIZCHIP_.
Definition: wizchip_conf.h:442
wiz_PhyConf_t
Ethernet PHY operation mode configuration.
Definition: wizchip_conf.h:409
NM_PPPoE
@ NM_PPPoE
PPPoE Mode.
Definition: wizchip_conf.h:474
wiz_PING_t::seq
uint16_t seq
Definition: wizchip_conf.h:563
wiz_ARP_t
Destination Information & Destination Hardware Address for CNS_ARP.
Definition: wizchip_conf.h:547
wiz_Prefix
struct wiz_Prefix_t wiz_Prefix
Prefix Information.
wiz_Prefix_t::len
uint8_t len
Prefix Length. It is used to set _SUB6R_ to 1 as many as len from LSB bit.
Definition: wizchip_conf.h:532
CW_RESET_WIZCHIP
@ CW_RESET_WIZCHIP
Reset _WIZCHIP_ by software.
Definition: wizchip_conf.h:245
IK_SOCK_2
@ IK_SOCK_2
Socket 2 Interrupt.
Definition: wizchip_conf.h:343
wizchip_settimeout
void wizchip_settimeout(wiz_NetTimeout *nettime)
Set retransmission time values and retry counts.
Definition: wizchip_conf.c:741
IK_DEST_UNREACH
@ IK_DEST_UNREACH
ICMPv4 Destination Unreachable Interrupt.
Definition: wizchip_conf.h:335
wiz_PING_t::destinfo
wiz_IPAddress destinfo
Definition: wizchip_conf.h:564
wizchip_arp
int8_t wizchip_arp(wiz_ARP *arp)
ARP process.
Definition: wizchip_conf.c:757
CN_GET_PREFER
@ CN_GET_PREFER
Get the preferred source IPv6 address of _SLCR_. Refer to IPV6_ADDR_AUTO, IPV6_ADDR_LLA,...
Definition: wizchip_conf.h:287
NM_MR_MASK
@ NM_MR_MASK
_NETMR_ Mask value
Definition: wizchip_conf.h:471
wiz_IPAddress_t
Destination Information for Network Service of _WIZCHIP_.
Definition: wizchip_conf.h:517
wizchip_gettimeout
void wizchip_gettimeout(wiz_NetTimeout *nettime)
Get retransmission time values and retry counts.
Definition: wizchip_conf.c:749
wizchip_setnetinfo
void wizchip_setnetinfo(wiz_NetInfo *pnetinfo)
Set the network information for _WIZCHIP_.
Definition: wizchip_conf.c:685
wizchip_ping
int8_t wizchip_ping(wiz_PING *ping)
PING process.
Definition: wizchip_conf.c:781
CW_SYS_UNLOCK
@ CW_SYS_UNLOCK
Lock or Unlock _WIZCHIP_ with SYS_CHIP_LOCK, SYS_PHY_LOCK, and SYS_NET_LOCK.
Definition: wizchip_conf.h:242
wiz_NetTimeout_t::s_retry_cnt
uint8_t s_retry_cnt
The default retry count of SOCKETn.
Definition: wizchip_conf.h:504
wizchip_setnetmode
void wizchip_setnetmode(netmode_type netmode)
Set the network mode such as WOL, PPPoE, PING Block, and etc.
Definition: wizchip_conf.c:722
NM_NET6_MASK
@ NM_NET6_MASK
_NET6MR_ Mask value
Definition: wizchip_conf.h:490
IK_DEST_UNREACH6
@ IK_DEST_UNREACH6
ICMPv6 Destination Unreachable Interrupt.
Definition: wizchip_conf.h:337
CW_GET_PHYCONF
@ CW_GET_PHYCONF
Get PHY operation mode (Manual/Auto, 10/100, Half/Full) with wiz_PhyConf.
Definition: wizchip_conf.h:264
NM_MR2_MASK
@ NM_MR2_MASK
_NETMR2_ Mask value
Definition: wizchip_conf.h:476
wiz_NetTimeout_t::sl_time_100us
uint16_t sl_time_100us
The retransmission time of SOCKET-less (unit 100us)
Definition: wizchip_conf.h:507
__WIZCHIP_T__::_CS
Definition: wizchip_conf.h:189
wiz_Prefix_t::valid_lifetime
uint32_t valid_lifetime
Valid Lifetime.
Definition: wizchip_conf.h:534
NM_UNRB_V4
@ NM_UNRB_V4
Unreachable Destination for IPv4 Block.
Definition: wizchip_conf.h:482
NETINFO_SLAAC_V6
@ NETINFO_SLAAC_V6
Stateless Adders Auto Configuration for IPv6.
Definition: wizchip_conf.h:429
wizphy_getphypmode
int8_t wizphy_getphypmode(void)
get the power mode of integrated Ethernet PHY.
Definition: wizchip_conf.c:675
wizchip_setinterruptmask
void wizchip_setinterruptmask(intr_kind intr)
Mask or Unmask Interrupt of _WIZCHIP_.
Definition: wizchip_conf.c:547
IK_SOCKL_ALL
@ IK_SOCKL_ALL
_SLCR_ All Interrupt
Definition: wizchip_conf.h:359
__WIZCHIP_T__::_IF::SPI
struct __WIZCHIP_T__::_IF::_SPI SPI
CW_GET_VER
@ CW_GET_VER
Get the version of TCP/IP TOE engine.
Definition: wizchip_conf.h:257
reg_wizchip_cris_cbfunc
void reg_wizchip_cris_cbfunc(void(*cris_en)(void), void(*cris_ex)(void))
Registers call back functions for critical section.
Definition: wizchip_conf.c:256
w6100.h
W6100 HAL Header File.
wiz_NetInfo_t::sn
uint8_t sn[4]
Subnet Mask value.
Definition: wizchip_conf.h:446
CW_GET_IEN
@ CW_GET_IEN
Get the global interrupt enable.
Definition: wizchip_conf.h:254
__WIZCHIP_T__::_CRIS
Definition: wizchip_conf.h:182
__WIZCHIP_T__::_IF
Definition: wizchip_conf.h:196