ADIN2111 2-port 10Base-T1L Ethernet switch driver. More...
Go to the source code of this file.
Macros | |
| #define | TRACE_LEVEL NIC_TRACE_LEVEL |
Functions | |
| error_t | adin2111Init (NetInterface *interface) |
| ADIN2111 Ethernet switch initialization. More... | |
| __weak_func void | adin2111InitHook (NetInterface *interface) |
| ADIN2111 custom configuration. More... | |
| __weak_func void | adin2111Tick (NetInterface *interface) |
| ADIN2111 timer handler. More... | |
| void | adin2111EnableIrq (NetInterface *interface) |
| Enable interrupts. More... | |
| void | adin2111DisableIrq (NetInterface *interface) |
| Disable interrupts. More... | |
| bool_t | adin2111IrqHandler (NetInterface *interface) |
| ADIN2111 interrupt service routine. More... | |
| __weak_func void | adin2111EventHandler (NetInterface *interface) |
| ADIN2111 event handler. More... | |
| void | adin2111LinkChangeEventHandler (NetInterface *interface) |
| ADIN2111 link status change event handler. More... | |
| error_t | adin2111SendPacket (NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary) |
| Send a packet. More... | |
| error_t | adin2111ReceivePacket (NetInterface *interface, uint8_t port) |
| Receive a packet. More... | |
| error_t | adin2111UpdateMacAddrFilter (NetInterface *interface) |
| Configure MAC address filtering. More... | |
| bool_t | adin2111GetLinkState (NetInterface *interface, uint8_t port) |
| Get link state. More... | |
| void | adin2111WriteReg (NetInterface *interface, uint16_t address, uint32_t data) |
| Write SPI register. More... | |
| uint32_t | adin2111ReadReg (NetInterface *interface, uint16_t address) |
| Read SPI register. More... | |
| void | adin2111DumpReg (NetInterface *interface) |
| Dump SPI registers for debugging purpose. More... | |
| void | adin2111WritePhyReg (NetInterface *interface, uint8_t port, uint8_t address, uint16_t data) |
| Write PHY register. More... | |
| uint16_t | adin2111ReadPhyReg (NetInterface *interface, uint8_t port, uint8_t address) |
| Read PHY register. More... | |
| void | adin2111DumpPhyReg (NetInterface *interface, uint8_t port) |
| Dump PHY registers for debugging purpose. More... | |
| void | adin2111WriteMmdReg (NetInterface *interface, uint8_t port, uint8_t devAddr, uint16_t regAddr, uint16_t data) |
| Write MMD register. More... | |
| uint16_t | adin2111ReadMmdReg (NetInterface *interface, uint8_t port, uint8_t devAddr, uint16_t regAddr) |
| Read MMD register. More... | |
| void | adin2111WriteFifo (NetInterface *interface, uint16_t header, const uint8_t *data, size_t length) |
| Write TX FIFO. More... | |
| void | adin2111ReadFifo (NetInterface *interface, uint8_t port, uint16_t *header, uint8_t *data, size_t length) |
| Read RX FIFO. More... | |
| uint32_t | adin2111CalcParity (uint32_t data) |
| Calculate parity bit over a 32-bit data. More... | |
| uint8_t | adin2111CalcCrc (const uint8_t *data, size_t length) |
| CRC calculation. More... | |
Variables | |
| const NicDriver | adin2111Driver |
| ADIN2111 driver. More... | |
Detailed Description
ADIN2111 2-port 10Base-T1L Ethernet switch driver.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2026 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.6.6
Definition in file adin2111_driver.c.
Macro Definition Documentation
◆ TRACE_LEVEL
| #define TRACE_LEVEL NIC_TRACE_LEVEL |
Definition at line 32 of file adin2111_driver.c.
Function Documentation
◆ adin2111CalcCrc()
| uint8_t adin2111CalcCrc | ( | const uint8_t * | 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 1820 of file adin2111_driver.c.
◆ adin2111CalcParity()
| uint32_t adin2111CalcParity | ( | uint32_t | data | ) |
Calculate parity bit over a 32-bit data.
- Parameters
-
[in] data 32-bit bit stream
- Returns
- Odd parity bit computed over the supplied data
Definition at line 1797 of file adin2111_driver.c.
◆ adin2111DisableIrq()
| void adin2111DisableIrq | ( | NetInterface * | interface | ) |
Disable interrupts.
- Parameters
-
[in] interface Underlying network interface
Definition at line 377 of file adin2111_driver.c.
◆ adin2111DumpPhyReg()
| void adin2111DumpPhyReg | ( | NetInterface * | interface, |
| uint8_t | port | ||
| ) |
Dump PHY registers for debugging purpose.
- Parameters
-
[in] interface Underlying network interface [in] port Port number
Definition at line 1566 of file adin2111_driver.c.
◆ adin2111DumpReg()
| void adin2111DumpReg | ( | NetInterface * | interface | ) |
Dump SPI registers for debugging purpose.
- Parameters
-
[in] interface Underlying network interface
Definition at line 1470 of file adin2111_driver.c.
◆ adin2111EnableIrq()
| void adin2111EnableIrq | ( | NetInterface * | interface | ) |
Enable interrupts.
- Parameters
-
[in] interface Underlying network interface
Definition at line 362 of file adin2111_driver.c.
◆ adin2111EventHandler()
| __weak_func void adin2111EventHandler | ( | NetInterface * | interface | ) |
ADIN2111 event handler.
- Parameters
-
[in] interface Underlying network interface
Definition at line 507 of file adin2111_driver.c.
◆ adin2111GetLinkState()
| bool_t adin2111GetLinkState | ( | NetInterface * | interface, |
| uint8_t | port | ||
| ) |
Get link state.
- Parameters
-
[in] interface Underlying network interface [in] port Port number
- Returns
- Link state
Definition at line 1246 of file adin2111_driver.c.
◆ adin2111Init()
| error_t adin2111Init | ( | NetInterface * | interface | ) |
ADIN2111 Ethernet switch initialization.
- Parameters
-
[in] interface Underlying network interface
- Returns
- Error code
Definition at line 71 of file adin2111_driver.c.
◆ adin2111InitHook()
| __weak_func void adin2111InitHook | ( | NetInterface * | interface | ) |
ADIN2111 custom configuration.
- Parameters
-
[in] interface Underlying network interface
Definition at line 241 of file adin2111_driver.c.
◆ adin2111IrqHandler()
| bool_t adin2111IrqHandler | ( | NetInterface * | interface | ) |
ADIN2111 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 393 of file adin2111_driver.c.
◆ adin2111LinkChangeEventHandler()
| void adin2111LinkChangeEventHandler | ( | NetInterface * | interface | ) |
ADIN2111 link status change event handler.
- Parameters
-
[in] interface Underlying network interface
Definition at line 620 of file adin2111_driver.c.
◆ adin2111ReadFifo()
| void adin2111ReadFifo | ( | NetInterface * | interface, |
| uint8_t | port, | ||
| uint16_t * | header, | ||
| uint8_t * | data, | ||
| size_t | length | ||
| ) |
Read RX FIFO.
- Parameters
-
[in] interface Underlying network interface [in] port Port number [out] header Frame header [out] data Buffer where to store the incoming data [in] length Number of data to read
Definition at line 1735 of file adin2111_driver.c.
◆ adin2111ReadMmdReg()
| uint16_t adin2111ReadMmdReg | ( | NetInterface * | interface, |
| uint8_t | port, | ||
| uint8_t | devAddr, | ||
| uint16_t | regAddr | ||
| ) |
Read MMD register.
- Parameters
-
[in] interface Underlying network interface [in] port Port number [in] devAddr Device address [in] regAddr Register address
- Returns
- MMD register value
Definition at line 1641 of file adin2111_driver.c.
◆ adin2111ReadPhyReg()
| uint16_t adin2111ReadPhyReg | ( | NetInterface * | interface, |
| uint8_t | port, | ||
| uint8_t | address | ||
| ) |
Read PHY register.
- Parameters
-
[in] interface Underlying network interface [in] port Port number [in] address PHY register address
- Returns
- Register value
Definition at line 1531 of file adin2111_driver.c.
◆ adin2111ReadReg()
| uint32_t adin2111ReadReg | ( | NetInterface * | interface, |
| uint16_t | address | ||
| ) |
Read SPI register.
- Parameters
-
[in] interface Underlying network interface [in] address System register address
- Returns
- Register value
Definition at line 1372 of file adin2111_driver.c.
◆ adin2111ReceivePacket()
| error_t adin2111ReceivePacket | ( | NetInterface * | interface, |
| uint8_t | port | ||
| ) |
Receive a packet.
- Parameters
-
[in] interface Underlying network interface [in] port Port number
- Returns
- Error code
Definition at line 956 of file adin2111_driver.c.
◆ adin2111SendPacket()
| error_t adin2111SendPacket | ( | 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 730 of file adin2111_driver.c.
◆ adin2111Tick()
| __weak_func void adin2111Tick | ( | NetInterface * | interface | ) |
ADIN2111 timer handler.
- Parameters
-
[in] interface Underlying network interface
Definition at line 251 of file adin2111_driver.c.
◆ adin2111UpdateMacAddrFilter()
| error_t adin2111UpdateMacAddrFilter | ( | NetInterface * | interface | ) |
Configure MAC address filtering.
- Parameters
-
[in] interface Underlying network interface
- Returns
- Error code
Definition at line 1160 of file adin2111_driver.c.
◆ adin2111WriteFifo()
| void adin2111WriteFifo | ( | NetInterface * | interface, |
| uint16_t | header, | ||
| const uint8_t * | data, | ||
| size_t | length | ||
| ) |
Write TX FIFO.
- Parameters
-
[in] interface Underlying network interface [in] header Frame header [in] data Pointer to the data being written [in] length Number of data to write
Definition at line 1690 of file adin2111_driver.c.
◆ adin2111WriteMmdReg()
| void adin2111WriteMmdReg | ( | NetInterface * | interface, |
| uint8_t | port, | ||
| uint8_t | devAddr, | ||
| uint16_t | regAddr, | ||
| uint16_t | data | ||
| ) |
Write MMD register.
- Parameters
-
[in] interface Underlying network interface [in] port Port number [in] devAddr Device address [in] regAddr Register address [in] data MMD register value
Definition at line 1592 of file adin2111_driver.c.
◆ adin2111WritePhyReg()
| void adin2111WritePhyReg | ( | NetInterface * | interface, |
| uint8_t | port, | ||
| uint8_t | address, | ||
| uint16_t | data | ||
| ) |
Write PHY register.
- Parameters
-
[in] interface Underlying network interface [in] port Port number [in] address PHY register address [in] data Register value
Definition at line 1495 of file adin2111_driver.c.
◆ adin2111WriteReg()
| void adin2111WriteReg | ( | NetInterface * | interface, |
| uint16_t | address, | ||
| uint32_t | data | ||
| ) |
Write SPI register.
- Parameters
-
[in] interface Underlying network interface [in] address Register address [in] data System register value
Definition at line 1280 of file adin2111_driver.c.
Variable Documentation
◆ adin2111Driver
| const NicDriver adin2111Driver |
ADIN2111 driver.
Definition at line 44 of file adin2111_driver.c.
