![]() |
io6Library
WIZnet Dual Stack TCP/IP Ethernet Controller Driver
|
These functions is optional function. More...
Functions | |
| int8_t | ctlwizchip (ctlwizchip_type cwtype, void *arg) |
| Control _WIZCHIP_. More... | |
| int8_t | ctlnetwork (ctlnetwork_type cntype, void *arg) |
| Controls to network. More... | |
| int8_t | ctlnetservice (ctlnetservice_type cnstype, void *arg) |
| Controls to network service. More... | |
| void | wizchip_sw_reset (void) |
| Soft Reset _WIZCHIP_. More... | |
| int8_t | wizchip_init (uint8_t *txsize, uint8_t *rxsize) |
| Initializes SOCKETn TX/RX buffer size. More... | |
| void | wizchip_clrinterrupt (intr_kind intr) |
| Clear Interrupt of _WIZCHIP_. More... | |
| intr_kind | wizchip_getinterrupt (void) |
| Get Interrupt of _WIZCHIP_. More... | |
| void | wizchip_setinterruptmask (intr_kind intr) |
| Mask or Unmask Interrupt of _WIZCHIP_. More... | |
| intr_kind | wizchip_getinterruptmask (void) |
| Get Interrupt mask of _WIZCHIP_. More... | |
| int8_t | wizphy_getphylink (void) |
| Get the Link status of integrated PHY. More... | |
| void | wizphy_reset (void) |
| Reset the integrated PHY. More... | |
| void | wizphy_setphyconf (wiz_PhyConf *phyconf) |
| void | wizphy_getphyconf (wiz_PhyConf *phyconf) |
| Get the integrated Ethernet PHY operation mode. More... | |
| void | wizphy_getphystatus (wiz_PhyConf *phyconf) |
| Get the real PHY operation status when link is established. More... | |
| void | wizphy_setphypmode (uint8_t pmode) |
| Set the power mode of integrated Ethernet PHY. More... | |
| int8_t | wizphy_getphypmode (void) |
| get the power mode of integrated Ethernet PHY. More... | |
| void | wizchip_setnetinfo (wiz_NetInfo *pnetinfo) |
| Set the network information for _WIZCHIP_. More... | |
| void | wizchip_getnetinfo (wiz_NetInfo *pnetinfo) |
| Get the network information of _WIZCHIP_. More... | |
| void | wizchip_setnetmode (netmode_type netmode) |
| Set the network mode such as WOL, PPPoE, PING Block, and etc. More... | |
| netmode_type | wizchip_getnetmode (void) |
| Get the network mode such as WOL, PPPoE, PING Block, and etc. More... | |
| void | wizchip_settimeout (wiz_NetTimeout *nettime) |
| Set retransmission time values and retry counts. More... | |
| void | wizchip_gettimeout (wiz_NetTimeout *nettime) |
| Get retransmission time values and retry counts. More... | |
| int8_t | wizchip_arp (wiz_ARP *arp) |
| ARP process. More... | |
| int8_t | wizchip_ping (wiz_PING *ping) |
| PING process. More... | |
| int8_t | wizchip_dad (uint8_t *ipv6) |
| DAD(Duplcated Address Detection) process. More... | |
| int8_t | wizchip_slaac (wiz_Prefix *prefix) |
| Stateless Address Auto Configuration(SLAAC) process. More... | |
| int8_t | wizchip_unsolicited (void) |
| Unsolicited NA process. More... | |
| int8_t | wizchip_getprefix (wiz_Prefix *prefix) |
| Get a prefix information of RA message from a router. More... | |
These functions is optional function.
2. WIZnet Extra Functions could be replaced with WIZCHIP I/O functions,
because they were made by Basic_IO_function_W6100.
These functions configure or indicate _WIZCHIP_, network information, interrupt, PHY, and timer.
| int8_t ctlwizchip | ( | ctlwizchip_type | cwtype, |
| void * | arg | ||
| ) |
Control _WIZCHIP_.
ctlwizchip() resets _WIZCHIP_ & integrated Ethernet PHY,
configures PHY mode, monitors PHY(Link,Speed,Half/Full/Auto), controls interrupt & mask and so on.
| cwtype | : Decides to the control type |
| arg | : arg type is dependent on cwtype. |
ctlwizchip(CW_RESET_PHY);
// Need to wait stable reset time 60.3ms
your_delay_function(60300); Definition at line 313 of file wizchip_conf.c.
References _WIZCHIP_SOCK_NUM_, CHIPLOCK, CHIPUNLOCK, CW_CLR_INTERRUPT, CW_GET_ID, CW_GET_IEN, CW_GET_INTERRUPT, CW_GET_INTRMASK, CW_GET_INTRTIME, CW_GET_PHYCONF, CW_GET_PHYLINK, CW_GET_PHYPOWMODE, CW_GET_PHYSTATUS, CW_GET_SYSCLK, CW_GET_SYSLOCK, CW_GET_VER, CW_INIT_WIZCHIP, CW_RESET_PHY, CW_RESET_WIZCHIP, CW_SET_IEN, CW_SET_INTRMASK, CW_SET_INTRTIME, CW_SET_PHYCONF, CW_SET_PHYPOWMODE, CW_SET_SYSCLK, CW_SYS_LOCK, CW_SYS_UNLOCK, getINTPTMR, getSYCR1, getSYSR, getVER, __WIZCHIP_T__::id, NETLOCK, NETUNLOCK, PHYLOCK, PHYUNLOCK, setINTPTMR, setSYCR1, SYCR1_CLKSEL, SYCR1_IEN, SYS_CHIP_LOCK, SYS_NET_LOCK, SYS_PHY_LOCK, SYSCLK_100MHZ, SYSCLK_25MHZ, WIZCHIP, wizchip_clrinterrupt(), wizchip_getinterrupt(), wizchip_getinterruptmask(), wizchip_init(), wizchip_setinterruptmask(), wizchip_sw_reset(), wizphy_getphyconf(), wizphy_getphylink(), wizphy_getphypmode(), wizphy_getphystatus(), wizphy_reset(), wizphy_setphyconf(), and wizphy_setphypmode().
| int8_t ctlnetwork | ( | ctlnetwork_type | cntype, |
| void * | arg | ||
| ) |
Controls to network.
ctlnetwork() controls to network environment, mode, timeout and so on.
| cntype | : Decides to the control type |
| arg | : arg type is dependent on cntype. |
Definition at line 415 of file wizchip_conf.c.
References CN_GET_NETINFO, CN_GET_NETMODE, CN_GET_PREFER, CN_GET_TIMEOUT, CN_SET_NETINFO, CN_SET_NETMODE, CN_SET_PREFER, CN_SET_TIMEOUT, getSLPSR, setSLPSR, wizchip_getnetinfo(), wizchip_getnetmode(), wizchip_gettimeout(), wizchip_setnetinfo(), wizchip_setnetmode(), and wizchip_settimeout().
| int8_t ctlnetservice | ( | ctlnetservice_type | cnstype, |
| void * | arg | ||
| ) |
Controls to network service.
Controls to network environment, mode, timeout and so on.
| cnstype | : Decides to the control type |
| arg | : arg type is dependent on cnstype. |
Definition at line 449 of file wizchip_conf.c.
References CNS_ARP, CNS_DAD, CNS_GET_PREFIX, CNS_PING, CNS_SLAAC, CNS_UNSOL_NA, wizchip_arp(), wizchip_dad(), wizchip_getprefix(), wizchip_ping(), wizchip_slaac(), and wizchip_unsolicited().
| void wizchip_sw_reset | ( | void | ) |
Soft Reset _WIZCHIP_.
Definition at line 471 of file wizchip_conf.c.
References CHIPLOCK, CHIPUNLOCK, getGA6R, getGAR, getGUAR, getLLAR, getSHAR, getSIPR, getSUB6R, getSUBR, getSYCR0, getSYSR, NETLOCK, NETUNLOCK, setGA6R, setGAR, setGUAR, setLLAR, setSHAR, setSIPR, setSUB6R, setSUBR, setSYCR0, SYCR0_RST, SYSR_CHPL, and SYSR_NETL.
Referenced by ctlwizchip(), and wizchip_init().
| int8_t wizchip_init | ( | uint8_t * | txsize, |
| uint8_t * | rxsize | ||
| ) |
Initializes SOCKETn TX/RX buffer size.
| txsize | SOCKETn TX buffer sizes. If it is null, SOCKETn TX buffer is initialized as the default size 2KB. |
| rxsize | SOCKETn RX buffer sizes. If it is null, SOCKETn RX buffer is initialized as the default size 2KB. |
Definition at line 498 of file wizchip_conf.c.
References _WIZCHIP_SOCK_NUM_, setSn_RXBUF_SIZE, setSn_TXBUF_SIZE, and wizchip_sw_reset().
Referenced by ctlwizchip().
| void wizchip_clrinterrupt | ( | intr_kind | intr | ) |
Clear Interrupt of _WIZCHIP_.
| intr | : intr_kind value operated OR. It can type-cast to uint32_t. |
Definition at line 526 of file wizchip_conf.c.
References _WIZCHIP_SOCK_NUM_, setIRCLR, setSLIRCLR, and setSn_IRCLR.
Referenced by ctlwizchip().
| intr_kind wizchip_getinterrupt | ( | void | ) |
Get Interrupt of _WIZCHIP_.
Definition at line 540 of file wizchip_conf.c.
References getIR, getSIR, and getSLIR.
Referenced by ctlwizchip().
| void wizchip_setinterruptmask | ( | intr_kind | intr | ) |
Mask or Unmask Interrupt of _WIZCHIP_.
| intr | : intr_kind value operated OR. It can type-cast to uint32_t. |
Definition at line 547 of file wizchip_conf.c.
References setIMR, setSIMR, and setSLIMR.
Referenced by ctlwizchip().
| intr_kind wizchip_getinterruptmask | ( | void | ) |
Get Interrupt mask of _WIZCHIP_.
Definition at line 557 of file wizchip_conf.c.
References getIMR, getSIMR, and getSLIMR.
Referenced by ctlwizchip().
| int8_t wizphy_getphylink | ( | void | ) |
Get the Link status of integrated PHY.
wizphy_getphylink() gets the link status of the integrated Ethernet PHY
through _PHY_IO_MODE_PHYCR_ or _PHY_IO_MODE_MII_.
Definition at line 564 of file wizchip_conf.c.
References BMSR_LINK_STATUS, getPHYSR, PHY_LINK_OFF, PHY_LINK_ON, PHYRAR_BMSR, PHYSR_LNK, and wiz_mdio_read().
Referenced by ctlwizchip().
| void wizphy_reset | ( | void | ) |
Reset the integrated PHY.
wizphy_reset() resets the integrated Ethernet PHY
through _PHY_IO_MODE_PHYCR_ or _PHY_IO_MODE_MII_.
Definition at line 574 of file wizchip_conf.c.
References BMCR_RST, getPHYCR1, PHYCR1_RST, PHYLOCK, PHYRAR_BMCR, PHYUNLOCK, setPHYCR1, wiz_mdio_read(), and wiz_mdio_write().
Referenced by ctlwizchip().
| void wizphy_setphyconf | ( | wiz_PhyConf * | phyconf | ) |
wizphy_setphyconf() set a operation mode of the integrated Ethernet PHY
through _PHY_IO_MODE_PHYCR_ or _PHY_IO_MODE_MII_.
| phyconf | : wiz_PhyConf |
Definition at line 587 of file wizchip_conf.c.
References BMCR_ANE, BMCR_DPX, BMCR_SPD, wiz_PhyConf_t::duplex, getPHYCR1, wiz_PhyConf_t::mode, PHY_DUPLEX_FULL, PHY_DUPLEX_HALF, PHY_MODE_AUTONEGO, PHY_MODE_TE, PHY_SPEED_10, PHY_SPEED_100, PHYCR0_AUTO, PHYCR1_TE, PHYRAR_BMCR, setPHYCR0, setPHYCR1, wiz_PhyConf_t::speed, wiz_mdio_read(), and wiz_mdio_write().
Referenced by ctlwizchip().
| void wizphy_getphyconf | ( | wiz_PhyConf * | phyconf | ) |
Get the integrated Ethernet PHY operation mode.
wizphy_getphyconf() gets a operation mode of the integrated Ethernet PHY
through _PHY_IO_MODE_PHYCR_ or _PHY_IO_MODE_MII_.
| phyconf | : wiz_PhyConf |
Definition at line 630 of file wizchip_conf.c.
References BMCR_ANE, BMCR_DPX, BMCR_SPD, wiz_PhyConf_t::duplex, getPHYCR1, getPHYSR, wiz_PhyConf_t::mode, PHY_DUPLEX_FULL, PHY_DUPLEX_HALF, PHY_MODE_AUTONEGO, PHY_MODE_MANUAL, PHY_MODE_TE, PHY_SPEED_10, PHY_SPEED_100, PHYCR1_TE, PHYRAR_BMCR, wiz_PhyConf_t::speed, and wiz_mdio_read().
Referenced by ctlwizchip().
| void wizphy_getphystatus | ( | wiz_PhyConf * | phyconf | ) |
Get the real PHY operation status when link is established.
wizphy_getphystatus() gets a operation mode of the integrated Ethernet PHY.
| phyconf | : wiz_PhyConf |
Definition at line 649 of file wizchip_conf.c.
References wiz_PhyConf_t::duplex, getPHYCR1, getPHYSR, wiz_PhyConf_t::mode, PHY_DUPLEX_FULL, PHY_DUPLEX_HALF, PHY_MODE_AUTONEGO, PHY_MODE_MANUAL, PHY_MODE_TE, PHY_SPEED_10, PHY_SPEED_100, PHYCR1_TE, PHYSR_DPX, PHYSR_SPD, and wiz_PhyConf_t::speed.
Referenced by ctlwizchip().
| void wizphy_setphypmode | ( | uint8_t | pmode | ) |
Set the power mode of integrated Ethernet PHY.
wizphy_setphypmode() sets a power mode of the integrated Ethernet PHY
through _PHY_IO_MODE_PHYCR_ or _PHY_IO_MODE_MII_.
| pmode | PHY_POWER_NORM or PHY_POWER_DOWN |
Definition at line 659 of file wizchip_conf.c.
References BMCR_PWDN, getPHYCR1, PHY_POWER_DOWN, PHYCR1_PWDN, PHYRAR_BMCR, setPHYCR1, wiz_mdio_read(), and wiz_mdio_write().
Referenced by ctlwizchip().
| int8_t wizphy_getphypmode | ( | void | ) |
get the power mode of integrated Ethernet PHY.
wizphy_getphypmode() gets a power mode of the integrated Ethernet PHY
through _PHY_IO_MODE_PHYCR_ or _PHY_IO_MODE_MII_.
Definition at line 675 of file wizchip_conf.c.
References BMCR_PWDN, getPHYCR1, PHY_POWER_DOWN, PHY_POWER_NORM, PHYCR1_PWDN, PHYRAR_BMCR, and wiz_mdio_read().
Referenced by ctlwizchip().
| void wizchip_setnetinfo | ( | wiz_NetInfo * | pnetinfo | ) |
Set the network information for _WIZCHIP_.
| pnetinfo | : wiz_NetInfo |
Definition at line 685 of file wizchip_conf.c.
References wiz_NetInfo_t::gua, wiz_NetInfo_t::gw, wiz_NetInfo_t::gw6, wiz_NetInfo_t::ip, wiz_NetInfo_t::lla, wiz_NetInfo_t::mac, setGA6R, setGAR, setGUAR, setLLAR, setSHAR, setSIPR, setSUB6R, setSUBR, wiz_NetInfo_t::sn, and wiz_NetInfo_t::sn6.
Referenced by ctlnetwork().
| void wizchip_getnetinfo | ( | wiz_NetInfo * | pnetinfo | ) |
Get the network information of _WIZCHIP_.
| pnetinfo | : wiz_NetInfo |
Definition at line 703 of file wizchip_conf.c.
References wiz_NetInfo_t::dns, getGA6R, getGAR, getGUAR, getLLAR, getSHAR, getSIPR, getSUB6R, getSUBR, wiz_NetInfo_t::gua, wiz_NetInfo_t::gw, wiz_NetInfo_t::gw6, wiz_NetInfo_t::ip, wiz_NetInfo_t::lla, wiz_NetInfo_t::mac, wiz_NetInfo_t::sn, and wiz_NetInfo_t::sn6.
Referenced by ctlnetwork().
| void wizchip_setnetmode | ( | netmode_type | netmode | ) |
Set the network mode such as WOL, PPPoE, PING Block, and etc.
| netmode | : netmode_type. |
Definition at line 722 of file wizchip_conf.c.
References setNET4MR, setNET6MR, setNETMR, and setNETMR2.
Referenced by ctlnetwork().
| netmode_type wizchip_getnetmode | ( | void | ) |
Get the network mode such as WOL, PPPoE, PING Block, and etc.
Definition at line 731 of file wizchip_conf.c.
References getNET4MR, getNET6MR, getNETMR, and getNETMR2.
Referenced by ctlnetwork().
| void wizchip_settimeout | ( | wiz_NetTimeout * | nettime | ) |
Set retransmission time values and retry counts.
| nettime | : wiz_NetTimeout. |
Definition at line 741 of file wizchip_conf.c.
References wiz_NetTimeout_t::s_retry_cnt, wiz_NetTimeout_t::s_time_100us, setRCR, setRTR, setSLRCR, setSLRTR, wiz_NetTimeout_t::sl_retry_cnt, and wiz_NetTimeout_t::sl_time_100us.
Referenced by ctlnetwork().
| void wizchip_gettimeout | ( | wiz_NetTimeout * | nettime | ) |
Get retransmission time values and retry counts.
| nettime | : wiz_NetTimeout. |
Definition at line 749 of file wizchip_conf.c.
References getRCR, getRTR, getSLRCR, getSLRTR, wiz_NetTimeout_t::s_retry_cnt, wiz_NetTimeout_t::s_time_100us, wiz_NetTimeout_t::sl_retry_cnt, and wiz_NetTimeout_t::sl_time_100us.
Referenced by ctlnetwork().
| int8_t wizchip_arp | ( | wiz_ARP * | arp | ) |
ARP process.
wizchip_arp() processes ARP.
It sends the APR-request to destination and waits to receive the ARP-reply.
| arp | wiz_ARP. It sets a destination IP address and indicates the destination hardware address. |
Definition at line 757 of file wizchip_conf.c.
References wiz_ARP_t::destinfo, wiz_ARP_t::dha, getSLCR, getSLDHAR, getSLIR, wiz_IPAddress_t::ip, wiz_IPAddress_t::len, setSLCR, setSLDIP4R, setSLDIP6R, setSLIRCLR, SLCR_ARP4, SLCR_ARP6, SLIR_ARP4, SLIR_ARP6, and SLIR_RA.
Referenced by ctlnetservice().
| int8_t wizchip_ping | ( | wiz_PING * | ping | ) |
PING process.
wizchip_ping() processes PING.
It sends the PING-request to destination and waits to receive the PING-reply.
| ping | wiz_PING, It sets a destination IP address, ID, SEQ of PING-request message |
Definition at line 781 of file wizchip_conf.c.
References wiz_PING_t::destinfo, getSLCR, getSLIR, wiz_PING_t::id, wiz_IPAddress_t::ip, wiz_IPAddress_t::len, wiz_PING_t::seq, setPINGIDR, setPINGSEQR, setSLCR, setSLDIP4R, setSLDIP6R, setSLIRCLR, SLCR_PING4, SLCR_PING6, SLIR_PING4, SLIR_PING6, and SLIR_RA.
Referenced by ctlnetservice().
| int8_t wizchip_dad | ( | uint8_t * | ipv6 | ) |
DAD(Duplcated Address Detection) process.
wizchip_dad() detects the duplication of source IPv6 address.
It sends a NA message for DAD to all-node multicasting address(FF02::01).
| ipv6 | : IPv6 address to be detected the duplication. |
Definition at line 803 of file wizchip_conf.c.
References getSLCR, getSLIR, setSLCR, setSLDIP6R, setSLIRCLR, SLCR_NS, SLIR_RA, and SLIR_TOUT.
Referenced by ctlnetservice().
| int8_t wizchip_slaac | ( | wiz_Prefix * | prefix | ) |
Stateless Address Auto Configuration(SLAAC) process.
wizchip_slaac() get a prefix information from a router for SLAAC.
It sends first a RS message to all-router and waits to receive a RS message with prefix information option from a router.
| prefix | wiz_Prefix |
Definition at line 815 of file wizchip_conf.c.
References wiz_Prefix_t::flag, getPAR, getPFR, getPLR, getPLTR, getSLCR, getSLIR, getVLTR, wiz_Prefix_t::len, wiz_Prefix_t::preferred_lifetime, wiz_Prefix_t::prefix, setSLCR, setSLIRCLR, SLCR_RS, SLIR_RA, SLIR_RS, and wiz_Prefix_t::valid_lifetime.
Referenced by ctlnetservice().
| int8_t wizchip_unsolicited | ( | void | ) |
Unsolicited NA process.
wizchip_unsolicited() updates the network information of _WIZCHIP_ to neighbors.
It sends a unsolicited NA message with _LLAR_ or _GUAR_ to neighbors
in order to update the network information of _WIZCHIP_.
Because the unsolicited NA message have no reply, timeout is always occurred.
Definition at line 834 of file wizchip_conf.c.
References getSLCR, getSLIR, setSLCR, setSLIRCLR, SLCR_UNA, SLIR_RA, and SLIR_TOUT.
Referenced by ctlnetservice().
| int8_t wizchip_getprefix | ( | wiz_Prefix * | prefix | ) |
Get a prefix information of RA message from a router.
wizchip_getprefix() get a prefix information of RA is periodically sent by a router.
Definition at line 845 of file wizchip_conf.c.
References wiz_Prefix_t::flag, getPAR, getPFR, getPLR, getPLTR, getSLIR, getVLTR, wiz_Prefix_t::len, wiz_Prefix_t::preferred_lifetime, wiz_Prefix_t::prefix, setSLIRCLR, SLIR_RA, and wiz_Prefix_t::valid_lifetime.
Referenced by ctlnetservice().
1.8.17