w5100s_driver.c File Reference

WIZnet W5100S Ethernet controller. More...

#include "core/net.h"
#include "drivers/eth/w5100s_driver.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   NIC_TRACE_LEVEL
 

Functions

error_t w5100sInit (NetInterface *interface)
 W5100S controller initialization. More...
 
__weak_func void w5100sInitHook (NetInterface *interface)
 W5100S custom configuration. More...
 
void w5100sTick (NetInterface *interface)
 W5100S timer handler. More...
 
void w5100sEnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void w5100sDisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
bool_t w5100sIrqHandler (NetInterface *interface)
 W5100S interrupt service routine. More...
 
void w5100sEventHandler (NetInterface *interface)
 W5100S event handler. More...
 
error_t w5100sSendPacket (NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
 Send a packet. More...
 
error_t w5100sReceivePacket (NetInterface *interface)
 Receive a packet. More...
 
error_t w5100sUpdateMacAddrFilter (NetInterface *interface)
 Configure MAC address filtering. More...
 
void w5100sWriteReg8 (NetInterface *interface, uint16_t address, uint8_t data)
 Write 8-bit register. More...
 
uint8_t w5100sReadReg8 (NetInterface *interface, uint16_t address)
 Read 8-bit register. More...
 
void w5100sWriteReg16 (NetInterface *interface, uint16_t address, uint16_t data)
 Write 16-bit register. More...
 
uint16_t w5100sReadReg16 (NetInterface *interface, uint16_t address)
 Read 16-bit register. More...
 
void w5100sWriteData (NetInterface *interface, const uint8_t *data, size_t length)
 Write data. More...
 
void w5100sReadData (NetInterface *interface, uint8_t *data, size_t length)
 Read data. More...
 
void w5100sWriteBuffer (NetInterface *interface, uint16_t address, const uint8_t *data, size_t length)
 Write TX buffer. More...
 
void w5100sReadBuffer (NetInterface *interface, uint16_t address, uint8_t *data, size_t length)
 Read RX buffer. More...
 
void w5100sDumpReg (NetInterface *interface)
 Dump registers for debugging purpose. More...
 

Variables

const NicDriver w5100sDriver
 W5100S driver. More...
 

Detailed Description

WIZnet W5100S Ethernet controller.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.0

Definition in file w5100s_driver.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   NIC_TRACE_LEVEL

Definition at line 32 of file w5100s_driver.c.

Function Documentation

◆ w5100sDisableIrq()

void w5100sDisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 262 of file w5100s_driver.c.

◆ w5100sDumpReg()

void w5100sDumpReg ( NetInterface interface)

Dump registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface

Definition at line 771 of file w5100s_driver.c.

◆ w5100sEnableIrq()

void w5100sEnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 247 of file w5100s_driver.c.

◆ w5100sEventHandler()

void w5100sEventHandler ( NetInterface interface)

W5100S event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 339 of file w5100s_driver.c.

◆ w5100sInit()

error_t w5100sInit ( NetInterface interface)

W5100S controller initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 71 of file w5100s_driver.c.

◆ w5100sInitHook()

__weak_func void w5100sInitHook ( NetInterface interface)

W5100S custom configuration.

Parameters
[in]interfaceUnderlying network interface

Definition at line 180 of file w5100s_driver.c.

◆ w5100sIrqHandler()

bool_t w5100sIrqHandler ( NetInterface interface)

W5100S interrupt service routine.

Parameters
[in]interfaceUnderlying network interface
Returns
TRUE if a higher priority task must be woken. Else FALSE is returned

Definition at line 278 of file w5100s_driver.c.

◆ w5100sReadBuffer()

void w5100sReadBuffer ( NetInterface interface,
uint16_t  address,
uint8_t *  data,
size_t  length 
)

Read RX buffer.

Parameters
[in]interfaceUnderlying network interface
[in]addressBuffer address
[out]dataBuffer where to store the incoming data
[in]lengthNumber of data to read

Definition at line 740 of file w5100s_driver.c.

◆ w5100sReadData()

void w5100sReadData ( NetInterface interface,
uint8_t *  data,
size_t  length 
)

Read data.

Parameters
[in]interfaceUnderlying network interface
[out]dataBuffer where to store the incoming data
[in]lengthNumber of data to read

Definition at line 659 of file w5100s_driver.c.

◆ w5100sReadReg16()

uint16_t w5100sReadReg16 ( NetInterface interface,
uint16_t  address 
)

Read 16-bit register.

Parameters
[in]interfaceUnderlying network interface
[in]addressRegister address
Returns
Register value

Definition at line 579 of file w5100s_driver.c.

◆ w5100sReadReg8()

uint8_t w5100sReadReg8 ( NetInterface interface,
uint16_t  address 
)

Read 8-bit register.

Parameters
[in]interfaceUnderlying network interface
[in]addressRegister address
Returns
Register value

Definition at line 519 of file w5100s_driver.c.

◆ w5100sReceivePacket()

error_t w5100sReceivePacket ( NetInterface interface)

Receive a packet.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 417 of file w5100s_driver.c.

◆ w5100sSendPacket()

error_t w5100sSendPacket ( NetInterface interface,
const NetBuffer buffer,
size_t  offset,
NetTxAncillary ancillary 
)

Send a packet.

Parameters
[in]interfaceUnderlying network interface
[in]bufferMulti-part buffer containing the data to send
[in]offsetOffset to the first data byte
[in]ancillaryAdditional options passed to the stack along with the packet
Returns
Error code

Definition at line 364 of file w5100s_driver.c.

◆ w5100sTick()

void w5100sTick ( NetInterface interface)

W5100S timer handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 190 of file w5100s_driver.c.

◆ w5100sUpdateMacAddrFilter()

error_t w5100sUpdateMacAddrFilter ( NetInterface interface)

Configure MAC address filtering.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 478 of file w5100s_driver.c.

◆ w5100sWriteBuffer()

void w5100sWriteBuffer ( NetInterface interface,
uint16_t  address,
const uint8_t *  data,
size_t  length 
)

Write TX buffer.

Parameters
[in]interfaceUnderlying network interface
[in]addressBuffer address
[in]dataPointer to the data being written
[in]lengthNumber of data to write

Definition at line 706 of file w5100s_driver.c.

◆ w5100sWriteData()

void w5100sWriteData ( NetInterface interface,
const uint8_t *  data,
size_t  length 
)

Write data.

Parameters
[in]interfaceUnderlying network interface
[in]dataPointer to the data being written
[in]lengthNumber of data to write

Definition at line 612 of file w5100s_driver.c.

◆ w5100sWriteReg16()

void w5100sWriteReg16 ( NetInterface interface,
uint16_t  address,
uint16_t  data 
)

Write 16-bit register.

Parameters
[in]interfaceUnderlying network interface
[in]addressRegister address
[in]dataRegister value

Definition at line 551 of file w5100s_driver.c.

◆ w5100sWriteReg8()

void w5100sWriteReg8 ( NetInterface interface,
uint16_t  address,
uint8_t  data 
)

Write 8-bit register.

Parameters
[in]interfaceUnderlying network interface
[in]addressRegister address
[in]dataRegister value

Definition at line 492 of file w5100s_driver.c.

Variable Documentation

◆ w5100sDriver

const NicDriver w5100sDriver
Initial value:
=
{
NULL,
NULL,
NULL,
}
#define ETH_MTU
Definition: ethernet.h:116
@ NIC_TYPE_ETHERNET
Ethernet interface.
Definition: nic.h:83
#define TRUE
Definition: os_port.h:50
error_t w5100sSendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Send a packet.
void w5100sEnableIrq(NetInterface *interface)
Enable interrupts.
void w5100sDisableIrq(NetInterface *interface)
Disable interrupts.
error_t w5100sUpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.
void w5100sTick(NetInterface *interface)
W5100S timer handler.
error_t w5100sInit(NetInterface *interface)
W5100S controller initialization.
Definition: w5100s_driver.c:71
void w5100sEventHandler(NetInterface *interface)
W5100S event handler.

W5100S driver.

Definition at line 44 of file w5100s_driver.c.