 |
io6Library
WIZnet Dual Stack TCP/IP Ethernet Controller Driver
|
Go to the documentation of this file.
35 #ifndef _WIZCHIP_CONF_H_
36 #define _WIZCHIP_CONF_H_
65 #define _WIZCHIP_ W6100 // W6100
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
76 #define _WIZCHIP_IO_MODE_BUS_DIR_ (_WIZCHIP_IO_MODE_BUS_ + 1)
77 #define _WIZCHIP_IO_MODE_BUS_INDIR_ (_WIZCHIP_IO_MODE_BUS_ + 2)
79 #define _WIZCHIP_IO_MODE_SPI_VDM_ (_WIZCHIP_IO_MODE_SPI_ + 1)
85 #define _WIZCHIP_IO_MODE_SPI_FDM_ (_WIZCHIP_IO_MODE_SPI_ + 2)
95 #define _PHY_IO_MODE_PHYCR_ 0x0000
104 #define _PHY_IO_MODE_MII_ 0x0010
112 #define _PHY_IO_MODE_ _PHY_IO_MODE_PHYCR_ //_PHY_IO_MODE_MII_
115 #if (_WIZCHIP_ == W6100)
116 #define _WIZCHIP_ID_ "W6100\0"
125 #define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_VDM_
128 typedef uint8_t iodata_t;
129 typedef int16_t datasize_t;
131 #include "../Application/Application.h"
134 #error "Unknown defined _WIZCHIP_. You should define 6100"
137 #ifndef _WIZCHIP_IO_MODE_
138 #error "Undefined _WIZCHIP_IO_MODE_. You should define it !!!"
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
153 #error "You should define _WIZCHIP_IO_BASE_ to fit your system memory map."
157 #define _WIZCHIP_SOCK_NUM_ 8
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);
366 #define SYS_CHIP_LOCK (1<<2)
367 #define SYS_NET_LOCK (1<<1)
368 #define SYS_PHY_LOCK (1<<0)
370 #define SYSCLK_100MHZ 0
371 #define SYSCLK_25MHZ 1
373 #define PHY_MODE_MANUAL 0
374 #define PHY_MODE_AUTONEGO 1
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
391 #define IPV6_ADDR_AUTO 0x00
392 #define IPV6_ADDR_LLA 0x02
393 #define IPV6_ADDR_GUA 0x03
592 #if (_WIZCHIP_IO_MODE_ & _WIZCHIP_IO_MODE_BUS_)
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) );
615 #if (_WIZCHIP_IO_MODE_ & _WIZCHIP_IO_MODE_SPI_)
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) );
967 #endif // _WIZCHIP_CONF_H_
uint8_t ip[16]
Destination IP Address. IPv4 index : 0 to 3, IPv6 index : 0 to 15.
@ NM_UNRB_V6
Unreachable Destination for IPv6 Block.
@ NM_PB4_ALL
All PING4 request Block.
@ NM_PB6_ALL
All PING6 request Block.
ipconf_mode
IP Address Configuration Mode.
@ NM_TRSTB_V6
TCP RST packet for IPv6 Send Block.
@ CNS_DAD
Duplicated IPv6 Address Detection.
ctlnetwork_type
Network control type enumeration.
@ NETINFO_NONE
No use DHCP.
uint8_t sl_retry_cnt
The retry count of SOCKET-less.
@ CW_SET_SYSCLK
Set the system clock with SYSCLK_100MHZ or SYSCLK_10MHZ only when SYS_CHIP_LOCK is unlock.
uint8_t duplex
set by PHY_DUPLEX_HALF PHY_DUPLEX_FULL
@ CN_SET_NETMODE
Set network mode with netmode_type.
@ IK_SOCKL_TOUT
_SLCR_ Timeout Interrupt. Refer to ctlnetservice_type.
void(* _write_byte_buf)(uint8_t *pBuf, datasize_t len)
Write byte data as many as len to _WIZCHIP_ through SPI.
@ IK_SOCKL_ARP4
_SLCR_ APR4 Interrupt. Refer to CNS_ARP.
@ CW_SET_PHYPOWMODE
Set PHY power mode with PHY_POWER_NORM or PHY_POWER_DOWN.
uint8_t lla[16]
Source Link Local Address.
@ NETINFO_DHCP_ALL
Dynamic IPv4 and IPv6 configuration from a DHCP sever.
uint8_t gua[16]
Source Global Unicast Address.
@ CN_SET_PREFER
Set the preferred source IPv6 address of _SLCR_. Refer to IPV6_ADDR_AUTO, IPV6_ADDR_LLA,...
uint8_t dns[4]
DNS server IPv4 Address.
struct wiz_PhyConf_t wiz_PhyConf
Ethernet PHY operation mode configuration.
@ NETINFO_DHCP_V6
Dynamic IPv6 configuration from a DHCP sever.
@ CW_GET_INTERRUPT
Get the interrupt status with intr_kind.
void(* _d_e_s_e_l_e_c_t_)(void)
_WIZCHIP_ deselected
uint16_t if_mode
HOST Interface Mode.
Destination Information & Destination Hardware Address for CNS_ARP.
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.
@ IK_SOCKL_ARP6
_SLCR_ ARP6 Interrupt. Refer to CNS_ARP.
@ NM_PARP_V4
ARP request for IPv4 before PINGv4 Replay.
@ CN_GET_NETINFO
Get Network with wiz_NetInfo.
@ IK_SOCK_0
Socket 0 Interrupt.
@ CW_GET_PHYPOWMODE
Get PHY Power mode with PHY_POWER_NORM or PHY_POWER_DOWN.
void(* _e_n_t_e_r_)(void)
critical section enter
@ CNS_SLAAC
Stateless Address Auto-configuration(SLAAC) with wiz_Prefix.
uint8_t dha[6]
Destination Hardware Address when ARP-reply is received from the destination.
uint8_t dns6[16]
DNS server IPv6 Address.
uint8_t mode
set by PHY_MODE_MANUAL ,PHY_MODE_AUTONEGO, or PHY_MODE_TE
@ NM_DHA_SELECT
Destination Hardware Address Select.
@ CNS_PING
PING process with wiz_IPAddress.
@ NM_IPB_V6
IPv6 Packet Block.
uint8_t gw6[16]
Gateway IPv6 Address.
@ CW_GET_SYSCLK
Get the system clock with SYSCLK_100MHZ or SYSCLK_10MHZ.
netmode_type
Network mode Configuration.
@ IK_SOCKL_NS
_SLCR_ NS Interrupt. Refer to CNS_DAD.
@ NM_IPB_V4
IPv4 Packet Block.
@ CW_SET_PHYCONF
Set PHY operation mode (Manual/Auto, 10/100, Half/Full) with wiz_PhyConf.
@ CN_GET_NETMODE
Get network mode with netmode_type.
@ NM_MASK_ALL
netmode_type all mask value
@ CW_GET_PHYLINK
Get PHY Link status with PHY_LINK_ON or PHY_LINK_OFF.
uint8_t len
Destination IP Address Length. IPv4 : 4, IPv6 : 16.
@ CW_SET_INTRMASK
Set the interrupt mask with intr_kind.
ctlwizchip_type
_WIZCHIP_ Control Type Enumeration.
@ NM_PB6_MULTI
PING6 request from multicasting group address Block.
@ IK_SOCK_5
Socket 5 Interrupt.
ctlnetservice_type
Network Service Control Type enumeration.
@ CNS_ARP
ARP process with wiz_IPAddress.
Callback function set for _WIZCHIP_.
struct __WIZCHIP_T__ _WIZCHIP_T_
Callback function set for _WIZCHIP_.
uint8_t(* _read_byte)(void)
Read 1 byte data from _WIZCHIP_ through SPI.
@ NETINFO_STATIC_ALL
Static IPv4 and IPv6 configuration by manually.
@ IK_SOCK_7
Socket 7 Interrupt.
@ CW_INIT_WIZCHIP
Initialize to SOCKETn buffer size with n byte array typed uint8_t.
@ NETINFO_DHCP_V4
Dynamic IPv4 configuration from a DHCP sever.
@ IK_SOCK_6
Socket 6 Interrupt.
uint8_t sn6[16]
IPv6 Prefix.
@ CN_SET_TIMEOUT
Set network timeout with wiz_NetTimeout.
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
Lock or Unlock _WIZCHIP_ with SYS_CHIP_LOCK, SYS_PHY_LOCK, and SYS_NET_LOCK.
@ NM_PARP_V6
ARP request for IPv6 before PINGv4 Replay.
_WIZCHIP_T_ WIZCHIP
WIZCHIP is instance of _WIZCHIP_T_ to access _WIZCHIP_.
void(* _write_data)(uint32_t AddrSel, iodata_t wb)
Write 1 iodata_t to _WIZCHIP_ through BUS.
@ IK_SOCKL_RS
_SLCR_ RS Interrupt. Refer to CNS_SLAAC.
struct wiz_NetInfo_t wiz_NetInfo
Network Information for _WIZCHIP_.
@ IK_SOCKL_PING4
_SLCR_ PING4 Interrupt. Refer to CNS_PING.
struct __WIZCHIP_T__::_CRIS CRIS
The set of _WIZCHIP_ select control callback function.
@ CW_GET_PHYSTATUS
Get real operation mode with wiz_PhyConf when PHY is linked up.
@ IK_SOCK_ALL
All Socket Interrupt.
@ CW_GET_ID
Get _WIZCHIP_ name.
void reg_wizchip_cs_cbfunc(void(*cs_sel)(void), void(*cs_desel)(void))
Registers call back functions for _WIZCHIP_ select & deselect.
@ CW_GET_INTRTIME
Get the interrupt pending time.
@ IK_SOCKL_RA
_SLCR_ RA Interrupt. Refer to CNS_GET_PREFIX.
Network Timeout for _WIZCHIP_.
void(* _e_x_i_t_)(void)
critical section exit
@ IK_SOCKL_PING6
_SLCR_ PING6 Interrupt. Refer to CNS_PING.
uint8_t mac[6]
Source Hardware Address.
@ NM_WOL
Wake On Lan(WOL) Mode.
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.
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...
@ CW_GET_SYSLOCK
Get the lock status of _WIZCHIP_ with SYS_CHIP_LOCK, SYS_PHY_LOCK, and SYS_NET_LOCK.
uint8_t speed
set by PHY_SPEED_10 or PHY_SPEED_100
@ IK_IP_CONFLICT
IPv4 Address Conflict Interrupt.
@ CW_GET_INTRMASK
Get the interrupt mask with intr_kind.
@ NM_NET4_MASK
_NET4MR_ Mask value
@ NETINFO_STATIC_V6
Static IPv6 configuration by manually.
uint16_t s_time_100us
The retransmission time of SOCKETn (unit 100us)
union __WIZCHIP_T__::_IF IF
ipconf_mode ipmode
IP Configuration Mode.
uint8_t prefix[16]
Prefix.
@ IK_NET_ALL
All Network Interrupt.
@ NM_PB6_ALLNODE
PING6 request from all-node multicasting address Block.
uint32_t preferred_lifetime
Preferred Lifetime.
void(* _write_byte)(uint8_t wb)
Write 1 byte data to _WIZCHIP_ through SPI.
uint8_t gw[4]
Gateway IPv4 Address.
@ CNS_GET_PREFIX
Get prefix information with wiz_Prefix.
void(* _s_e_l_e_c_t_)(void)
_WIZCHIP_ selected
struct wiz_IPAddress_t wiz_IPAddress
Destination Information for Network Service of _WIZCHIP_.
iodata_t(* _read_data)(uint32_t AddrSel)
Read 1 iodata_t from _WIZCHIP_ through BUS.
void(* _read_byte_buf)(uint8_t *pBuf, datasize_t len)
Read byte data as many as len from _WIZCHIP_ through SPI.
@ IK_SOCK_3
Socket 3 Interrupt.
struct wiz_NetTimeout_t wiz_NetTimeout
Network Timeout for _WIZCHIP_.
struct __WIZCHIP_T__::_CS CS
The set of interface IO callback function.
@ CW_SET_INTRTIME
Set the interrupt pending time.
@ CW_CLR_INTERRUPT
Clear the interrupt with intr_kind.
@ NETINFO_STATIC_V4
Static IPv4 configuration by manually.
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.
struct wiz_ARP_t wiz_ARP
Destination Information & Destination Hardware Address for CNS_ARP.
@ CN_SET_NETINFO
Set Network with wiz_NetInfo.
@ NM_TRSTB_V4
TCP RST packet for IPv4 Send Block.
uint8_t ip[4]
Source IPv4 Address.
@ IK_INT_ALL
All Interrupt.
@ CNS_UNSOL_NA
Unsolicited Neighbor Advertisement for update _WIZCHIP_ network information to neighbors.
@ CW_SET_IEN
Set the global interrupt enable only when SYS_CHIP_LOCK is not set.
@ IK_PPPOE_TERMINATED
PPPoE Termination Interrupt.
struct wiz_PING_t wiz_PING
Destination Information & Destination Hardware Address for CNS_ARP.
@ IK_SOCK_4
Socket 4 Interrupt.
@ CN_GET_TIMEOUT
Get network timeout with wiz_NetTimeout.
@ IK_WOL
WOL magic packet Interrupt.
wiz_IPAddress destinfo
Destination IP address for ARP-request.
@ IK_SOCK_1
Socket 1 Interrupt.
Network Information for _WIZCHIP_.
Ethernet PHY operation mode configuration.
Destination Information & Destination Hardware Address for CNS_ARP.
struct wiz_Prefix_t wiz_Prefix
Prefix Information.
uint8_t len
Prefix Length. It is used to set _SUB6R_ to 1 as many as len from LSB bit.
@ CW_RESET_WIZCHIP
Reset _WIZCHIP_ by software.
@ IK_SOCK_2
Socket 2 Interrupt.
@ IK_DEST_UNREACH
ICMPv4 Destination Unreachable Interrupt.
@ CN_GET_PREFER
Get the preferred source IPv6 address of _SLCR_. Refer to IPV6_ADDR_AUTO, IPV6_ADDR_LLA,...
@ NM_MR_MASK
_NETMR_ Mask value
Destination Information for Network Service of _WIZCHIP_.
@ CW_SYS_UNLOCK
Lock or Unlock _WIZCHIP_ with SYS_CHIP_LOCK, SYS_PHY_LOCK, and SYS_NET_LOCK.
uint8_t s_retry_cnt
The default retry count of SOCKETn.
@ NM_NET6_MASK
_NET6MR_ Mask value
@ IK_DEST_UNREACH6
ICMPv6 Destination Unreachable Interrupt.
@ CW_GET_PHYCONF
Get PHY operation mode (Manual/Auto, 10/100, Half/Full) with wiz_PhyConf.
@ NM_MR2_MASK
_NETMR2_ Mask value
uint16_t sl_time_100us
The retransmission time of SOCKET-less (unit 100us)
uint32_t valid_lifetime
Valid Lifetime.
@ NM_UNRB_V4
Unreachable Destination for IPv4 Block.
@ NETINFO_SLAAC_V6
Stateless Adders Auto Configuration for IPv6.
@ IK_SOCKL_ALL
_SLCR_ All Interrupt
struct __WIZCHIP_T__::_IF::_SPI SPI
@ CW_GET_VER
Get the version of TCP/IP TOE engine.
void reg_wizchip_cris_cbfunc(void(*cris_en)(void), void(*cris_ex)(void))
Registers call back functions for critical section.
uint8_t sn[4]
Subnet Mask value.
@ CW_GET_IEN
Get the global interrupt enable.