ioLibrary for Cortex M series
|
W5500 HAL Header File. More...
Go to the source code of this file.
Macros | |
#define | _W5500_IO_BASE_ 0x00000000 |
#define | _W5500_SPI_READ_ (0x00 << 2) |
#define | _W5500_SPI_WRITE_ (0x01 << 2) |
#define | WIZCHIP_CREG_BLOCK 0x00 |
#define | WIZCHIP_SREG_BLOCK(N) (1+4*N) |
#define | WIZCHIP_TXBUF_BLOCK(N) (2+4*N) |
#define | WIZCHIP_RXBUF_BLOCK(N) (3+4*N) |
#define | WIZCHIP_OFFSET_INC(ADDR, N) (ADDR + (N<<8)) |
#define | MR (_W5500_IO_BASE_ + (0x0000 << 8) + (WIZCHIP_CREG_BLOCK << 3)) |
Mode Register address(R/W) MR is used for S/W reset, ping block mode, PPPoE mode and etc. More... | |
#define | GAR (_W5500_IO_BASE_ + (0x0001 << 8) + (WIZCHIP_CREG_BLOCK << 3)) |
Gateway IP Register address(R/W) More... | |
#define | SUBR (_W5500_IO_BASE_ + (0x0005 << 8) + (WIZCHIP_CREG_BLOCK << 3)) |
Subnet mask Register address(R/W) More... | |
#define | SHAR (_W5500_IO_BASE_ + (0x0009 << 8) + (WIZCHIP_CREG_BLOCK << 3)) |
Source MAC Register address(R/W) More... | |
#define | SIPR (_W5500_IO_BASE_ + (0x000F << 8) + (WIZCHIP_CREG_BLOCK << 3)) |
Source IP Register address(R/W) More... | |
#define | INTLEVEL (_W5500_IO_BASE_ + (0x0013 << 8) + (WIZCHIP_CREG_BLOCK << 3)) |
Set Interrupt low level timer register address(R/W) More... | |
#define | IR (_W5500_IO_BASE_ + (0x0015 << 8) + (WIZCHIP_CREG_BLOCK << 3)) |
Interrupt Register(R/W) More... | |
#define | IMR (_W5500_IO_BASE_ + (0x0016 << 8) + (WIZCHIP_CREG_BLOCK << 3)) |
Interrupt mask register(R/W) More... | |
#define | SIR (_W5500_IO_BASE_ + (0x0017 << 8) + (WIZCHIP_CREG_BLOCK << 3)) |
Socket Interrupt Register(R/W) More... | |
#define | SIMR (_W5500_IO_BASE_ + (0x0018 << 8) + (WIZCHIP_CREG_BLOCK << 3)) |
Socket Interrupt Mask Register(R/W) More... | |
#define | RTR (_W5500_IO_BASE_ + (0x0019 << 8) + (WIZCHIP_CREG_BLOCK << 3)) |
Timeout register address( 1 is 100us )(R/W) More... | |
#define | RCR (_W5500_IO_BASE_ + (0x001B << 8) + (WIZCHIP_CREG_BLOCK << 3)) |
Retry count register(R/W) More... | |
#define | PTIMER (_W5500_IO_BASE_ + (0x001C << 8) + (WIZCHIP_CREG_BLOCK << 3)) |
PPP LCP Request Timer register in PPPoE mode(R/W) More... | |
#define | PMAGIC (_W5500_IO_BASE_ + (0x001D << 8) + (WIZCHIP_CREG_BLOCK << 3)) |
PPP LCP Magic number register in PPPoE mode(R/W) More... | |
#define | PHAR (_W5500_IO_BASE_ + (0x001E << 8) + (WIZCHIP_CREG_BLOCK << 3)) |
PPP Destination MAC Register address(R/W) More... | |
#define | PSID (_W5500_IO_BASE_ + (0x0024 << 8) + (WIZCHIP_CREG_BLOCK << 3)) |
PPP Session Identification Register(R/W) More... | |
#define | PMRU (_W5500_IO_BASE_ + (0x0026 << 8) + (WIZCHIP_CREG_BLOCK << 3)) |
PPP Maximum Segment Size(MSS) register(R/W) More... | |
#define | UIPR (_W5500_IO_BASE_ + (0x0028 << 8) + (WIZCHIP_CREG_BLOCK << 3)) |
Unreachable IP register address in UDP mode(R) More... | |
#define | UPORTR (_W5500_IO_BASE_ + (0x002C << 8) + (WIZCHIP_CREG_BLOCK << 3)) |
Unreachable Port register address in UDP mode(R) More... | |
#define | PHYCFGR (_W5500_IO_BASE_ + (0x002E << 8) + (WIZCHIP_CREG_BLOCK << 3)) |
PHY Status Register(R/W) More... | |
#define | VERSIONR (_W5500_IO_BASE_ + (0x0039 << 8) + (WIZCHIP_CREG_BLOCK << 3)) |
chip version register address(R) More... | |
#define | Sn_MR(N) (_W5500_IO_BASE_ + (0x0000 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
socket Mode register(R/W) More... | |
#define | Sn_CR(N) (_W5500_IO_BASE_ + (0x0001 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
Socket command register(R/W) More... | |
#define | Sn_IR(N) (_W5500_IO_BASE_ + (0x0002 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
Socket interrupt register(R) More... | |
#define | Sn_SR(N) (_W5500_IO_BASE_ + (0x0003 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
Socket status register(R) More... | |
#define | Sn_PORT(N) (_W5500_IO_BASE_ + (0x0004 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
source port register(R/W) More... | |
#define | Sn_DHAR(N) (_W5500_IO_BASE_ + (0x0006 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
Peer MAC register address(R/W) More... | |
#define | Sn_DIPR(N) (_W5500_IO_BASE_ + (0x000C << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
Peer IP register address(R/W) More... | |
#define | Sn_DPORT(N) (_W5500_IO_BASE_ + (0x0010 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
Peer port register address(R/W) More... | |
#define | Sn_MSSR(N) (_W5500_IO_BASE_ + (0x0012 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
Maximum Segment Size(Sn_MSSR0) register address(R/W) More... | |
#define | Sn_TOS(N) (_W5500_IO_BASE_ + (0x0015 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
IP Type of Service(TOS) Register(R/W) More... | |
#define | Sn_TTL(N) (_W5500_IO_BASE_ + (0x0016 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
IP Time to live(TTL) Register(R/W) More... | |
#define | Sn_RXBUF_SIZE(N) (_W5500_IO_BASE_ + (0x001E << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
Receive memory size register(R/W) More... | |
#define | Sn_TXBUF_SIZE(N) (_W5500_IO_BASE_ + (0x001F << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
Transmit memory size register(R/W) More... | |
#define | Sn_TX_FSR(N) (_W5500_IO_BASE_ + (0x0020 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
Transmit free memory size register(R) More... | |
#define | Sn_TX_RD(N) (_W5500_IO_BASE_ + (0x0022 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
Transmit memory read pointer register address(R) More... | |
#define | Sn_TX_WR(N) (_W5500_IO_BASE_ + (0x0024 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
Transmit memory write pointer register address(R/W) More... | |
#define | Sn_RX_RSR(N) (_W5500_IO_BASE_ + (0x0026 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
Received data size register(R) More... | |
#define | Sn_RX_RD(N) (_W5500_IO_BASE_ + (0x0028 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
Read point of Receive memory(R/W) More... | |
#define | Sn_RX_WR(N) (_W5500_IO_BASE_ + (0x002A << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
Write point of Receive memory(R) More... | |
#define | Sn_IMR(N) (_W5500_IO_BASE_ + (0x002C << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
socket interrupt mask register(R) More... | |
#define | Sn_FRAG(N) (_W5500_IO_BASE_ + (0x002D << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
Fragment field value in IP header register(R/W) More... | |
#define | Sn_KPALVTR(N) (_W5500_IO_BASE_ + (0x002F << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) |
Keep Alive Timer register(R/W) More... | |
#define | MR_RST 0x80 |
Reset. More... | |
#define | MR_WOL 0x20 |
Wake on LAN. More... | |
#define | MR_PB 0x10 |
Ping block. More... | |
#define | MR_PPPOE 0x08 |
Enable PPPoE. More... | |
#define | MR_FARP 0x02 |
Enable UDP_FORCE_ARP CHECHK. More... | |
#define | IR_CONFLICT 0x80 |
Check IP conflict. More... | |
#define | IR_UNREACH 0x40 |
Get the destination unreachable message in UDP sending. More... | |
#define | IR_PPPoE 0x20 |
Get the PPPoE close message. More... | |
#define | IR_MP 0x10 |
Get the magic packet interrupt. More... | |
#define | PHYCFGR_RST ~(1<<7) |
#define | PHYCFGR_OPMD (1<<6) |
#define | PHYCFGR_OPMDC_ALLA (7<<3) |
#define | PHYCFGR_OPMDC_PDOWN (6<<3) |
#define | PHYCFGR_OPMDC_NA (5<<3) |
#define | PHYCFGR_OPMDC_100FA (4<<3) |
#define | PHYCFGR_OPMDC_100F (3<<3) |
#define | PHYCFGR_OPMDC_100H (2<<3) |
#define | PHYCFGR_OPMDC_10F (1<<3) |
#define | PHYCFGR_OPMDC_10H (0<<3) |
#define | PHYCFGR_DPX_FULL (1<<2) |
#define | PHYCFGR_DPX_HALF (0<<2) |
#define | PHYCFGR_SPD_100 (1<<1) |
#define | PHYCFGR_SPD_10 (0<<1) |
#define | PHYCFGR_LNK_ON (1<<0) |
#define | PHYCFGR_LNK_OFF (0<<0) |
#define | IM_IR7 0x80 |
IP Conflict Interrupt Mask. More... | |
#define | IM_IR6 0x40 |
Destination unreachable Interrupt Mask. More... | |
#define | IM_IR5 0x20 |
PPPoE Close Interrupt Mask. More... | |
#define | IM_IR4 0x10 |
Magic Packet Interrupt Mask. More... | |
#define | Sn_MR_MULTI 0x80 |
Support UDP Multicasting. More... | |
#define | Sn_MR_BCASTB 0x40 |
Broadcast block in UDP Multicasting. More... | |
#define | Sn_MR_ND 0x20 |
No Delayed Ack(TCP), Multicast flag. More... | |
#define | Sn_MR_UCASTB 0x10 |
Unicast Block in UDP Multicasting. More... | |
#define | Sn_MR_MACRAW 0x04 |
MAC LAYER RAW SOCK. More... | |
#define | Sn_MR_UDP 0x02 |
UDP. More... | |
#define | Sn_MR_TCP 0x01 |
TCP. More... | |
#define | Sn_MR_CLOSE 0x00 |
Unused socket. More... | |
#define | Sn_MR_MFEN Sn_MR_MULTI |
MAC filter enable in Sn_MR_MACRAW mode. More... | |
#define | Sn_MR_MMB Sn_MR_ND |
Multicast Blocking in Sn_MR_MACRAW mode. More... | |
#define | Sn_MR_MIP6B Sn_MR_UCASTB |
IPv6 packet Blocking in Sn_MR_MACRAW mode. More... | |
#define | Sn_MR_MC Sn_MR_ND |
IGMP version used in UDP mulitcasting. More... | |
#define | SOCK_STREAM Sn_MR_TCP |
For Berkeley Socket API. More... | |
#define | SOCK_DGRAM Sn_MR_UDP |
For Berkeley Socket API. More... | |
#define | Sn_CR_OPEN 0x01 |
Initialize or open socket. More... | |
#define | Sn_CR_LISTEN 0x02 |
Wait connection request in TCP mode(Server mode) More... | |
#define | Sn_CR_CONNECT 0x04 |
Send connection request in TCP mode(Client mode) More... | |
#define | Sn_CR_DISCON 0x08 |
Send closing request in TCP mode. More... | |
#define | Sn_CR_CLOSE 0x10 |
Close socket. More... | |
#define | Sn_CR_SEND 0x20 |
Update TX buffer pointer and send data. More... | |
#define | Sn_CR_SEND_MAC 0x21 |
Send data with MAC address, so without ARP process. More... | |
#define | Sn_CR_SEND_KEEP 0x22 |
Send keep alive message. More... | |
#define | Sn_CR_RECV 0x40 |
Update RX buffer pointer and receive data. More... | |
#define | Sn_IR_SENDOK 0x10 |
SEND_OK Interrupt. More... | |
#define | Sn_IR_TIMEOUT 0x08 |
TIMEOUT Interrupt. More... | |
#define | Sn_IR_RECV 0x04 |
RECV Interrupt. More... | |
#define | Sn_IR_DISCON 0x02 |
DISCON Interrupt. More... | |
#define | Sn_IR_CON 0x01 |
CON Interrupt. More... | |
#define | SOCK_CLOSED 0x00 |
Closed. More... | |
#define | SOCK_INIT 0x13 |
Initiate state. More... | |
#define | SOCK_LISTEN 0x14 |
Listen state. More... | |
#define | SOCK_SYNSENT 0x15 |
Connection state. More... | |
#define | SOCK_SYNRECV 0x16 |
Connection state. More... | |
#define | SOCK_ESTABLISHED 0x17 |
Success to connect. More... | |
#define | SOCK_FIN_WAIT 0x18 |
Closing state. More... | |
#define | SOCK_CLOSING 0x1A |
Closing state. More... | |
#define | SOCK_TIME_WAIT 0x1B |
Closing state. More... | |
#define | SOCK_CLOSE_WAIT 0x1C |
Closing state. More... | |
#define | SOCK_LAST_ACK 0x1D |
Closing state. More... | |
#define | SOCK_UDP 0x22 |
UDP socket. More... | |
#define | SOCK_MACRAW 0x42 |
MAC raw mode socket. More... | |
#define | IPPROTO_IP 0 |
#define | IPPROTO_ICMP 1 |
#define | IPPROTO_IGMP 2 |
#define | IPPROTO_GGP 3 |
#define | IPPROTO_TCP 6 |
#define | IPPROTO_PUP 12 |
#define | IPPROTO_UDP 17 |
#define | IPPROTO_IDP 22 |
#define | IPPROTO_ND 77 |
#define | IPPROTO_RAW 255 |
Functions | |
void | WIZCHIP_CRITICAL_ENTER (void) |
Enter a critical section. More... | |
void | WIZCHIP_CRITICAL_EXIT (void) |
Exit a critical section. More... | |
uint8_t | WIZCHIP_READ (uint32_t AddrSel) |
It reads 1 byte value from a register. More... | |
void | WIZCHIP_WRITE (uint32_t AddrSel, uint8_t wb) |
It writes 1 byte value to a register. More... | |
void | WIZCHIP_READ_BUF (uint32_t AddrSel, uint8_t *pBuf, uint16_t len) |
It reads sequence data from registers. More... | |
void | WIZCHIP_WRITE_BUF (uint32_t AddrSel, uint8_t *pBuf, uint16_t len) |
It writes sequence data to registers. More... | |
void | setMR (uint8_t mr) |
Set Mode Register. More... | |
uint8_t | getMR (void) |
Get Mode Register. More... | |
void | setGAR (uint8_t *gar) |
Set gateway IP address. More... | |
void | getGAR (uint8_t *gar) |
Get gateway IP address. More... | |
void | setSUBR (uint8_t *subr) |
Set subnet mask address. More... | |
void | getSUBR (uint8_t *subr) |
Get subnet mask address. More... | |
void | setSHAR (uint8_t *shar) |
Set local MAC address. More... | |
void | getSHAR (uint8_t *shar) |
Get local MAC address. More... | |
void | setSIPR (uint8_t *sipr) |
Set local IP address. More... | |
void | getSIPR (uint8_t *sipr) |
Get local IP address. More... | |
void | setINTLEVEL (uint16_t intlevel) |
Set INTLEVEL register. More... | |
uint16_t | getINTLEVEL (void) |
Get INTLEVEL register. More... | |
void | setIR (uint8_t ir) |
Set IR register. More... | |
uint8_t | getIR (void) |
Get IR register. More... | |
void | setIMR (uint8_t imr) |
Set IMR register. More... | |
uint8_t | getIMR (void) |
Get IMR register. More... | |
void | setSIR (uint8_t sir) |
Set SIR register. More... | |
uint8_t | getSIR (void) |
Get SIR register. More... | |
void | setSIMR (uint8_t simr) |
Set SIMR register. More... | |
uint8_t | getSIMR (void) |
Get SIMR register. More... | |
void | setRTR (uint16_t rtr) |
Set RTR register. More... | |
uint16_t | getRTR (void) |
Get RTR register. More... | |
void | setRCR (uint8_t rcr) |
Set RCR register. More... | |
uint8_t | getRCR (void) |
Get RCR register. More... | |
void | setPTIMER (uint8_t ptimer) |
Set PTIMER register. More... | |
uint8_t | getPTIMER (void) |
Get PTIMER register. More... | |
void | setPMAGIC (uint8_t pmagic) |
Set PMAGIC register. More... | |
uint8_t | getPMAGIC (void) |
Get PMAGIC register. More... | |
void | setPHAR (uint8_t *phar) |
Set PHAR register. More... | |
void | getPHAR (uint8_t *phar) |
Get PHAR register. More... | |
void | setPSID (uint16_t psid) |
Set PSID register. More... | |
uint16_t | getPSID (void) |
Get PSID register. More... | |
void | setPMRU (uint16_t pmru) |
Set PMRU register. More... | |
uint16_t | getPMRU (void) |
Get PMRU register. More... | |
void | getUIPR (uint8_t *uipr) |
Get unreachable IP address. More... | |
uint16_t | getUPORTR (void) |
Get UPORTR register. More... | |
void | setPHYCFGR (uint8_t phycfgr) |
Set PHYCFGR register. More... | |
uint8_t | getPHYCFGR (void) |
Get PHYCFGR register. More... | |
uint8_t | getVERSIONR (void) |
Get VERSIONR register. More... | |
void | setSn_MR (uint8_t sn, uint8_t mr) |
Set Sn_MR register. More... | |
uint8_t | getSn_MR (uint8_t sn) |
Get Sn_MR register. More... | |
void | setSn_CR (uint8_t sn, uint8_t cr) |
Set Sn_CR register. More... | |
uint8_t | getSn_CR (uint8_t sn) |
Get Sn_CR register. More... | |
void | setSn_IR (uint8_t sn, uint8_t ir) |
Set Sn_IR register. More... | |
uint8_t | getSn_IR (uint8_t sn) |
Get Sn_IR register. More... | |
void | setSn_IMR (uint8_t sn, uint8_t imr) |
Set Sn_IMR register. More... | |
uint8_t | getSn_IMR (uint8_t sn) |
Get Sn_IMR register. More... | |
uint8_t | getSn_SR (uint8_t sn) |
Get Sn_SR register. More... | |
void | setSn_PORT (uint8_t sn, uint16_t port) |
Set Sn_PORT register. More... | |
uint16_t | getSn_PORT (uint8_t sn) |
Get Sn_PORT register. More... | |
void | setSn_DHAR (uint8_t sn, uint8_t *dhar) |
Set Sn_DHAR register. More... | |
void | getSn_DHAR (uint8_t sn, uint8_t *dhar) |
Get Sn_MR register. More... | |
void | setSn_DIPR (uint8_t sn, uint8_t *dipr) |
Set Sn_DIPR register. More... | |
void | getSn_DIPR (uint8_t sn, uint8_t *dipr) |
Get Sn_DIPR register. More... | |
void | setSn_DPORT (uint8_t sn, uint16_t dport) |
Set Sn_DPORT register. More... | |
uint16_t | getSn_DPORT (uint8_t sn) |
Get Sn_DPORT register. More... | |
void | setSn_MSSR (uint8_t sn, uint16_t mss) |
Set Sn_MSSR register. More... | |
uint16_t | getSn_MSSR (uint8_t sn) |
Get Sn_MSSR register. More... | |
void | setSn_TOS (uint8_t sn, uint8_t tos) |
Set Sn_TOS register. More... | |
uint8_t | getSn_TOS (uint8_t sn) |
Get Sn_TOS register. More... | |
void | setSn_TTL (uint8_t sn, uint8_t ttl) |
Set Sn_TTL register. More... | |
uint8_t | getSn_TTL (uint8_t sn) |
Get Sn_TTL register. More... | |
void | setSn_RXBUF_SIZE (uint8_t sn, uint8_t rxbufsize) |
Set Sn_RXBUF_SIZE register. More... | |
uint8_t | getSn_RXBUF_SIZE (uint8_t sn) |
Get Sn_RXBUF_SIZE register. More... | |
void | setSn_TXBUF_SIZE (uint8_t sn, uint8_t txbufsize) |
Set Sn_TXBUF_SIZE register. More... | |
uint8_t | getSn_TXBUF_SIZE (uint8_t sn) |
Get Sn_TXBUF_SIZE register. More... | |
uint16_t | getSn_TX_FSR (uint8_t sn) |
Get Sn_TX_FSR register. More... | |
uint16_t | getSn_TX_RD (uint8_t sn) |
Get Sn_TX_RD register. More... | |
void | setSn_TX_WR (uint8_t sn, uint16_t txwr) |
Set Sn_TX_WR register. More... | |
uint16_t | getSn_TX_WR (uint8_t sn) |
Get Sn_TX_WR register. More... | |
uint16_t | getSn_RX_RSR (uint8_t sn) |
Get Sn_RX_RSR register. More... | |
void | setSn_RX_RD (uint8_t sn, uint16_t rxrd) |
Set Sn_RX_RD register. More... | |
uint16_t | getSn_RX_RD (uint8_t sn) |
Get Sn_RX_RD register. More... | |
uint16_t | getSn_RX_WR (uint8_t sn) |
Get Sn_RX_WR register. More... | |
void | setSn_FRAG (uint8_t sn, uint16_t frag) |
Set Sn_FRAG register. More... | |
uint16_t | getSn_FRAG (uint8_t sn) |
Get Sn_FRAG register. More... | |
void | setSn_KPALVTR (uint8_t sn, uint8_t kpalvt) |
Set Sn_KPALVTR register. More... | |
uint8_t | getSn_KPALVTR (uint8_t sn) |
Get Sn_KPALVTR register. More... | |
uint16_t | getSn_RxMAX (uint8_t sn) |
Gets the max buffer size of socket sn passed as parameter. More... | |
uint16_t | getSn_TxMAX (uint8_t sn) |
Gets the max buffer size of socket sn passed as parameters. More... | |
void | wiz_send_data (uint8_t sn, uint8_t *wizdata, uint16_t len) |
It copies data to internal TX memory. More... | |
void | wiz_recv_data (uint8_t sn, uint8_t *wizdata, uint16_t len) |
It copies data to your buffer from internal RX memory. More... | |
void | wiz_recv_ignore (uint8_t sn, uint16_t len) |
It discard the received data in RX memory. More... | |
W5500 HAL Header File.
Copyright (c) 2013, WIZnet Co., LTD. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file w5500.h.
#define _W5500_SPI_READ_ (0x00 << 2) |
Definition at line 50 of file w5500.h.
Referenced by WIZCHIP_READ(), and WIZCHIP_READ_BUF().
#define _W5500_SPI_WRITE_ (0x01 << 2) |
Definition at line 51 of file w5500.h.
Referenced by WIZCHIP_WRITE(), and WIZCHIP_WRITE_BUF().
#define WIZCHIP_TXBUF_BLOCK | ( | N) | (2+4*N) |
Definition at line 55 of file w5500.h.
Referenced by wiz_send_data().
#define WIZCHIP_RXBUF_BLOCK | ( | N) | (3+4*N) |
Definition at line 56 of file w5500.h.
Referenced by wiz_recv_data().
#define WIZCHIP_OFFSET_INC | ( | ADDR, | |
N | |||
) | (ADDR + (N<<8)) |
Definition at line 58 of file w5500.h.
Referenced by getINTLEVEL(), getPMRU(), getPSID(), getRTR(), getSn_DPORT(), getSn_FRAG(), getSn_MSSR(), getSn_PORT(), getSn_RX_RD(), getSn_RX_RSR(), getSn_RX_WR(), getSn_TX_FSR(), getSn_TX_RD(), getSn_TX_WR(), getUPORTR(), setINTLEVEL(), setPMRU(), setPSID(), setRTR(), setSn_DPORT(), setSn_FRAG(), setSn_MSSR(), setSn_PORT(), setSn_RX_RD(), setSn_TX_WR(), WIZCHIP_READ_BUF(), and WIZCHIP_WRITE_BUF().
#define MR_RST 0x80 |
Reset.
If this bit is All internal registers will be initialized. It will be automatically cleared as after S/W reset.
Definition at line 592 of file w5500.h.
Referenced by wizchip_sw_reset().
#define MR_WOL 0x20 |
Wake on LAN.
0 : Disable WOL mode
1 : Enable WOL mode
If WOL mode is enabled and the received magic packet over UDP has been normally processed, the Interrupt PIN (INTn) asserts to low. When using WOL mode, the UDP Socket should be opened with any source port number. (Refer to Socket n Mode Register (Sn_MR) for opening Socket.)
#define MR_PB 0x10 |
#define MR_PPPOE 0x08 |
#define MR_FARP 0x02 |
#define IR_CONFLICT 0x80 |
#define IR_UNREACH 0x40 |
Get the destination unreachable message in UDP sending.
When receiving the ICMP (Destination port unreachable) packet, this bit is set as When this bit is Destination Information such as IP address and Port number may be checked with the corresponding UIPR & UPORT.
#define IR_PPPoE 0x20 |
#define IR_MP 0x10 |
#define IM_IR7 0x80 |
#define IM_IR6 0x40 |
#define IM_IR5 0x20 |
#define IM_IR4 0x10 |
#define Sn_MR_MULTI 0x80 |
Support UDP Multicasting.
0 : disable Multicasting
1 : enable Multicasting
This bit is applied only during UDP mode(P[3:0] = 010.
To use multicasting, Sn_DIPR & Sn_DPORT should be respectively configured with the multicast group IP address & port number before Socket n is opened by OPEN command of Sn_CR.
#define Sn_MR_BCASTB 0x40 |
#define Sn_MR_ND 0x20 |
No Delayed Ack(TCP), Multicast flag.
0 : Disable No Delayed ACK option
1 : Enable No Delayed ACK option
This bit is applied only during TCP mode (P[3:0] = 001.
When this bit is It sends the ACK packet without delay as soon as a Data packet is received from a peer.
When this bit is It sends the ACK packet after waiting for the timeout time configured by RTR.
#define Sn_MR_UCASTB 0x10 |
#define Sn_MR_MACRAW 0x04 |
#define Sn_MR_UDP 0x02 |
UDP.
This configures the protocol mode of Socket n.
Definition at line 754 of file w5500.h.
Referenced by GetUDPSocketStatus(), UDPOpen(), UDPRecv(), and UDPSendNB().
#define Sn_MR_TCP 0x01 |
TCP.
This configures the protocol mode of Socket n.
Definition at line 760 of file w5500.h.
Referenced by GetTCPSocketStatus(), TCPCltOpenNB(), TCPRecv(), TCPReSendNB(), TCPSendNB(), and TCPServerOpen().
#define Sn_MR_CLOSE 0x00 |
#define Sn_MR_MFEN Sn_MR_MULTI |
MAC filter enable in Sn_MR_MACRAW mode.
0 : disable MAC Filtering
1 : enable MAC Filtering
This bit is applied only during MACRAW mode(P[3:0] = 100.
When set as W5500 can only receive broadcasting packet or packet sent to itself. When this bit is W5500 can receive all packets on Ethernet. If user wants to implement Hybrid TCP/IP stack, it is recommended that this bit is set as for reducing host overhead to process the all received packets.
#define Sn_MR_MMB Sn_MR_ND |
Multicast Blocking in Sn_MR_MACRAW mode.
0 : using IGMP version 2
1 : using IGMP version 1
This bit is applied only during UDP mode(P[3:0] = 010 and MULTI = It configures the version for IGMP messages (Join/Leave/Report).
#define Sn_MR_MIP6B Sn_MR_UCASTB |
IPv6 packet Blocking in Sn_MR_MACRAW mode.
0 : disable IPv6 Blocking
1 : enable IPv6 Blocking
This bit is applied only during MACRAW mode (P[3:0] = 100. It blocks to receiving the IPv6 packet.
#define Sn_MR_MC Sn_MR_ND |
#define Sn_CR_OPEN 0x01 |
Initialize or open socket.
Socket n is initialized and opened according to the protocol selected in Sn_MR(P3:P0). The table below shows the value of Sn_SR corresponding to Sn_MR.
Sn_MR (P[3:0]) | Sn_SR |
Sn_MR_CLOSE (000 | |
Sn_MR_TCP (001 | SOCK_INIT (0x13) |
Sn_MR_UDP (010 | SOCK_UDP (0x22) |
S0_MR_MACRAW (100 | SOCK_MACRAW (0x02) |
Definition at line 832 of file w5500.h.
Referenced by TCPCltOpenNB(), TCPServerOpen(), and UDPOpen().
#define Sn_CR_LISTEN 0x02 |
Wait connection request in TCP mode(Server mode)
This is valid only in TCP mode (Sn_MR(P3:P0) = Sn_MR_TCP). In this mode, Socket n operates as a TCP server and waits for connection-request (SYN packet) from any TCP client The Sn_SR changes the state from SOCK_INIT to SOCKET_LISTEN. When a TCP client connection request is successfully established, the Sn_SR changes from SOCK_LISTEN to SOCK_ESTABLISHED and the Sn_IR(0) becomes But when a �TCP client connection request is failed, Sn_IR(3) becomes and the status of Sn_SR changes to SOCK_CLOSED.
Definition at line 843 of file w5500.h.
Referenced by TCPServerOpen().
#define Sn_CR_CONNECT 0x04 |
Send connection request in TCP mode(Client mode)
To connect, a connect-request (SYN packet) is sent to TCP server configured by Sn_DIPR & Sn_DPORT (destination address & port). If the connect-request is successful, the Sn_SR is changed to SOCK_ESTABLISHED and the Sn_IR(0) becomes
The connect-request fails in the following three cases.
Definition at line 855 of file w5500.h.
Referenced by TCPCltOpenNB().
#define Sn_CR_DISCON 0x08 |
Send closing request in TCP mode.
Regardless of TCP serveror TCP client the DISCON command processes the disconnect-process Active closeor b>Passive close.
When the disconnect-process is successful (that is, FIN/ACK packet is received successfully), Sn_SR is changed to SOCK_CLOSED.
Otherwise, TCPTO occurs (Sn_IR(3)=)= and then Sn_SR is changed to SOCK_CLOSED.
Definition at line 868 of file w5500.h.
Referenced by TCPCloseNB(), and TCPDisconnect().
#define Sn_CR_CLOSE 0x10 |
Close socket.
Sn_SR is changed to SOCK_CLOSED.
Definition at line 874 of file w5500.h.
Referenced by TCPCloseCHK(), TCPClsRcvCHK(), and UDPClose().
#define Sn_CR_SEND 0x20 |
Update TX buffer pointer and send data.
SEND transmits all the data in the Socket n TX buffer.
For more details, please refer to Socket n TX Free Size Register (Sn_TX_FSR), Socket n, TX Write Pointer Register(Sn_TX_WR), and Socket n TX Read Pointer Register(Sn_TX_RD).
Definition at line 882 of file w5500.h.
Referenced by TCPReSendNB(), TCPSendNB(), and UDPSendNB().
#define Sn_CR_SEND_MAC 0x21 |
Send data with MAC address, so without ARP process.
The basic operation is same as SEND.
Normally SEND transmits data after destination hardware address is acquired by the automatic ARP-process(Address Resolution Protocol).
But SEND_MAC transmits data without the automatic ARP-process.
In this case, the destination hardware address is acquired from Sn_DHAR configured by host, instead of APR-process.
#define Sn_CR_SEND_KEEP 0x22 |
Send keep alive message.
It checks the connection status by sending 1byte keep-alive packet.
If the peer can not respond to the keep-alive packet during timeout time, the connection is terminated and the timeout interrupt will occur.
#define Sn_CR_RECV 0x40 |
Update RX buffer pointer and receive data.
RECV completes the processing of the received data in Socket n RX Buffer by using a RX read pointer register (Sn_RX_RD).
For more details, refer to Socket n RX Received Size Register (Sn_RX_RSR), Socket n RX Write Pointer Register (Sn_RX_WR), and Socket n RX Read Pointer Register (Sn_RX_RD).
#define Sn_IR_SENDOK 0x10 |
SEND_OK Interrupt.
This is issued when SEND command is completed.
Definition at line 915 of file w5500.h.
Referenced by TCPSendCHK(), and UDPSendCHK().
#define Sn_IR_TIMEOUT 0x08 |
TIMEOUT Interrupt.
This is issued when ARPTO or TCPTO occurs.
Definition at line 921 of file w5500.h.
Referenced by TCPConnChk(), and UDPSendCHK().
#define Sn_IR_RECV 0x04 |
#define Sn_IR_DISCON 0x02 |
#define Sn_IR_CON 0x01 |
CON Interrupt.
This is issued one time when the connection with peer is successful and then Sn_SR is changed to SOCK_ESTABLISHED.
#define SOCK_CLOSED 0x00 |
Closed.
This indicates that Socket n is released. When DICON, CLOSE command is ordered, or when a timeout occurs, it is changed to SOCK_CLOSED regardless of previous status.
Definition at line 947 of file w5500.h.
Referenced by GetTCPSocketStatus(), GetUDPSocketStatus(), TCPCloseCHK(), TCPCloseNB(), TCPClsRcvCHK(), TCPRecv(), TCPReSendNB(), TCPSendCHK(), TCPSendNB(), UDPRecv(), and UDPSendNB().
#define SOCK_INIT 0x13 |
Initiate state.
This indicates Socket n is opened with TCP mode. It is changed to SOCK_INIT when Sn_MR(P[3:0]) = 001 and OPEN command is ordered. After SOCK_INIT, user can use LISTEN /CONNECT command.
Definition at line 955 of file w5500.h.
Referenced by GetTCPSocketStatus(), and TCPServerOpen().
#define SOCK_LISTEN 0x14 |
Listen state.
This indicates Socket n is operating as TCP server mode and waiting for connection-request (SYN packet) from a peer TCP client.
It will change to SOCK_ESTABLISHED when the connection-request is successfully accepted.
Otherwise it will change to SOCK_CLOSED after TCPTO occurred (Sn_IR(TIMEOUT) = 1).
Definition at line 963 of file w5500.h.
Referenced by GetTCPSocketStatus().
#define SOCK_SYNSENT 0x15 |
Connection state.
This indicates Socket n sent the connect-request packet (SYN packet) to a peer.
It is temporarily shown when Sn_SR is changed from SOCK_INIT to SOCK_ESTABLISHED by CONNECT command.
If connect-accept(SYN/ACK packet) is received from the peer at SOCK_SYNSENT, it changes to SOCK_ESTABLISHED.
Otherwise, it changes to SOCK_CLOSED after TCPTO (Sn_IR[TIMEOUT] = 1) is occurred.
Definition at line 972 of file w5500.h.
Referenced by GetTCPSocketStatus().
#define SOCK_SYNRECV 0x16 |
Connection state.
It indicates Socket n successfully received the connect-request packet (SYN packet) from a peer.
If socket n sends the response (SYN/ACK packet) to the peer successfully, it changes to SOCK_ESTABLISHED.
If not, it changes to SOCK_CLOSED after timeout occurs (Sn_IR[TIMEOUT] = 1).
Definition at line 980 of file w5500.h.
Referenced by GetTCPSocketStatus().
#define SOCK_ESTABLISHED 0x17 |
Success to connect.
This indicates the status of the connection of Socket n.
It changes to SOCK_ESTABLISHED when the TCP SERVER processed the SYN packet from the TCP CLIENT during SOCK_LISTEN, or when the CONNECT command is successful.
During SOCK_ESTABLISHED, DATA packet can be transferred using SEND or RECV command.
Definition at line 989 of file w5500.h.
Referenced by GetTCPSocketStatus(), TCPConnChk(), TCPRecv(), TCPReSendNB(), and TCPSendNB().
#define SOCK_FIN_WAIT 0x18 |
Closing state.
These indicate Socket n is closing.
These are shown in disconnect-process such as active-close and passive-close.
When Disconnect-process is successfully completed, or when timeout occurs, these change to SOCK_CLOSED.
Definition at line 997 of file w5500.h.
Referenced by GetTCPSocketStatus(), TCPReSendNB(), and TCPSendNB().
#define SOCK_CLOSING 0x1A |
Closing state.
These indicate Socket n is closing.
These are shown in disconnect-process such as active-close and passive-close.
When Disconnect-process is successfully completed, or when timeout occurs, these change to SOCK_CLOSED.
Definition at line 1005 of file w5500.h.
Referenced by GetTCPSocketStatus().
#define SOCK_TIME_WAIT 0x1B |
Closing state.
These indicate Socket n is closing.
These are shown in disconnect-process such as active-close and passive-close.
When Disconnect-process is successfully completed, or when timeout occurs, these change to SOCK_CLOSED.
Definition at line 1013 of file w5500.h.
Referenced by GetTCPSocketStatus().
#define SOCK_CLOSE_WAIT 0x1C |
Closing state.
This indicates Socket n received the disconnect-request (FIN packet) from the connected peer.
This is half-closing status, and data can be transferred.
For full-closing, DISCON command is used. But For just-closing, CLOSE command is used.
Definition at line 1021 of file w5500.h.
Referenced by GetTCPSocketStatus(), TCPClsRcvCHK(), TCPRecv(), TCPReSendNB(), and TCPSendNB().
#define SOCK_LAST_ACK 0x1D |
Closing state.
This indicates Socket n is waiting for the response (FIN/ACK packet) to the disconnect-request (FIN packet) by passive-close.
It changes to SOCK_CLOSED when Socket n received the response successfully, or when timeout occurs (Sn_IR[TIMEOUT] = 1).
Definition at line 1028 of file w5500.h.
Referenced by GetTCPSocketStatus().
#define SOCK_UDP 0x22 |
UDP socket.
This indicates Socket n is opened in UDP mode(Sn_MR(P[3:0]) = 010).
It changes to SOCK_UPD when Sn_MR(P[3:0] = 010) and OPEN command is ordered.
Unlike TCP mode, data can be transfered without the connection-process.
Definition at line 1036 of file w5500.h.
Referenced by GetUDPSocketStatus(), UDPRecv(), and UDPSendNB().
#define SOCK_MACRAW 0x42 |
MAC raw mode socket.
This indicates Socket 0 is opened in MACRAW mode (S0_MR(P[3:0]) = 100) and is valid only in Socket 0.
It changes to SOCK_MACRAW when S0_MR(P[3:0] = 100) and OPEN command is ordered.
Like UDP mode socket, MACRAW mode Socket 0 can transfer a MAC packet (Ethernet frame) without the connection-process.
Definition at line 1046 of file w5500.h.
Referenced by GetUDPSocketStatus().
void WIZCHIP_CRITICAL_ENTER | ( | void | ) |
Enter a critical section.
It is provided to protect your shared code which are executed without distribution.
In non-OS environment, It can be just implemented by disabling whole interrupt.
In OS environment, You can replace it to critical section api supported by OS.
Definition at line 52 of file w5500.c.
References __WIZCHIP::_CRIS::_enter, __WIZCHIP::CRIS, and WIZCHIP.
Referenced by WIZCHIP_READ(), WIZCHIP_READ_BUF(), WIZCHIP_WRITE(), and WIZCHIP_WRITE_BUF().
void WIZCHIP_CRITICAL_EXIT | ( | void | ) |
Exit a critical section.
It is provided to protect your shared code which are executed without distribution.
In non-OS environment, It can be just implemented by disabling whole interrupt.
In OS environment, You can replace it to critical section api supported by OS.
Definition at line 57 of file w5500.c.
References __WIZCHIP::_CRIS::_exit, __WIZCHIP::CRIS, and WIZCHIP.
Referenced by WIZCHIP_READ(), WIZCHIP_READ_BUF(), WIZCHIP_WRITE(), and WIZCHIP_WRITE_BUF().
uint16_t getSn_RxMAX | ( | uint8_t | sn) |
Gets the max buffer size of socket sn passed as parameter.
Definition at line 777 of file w5500.c.
References getSn_RXBUF_SIZE().
uint16_t getSn_TxMAX | ( | uint8_t | sn) |
Gets the max buffer size of socket sn passed as parameters.
Definition at line 782 of file w5500.c.
References getSn_TXBUF_SIZE().
Referenced by TCPSendNB(), and UDPSendNB().