Webserver+3d print
Dependents:
Nucleo
« Back to documentation index
ksz8851.h File Reference
KSZ8851 Ethernet controller.
More...
Go to the source code of this file.
Data Structures
struct Ksz8851Context
KSZ8851 driver context. More...
Functions
error_t ksz8851Init (NetInterface *interface)
KSZ8851 controller initialization.
void ksz8851Tick (NetInterface *interface)
KSZ8851 timer handler.
void ksz8851EnableIrq (NetInterface *interface)
Enable interrupts.
void ksz8851DisableIrq (NetInterface *interface)
Disable interrupts.
bool_t ksz8851IrqHandler (NetInterface *interface)
KSZ8851 interrupt service routine.
void ksz8851EventHandler (NetInterface *interface)
KSZ8851 event handler.
error_t ksz8851SendPacket (NetInterface *interface, const NetBuffer *buffer, size_t offset)
Send a packet.
error_t ksz8851ReceivePacket (NetInterface *interface)
Receive a packet.
error_t ksz8851SetMulticastFilter (NetInterface *interface)
Configure multicast MAC address filtering.
void ksz8851WriteReg (NetInterface *interface, uint8_t address, uint16_t data)
Write KSZ8851 register.
uint16_t ksz8851ReadReg (NetInterface *interface, uint8_t address)
Read KSZ8851 register.
void ksz8851WriteFifo (NetInterface *interface, const uint8_t *data, size_t length)
Write TX FIFO.
void ksz8851ReadFifo (NetInterface *interface, uint8_t *data, size_t length)
Read RX FIFO.
void ksz8851SetBit (NetInterface *interface, uint8_t address, uint16_t mask)
Set bit field.
void ksz8851ClearBit (NetInterface *interface, uint8_t address, uint16_t mask)
Clear bit field.
uint32_t ksz8851CalcCrc (const void *data, size_t length)
CRC calculation.
void ksz8851DumpReg (NetInterface *interface)
Dump registers for debugging purpose.
Variables
const NicDriver ksz8851Driver
KSZ8851 driver.
Detailed Description
KSZ8851 Ethernet controller.
License
Copyright (C) 2010-2017 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: 1.7.6
Definition in file ksz8851.h .
Function Documentation
uint32_t ksz8851CalcCrc
(
const void *
data ,
size_t
length
)
CRC calculation.
Parameters:
[in] data Pointer to the data over which to calculate the CRC
[in] length Number of bytes to process
Returns: Resulting CRC value
Definition at line 755 of file ksz8851.c .
void ksz8851ClearBit
(
NetInterface *
interface ,
uint8_t
address ,
uint16_t
mask
)
Clear bit field.
Parameters:
[in] interface Underlying network interface
[in] address Register address
[in] mask Bits to clear in the target register
Definition at line 737 of file ksz8851.c .
void ksz8851DisableIrq
(
NetInterface *
interface )
Disable interrupts.
Parameters:
[in] interface Underlying network interface
Definition at line 198 of file ksz8851.c .
void ksz8851DumpReg
(
NetInterface *
interface )
Dump registers for debugging purpose.
Parameters:
[in] interface Underlying network interface
Definition at line 789 of file ksz8851.c .
void ksz8851EnableIrq
(
NetInterface *
interface )
Enable interrupts.
Parameters:
[in] interface Underlying network interface
Definition at line 186 of file ksz8851.c .
void ksz8851EventHandler
(
NetInterface *
interface )
KSZ8851 event handler.
Parameters:
[in] interface Underlying network interface
Definition at line 275 of file ksz8851.c .
error_t ksz8851Init
(
NetInterface *
interface )
KSZ8851 controller initialization.
Parameters:
[in] interface Underlying network interface
Returns: Error code
Definition at line 69 of file ksz8851.c .
bool_t ksz8851IrqHandler
(
NetInterface *
interface )
KSZ8851 interrupt service routine.
Parameters:
[in] interface Underlying network interface
Returns: TRUE if a higher priority task must be woken. Else FALSE is returned
Definition at line 211 of file ksz8851.c .
void ksz8851ReadFifo
(
NetInterface *
interface ,
uint8_t *
data ,
size_t
length
)
Read RX FIFO.
Parameters:
[in] interface Underlying network interface
[in] data Buffer where to store the incoming data
[in] length Number of data to read
Definition at line 657 of file ksz8851.c .
uint16_t ksz8851ReadReg
(
NetInterface *
interface ,
uint8_t
address
)
Read KSZ8851 register.
Parameters:
[in] interface Underlying network interface
[in] address Register address
Returns: Register value
Definition at line 566 of file ksz8851.c .
error_t ksz8851ReceivePacket
(
NetInterface *
interface )
Receive a packet.
Parameters:
[in] interface Underlying network interface
Returns: Error code
Definition at line 411 of file ksz8851.c .
error_t ksz8851SendPacket
(
NetInterface *
interface ,
const NetBuffer *
buffer ,
size_t
offset
)
Send a packet.
Parameters:
[in] interface Underlying network interface
[in] buffer Multi-part buffer containing the data to send
[in] offset Offset to the first data byte
Returns: Error code
Definition at line 350 of file ksz8851.c .
void ksz8851SetBit
(
NetInterface *
interface ,
uint8_t
address ,
uint16_t
mask
)
Set bit field.
Parameters:
[in] interface Underlying network interface
[in] address Register address
[in] mask Bits to set in the target register
Definition at line 719 of file ksz8851.c .
error_t ksz8851SetMulticastFilter
(
NetInterface *
interface )
Configure multicast MAC address filtering.
Parameters:
[in] interface Underlying network interface
Returns: Error code
Definition at line 465 of file ksz8851.c .
void ksz8851Tick
(
NetInterface *
interface )
KSZ8851 timer handler.
Parameters:
[in] interface Underlying network interface
Definition at line 176 of file ksz8851.c .
void ksz8851WriteFifo
(
NetInterface *
interface ,
const uint8_t *
data ,
size_t
length
)
Write TX FIFO.
Parameters:
[in] interface Underlying network interface
[in] data Pointer to the data being written
[in] length Number of data to write
Definition at line 615 of file ksz8851.c .
void ksz8851WriteReg
(
NetInterface *
interface ,
uint8_t
address ,
uint16_t
data
)
Write KSZ8851 register.
Parameters:
[in] interface Underlying network interface
[in] address Register address
[in] data Register value
Definition at line 522 of file ksz8851.c .
Variable Documentation
KSZ8851 driver.
Definition at line 42 of file ksz8851.c .