ENC28J60 Ethernet controller. More...
Go to the source code of this file.
Macros | |
| #define | TRACE_LEVEL NIC_TRACE_LEVEL |
Functions | |
| error_t | enc28j60Init (NetInterface *interface) |
| ENC28J60 controller initialization. More... | |
| __weak_func void | enc28j60InitHook (NetInterface *interface) |
| ENC28J60 custom configuration. More... | |
| void | enc28j60Tick (NetInterface *interface) |
| ENC28J60 timer handler. More... | |
| void | enc28j60EnableIrq (NetInterface *interface) |
| Enable interrupts. More... | |
| void | enc28j60DisableIrq (NetInterface *interface) |
| Disable interrupts. More... | |
| bool_t | enc28j60IrqHandler (NetInterface *interface) |
| ENC28J60 interrupt service routine. More... | |
| void | enc28j60EventHandler (NetInterface *interface) |
| ENC28J60 event handler. More... | |
| error_t | enc28j60SendPacket (NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary) |
| Send a packet. More... | |
| error_t | enc28j60ReceivePacket (NetInterface *interface) |
| Receive a packet. More... | |
| error_t | enc28j60UpdateMacAddrFilter (NetInterface *interface) |
| Configure MAC address filtering. More... | |
| void | enc28j60SoftReset (NetInterface *interface) |
| ENC28J60 controller reset. More... | |
| void | enc28j60SelectBank (NetInterface *interface, uint16_t address) |
| Bank selection. More... | |
| void | enc28j60WriteReg (NetInterface *interface, uint16_t address, uint8_t data) |
| Write ENC28J60 register. More... | |
| uint8_t | enc28j60ReadReg (NetInterface *interface, uint16_t address) |
| Read ENC28J60 register. More... | |
| void | enc28j60WritePhyReg (NetInterface *interface, uint16_t address, uint16_t data) |
| Write PHY register. More... | |
| uint16_t | enc28j60ReadPhyReg (NetInterface *interface, uint16_t address) |
| Read PHY register. More... | |
| void | enc28j60WriteBuffer (NetInterface *interface, const NetBuffer *buffer, size_t offset) |
| Write SRAM buffer. More... | |
| void | enc28j60ReadBuffer (NetInterface *interface, uint8_t *data, size_t length) |
| Read SRAM buffer. More... | |
| void | enc28j60SetBit (NetInterface *interface, uint16_t address, uint16_t mask) |
| Set bit field. More... | |
| void | enc28j60ClearBit (NetInterface *interface, uint16_t address, uint16_t mask) |
| Clear bit field. More... | |
| uint32_t | enc28j60CalcCrc (const void *data, size_t length) |
| CRC calculation using the polynomial 0x4C11DB7. More... | |
| void | enc28j60DumpReg (NetInterface *interface) |
| Dump registers for debugging purpose. More... | |
| void | enc28j60DumpPhyReg (NetInterface *interface) |
| Dump PHY registers for debugging purpose. More... | |
Variables | |
| const NicDriver | enc28j60Driver |
| ENC28J60 driver. More... | |
Detailed Description
ENC28J60 Ethernet controller.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2025 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.
- Version
- 2.5.4
Definition in file enc28j60_driver.c.
Macro Definition Documentation
◆ TRACE_LEVEL
| #define TRACE_LEVEL NIC_TRACE_LEVEL |
Definition at line 32 of file enc28j60_driver.c.
Function Documentation
◆ enc28j60CalcCrc()
| uint32_t enc28j60CalcCrc | ( | const void * | data, |
| size_t | length | ||
| ) |
CRC calculation using the polynomial 0x4C11DB7.
- 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 970 of file enc28j60_driver.c.
◆ enc28j60ClearBit()
| void enc28j60ClearBit | ( | NetInterface * | interface, |
| uint16_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 948 of file enc28j60_driver.c.
◆ enc28j60DisableIrq()
| void enc28j60DisableIrq | ( | NetInterface * | interface | ) |
Disable interrupts.
- Parameters
-
[in] interface Underlying network interface
Definition at line 275 of file enc28j60_driver.c.
◆ enc28j60DumpPhyReg()
| void enc28j60DumpPhyReg | ( | NetInterface * | interface | ) |
Dump PHY registers for debugging purpose.
- Parameters
-
[in] interface Underlying network interface
Definition at line 1065 of file enc28j60_driver.c.
◆ enc28j60DumpReg()
| void enc28j60DumpReg | ( | NetInterface * | interface | ) |
Dump registers for debugging purpose.
- Parameters
-
[in] interface Underlying network interface
Definition at line 1010 of file enc28j60_driver.c.
◆ enc28j60EnableIrq()
| void enc28j60EnableIrq | ( | NetInterface * | interface | ) |
Enable interrupts.
- Parameters
-
[in] interface Underlying network interface
Definition at line 260 of file enc28j60_driver.c.
◆ enc28j60EventHandler()
| void enc28j60EventHandler | ( | NetInterface * | interface | ) |
ENC28J60 event handler.
- Parameters
-
[in] interface Underlying network interface
Definition at line 354 of file enc28j60_driver.c.
◆ enc28j60Init()
| error_t enc28j60Init | ( | NetInterface * | interface | ) |
ENC28J60 controller initialization.
- Parameters
-
[in] interface Underlying network interface
- Returns
- Error code
Definition at line 71 of file enc28j60_driver.c.
◆ enc28j60InitHook()
| __weak_func void enc28j60InitHook | ( | NetInterface * | interface | ) |
ENC28J60 custom configuration.
- Parameters
-
[in] interface Underlying network interface
Definition at line 240 of file enc28j60_driver.c.
◆ enc28j60IrqHandler()
| bool_t enc28j60IrqHandler | ( | NetInterface * | interface | ) |
ENC28J60 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 291 of file enc28j60_driver.c.
◆ enc28j60ReadBuffer()
| void enc28j60ReadBuffer | ( | NetInterface * | interface, |
| uint8_t * | data, | ||
| size_t | length | ||
| ) |
Read SRAM buffer.
- Parameters
-
[in] interface Underlying network interface [out] data Buffer where to store the incoming data [in] length Number of data to read
Definition at line 897 of file enc28j60_driver.c.
◆ enc28j60ReadPhyReg()
| uint16_t enc28j60ReadPhyReg | ( | NetInterface * | interface, |
| uint16_t | address | ||
| ) |
Read PHY register.
- Parameters
-
[in] interface Underlying network interface [in] address PHY register address
- Returns
- Register value
Definition at line 808 of file enc28j60_driver.c.
◆ enc28j60ReadReg()
| uint8_t enc28j60ReadReg | ( | NetInterface * | interface, |
| uint16_t | address | ||
| ) |
Read ENC28J60 register.
- Parameters
-
[in] interface Underlying network interface [in] address Register address
- Returns
- Register value
Definition at line 746 of file enc28j60_driver.c.
◆ enc28j60ReceivePacket()
| error_t enc28j60ReceivePacket | ( | NetInterface * | interface | ) |
Receive a packet.
- Parameters
-
[in] interface Underlying network interface
- Returns
- Error code
Definition at line 495 of file enc28j60_driver.c.
◆ enc28j60SelectBank()
| void enc28j60SelectBank | ( | NetInterface * | interface, |
| uint16_t | address | ||
| ) |
Bank selection.
- Parameters
-
[in] interface Underlying network interface [in] address Register address
Definition at line 668 of file enc28j60_driver.c.
◆ enc28j60SendPacket()
| error_t enc28j60SendPacket | ( | NetInterface * | interface, |
| const NetBuffer * | buffer, | ||
| size_t | offset, | ||
| NetTxAncillary * | ancillary | ||
| ) |
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 [in] ancillary Additional options passed to the stack along with the packet
- Returns
- Error code
Definition at line 431 of file enc28j60_driver.c.
◆ enc28j60SetBit()
| void enc28j60SetBit | ( | NetInterface * | interface, |
| uint16_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 926 of file enc28j60_driver.c.
◆ enc28j60SoftReset()
| void enc28j60SoftReset | ( | NetInterface * | interface | ) |
ENC28J60 controller reset.
- Parameters
-
[in] interface Underlying network interface
Definition at line 649 of file enc28j60_driver.c.
◆ enc28j60Tick()
| void enc28j60Tick | ( | NetInterface * | interface | ) |
ENC28J60 timer handler.
- Parameters
-
[in] interface Underlying network interface
Definition at line 250 of file enc28j60_driver.c.
◆ enc28j60UpdateMacAddrFilter()
| error_t enc28j60UpdateMacAddrFilter | ( | NetInterface * | interface | ) |
Configure MAC address filtering.
- Parameters
-
[in] interface Underlying network interface
- Returns
- Error code
Definition at line 586 of file enc28j60_driver.c.
◆ enc28j60WriteBuffer()
| void enc28j60WriteBuffer | ( | NetInterface * | interface, |
| const NetBuffer * | buffer, | ||
| size_t | offset | ||
| ) |
Write SRAM buffer.
- Parameters
-
[in] interface Underlying network interface [in] buffer Multi-part buffer containing the data to be written [in] offset Offset to the first data byte
Definition at line 842 of file enc28j60_driver.c.
◆ enc28j60WritePhyReg()
| void enc28j60WritePhyReg | ( | NetInterface * | interface, |
| uint16_t | address, | ||
| uint16_t | data | ||
| ) |
Write PHY register.
- Parameters
-
[in] interface Underlying network interface [in] address PHY register address [in] data Register value
Definition at line 783 of file enc28j60_driver.c.
◆ enc28j60WriteReg()
| void enc28j60WriteReg | ( | NetInterface * | interface, |
| uint16_t | address, | ||
| uint8_t | data | ||
| ) |
Write ENC28J60 register.
- Parameters
-
[in] interface Underlying network interface [in] address Register address [in] data Register value
Definition at line 721 of file enc28j60_driver.c.
