W5500
Macros | Functions
w5500.c File Reference

W5500 HAL Interface. More...

#include <stdio.h>
#include "w5500.h"
Include dependency graph for w5500.c:

Go to the source code of this file.

Macros

#define _W5500_SPI_VDM_OP_   0x00
 
#define _W5500_SPI_FDM_OP_LEN1_   0x01
 
#define _W5500_SPI_FDM_OP_LEN2_   0x02
 
#define _W5500_SPI_FDM_OP_LEN4_   0x03
 

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 address. More...
 
void getPHAR (uint8_t *phar)
 Get local IP address. 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...
 
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...
 

Detailed Description

W5500 HAL Interface.

Version
1.0.0.0
Date
09/01/2013
Revision history
<09-01-2013> 1st Release
Author
MidnightCow

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.c.

Macro Definition Documentation

#define _W5500_SPI_VDM_OP_   0x00

Definition at line 45 of file w5500.c.

Referenced by WIZCHIP_READ(), WIZCHIP_READ_BUF(), WIZCHIP_WRITE(), and WIZCHIP_WRITE_BUF().

#define _W5500_SPI_FDM_OP_LEN1_   0x01

Definition at line 46 of file w5500.c.

Referenced by WIZCHIP_READ(), and WIZCHIP_WRITE().

#define _W5500_SPI_FDM_OP_LEN2_   0x02

Definition at line 47 of file w5500.c.

#define _W5500_SPI_FDM_OP_LEN4_   0x03

Definition at line 48 of file w5500.c.

Referenced by WIZCHIP_READ_BUF(), and WIZCHIP_WRITE_BUF().

Function Documentation

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.

See Also
WIZCHIP_READ(), WIZCHIP_WRITE(), WIZCHIP_READ_BUF(), WIZCHIP_WRITE_BUF()
WIZCHIP_CRITICAL_EXIT()

Definition at line 50 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.

See Also
WIZCHIP_READ(), WIZCHIP_WRITE(), WIZCHIP_READ_BUF(), WIZCHIP_WRITE_BUF()
WIZCHIP_CRITICAL_ENTER()

Definition at line 55 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().