ioLibrary for Cortex M series
Classes | Macros | Typedefs | Functions | Variables
wizchip_conf.h File Reference

WIZCHIP Config Header File. More...

#include <stdint.h>
#include "W5500/w5500.h"
Include dependency graph for wizchip_conf.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  __WIZCHIP
 
struct  __WIZCHIP::_CRIS
 
struct  __WIZCHIP::_CS
 

Macros

#define _WIZCHIP_   5500
 Select WIZCHIP. More...
 
#define _WIZCHIP_IO_MODE_NONE_   0x0000
 
#define _WIZCHIP_IO_MODE_BUS_   0x0100
 
#define _WIZCHIP_IO_MODE_SPI_   0x0200
 
#define _WIZCHIP_IO_MODE_BUS_DIR_   (_WIZCHIP_IO_MODE_BUS_ + 1)
 
#define _WIZCHIP_IO_MODE_BUS_INDIR_   (_WIZCHIP_IO_MODE_BUS_ + 2)
 
#define _WIZCHIP_IO_MODE_SPI_VDM_   (_WIZCHIP_IO_MODE_SPI_ + 1)
 
#define _WIZCHIP_IO_MODE_SPI_FDM_   (_WIZCHIP_IO_MODE_SPI_ + 2)
 
#define _WIZCHIP_ID_   "W5500\0"
 Define chip ID. More...
 
#define _WIZCHIP_IO_MODE_   _WIZCHIP_IO_MODE_SPI_VDM_
 Define interface mode. More...
 
#define _WIZCHIP_SOCK_NUM_   8
 
#define DEFAULT_MAC_ADDR   "00:08:DC:70:80:22"
 
#define DEFAULT_IP_ADDR   "192.168.11.123"
 
#define DEFAULT_SN_MASK   "255.255.255.0"
 
#define DEFAULT_GW_ADDR   "192.168.11.1"
 
#define DEFAULT_DNS_ADDR   "168.126.63.1"
 

Typedefs

typedef struct __WIZCHIP _WIZCHIP
 

Functions

void reg_wizchip_cris_cbfunc (void(*cris_en)(void), void(*cris_ex)(void))
 Registers call back function for critical section of I/O functions such as WIZCHIP_READ, WIZCHIP_WRITE, WIZCHIP_READ_BUF and WIZCHIP_WRITE_BUF. More...
 
void reg_wizchip_cs_cbfunc (void(*cs_sel)(void), void(*cs_desel)(void))
 Registers call back function for WIZCHIP select & deselect. More...
 
void reg_wizchip_bus_cbfunc (uint8_t(*bus_rb)(uint32_t addr), void(*bus_wb)(uint32_t addr, uint8_t wb))
 Registers call back function for bus interface. More...
 
void reg_wizchip_spi_cbfunc (uint8_t(*spi_rb)(void), void(*spi_wb)(uint8_t wb))
 Registers call back function for SPI interface. More...
 
void wizchip_sw_reset (void)
 
int8_t wizchip_init (uint8_t *txsize, uint8_t *rxsize)
 

Variables

_WIZCHIP WIZCHIP
 

Detailed Description

WIZCHIP Config Header File.

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 wizchip_conf.h.

Macro Definition Documentation

#define _WIZCHIP_   5500

Select WIZCHIP.

Todo:
You should select one, 5100, 5200 or 5500.

Definition at line 50 of file wizchip_conf.h.

#define _WIZCHIP_IO_MODE_NONE_   0x0000

Definition at line 52 of file wizchip_conf.h.

#define _WIZCHIP_IO_MODE_BUS_   0x0100

Bus interface mode

Definition at line 53 of file wizchip_conf.h.

Referenced by reg_wizchip_bus_cbfunc().

#define _WIZCHIP_IO_MODE_SPI_   0x0200

SPI interface mode

Definition at line 54 of file wizchip_conf.h.

Referenced by reg_wizchip_spi_cbfunc().

#define _WIZCHIP_IO_MODE_BUS_DIR_   (_WIZCHIP_IO_MODE_BUS_ + 1)

BUS interface mode for direct

Definition at line 56 of file wizchip_conf.h.

#define _WIZCHIP_IO_MODE_BUS_INDIR_   (_WIZCHIP_IO_MODE_BUS_ + 2)

BUS interface mode for indirect

Definition at line 57 of file wizchip_conf.h.

#define _WIZCHIP_IO_MODE_SPI_VDM_   (_WIZCHIP_IO_MODE_SPI_ + 1)

SPI interface mode for variable length data

Definition at line 59 of file wizchip_conf.h.

#define _WIZCHIP_IO_MODE_SPI_FDM_   (_WIZCHIP_IO_MODE_SPI_ + 2)

SPI interface mode for fixed length data mode

Definition at line 60 of file wizchip_conf.h.

#define _WIZCHIP_ID_   "W5500\0"

Define chip ID.

Definition at line 67 of file wizchip_conf.h.

#define _WIZCHIP_IO_MODE_   _WIZCHIP_IO_MODE_SPI_VDM_

