io6Library
WIZnet Dual Stack TCP/IP Ethernet Controller Driver
Functions | Variables
wizchip_conf.c File Reference

WIZCHIP Config Implements file. More...

#include <stddef.h>
#include "wizchip_conf.h"

Go to the source code of this file.

Functions

void wizchip_cris_enter (void)
 Default function to enter the critical section for _WIZCHIP_. More...
 
void wizchip_cris_exit (void)
 Default function to exit the critical section for _WIZCHIP_. More...
 
void wizchip_cs_select (void)
 Default function to select _WIZCHIP_. More...
 
void wizchip_cs_deselect (void)
 Default function to de-select _WIZCHIP_. More...
 
iodata_t wizchip_bus_read (uint32_t AddrSel)
 Default function to read one iodata_t data by using BUS interface. More...
 
void wizchip_bus_write (uint32_t AddrSel, iodata_t wb)
 Default function to write one iodata_t data by using BUS interface. More...
 
void wizchip_bus_read_buf (uint32_t AddrSel, iodata_t *buf, datasize_t len, uint8_t addrinc)
 Default function to read iodata_t buffer by using BUS interface. More...
 
void wizchip_bus_write_buf (uint32_t AddrSel, iodata_t *buf, datasize_t len, uint8_t addrinc)
 Default function to write iodata_t buffer by using BUS interface. More...
 
uint8_t wizchip_spi_read (void)
 Default function to read one byte by using SPI interface. More...
 
void wizchip_spi_write (uint8_t wb)
 Default function to write one byte by using SPI interface. More...
 
void wizchip_spi_read_buf (uint8_t *buf, datasize_t len)
 Default function to read buffer by using SPI interface. More...
 
void wizchip_spi_write_buf (uint8_t *buf, datasize_t len)
 Default function to write buffer by using SPI interface. More...
 
void reg_wizchip_cris_cbfunc (void(*cris_en)(void), void(*cris_ex)(void))
 Registers call back functions for critical section. More...
 
void reg_wizchip_cs_cbfunc (void(*cs_sel)(void), void(*cs_desel)(void))
 Registers call back functions for _WIZCHIP_ select & deselect. More...
 
int8_t ctlwizchip (ctlwizchip_type cwtype, void *arg)
 Control _WIZCHIP_. More...
 
int8_t ctlnetwork (ctlnetwork_type cntype, void *arg)
 Controls to network. More...
 
int8_t ctlnetservice (ctlnetservice_type cnstype, void *arg)
 Controls to network service. More...
 
void wizchip_sw_reset (void)
 Soft Reset _WIZCHIP_. More...
 
int8_t wizchip_init (uint8_t *txsize, uint8_t *rxsize)
 Initializes SOCKETn TX/RX buffer size. More...
 
void wizchip_clrinterrupt (intr_kind intr)
 Clear Interrupt of _WIZCHIP_. More...
 
intr_kind wizchip_getinterrupt (void)
 Get Interrupt of _WIZCHIP_. More...
 
void wizchip_setinterruptmask (intr_kind intr)
 Mask or Unmask Interrupt of _WIZCHIP_. More...
 
intr_kind wizchip_getinterruptmask (void)
 Get Interrupt mask of _WIZCHIP_. More...
 
int8_t wizphy_getphylink (void)
 Get the Link status of integrated PHY. More...
 
void wizphy_reset (void)
 Reset the integrated PHY. More...
 
void wizphy_setphyconf (wiz_PhyConf *phyconf)
 
void wizphy_getphyconf (wiz_PhyConf *phyconf)
 Get the integrated Ethernet PHY operation mode. More...
 
void wizphy_getphystatus (wiz_PhyConf *phyconf)
 Get the real PHY operation status when link is established. More...
 
void wizphy_setphypmode (uint8_t pmode)
 Set the power mode of integrated Ethernet PHY. More...
 
