adin1111_driver.c File Reference

ADIN1111 10Base-T1L Ethernet controller. More...

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

Go to the source code of this file.

Macros

#define TRACE_LEVEL   NIC_TRACE_LEVEL
 

Functions

error_t adin1111Init (NetInterface *interface)
 ADIN1111 controller initialization. More...
 
__weak_func void adin1111InitHook (NetInterface *interface)
 ADIN1111 custom configuration. More...
 
void adin1111Tick (NetInterface *interface)
 ADIN1111 timer handler. More...
 
void adin1111EnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void adin1111DisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
bool_t adin1111IrqHandler (NetInterface *interface)
 ADIN1111 interrupt service routine. More...
 
void adin1111EventHandler (NetInterface *interface)
 ADIN1111 event handler. More...
 
error_t adin1111SendPacket (NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
 Send a packet. More...
 
error_t adin1111ReceivePacket (NetInterface *interface)
 Receive a packet. More...
 
error_t adin1111UpdateMacAddrFilter (NetInterface *interface)
 Configure MAC address filtering. More...
 
void adin1111WriteReg (NetInterface *interface, uint16_t address, uint32_t data)
 Write SPI register. More...
 
uint32_t adin1111ReadReg (NetInterface *interface, uint16_t address)
 Read SPI register. More...
 
void adin1111DumpReg (NetInterface *interface)
 Dump SPI registers for debugging purpose. More...
 
void adin1111WritePhyReg (NetInterface *interface, uint8_t address, uint16_t data)
 Write PHY register. More...
 
uint16_t adin1111ReadPhyReg (NetInterface *interface, uint8_t address)
 Read PHY register. More...
 
void adin1111DumpPhyReg (NetInterface *interface)
 Dump PHY registers for debugging purpose. More...
 
void adin1111WriteMmdReg (NetInterface *interface, uint8_t devAddr, uint16_t regAddr, uint16_t data)
 Write MMD register. More...
 
uint16_t adin1111ReadMmdReg (NetInterface *interface, uint8_t devAddr, uint16_t regAddr)
 Read MMD register. More...
 
void adin1111WriteFifo (NetInterface *interface, uint16_t header, const uint8_t *data, size_t length)
 Write TX FIFO. More...
 
void adin1111ReadFifo (NetInterface *interface, uint16_t *header, uint8_t *data, size_t length)
 Read RX FIFO. More...
 
uint32_t adin1111CalcParity (uint32_t data)
 Calculate parity bit over a 32-bit data. More...
 

Variables

const NicDriver adin1111Driver
 ADIN1111 driver. More...
 

Detailed Description

ADIN1111 10Base-T1L Ethernet controller.

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.

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

Definition in file adin1111_driver.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   NIC_TRACE_LEVEL

Definition at line 32 of file adin1111_driver.c.

Function Documentation

◆ adin1111CalcParity()

uint32_t adin1111CalcParity ( uint32_t  data)

Calculate parity bit over a 32-bit data.

Parameters
[in]data32-bit bit stream
Returns
Odd parity bit computed over the supplied data

Definition at line 1379 of file adin1111_driver.c.

◆ adin1111DisableIrq()

void adin1111DisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 282 of file adin1111_driver.c.

◆ adin1111DumpPhyReg()

void adin1111DumpPhyReg ( NetInterface interface)

Dump PHY registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface

Definition at line 1162 of file adin1111_driver.c.

◆ adin1111DumpReg()

void adin1111DumpReg ( NetInterface interface)

Dump SPI registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface

Definition at line 1070 of file adin1111_driver.c.

◆ adin1111EnableIrq()

void adin1111EnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 267 of file adin1111_driver.c.

◆ adin1111EventHandler()

void adin1111EventHandler ( NetInterface interface)

ADIN1111 event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 380 of file adin1111_driver.c.

◆ adin1111Init()

error_t adin1111Init ( NetInterface interface)

ADIN1111 controller initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 71 of file adin1111_driver.c.

◆ adin1111InitHook()

__weak_func void adin1111InitHook ( NetInterface interface)

ADIN1111 custom configuration.

Parameters
[in]interfaceUnderlying network interface

Definition at line 215 of file adin1111_driver.c.

◆ adin1111IrqHandler()

bool_t adin1111IrqHandler ( NetInterface interface)

ADIN1111 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 298 of file adin1111_driver.c.

◆ adin1111ReadFifo()

void adin1111ReadFifo ( NetInterface interface,
uint16_t *  header,
uint8_t *  data,
size_t  length 
)

Read RX FIFO.

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

Definition at line 1328 of file adin1111_driver.c.

◆ adin1111ReadMmdReg()

uint16_t adin1111ReadMmdReg ( NetInterface interface,
uint8_t  devAddr,
uint16_t  regAddr 
)

Read MMD register.

Parameters
[in]interfaceUnderlying network interface
[in]devAddrDevice address
[in]regAddrRegister address
Returns
MMD register value

Definition at line 1235 of file adin1111_driver.c.

◆ adin1111ReadPhyReg()

uint16_t adin1111ReadPhyReg ( NetInterface interface,
uint8_t  address 
)

Read PHY register.

Parameters
[in]interfaceUnderlying network interface
[in]addressPHY register address
Returns
Register value

Definition at line 1129 of file adin1111_driver.c.

◆ adin1111ReadReg()

uint32_t adin1111ReadReg ( NetInterface interface,
uint16_t  address 
)

Read SPI register.

Parameters
[in]interfaceUnderlying network interface
[in]addressSystem register address
Returns
Register value

Definition at line 972 of file adin1111_driver.c.

◆ adin1111ReceivePacket()

error_t adin1111ReceivePacket ( NetInterface interface)

Receive a packet.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 637 of file adin1111_driver.c.

◆ adin1111SendPacket()

error_t adin1111SendPacket ( 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 464 of file adin1111_driver.c.

◆ adin1111Tick()

void adin1111Tick ( NetInterface interface)

ADIN1111 timer handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 225 of file adin1111_driver.c.

◆ adin1111UpdateMacAddrFilter()

error_t adin1111UpdateMacAddrFilter ( NetInterface interface)

Configure MAC address filtering.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 806 of file adin1111_driver.c.

◆ adin1111WriteFifo()

void adin1111WriteFifo ( NetInterface interface,
uint16_t  header,
const uint8_t *  data,
size_t  length 
)

Write TX FIFO.

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

Definition at line 1284 of file adin1111_driver.c.

◆ adin1111WriteMmdReg()

void adin1111WriteMmdReg ( NetInterface interface,
uint8_t  devAddr,
uint16_t  regAddr,
uint16_t  data 
)

Write MMD register.

Parameters
[in]interfaceUnderlying network interface
[in]devAddrDevice address
[in]regAddrRegister address
[in]dataMMD register value

Definition at line 1187 of file adin1111_driver.c.

◆ adin1111WritePhyReg()

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

Write PHY register.

Parameters
[in]interfaceUnderlying network interface
[in]addressPHY register address
[in]dataRegister value

Definition at line 1094 of file adin1111_driver.c.

◆ adin1111WriteReg()

void adin1111WriteReg ( NetInterface interface,
uint16_t  address,
uint32_t  data 
)

Write SPI register.

Parameters
[in]interfaceUnderlying network interface
[in]addressRegister address
[in]dataSystem register value

Definition at line 880 of file adin1111_driver.c.

Variable Documentation

◆ adin1111Driver

const NicDriver adin1111Driver
void adin1111EventHandler(NetInterface *interface)
ADIN1111 event handler.
#define TRUE
Definition: os_port.h:50
#define FALSE
Definition: os_port.h:46
error_t adin1111Init(NetInterface *interface)
ADIN1111 controller initialization.
void adin1111EnableIrq(NetInterface *interface)
Enable interrupts.
void adin1111DisableIrq(NetInterface *interface)
Disable interrupts.
error_t adin1111UpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.
#define ETH_MTU
Definition: ethernet.h:116
void adin1111Tick(NetInterface *interface)
ADIN1111 timer handler.
error_t adin1111SendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Send a packet.
@ NIC_TYPE_ETHERNET
Ethernet interface.
Definition: nic.h:83