@ -57,18 +57,11 @@
|
||||
#include <stdint.h>
|
||||
/**
|
||||
* @brief Select WIZCHIP.
|
||||
* @todo You should select one, \b W5100, \b W5100S, \b W5200, \b W5300, \b W5500 or etc. \n\n
|
||||
* ex> <code> #define \_WIZCHIP_ W5500 </code>
|
||||
* @todo You should select one, \b 5100, \b 5200, \b 5300, \b 5500 or etc. \n\n
|
||||
* ex> <code> #define \_WIZCHIP_ 5500 </code>
|
||||
*/
|
||||
|
||||
#define W5100 5100
|
||||
#define W5100S 5100+5
|
||||
#define W5200 5200
|
||||
#define W5300 5300
|
||||
#define W5500 5500
|
||||
|
||||
#ifndef _WIZCHIP_
|
||||
#define _WIZCHIP_ W5100S // W5100, W5100S, W5200, W5300, W5500
|
||||
#define _WIZCHIP_ 5500 // 5100, 5200, 5300, 5500
|
||||
#endif
|
||||
|
||||
#define _WIZCHIP_IO_MODE_NONE_ 0x0000
|
||||
@ -84,9 +77,9 @@
|
||||
|
||||
#define _WIZCHIP_IO_MODE_SPI_VDM_ (_WIZCHIP_IO_MODE_SPI_ + 1) /**< SPI interface mode for variable length data*/
|
||||
#define _WIZCHIP_IO_MODE_SPI_FDM_ (_WIZCHIP_IO_MODE_SPI_ + 2) /**< SPI interface mode for fixed length data mode*/
|
||||
#define _WIZCHIP_IO_MODE_SPI_5500_ (_WIZCHIP_IO_MODE_SPI_ + 3) /**< SPI interface mode for fixed length data mode*/
|
||||
|
||||
#if (_WIZCHIP_ == W5100)
|
||||
|
||||
#if (_WIZCHIP_ == 5100)
|
||||
#define _WIZCHIP_ID_ "W5100\0"
|
||||
/**
|
||||
* @brief Define interface mode.
|
||||
@ -98,24 +91,10 @@
|
||||
|
||||
//A20150601 : Define the unit of IO DATA.
|
||||
typedef uint8_t iodata_t;
|
||||
//A20150401 : Indclude W5100.h file
|
||||
//A20150401 : Indclude W5100.h file
|
||||
#include "W5100/w5100.h"
|
||||
|
||||
#elif (_WIZCHIP_ == W5100S)
|
||||
#define _WIZCHIP_ID_ "W5100S\0"
|
||||
/**
|
||||
* @brief Define interface mode.
|
||||
* @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_
|
||||
*/
|
||||
// #define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_BUS_INDIR_
|
||||
// #define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_5500_
|
||||
#define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_
|
||||
|
||||
//A20150601 : Define the unit of IO DATA.
|
||||
typedef uint8_t iodata_t;
|
||||
//A20150401 : Indclude W5100.h file
|
||||
#include "W5100S/w5100s.h"
|
||||
#elif (_WIZCHIP_ == W5200)
|
||||
#elif (_WIZCHIP_ == 5200)
|
||||
#define _WIZCHIP_ID_ "W5200\0"
|
||||
/**
|
||||
* @brief Define interface mode.
|
||||
@ -128,15 +107,15 @@
|
||||
//A20150601 : Define the unit of IO DATA.
|
||||
typedef uint8_t iodata_t;
|
||||
#include "W5200/w5200.h"
|
||||
#elif (_WIZCHIP_ == W5500)
|
||||
#elif (_WIZCHIP_ == 5500)
|
||||
#define _WIZCHIP_ID_ "W5500\0"
|
||||
|
||||
/**
|
||||
* @brief Define interface mode. \n
|
||||
* @todo Should select interface mode as chip.
|
||||
* - @ref \_WIZCHIP_IO_MODE_SPI_ \n
|
||||
* -@ref \_WIZCHIP_IO_MODE_SPI_VDM_ : Valid only in @ref \_WIZCHIP_ == W5500 \n
|
||||
* -@ref \_WIZCHIP_IO_MODE_SPI_FDM_ : Valid only in @ref \_WIZCHIP_ == W5500 \n
|
||||
* -@ref \_WIZCHIP_IO_MODE_SPI_VDM_ : Valid only in @ref \_WIZCHIP_ == 5500 \n
|
||||
* -@ref \_WIZCHIP_IO_MODE_SPI_FDM_ : Valid only in @ref \_WIZCHIP_ == 5500 \n
|
||||
* - @ref \_WIZCHIP_IO_MODE_BUS_ \n
|
||||
* - @ref \_WIZCHIP_IO_MODE_BUS_DIR_ \n
|
||||
* - @ref \_WIZCHIP_IO_MODE_BUS_INDIR_ \n
|
||||
@ -151,7 +130,7 @@
|
||||
//A20150601 : Define the unit of IO DATA.
|
||||
typedef uint8_t iodata_t;
|
||||
#include "W5500/w5500.h"
|
||||
#elif ( _WIZCHIP_ == W5300)
|
||||
#elif ( _WIZCHIP_ == 5300)
|
||||
#define _WIZCHIP_ID_ "W5300\0"
|
||||
/**
|
||||
* @brief Define interface mode.
|
||||
@ -193,7 +172,6 @@
|
||||
* @ref \_WIZCHIP_IO_MODE_BUS_DIR_, @ref \_WIZCHIP_IO_MODE_BUS_INDIR_). \n\n
|
||||
* ex> <code> #define \_WIZCHIP_IO_BASE_ 0x00008000 </code>
|
||||
*/
|
||||
#define _WIZCHIP_IO_BASE_ 0x60000000
|
||||
#ifndef _WIZCHIP_IO_BASE_
|
||||
#define _WIZCHIP_IO_BASE_ 0x00000000 // 0x8000
|
||||
#endif
|
||||
@ -206,7 +184,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if _WIZCHIP_ >= W5200
|
||||
#if _WIZCHIP_ > 5100
|
||||
#define _WIZCHIP_SOCK_NUM_ 8 ///< The count of independant socket of @b WIZCHIP
|
||||
#else
|
||||
#define _WIZCHIP_SOCK_NUM_ 4 ///< The count of independant socket of @b WIZCHIP
|
||||
@ -294,7 +272,7 @@ typedef enum
|
||||
CW_GET_ID, ///< Gets WIZCHIP name.
|
||||
|
||||
//D20150601 : For no modification your application code
|
||||
//#if _WIZCHIP_ == W5500
|
||||
//#if _WIZCHIP_ == 5500
|
||||
CW_RESET_PHY, ///< Resets internal PHY. Valid Only W5500
|
||||
CW_SET_PHYCONF, ///< When PHY configured by internal register, PHY operation mode (Manual/Auto, 10/100, Half/Full). Valid Only W5000
|
||||
CW_GET_PHYCONF, ///< Get PHY operation mode in internal register. Valid Only W5500
|
||||
@ -302,7 +280,7 @@ typedef enum
|
||||
CW_SET_PHYPOWMODE, ///< Set PHY power mode as normal and down when PHYSTATUS.OPMD == 1. Valid Only W5500
|
||||
//#endif
|
||||
//D20150601 : For no modification your application code
|
||||
//#if _WIZCHIP_ == W5200 || _WIZCHIP_ == W5500
|
||||
//#if _WIZCHIP_ == 5200 || _WIZCHIP_ == 5500
|
||||
CW_GET_PHYPOWMODE, ///< Get PHY Power mode as down or normal, Valid Only W5100, W5200
|
||||
CW_GET_PHYLINK ///< Get PHY Link status, Valid Only W5100, W5200
|
||||
//#endif
|
||||
@ -330,15 +308,15 @@ typedef enum
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
#if _WIZCHIP_ == W5500
|
||||
#if _WIZCHIP_ == 5500
|
||||
IK_WOL = (1 << 4), ///< Wake On Lan by receiving the magic packet. Valid in W500.
|
||||
#elif _WIZCHIP_ == W5300
|
||||
#elif _WIZCHIP_ == 5300
|
||||
IK_FMTU = (1 << 4), ///< Received a ICMP message (Fragment MTU)
|
||||
#endif
|
||||
|
||||
IK_PPPOE_TERMINATED = (1 << 5), ///< PPPoE Disconnected
|
||||
|
||||
#if _WIZCHIP_ != W5200
|
||||
#if _WIZCHIP_ != 5200
|
||||
IK_DEST_UNREACH = (1 << 6), ///< Destination IP & Port Unreachable, No use in W5200
|
||||
#endif
|
||||
|
||||
@ -348,14 +326,14 @@ typedef enum
|
||||
IK_SOCK_1 = (1 << 9), ///< Socket 1 interrupt
|
||||
IK_SOCK_2 = (1 << 10), ///< Socket 2 interrupt
|
||||
IK_SOCK_3 = (1 << 11), ///< Socket 3 interrupt
|
||||
#if _WIZCHIP_ > W5100S
|
||||
#if _WIZCHIP_ > 5100
|
||||
IK_SOCK_4 = (1 << 12), ///< Socket 4 interrupt, No use in 5100
|
||||
IK_SOCK_5 = (1 << 13), ///< Socket 5 interrupt, No use in 5100
|
||||
IK_SOCK_6 = (1 << 14), ///< Socket 6 interrupt, No use in 5100
|
||||
IK_SOCK_7 = (1 << 15), ///< Socket 7 interrupt, No use in 5100
|
||||
#endif
|
||||
|
||||
#if _WIZCHIP_ > W5100S
|
||||
#if _WIZCHIP_ > 5100
|
||||
IK_SOCK_ALL = (0xFF << 8) ///< All Socket interrupt
|
||||
#else
|
||||
IK_SOCK_ALL = (0x0F << 8) ///< All Socket interrupt
|
||||
@ -376,7 +354,7 @@ typedef enum
|
||||
#define PHY_POWER_DOWN 1 ///< PHY power down mode
|
||||
|
||||
|
||||
#if _WIZCHIP_ == W5500
|
||||
#if _WIZCHIP_ == 5500
|
||||
/**
|
||||
* @ingroup DATA_TYPE
|
||||
* It configures PHY configuration when CW_SET PHYCONF or CW_GET_PHYCONF in W5500,
|
||||
@ -424,7 +402,7 @@ typedef struct wiz_NetInfo_t
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
#if _WIZCHIP_ == W5500
|
||||
#if _WIZCHIP_ == 5500
|
||||
NM_FORCEARP = (1<<1), ///< Force to APP send whenever udp data is sent. Valid only in W5500
|
||||
#endif
|
||||
NM_WAKEONLAN = (1<<5), ///< Wake On Lan
|
||||
@ -567,13 +545,12 @@ void wizchip_setinterruptmask(intr_kind intr);
|
||||
*/
|
||||
intr_kind wizchip_getinterruptmask(void);
|
||||
|
||||
//todo
|
||||
#if _WIZCHIP_ > W5100S
|
||||
#if _WIZCHIP_ > 5100
|
||||
int8_t wizphy_getphylink(void); ///< get the link status of phy in WIZCHIP. No use in W5100
|
||||
int8_t wizphy_getphypmode(void); ///< get the power mode of PHY in WIZCHIP. No use in W5100
|
||||
#endif
|
||||
|
||||
#if _WIZCHIP_ == W5500
|
||||
#if _WIZCHIP_ == 5500
|
||||
void wizphy_reset(void); ///< Reset phy. Vailid only in W5500
|
||||
/**
|
||||
* @ingroup extra_functions
|
||||
|
Reference in New Issue
Block a user