int8_t wizphy_getphypmode (void)
 get the power mode of integrated Ethernet PHY. More...
 
void wizchip_setnetinfo (wiz_NetInfo *pnetinfo)
 Set the network information for _WIZCHIP_. More...
 
void wizchip_getnetinfo (wiz_NetInfo *pnetinfo)
 Get the network information of _WIZCHIP_. More...
 
void wizchip_setnetmode (netmode_type netmode)
 Set the network mode such as WOL, PPPoE, PING Block, and etc. More...
 
netmode_type wizchip_getnetmode (void)
 Get the network mode such as WOL, PPPoE, PING Block, and etc. More...
 
void wizchip_settimeout (wiz_NetTimeout *nettime)
 Set retransmission time values and retry counts. More...
 
void wizchip_gettimeout (wiz_NetTimeout *nettime)
 Get retransmission time values and retry counts. More...
 
int8_t wizchip_arp (wiz_ARP *arp)
 ARP process. More...
 
int8_t wizchip_ping (wiz_PING *ping)
 PING process. More...
 
int8_t wizchip_dad (uint8_t *ipv6)
 DAD(Duplcated Address Detection) process. More...
 
int8_t wizchip_slaac (wiz_Prefix *prefix)
 Stateless Address Auto Configuration(SLAAC) process. More...
 
int8_t wizchip_unsolicited (void)
 Unsolicited NA process. More...
 
int8_t wizchip_getprefix (wiz_Prefix *prefix)
 Get a prefix information of RA message from a router. More...
 

Variables

_WIZCHIP_T_ WIZCHIP
 _WIZCHIP_T_ instance More...
 

Detailed Description

WIZCHIP Config Implements file.

Version
1.0.0
Date
2019/01/01
Revision history
<2019/01/01> 1st Release
Author
MidnightCow

Copyright (c) 2019, WIZnet Co., LTD.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Definition in file wizchip_conf.c.

Function Documentation

◆ wizchip_cris_enter()

void wizchip_cris_enter ( void  )

Default function to enter the critical section for _WIZCHIP_.

wizchip_cris_enter() provides the default protection while _WIZCHIP_ is accessed.
but it is null function.

Note
It can be overwritten with your function or register your functions by calling reg_wizchip_cris_cbfunc().
See also
wizchip_cris_exit()

Definition at line 45 of file wizchip_conf.c.

Referenced by reg_wizchip_cris_cbfunc().

◆ wizchip_cris_exit()

void wizchip_cris_exit ( void  )

Default function to exit the critical section for _WIZCHIP_.

wizchip_cris_exit provides the default protection while _WIZCHIP_ is accessed
but it is null function.

Note
It can be overwritten with your function or register your functions by calling reg_wizchip_cris_cbfunc().
See also
wizchip_cris_enter()

Definition at line 54 of file wizchip_conf.c.

Referenced by reg_wizchip_cris_cbfunc().

◆ wizchip_cs_select()

void wizchip_cs_select ( void  )

Default function to select _WIZCHIP_.

wizchip_cs_select() provides the default selection _WIZCHIP_,
but it is null function.

Note
It can be overwritten with your function or register your functions by calling reg_wizchip_cs_cbfunc().
See also
wizchip_cs_deselect()

Definition at line 63 of file wizchip_conf.c.

Referenced by reg_wizchip_cs_cbfunc().

◆ wizchip_cs_deselect()

void wizchip_cs_deselect ( void  )

Default function to de-select _WIZCHIP_.

wizchip_cs_deselect() provides the default de-selection _WIZCHIP_,
but it is null function.

Note
It can be overwritten with your function or register your functions by calling reg_wizchip_cs_cbfunc().
See also
wizchip_cs_select()

Definition at line 72 of file wizchip_conf.c.

Referenced by reg_wizchip_cs_cbfunc().

◆ wizchip_bus_read()

iodata_t wizchip_bus_read ( uint32_t  AddrSel)

