BSD style socket API for W5500.
Dependencies: W5500
Fork of Ethernet by
wizchip_conf.h
00001 //***************************************************************************** 00002 // 00003 //! \file wizchip_conf.h 00004 //! \brief WIZCHIP Config Header File. 00005 //! \version 1.0.0 00006 //! \date 2013/10/01 00007 //! \par Revision history 00008 //! <2013/10/01> 1st Release 00009 //! \author MidnightCow 00010 //! \copyright 00011 //! 00012 //! Copyright (c) 2013, WIZnet Co., LTD. 00013 //! All rights reserved. 00014 //! 00015 //! Redistribution and use in source and binary forms, with or without 00016 //! modification, are permitted provided that the following conditions 00017 //! are met: 00018 //! 00019 //! * Redistributions of source code must retain the above copyright 00020 //! notice, this list of conditions and the following disclaimer. 00021 //! * Redistributions in binary form must reproduce the above copyright 00022 //! notice, this list of conditions and the following disclaimer in the 00023 //! documentation and/or other materials provided with the distribution. 00024 //! * Neither the name of the <ORGANIZATION> nor the names of its 00025 //! contributors may be used to endorse or promote products derived 00026 //! from this software without specific prior written permission. 00027 //! 00028 //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00029 //! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00030 //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00031 //! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00032 //! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00033 //! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00034 //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00035 //! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00036 //! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00037 //! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 00038 //! THE POSSIBILITY OF SUCH DAMAGE. 00039 // 00040 //***************************************************************************** 00041 00042 /** 00043 * @defgroup extra_functions 2. WIZnet Extra Functions 00044 * 00045 * @brief These functions is optional function. It could be replaced at WIZCHIP I/O function because they were made by WIZCHIP I/O functions. 00046 * @details There are functions of configuring WIZCHIP, network, interrupt, phy, network information and timer. \n 00047 * 00048 */ 00049 #ifdef __cplusplus 00050 extern "C" { 00051 #endif 00052 00053 #ifndef _WIZCHIP_CONF_H_ 00054 #define _WIZCHIP_CONF_H_ 00055 00056 #include <stdint.h> 00057 /** 00058 * @brief Select WIZCHIP. 00059 * @todo You should select one, \b 5100, \b 5200 ,\b 5500 or etc. \n\n 00060 * ex> <code> #define \_WIZCHIP_ 5500 </code> 00061 */ 00062 #define _WIZCHIP_ 5500 // 5100, 5200, 5500 00063 00064 #define _WIZCHIP_IO_MODE_NONE_ 0x0000 00065 #define _WIZCHIP_IO_MODE_BUS_ 0x0100 /**< Bus interface mode */ 00066 #define _WIZCHIP_IO_MODE_SPI_ 0x0200 /**< SPI interface mode */ 00067 //#define _WIZCHIP_IO_MODE_IIC_ 0x0400 00068 //#define _WIZCHIP_IO_MODE_SDIO_ 0x0800 00069 // Add to 00070 // 00071 00072 #define _WIZCHIP_IO_MODE_BUS_DIR_ (_WIZCHIP_IO_MODE_BUS_ + 1) /**< BUS interface mode for direct */ 00073 #define _WIZCHIP_IO_MODE_BUS_INDIR_ (_WIZCHIP_IO_MODE_BUS_ + 2) /**< BUS interface mode for indirect */ 00074 00075 #define _WIZCHIP_IO_MODE_SPI_VDM_ (_WIZCHIP_IO_MODE_SPI_ + 1) /**< SPI interface mode for variable length data*/ 00076 #define _WIZCHIP_IO_MODE_SPI_FDM_ (_WIZCHIP_IO_MODE_SPI_ + 2) /**< SPI interface mode for fixed length data mode*/ 00077 00078 00079 #if (_WIZCHIP_ == 5100) 00080 #define _WIZCHIP_ID_ "W5100\0" 00081 /** 00082 * @brief Define interface mode. 00083 * @todo you should select interface mode as chip. Select one of @ref \_WIZCHIP_IO_MODE_SPI_ , @ref \_WIZCHIP_IO_MODE_BUS_DIR_ or @ref \_WIZCHIP_IO_MODE_BUS_INDIR_ 00084 */ 00085 00086 // #define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_BUS_DIR_ 00087 // #define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_BUS_INDIR_ 00088 #define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_ 00089 00090 #elif (_WIZCHIP_ == 5200) 00091 #define _WIZCHIP_ID_ "W5200\0" 00092 /** 00093 * @brief Define interface mode. 00094 * @todo you should select interface mode as chip. Select one of @ref \_WIZCHIP_IO_MODE_SPI_ or @ref \_WIZCHIP_IO_MODE_BUS_INDIR_ 00095 */ 00096 // #define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_BUS_INDIR_ 00097 #define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_ 00098 #include "W5200/w5200.h" 00099 #elif (_WIZCHIP_ == 5500) 00100 #define _WIZCHIP_ID_ "W5500\0" 00101 00102 /** 00103 * @brief Define interface mode. \n 00104 * @todo Should select interface mode as chip. 00105 * - @ref \_WIZCHIP_IO_MODE_SPI_ \n 00106 * -@ref \_WIZCHIP_IO_MODE_SPI_VDM_ : Valid only in @ref \_WIZCHIP_ == 5500 \n 00107 * -@ref \_WIZCHIP_IO_MODE_SPI_FDM_ : Valid only in @ref \_WIZCHIP_ == 5500 \n 00108 * - @ref \_WIZCHIP_IO_MODE_BUS_ \n 00109 * - @ref \_WIZCHIP_IO_MODE_BUS_DIR_ \n 00110 * - @ref \_WIZCHIP_IO_MODE_BUS_INDIR_ \n 00111 * - Others will be defined in future. \n\n 00112 * ex> <code> #define \_WIZCHIP_IO_MODE_ \_WIZCHIP_IO_MODE_SPI_VDM_ </code> 00113 * 00114 */ 00115 //#define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_FDM_ 00116 #define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_VDM_ 00117 #include "W5500/w5500.h" 00118 #else 00119 #error "Unknown defined _WIZCHIP_. You should define one of 5100, 5200, and 5500 !!!" 00120 #endif 00121 00122 #ifndef _WIZCHIP_IO_MODE_ 00123 #error "Undefined _WIZCHIP_IO_MODE_. You should define it !!!" 00124 #endif 00125 00126 /** 00127 * @brief Define I/O base address when BUS IF mode. 00128 * @todo Should re-define it to fit your system when BUS IF Mode (@ref \_WIZCHIP_IO_MODE_BUS_, 00129 * @ref \_WIZCHIP_IO_MODE_BUS_DIR_, @ref \_WIZCHIP_IO_MODE_BUS_INDIR_). \n\n 00130 * ex> <code> #define \_WIZCHIP_IO_BASE_ 0x00008000 </code> 00131 */ 00132 #define _WIZCHIP_IO_BASE_ 0x00000000 // 00133 00134 #if _WIZCHIP_IO_MODE_ & _WIZCHIP_IO_MODE_BUS 00135 #ifndef _WIZCHIP_IO_BASE_ 00136 #error "You should be define _WIZCHIP_IO_BASE to fit your system memory map." 00137 #endif 00138 #endif 00139 00140 #if _WIZCHIP_ > 5100 00141 #define _WIZCHIP_SOCK_NUM_ 8 ///< The count of independant socket of @b WIZCHIP 00142 #else 00143 #define _WIZCHIP_SOCK_NUM_ 4 ///< The count of independant socket of @b WIZCHIP 00144 #endif 00145 00146 00147 /******************************************************** 00148 * WIZCHIP BASIC IF functions for SPI, SDIO, I2C , ETC. 00149 *********************************************************/ 00150 /** 00151 * @ingroup DATA_TYPE 00152 * @brief The set of callback functions for W5500:@ref WIZCHIP_IO_Functions W5200:@ref WIZCHIP_IO_Functions_W5200 00153 */ 00154 typedef struct __WIZCHIP 00155 { 00156 uint16_t if_mode; ///< host interface mode 00157 uint8_t id[6]; ///< @b WIZCHIP ID such as @b 5100, @b 5200, @b 5500, and so on. 00158 /** 00159 * The set of critical section callback func. 00160 */ 00161 struct _CRIS 00162 { 00163 void (*_enter) (void); ///< crtical section enter 00164 void (*_exit) (void); ///< critial section exit 00165 }CRIS; 00166 /** 00167 * The set of @ref\_WIZCHIP_ select control callback func. 00168 */ 00169 struct _CS 00170 { 00171 void (*_select) (void); ///< @ref \_WIZCHIP_ selected 00172 void (*_deselect)(void); ///< @ref \_WIZCHIP_ deselected 00173 }CS; 00174 /** 00175 * The set of interface IO callback func. 00176 */ 00177 union _IF 00178 { 00179 /** 00180 * For BUS interface IO 00181 */ 00182 struct 00183 { 00184 uint8_t (*_read_byte) (uint32_t AddrSel); 00185 void (*_write_byte) (uint32_t AddrSel, uint8_t wb); 00186 }BUS; 00187 /** 00188 * For SPI interface IO 00189 */ 00190 struct 00191 { 00192 uint8_t (*_read_byte) (void); 00193 void (*_write_byte) (uint8_t wb); 00194 }SPI; 00195 // To be added 00196 // 00197 }IF; 00198 }_WIZCHIP; 00199 00200 extern _WIZCHIP WIZCHIP; 00201 00202 /** 00203 * @ingroup DATA_TYPE 00204 * WIZCHIP control type enumration used in @ref ctlwizchip(). 00205 */ 00206 typedef enum 00207 { 00208 CW_RESET_WIZCHIP, ///< Resets WIZCHIP by softly 00209 CW_INIT_WIZCHIP, ///< Inializes to WIZCHIP with SOCKET buffer size 2 or 1 dimension array typed uint8_t. 00210 CW_GET_INTERRUPT, ///< Get Interrupt status of WIZCHIP 00211 CW_CLR_INTERRUPT, ///< Clears interrupt 00212 CW_SET_INTRMASK, ///< Masks interrupt 00213 CW_GET_INTRMASK, ///< Get interrupt mask 00214 CW_SET_INTRTIME, ///< Set interval time between the current and next interrupt. 00215 CW_GET_INTRTIME, ///< Set interval time between the current and next interrupt. 00216 CW_GET_ID, ///< Gets WIZCHIP name. 00217 00218 #if _WIZCHIP_ == 5500 00219 CW_RESET_PHY, ///< Resets internal PHY. Valid Only W5000 00220 CW_SET_PHYCONF, ///< When PHY configured by interal register, PHY operation mode (Manual/Auto, 10/100, Half/Full). Valid Only W5000 00221 CW_GET_PHYCONF, ///< Get PHY operation mode in interal register. Valid Only W5000 00222 CW_GET_PHYSTATUS, ///< Get real PHY status on operating. Valid Only W5000 00223 CW_SET_PHYPOWMODE, ///< Set PHY power mode as noraml and down when PHYSTATUS.OPMD == 1. Valid Only W5000 00224 #endif 00225 CW_GET_PHYPOWMODE, ///< Get PHY Power mode as down or normal 00226 CW_GET_PHYLINK ///< Get PHY Link status 00227 }ctlwizchip_type; 00228 00229 /** 00230 * @ingroup DATA_TYPE 00231 * Network control type enumration used in @ref ctlnetwork(). 00232 */ 00233 typedef enum 00234 { 00235 CN_SET_NETINFO, ///< Set Network with @ref wiz_NetInfo 00236 CN_GET_NETINFO, ///< Get Network with @ref wiz_NetInfo 00237 CN_SET_NETMODE, ///< Set network mode as WOL, PPPoE, Ping Block, and Force ARP mode 00238 CN_GET_NETMODE, ///< Get network mode as WOL, PPPoE, Ping Block, and Force ARP mode 00239 CN_SET_TIMEOUT, ///< Set network timeout as retry count and time. 00240 CN_GET_TIMEOUT, ///< Get network timeout as retry count and time. 00241 }ctlnetwork_type; 00242 00243 /** 00244 * @ingroup DATA_TYPE 00245 * Interrupt kind when CW_SET_INTRRUPT, CW_GET_INTERRUPT, CW_SET_INTRMASK 00246 * and CW_GET_INTRMASK is used in @ref ctlnetwork(). 00247 * It can be used with OR operation. 00248 */ 00249 typedef enum 00250 { 00251 #if _WIZCHIP_ > 5200 00252 IK_WOL = (1 << 4), ///< Wake On Lan by receiving the magic packet. Valid in W500. 00253 #endif 00254 00255 IK_PPPOE_TERMINATED = (1 << 5), ///< PPPoE Disconnected 00256 00257 #if _WIZCHIP_ != 5200 00258 IK_DEST_UNREACH = (1 << 6), ///< Destination IP & Port Unreable, No use in W5200 00259 #endif 00260 00261 IK_IP_CONFLICT = (1 << 7), ///< IP conflict occurred 00262 00263 IK_SOCK_0 = (1 << 8), ///< Socket 0 interrupt 00264 IK_SOCK_1 = (1 << 9), ///< Socket 1 interrupt 00265 IK_SOCK_2 = (1 << 10), ///< Socket 2 interrupt 00266 IK_SOCK_3 = (1 << 11), ///< Socket 3 interrupt 00267 #if _WIZCHIP_ > 5100 00268 IK_SOCK_4 = (1 << 12), ///< Socket 4 interrupt, No use in 5100 00269 IK_SOCK_5 = (1 << 13), ///< Socket 5 interrupt, No use in 5100 00270 IK_SOCK_6 = (1 << 14), ///< Socket 6 interrupt, No use in 5100 00271 IK_SOCK_7 = (1 << 15), ///< Socket 7 interrupt, No use in 5100 00272 #endif 00273 00274 #if _WIZCHIP_ > 5100 00275 IK_SOCK_ALL = (0xFF << 8) ///< All Socket interrpt 00276 #else 00277 IK_SOCK_ALL = (0x0F << 8) ///< All Socket interrpt 00278 #endif 00279 }intr_kind; 00280 00281 #define PHY_CONFBY_HW 0 ///< Configured PHY operation mode by HW pin 00282 #define PHY_CONFBY_SW 1 ///< Configured PHY operation mode by SW register 00283 #define PHY_MODE_MANUAL 0 ///< Configured PHY operation mode with user setting. 00284 #define PHY_MODE_AUTONEGO 1 ///< Configured PHY operation mode with auto-negotiation 00285 #define PHY_SPEED_10 0 ///< Link Speed 10 00286 #define PHY_SPEED_100 1 ///< Link Speed 100 00287 #define PHY_DUPLEX_HALF 0 ///< Link Half-Duplex 00288 #define PHY_DUPLEX_FULL 1 ///< Link Full-Duplex 00289 #define PHY_LINK_OFF 0 ///< Link Off 00290 #define PHY_LINK_ON 1 ///< Link On 00291 #define PHY_POWER_NORM 0 ///< PHY power normal mode 00292 #define PHY_POWER_DOWN 1 ///< PHY power down mode 00293 00294 00295 #if _WIZCHIP_ == 5500 00296 /** 00297 * @ingroup DATA_TYPE 00298 * It configures PHY configuration when CW_SET PHYCONF or CW_GET_PHYCONF in W5500, 00299 * and it indicates the real PHY status configured by HW or SW in all WIZCHIP. \n 00300 * Valid only in W5500. 00301 */ 00302 typedef struct wiz_PhyConf_t 00303 { 00304 uint8_t by; ///< set by @ref PHY_CONFBY_HW or @ref PHY_CONFBY_SW 00305 uint8_t mode; ///< set by @ref PHY_MODE_MANUAL or @ref PHY_MODE_AUTONEGO 00306 uint8_t speed; ///< set by @ref PHY_SPEED_10 or @ref PHY_SPEED_100 00307 uint8_t duplex; ///< set by @ref PHY_DUPLEX_HALF @ref PHY_DUPLEX_FULL 00308 //uint8_t power; ///< set by @ref PHY_POWER_NORM or @ref PHY_POWER_DOWN 00309 //uint8_t link; ///< Valid only in CW_GET_PHYSTATUS. set by @ref PHY_LINK_ON or PHY_DUPLEX_OFF 00310 }wiz_PhyConf; 00311 #endif 00312 00313 /** 00314 * @ingroup DATA_TYPE 00315 * It used in setting dhcp_mode of @ref wiz_NetInfo. 00316 */ 00317 typedef enum 00318 { 00319 NETINFO_STATIC = 1, ///< Static IP configuration by manually. 00320 NETINFO_DHCP ///< Dynamic IP configruation from a DHCP sever 00321 }dhcp_mode; 00322 00323 /** 00324 * @ingroup DATA_TYPE 00325 * Network Information for WIZCHIP 00326 */ 00327 typedef struct wiz_NetInfo_t 00328 { 00329 uint8_t mac[6]; ///< Source Mac Address 00330 uint8_t ip[4]; ///< Source IP Address 00331 uint8_t sn[4]; ///< Subnet Mask 00332 uint8_t gw[4]; ///< Gateway IP Address 00333 uint8_t dns[4]; ///< DNS server IP Address 00334 dhcp_mode dhcp; ///< 1 - Static, 2 - DHCP 00335 }wiz_NetInfo; 00336 00337 /** 00338 * @ingroup DATA_TYPE 00339 * Network mode 00340 */ 00341 typedef enum 00342 { 00343 #if _WIZCHIP_ == 5500 00344 NM_FORCEARP = (1<<1), ///< Force to APP send whenever udp data is sent. Valid only in W5500 00345 #endif 00346 NM_WAKEONLAN = (1<<5), ///< Wake On Lan 00347 NM_PINGBLOCK = (1<<4), ///< Block ping-request 00348 NM_PPPOE = (1<<3), ///< PPPoE mode 00349 }netmode_type; 00350 00351 /** 00352 * @ingroup DATA_TYPE 00353 * Used in CN_SET_TIMEOUT or CN_GET_TIMEOUT of @ref ctlwizchip() for timeout configruation. 00354 */ 00355 typedef struct wiz_NetTimeout_t 00356 { 00357 uint8_t retry_cnt; ///< retry count 00358 uint16_t time_100us; ///< time unit 100us 00359 }wiz_NetTimeout; 00360 00361 /** 00362 *@brief Registers call back function for critical section of I/O functions such as 00363 *\ref WIZCHIP_READ, @ref WIZCHIP_WRITE, @ref WIZCHIP_READ_BUF and @ref WIZCHIP_WRITE_BUF. 00364 *@param cris_en : callback function for critical section enter. 00365 *@param cris_ex : callback function for critical section exit. 00366 *@todo Describe @ref WIZCHIP_CRITICAL_ENTER and @ref WIZCHIP_CRITICAL_EXIT marco or register your functions. 00367 *@note If you do not describe or register, default functions(@ref wizchip_cris_enter & @ref wizchip_cris_exit) is called. 00368 */ 00369 void reg_wizchip_cris_cbfunc(void(*cris_en)(void), void(*cris_ex)(void)); 00370 00371 00372 /** 00373 *@brief Registers call back function for WIZCHIP select & deselect. 00374 *@param cs_sel : callback function for WIZCHIP select 00375 *@param cs_desel : callback fucntion for WIZCHIP deselect 00376 *@todo Describe @ref wizchip_cs_select and @ref wizchip_cs_deselect function or register your functions. 00377 *@note If you do not describe or register, null function is called. 00378 */ 00379 void reg_wizchip_cs_cbfunc(void(*cs_sel)(void), void(*cs_desel)(void)); 00380 00381 /** 00382 *@brief Registers call back function for bus interface. 00383 *@param bus_rb : callback function to read byte data using system bus 00384 *@param bus_wb : callback function to write byte data using system bus 00385 *@todo Describe @ref wizchip_bus_readbyte and @ref wizchip_bus_writebyte function 00386 *or register your functions. 00387 *@note If you do not describe or register, null function is called. 00388 */ 00389 void reg_wizchip_bus_cbfunc(uint8_t (*bus_rb)(uint32_t addr), void (*bus_wb)(uint32_t addr, uint8_t wb)); 00390 00391 /** 00392 *@brief Registers call back function for SPI interface. 00393 *@param spi_rb : callback function to read byte usig SPI 00394 *@param spi_wb : callback function to write byte usig SPI 00395 *@todo Describe \ref wizchip_spi_readbyte and \ref wizchip_spi_writebyte function 00396 *or register your functions. 00397 *@note If you do not describe or register, null function is called. 00398 */ 00399 void reg_wizchip_spi_cbfunc(uint8_t (*spi_rb)(void), void (*spi_wb)(uint8_t wb)); 00400 00401 /** 00402 * @ingroup extra_functions 00403 * @brief Controls to the WIZCHIP. 00404 * @details Resets WIZCHIP & internal PHY, Configures PHY mode, Monitor PHY(Link,Speed,Half/Full/Auto), 00405 * controls interrupt & mask and so on. 00406 * @param cwtype : Decides to the control type 00407 * @param arg : arg type is dependent on cwtype. 00408 * @return 0 : Success \n 00409 * -1 : Fail because of invalid \ref ctlwizchip_type or unsupported \ref ctlwizchip_type in WIZCHIP 00410 */ 00411 int8_t ctlwizchip(ctlwizchip_type cwtype, void* arg); 00412 00413 /** 00414 * @ingroup extra_functions 00415 * @brief Controls to network. 00416 * @details Controls to network environment, mode, timeout and so on. 00417 * @param cntype : Input. Decides to the control type 00418 * @param arg : Inout. arg type is dependent on cntype. 00419 * @return -1 : Fail because of invalid \ref ctlnetwork_type or unsupported \ref ctlnetwork_type in WIZCHIP \n 00420 * 0 : Success 00421 */ 00422 int8_t ctlnetwork(ctlnetwork_type cntype, void* arg); 00423 00424 00425 /* 00426 * The following functions are implemented for internal use. 00427 * but You can call these functions for code size reduction instead of ctlwizchip() and ctlnetwork(). 00428 */ 00429 00430 /** 00431 * @ingroup extra_functions 00432 * @brief Reset WIZCHIP by softly. 00433 */ 00434 void wizchip_sw_reset(void); 00435 00436 /** 00437 * @ingroup extra_functions 00438 * @brief Initializes WIZCHIP with socket buffer size 00439 * @param txsize Socket tx buffer sizes. If null, initialized the default size 2KB. 00440 * @param rxsize Socket rx buffer sizes. If null, initialized the default size 2KB. 00441 * @return 0 : succcess \n 00442 * -1 : fail. Invalid buffer size 00443 */ 00444 int8_t wizchip_init(uint8_t* txsize, uint8_t* rxsize); 00445 00446 /** 00447 * @ingroup extra_functions 00448 * @brief Clear Interrupt of WIZCHIP. 00449 * @param intr : @ref intr_kind value operated OR. It can type-cast to uint16_t. 00450 */ 00451 void wizchip_clrinterrupt(intr_kind intr); 00452 00453 /** 00454 * @ingroup extra_functions 00455 * @brief Get Interrupt of WIZCHIP. 00456 * @return @ref intr_kind value operated OR. It can type-cast to uint16_t. 00457 */ 00458 intr_kind wizchip_getinterrupt(void); 00459 00460 /** 00461 * @ingroup extra_functions 00462 * @brief Mask or Unmask Interrupt of WIZCHIP. 00463 * @param intr : @ref intr_kind value operated OR. It can type-cast to uint16_t. 00464 */ 00465 void wizchip_setinterruptmask(intr_kind intr); 00466 00467 /** 00468 * @ingroup extra_functions 00469 * @brief Get Interrupt mask of WIZCHIP. 00470 * @return : The operated OR vaule of @ref intr_kind. It can type-cast to uint16_t. 00471 */ 00472 intr_kind wizchip_getinterruptmask(void); 00473 00474 #if _WIZCHIP_ > 5100 00475 int8_t wizphy_getphylink(void); ///< get the link status of phy in WIZCHIP. No use in W5100 00476 int8_t wizphy_getphypmode(void); ///< get the power mode of PHY in WIZCHIP. No use in W5100 00477 #endif 00478 00479 #if _WIZCHIP_ == 5500 00480 void wizphy_reset(void); ///< Reset phy. Vailid only in W5500 00481 /** 00482 * @ingroup extra_functions 00483 * @brief Set the phy information for WIZCHIP without power mode 00484 * @param phyconf : @ref wiz_PhyConf 00485 */ 00486 void wizphy_setphyconf(wiz_PhyConf* phyconf); 00487 /** 00488 * @ingroup extra_functions 00489 * @brief Get phy configuration information. 00490 * @param phyconf : @ref wiz_PhyConf 00491 */ 00492 void wizphy_getphyconf(wiz_PhyConf* phyconf); 00493 /** 00494 * @ingroup extra_functions 00495 * @brief Get phy status. 00496 * @param phyconf : @ref wiz_PhyConf 00497 */ 00498 void wizphy_getphystat(wiz_PhyConf* phyconf); 00499 /** 00500 * @ingroup extra_functions 00501 * @brief set the power mode of phy inside WIZCHIP. Refer to @ref PHYCFGR in W5500, @ref PHYSTATUS in W5200 00502 * @param pmode Settig value of power down mode. 00503 */ 00504 int8_t wizphy_setphypmode(uint8_t pmode); 00505 #endif 00506 00507 /** 00508 * @ingroup extra_functions 00509 * @brief Set the network information for WIZCHIP 00510 * @param pnetinfo : @ref wizNetInfo 00511 */ 00512 void wizchip_setnetinfo(wiz_NetInfo* pnetinfo); 00513 00514 /** 00515 * @ingroup extra_functions 00516 * @brief Get the network information for WIZCHIP 00517 * @param pnetinfo : @ref wizNetInfo 00518 */ 00519 void wizchip_getnetinfo(wiz_NetInfo* pnetinfo); 00520 00521 /** 00522 * @ingroup extra_functions 00523 * @brief Set the network mode such WOL, PPPoE, Ping Block, and etc. 00524 * @param pnetinfo Value of network mode. Refer to @ref netmode_type. 00525 */ 00526 int8_t wizchip_setnetmode(netmode_type netmode); 00527 00528 /** 00529 * @ingroup extra_functions 00530 * @brief Get the network mode such WOL, PPPoE, Ping Block, and etc. 00531 * @return Value of network mode. Refer to @ref netmode_type. 00532 */ 00533 netmode_type wizchip_getnetmode(void); 00534 00535 /** 00536 * @ingroup extra_functions 00537 * @brief Set retry time value(@ref RTR) and retry count(@ref RCR). 00538 * @details @ref RTR configures the retransmission timeout period and @ref RCR configures the number of time of retransmission. 00539 * @param nettime @ref RTR value and @ref RCR value. Refer to @ref wiz_NetTimeout. 00540 */ 00541 void wizchip_settimeout(wiz_NetTimeout* nettime); 00542 00543 /** 00544 * @ingroup extra_functions 00545 * @brief Get retry time value(@ref RTR) and retry count(@ref RCR). 00546 * @details @ref RTR configures the retransmission timeout period and @ref RCR configures the number of time of retransmission. 00547 * @param nettime @ref RTR value and @ref RCR value. Refer to @ref wiz_NetTimeout. 00548 */ 00549 void wizchip_gettimeout(wiz_NetTimeout* nettime); 00550 00551 #endif // _WIZCHIP_CONF_H_ 00552 00553 #ifdef __cplusplus 00554 } 00555 #endif
Generated on Tue Jul 12 2022 17:16:46 by 1.7.2