Define interface mode.

Todo:
You should select interface mode as chip.

Definition at line 73 of file wizchip_conf.h.

#define _WIZCHIP_SOCK_NUM_   8
#define DEFAULT_MAC_ADDR   "00:08:DC:70:80:22"

Definition at line 104 of file wizchip_conf.h.

Referenced by network_init().

#define DEFAULT_IP_ADDR   "192.168.11.123"

Definition at line 105 of file wizchip_conf.h.

#define DEFAULT_SN_MASK   "255.255.255.0"

Definition at line 106 of file wizchip_conf.h.

#define DEFAULT_GW_ADDR   "192.168.11.1"

Definition at line 107 of file wizchip_conf.h.

#define DEFAULT_DNS_ADDR   "168.126.63.1"

Definition at line 108 of file wizchip_conf.h.

Typedef Documentation

typedef struct __WIZCHIP _WIZCHIP

Function Documentation

void reg_wizchip_cris_cbfunc ( void(*)(void)  cris_en,
void(*)(void)  cris_ex 
)

Registers call back function for critical section of I/O functions such as WIZCHIP_READ, WIZCHIP_WRITE, WIZCHIP_READ_BUF and WIZCHIP_WRITE_BUF.

Parameters
cris_en: callback function for critical section enter.
cris_ex: callback function for critical section exit.
Todo:
Describe wizchip_int_enable and wizchip_int_disable function or register your functions.
Note
If you do not describe or register, default functions(wizchip_cris_enter & wizchip_cris_exit) is called.

Definition at line 110 of file wizchip_conf.c.

References __WIZCHIP::_CRIS::_enter, __WIZCHIP::_CRIS::_exit, __WIZCHIP::CRIS, wizchip_cris_enter(), and wizchip_cris_exit().

void reg_wizchip_cs_cbfunc ( void(*)(void)  cs_sel,
void(*)(void)  cs_desel 
)

Registers call back function for WIZCHIP select & deselect.

Parameters
cs_sel: callback function for WIZCHIP select
cs_desel: callback fucntion for WIZCHIP deselect
Todo:
Describe wizchip_cs_select and wizchip_cs_deselect function or register your functions.
Note
If you do not describe or register, null function is called.

Definition at line 124 of file wizchip_conf.c.

References __WIZCHIP::_CS::_deselect, __WIZCHIP::_CS::_select, __WIZCHIP::CS, wizchip_cs_deselect(), and wizchip_cs_select().

Referenced by platform_init().

void reg_wizchip_bus_cbfunc ( uint8_t(*)(uint32_t addr)  bus_rb,
void(*)(uint32_t addr, uint8_t wb)  bus_wb 
)

Registers call back function for bus interface.

Parameters
bus_rb: callback function to read byte data using system bus
bus_wb: callback function to write byte data using system bus
Todo:
Describe wizchip_bus_readbyte and wizchip_bus_writebyte function or register your functions.
Note
If you do not describe or register, null function is called.

Definition at line 138 of file wizchip_conf.c.

References _WIZCHIP_IO_MODE_BUS_, __WIZCHIP::BUS, __WIZCHIP::IF, __WIZCHIP::if_mode, wizchip_bus_readbyte(), and wizchip_bus_writebyte().

void reg_wizchip_spi_cbfunc ( uint8_t(*)(void)  spi_rb,
void(*)(uint8_t wb)  spi_wb 
)

Registers call back function for SPI interface.

Parameters
spi_rb: callback function to read byte usig SPI
spi_wb: callback function to write byte usig SPI
Todo:
Describe wizchip_spi_readbyte and wizchip_spi_writebyte function or register your functions.
Note
If you do not describe or register, null function is called.

Definition at line 154 of file wizchip_conf.c.

References _WIZCHIP_IO_MODE_SPI_, __WIZCHIP::IF, __WIZCHIP::if_mode, __WIZCHIP::SPI, wizchip_spi_readbyte(), and wizchip_spi_writebyte().

Referenced by platform_init().

void wizchip_sw_reset ( void  )

Reset WIZCHIP by softly.

Definition at line 170 of file wizchip_conf.c.

References getGAR(), getMR(), getSHAR(), getSIPR(), getSUBR(), MR_RST, setGAR(), setMR(), setSHAR(), setSIPR(), and setSUBR().

Referenced by wizchip_init().

int8_t wizchip_init ( uint8_t *  txsize,
uint8_t *  rxsize 
)

Initializes WIZCHIP with socket buffer size

Parameters
txsize- socket tx buffer sizes. if null, initialized the default size 2KB.
rxsize- socket rx buffer sizes. if null, initialized the default size 2KB.
Returns
0 : succcess -1 : fail. Invalid buffer size

Definition at line 184 of file wizchip_conf.c.

References _WIZCHIP_SOCK_NUM_, setSn_RXBUF_SIZE(), setSn_TXBUF_SIZE(), and wizchip_sw_reset().

Referenced by platform_init().

Variable Documentation

_WIZCHIP WIZCHIP