Default function to read one iodata_t data by using BUS interface.

wizchip_bus_read() provides the default read one iodata_t data from BUS of _WIZCHIP_.

Parameters
AddrSelIt specifies the address of register to be read.
Returns
iodata_t
Note
It can be overwritten with your function or register your functions by calling reg_wizchip_bus_cbfunc().
See also
wizchip_bus_write()

Definition at line 87 of file wizchip_conf.c.

◆ wizchip_bus_write()

void wizchip_bus_write ( uint32_t  AddrSel,
iodata_t  wb 
)

Default function to write one iodata_t data by using BUS interface.

wizchip_bus_write() provides the default write one iodata_t data to BUS of _WIZCHIP_.

Parameters
AddrSelIt specifies the address of register to be written.
wbiodata_t data to be written
Returns
void
Note
It can be overwritten with your function or register your functions by calling reg_wizchip_bus_cbfunc().
See also
wizchip_bus_read()

Definition at line 98 of file wizchip_conf.c.

◆ wizchip_bus_read_buf()

void wizchip_bus_read_buf ( uint32_t  AddrSel,
iodata_t *  buf,
datasize_t  len,
uint8_t  addrinc 
)

Default function to read iodata_t buffer by using BUS interface.

wizchip_bus_read_buf() provides the default read iodata_t data as many as len from BUS of _WIZCHIP_.

Parameters
AddrSelIt specifies the address of register to be read.
bufIt specifies your buffer pointer to be saved the read data from _WIZCHIP_.
lenIt specifies the data length to be read from _WIZCHIP_.
addrincIt specifies whether the address is increased by every read operation or not.
0 : Not Increased
1 : Increased
Returns
void
Note
It can be overwritten with your function or register your functions by calling reg_wizchip_bus_cbfunc().
See also
wizchip_bus_write_buf()

Definition at line 113 of file wizchip_conf.c.

References __WIZCHIP_T__::_IF::_BUS::_read_data, __WIZCHIP_T__::_IF::BUS, __WIZCHIP_T__::IF, and WIZCHIP.

◆ wizchip_bus_write_buf()

void wizchip_bus_write_buf ( uint32_t  AddrSel,
iodata_t *  buf,
datasize_t  len,
uint8_t  addrinc 
)

Default function to write iodata_t buffer by using BUS interface.

wizchip_bus_write_buf() provides the default write iodata_t data as many as len to BUS of _WIZCHIP_.

Parameters
AddrSelIt specifies the address of register to be written.
bufIt specifies your buffer pointer to be written to _WIZCHIP_.
lenIt specifies the data length to be written to _WIZCHIP_.
addrincIt specifies whether the address is increased by every write operation or not.
0 : Not Increased
1 : Increased
Returns
void
Note
It can be overwritten with your function or register your functions by calling reg_wizchip_bus_cbfunc().
See also
wizchip_bus_read_buf()

Definition at line 137 of file wizchip_conf.c.

References __WIZCHIP_T__::_IF::_BUS::_write_data, __WIZCHIP_T__::_IF::BUS, __WIZCHIP_T__::IF, and WIZCHIP.

◆ wizchip_spi_read()

uint8_t wizchip_spi_read ( void  )

Default function to read one byte by using SPI interface.

wizchip_spi_read() provides the default read one byte data from SPI of _WIZCHIP_,
but it is null function.

Returns
uint8_t
Todo:
It should be overwritten with your function or register your functions by calling reg_wizchip_spi_cbfunc().

Definition at line 165 of file wizchip_conf.c.

◆ wizchip_spi_write()

void wizchip_spi_write ( uint8_t  wb)

Default function to write one byte by using SPI interface.

wizchip_spi_write() provides the default write one byte data to SPI of _WIZCHIP_,
but it is null function.

Parameters
wbuint8_t data to be written
Returns
void
Todo:
It should be overwritten with your function or register your functions by calling reg_wizchip_spi_cbfunc().

