adin1110_driver.c File Reference

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

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

Go to the source code of this file.

Macros

#define TRACE_LEVEL   NIC_TRACE_LEVEL
 

Functions

error_t adin1110Init (NetInterface *interface)
 ADIN1110 controller initialization. More...
 
__weak_func void adin1110InitHook (NetInterface *interface)
 ADIN1110 custom configuration. More...
 
void adin1110Tick (NetInterface *interface)
 ADIN1110 timer handler. More...
 
void adin1110EnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void adin1110DisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
bool_t adin1110IrqHandler (NetInterface *interface)
 ADIN1110 interrupt service routine. More...
 
void adin1110EventHandler (NetInterface *interface)
 ADIN1110 event handler. More...
 
error_t adin1110SendPacket (NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
 Send a packet. More...
 
error_t adin1110ReceivePacket (NetInterface *interface)
 Receive a packet. More...
 
error_t adin1110UpdateMacAddrFilter (NetInterface *interface)
 Configure MAC address filtering. More...
 
void adin1110WriteReg (NetInterface *interface, uint16_t address, uint32_t data)
 Write SPI register. More...
 
uint32_t adin1110ReadReg (NetInterface *interface, uint16_t address)
 Read SPI register. More...
 
void adin1110DumpReg (NetInterface *interface)
 Dump SPI registers for debugging purpose. More...
 
void adin1110WritePhyReg (NetInterface *interface, uint8_t address, uint16_t data)
 Write PHY register. More...
 
uint16_t adin1110ReadPhyReg (NetInterface *interface, uint8_t address)
 Read PHY register. More...
 
void adin1110DumpPhyReg (NetInterface *interface)
 Dump PHY registers for debugging purpose. More...
 
void adin1110WriteMmdReg (NetInterface *interface, uint8_t devAddr, uint16_t regAddr, uint16_t data)
 Write MMD register. More...
 
uint16_t adin1110ReadMmdReg (NetInterface *interface, uint8_t devAddr, uint16_t regAddr)
 Read MMD register. More...
 
void adin1110WriteFifo (NetInterface *interface, uint16_t header, const uint8_t *data, size_t length)
 Write TX FIFO. More...
 
void adin1110ReadFifo (NetInterface *interface, uint16_t *header, uint8_t *data, size_t length)
 Read RX FIFO. More...
 
uint32_t adin1110CalcParity (uint32_t data)
 Calculate parity bit over a 32-bit data. More...
 

Variables

const NicDriver adin1110Driver
 ADIN1110 driver. More...
 

Detailed Description

ADIN1110 10Base-T1L 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.4

Definition in file adin1110_driver.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   NIC_TRACE_LEVEL

Definition at line 32 of file adin1110_driver.c.

Function Documentation

◆ adin1110CalcParity()

uint32_t adin1110CalcParity ( 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 adin1110_driver.c.

◆ adin1110DisableIrq()

void adin1110DisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 282 of file adin1110_driver.c.

◆ adin1110DumpPhyReg()

void adin1110DumpPhyReg ( NetInterface interface)

Dump PHY registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface

Definition at line 1162 of file adin1110_driver.c.

◆ adin1110DumpReg()

void adin1110DumpReg ( NetInterface interface)

Dump SPI registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface

Definition at line 1070 of file adin1110_driver.c.

◆ adin1110EnableIrq()

void adin1110EnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 267 of file adin1110_driver.c.

◆ adin1110EventHandler()

void adin1110EventHandler ( NetInterface interface)

ADIN1110 event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 380 of file adin1110_driver.c.

◆ adin1110Init()

error_t adin1110Init ( NetInterface interface)

ADIN1110 controller initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 71 of file adin1110_driver.c.

◆ adin1110InitHook()

__weak_func void adin1110InitHook ( NetInterface interface)

ADIN1110 custom configuration.

Parameters
[in]interfaceUnderlying network interface

Definition at line 215 of file adin1110_driver.c.

◆ adin1110IrqHandler()

bool_t adin1110IrqHandler ( NetInterface interface)

ADIN1110 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 adin1110_driver.c.

◆ adin1110ReadFifo()

void adin1110ReadFifo ( 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 adin1110_driver.c.

◆ adin1110ReadMmdReg()

uint16_t adin1110ReadMmdReg ( 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 adin1110_driver.c.

◆ adin1110ReadPhyReg()

uint16_t adin1110ReadPhyReg ( 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 adin1110_driver.c.

◆ adin1110ReadReg()

uint32_t adin1110ReadReg ( 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 adin1110_driver.c.

◆ adin1110ReceivePacket()

error_t adin1110ReceivePacket ( NetInterface interface)

Receive a packet.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 637 of file adin1110_driver.c.

◆ adin1110SendPacket()

error_t adin1110SendPacket ( 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 adin1110_driver.c.

◆ adin1110Tick()

void adin1110Tick ( NetInterface interface)

ADIN1110 timer handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 225 of file adin1110_driver.c.

◆ adin1110UpdateMacAddrFilter()

error_t adin1110UpdateMacAddrFilter ( NetInterface interface)

Configure MAC address filtering.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 806 of file adin1110_driver.c.

◆ adin1110WriteFifo()

void adin1110WriteFifo ( 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 adin1110_driver.c.

◆ adin1110WriteMmdReg()

void adin1110WriteMmdReg ( 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 adin1110_driver.c.

◆ adin1110WritePhyReg()

void adin1110WritePhyReg ( 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 adin1110_driver.c.

◆ adin1110WriteReg()

void adin1110WriteReg ( 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 adin1110_driver.c.

Variable Documentation

◆ adin1110Driver

const NicDriver adin1110Driver
void adin1110EventHandler(NetInterface *interface)
ADIN1110 event handler.
error_t adin1110Init(NetInterface *interface)
ADIN1110 controller initialization.
#define TRUE
Definition: os_port.h:50
void adin1110EnableIrq(NetInterface *interface)
Enable interrupts.
void adin1110Tick(NetInterface *interface)
ADIN1110 timer handler.
void adin1110DisableIrq(NetInterface *interface)
Disable interrupts.
#define FALSE
Definition: os_port.h:46
error_t adin1110UpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.
#define ETH_MTU
Definition: ethernet.h:116
error_t adin1110SendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Send a packet.
@ NIC_TYPE_ETHERNET
Ethernet interface.
Definition: nic.h:83