Definition at line 175 of file wizchip_conf.c.

◆ wizchip_spi_read_buf()

void wizchip_spi_read_buf ( uint8_t *  buf,
datasize_t  len 
)

Default function to read buffer by using SPI interface.

wizchip_spi_read_buf() provides the default read byte buffer as many as len from SPI of _WIZCHIP_.

Parameters
bufIt specifies your buffer pointer to be saved the read data from _WIZCHIP_.
lenIt specifies the data length to be read from _WIZCHIP_.
Returns
void
Note
It is use wizchip_spi_read() as default.
It can be overwritten with your function or register your functions by calling reg_wizchip_spi_cbfunc().

Definition at line 186 of file wizchip_conf.c.

References __WIZCHIP_T__::_IF::_SPI::_read_byte, __WIZCHIP_T__::IF, __WIZCHIP_T__::_IF::SPI, and WIZCHIP.

◆ wizchip_spi_write_buf()

void wizchip_spi_write_buf ( uint8_t *  buf,
datasize_t  len 
)

Default function to write buffer by using SPI interface.

wizchip_spi_write_buf() provides the default write byte buffer as many as len to SPI of _WIZCHIP_.

Parameters
bufIt specifies your buffer pointer to be written to _WIZCHIP_.
lenIt specifies the data length to be write from _WIZCHIP_.
Returns
void
Note
It is use wizchip_spi_write() as default.
It can be overwritten with your function or register your functions by calling reg_wizchip_spi_cbfunc().

Definition at line 200 of file wizchip_conf.c.

References __WIZCHIP_T__::_IF::_SPI::_write_byte, __WIZCHIP_T__::IF, __WIZCHIP_T__::_IF::SPI, and WIZCHIP.

◆ reg_wizchip_cris_cbfunc()

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

Registers call back functions for critical section.

reg_wizchip_cris_cbfunc() is for basic 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:
Register your functions for critical session.
Note
If you do not register it, the empty default functions are called.
wizchip_cris_enter(), wizchip_cris_exit()

Definition at line 256 of file wizchip_conf.c.

References __WIZCHIP_T__::_CRIS::_e_n_t_e_r_, __WIZCHIP_T__::_CRIS::_e_x_i_t_, __WIZCHIP_T__::CRIS, WIZCHIP, wizchip_cris_enter(), and wizchip_cris_exit().

◆ reg_wizchip_cs_cbfunc()

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

Registers call back functions for _WIZCHIP_ select & deselect.

reg_wizchip_cs_cbfunc() registers your functions to select & deselect _WIZCHIP_

Parameters
cs_sel: callback function to select _WIZCHIP_
cs_desel: callback function to deselect _WIZCHIP_
Todo:
Register your functions to select or deselect _WIZCHIP_.
Note
If you do not register it, the empty default functions are called.
wizchip_cs_select(), wizchip_cs_deselect()

Definition at line 264 of file wizchip_conf.c.

References __WIZCHIP_T__::_CS::_d_e_s_e_l_e_c_t_, __WIZCHIP_T__::_CS::_s_e_l_e_c_t_, __WIZCHIP_T__::CS, WIZCHIP, wizchip_cs_deselect(), and wizchip_cs_select().

Variable Documentation

◆ WIZCHIP

_WIZCHIP_T_ WIZCHIP

_WIZCHIP_T_ instance

WIZCHIP is instance of _WIZCHIP_T_ to access _WIZCHIP_.

It provides the call-back function set for accessing to _WIZCHIP_

Definition at line 214 of file wizchip_conf.c.

Referenced by ctlwizchip(), reg_wizchip_cris_cbfunc(), reg_wizchip_cs_cbfunc(), wizchip_bus_read_buf(), wizchip_bus_write_buf(), wizchip_spi_read_buf(), and wizchip_spi_write_buf().