ncn26010_driver.c File Reference

Onsemi NCN26010 10Base-T1S Ethernet controller. More...

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

Go to the source code of this file.

Macros

#define TRACE_LEVEL   NIC_TRACE_LEVEL
 

Functions

error_t ncn26010Init (NetInterface *interface)
 NCN26010 controller initialization. More...
 
__weak_func void ncn26010InitHook (NetInterface *interface)
 NCN26010 custom configuration. More...
 
void ncn26010Tick (NetInterface *interface)
 NCN26010 timer handler. More...
 
void ncn26010EnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void ncn26010DisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
bool_t ncn26010IrqHandler (NetInterface *interface)
 NCN26010 interrupt service routine. More...
 
void ncn26010EventHandler (NetInterface *interface)
 NCN26010 event handler. More...
 
error_t ncn26010SendPacket (NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
 Send a packet. More...
 
error_t ncn26010ReceivePacket (NetInterface *interface)
 Receive a packet. More...
 
error_t ncn26010UpdateMacAddrFilter (NetInterface *interface)
 Configure MAC address filtering. More...
 
void ncn26010WriteReg (NetInterface *interface, uint8_t mms, uint16_t address, uint32_t data)
 Write register. More...
 
uint32_t ncn26010ReadReg (NetInterface *interface, uint8_t mms, uint16_t address)
 Read register. More...
 
void ncn26010DumpReg (NetInterface *interface, uint8_t mms, uint16_t address, uint_t num)
 Dump registers for debugging purpose. More...
 
uint32_t ncn26010CalcParity (uint32_t data)
 Calculate parity bit over a 32-bit data. More...
 

Variables

const NicDriver ncn26010Driver
 NCN26010 driver. More...
 

Detailed Description

Onsemi NCN26010 10Base-T1S 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 ncn26010_driver.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   NIC_TRACE_LEVEL

Definition at line 32 of file ncn26010_driver.c.

Function Documentation

◆ ncn26010CalcParity()

uint32_t ncn26010CalcParity ( 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 872 of file ncn26010_driver.c.

◆ ncn26010DisableIrq()

void ncn26010DisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 281 of file ncn26010_driver.c.

◆ ncn26010DumpReg()

void ncn26010DumpReg ( NetInterface interface,
uint8_t  mms,
uint16_t  address,
uint_t  num 
)

Dump registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface
[in]mmsRegister memory map to access
[in]addressStart address
[in]numNumber of registers to dump

Definition at line 848 of file ncn26010_driver.c.

◆ ncn26010EnableIrq()

void ncn26010EnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 266 of file ncn26010_driver.c.

◆ ncn26010EventHandler()

void ncn26010EventHandler ( NetInterface interface)

NCN26010 event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 313 of file ncn26010_driver.c.

◆ ncn26010Init()

error_t ncn26010Init ( NetInterface interface)

NCN26010 controller initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 71 of file ncn26010_driver.c.

◆ ncn26010InitHook()

__weak_func void ncn26010InitHook ( NetInterface interface)

NCN26010 custom configuration.

Parameters
[in]interfaceUnderlying network interface

Definition at line 200 of file ncn26010_driver.c.

◆ ncn26010IrqHandler()

bool_t ncn26010IrqHandler ( NetInterface interface)

NCN26010 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 297 of file ncn26010_driver.c.

◆ ncn26010ReadReg()

uint32_t ncn26010ReadReg ( NetInterface interface,
uint8_t  mms,
uint16_t  address 
)

Read register.

Parameters
[in]interfaceUnderlying network interface
[in]mmsRegister memory map to access
[in]addressRegister address
Returns
Register value

Definition at line 790 of file ncn26010_driver.c.

◆ ncn26010ReceivePacket()

error_t ncn26010ReceivePacket ( NetInterface interface)

Receive a packet.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 461 of file ncn26010_driver.c.

◆ ncn26010SendPacket()

error_t ncn26010SendPacket ( 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 342 of file ncn26010_driver.c.

◆ ncn26010Tick()

void ncn26010Tick ( NetInterface interface)

NCN26010 timer handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 226 of file ncn26010_driver.c.

◆ ncn26010UpdateMacAddrFilter()

error_t ncn26010UpdateMacAddrFilter ( NetInterface interface)

Configure MAC address filtering.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 589 of file ncn26010_driver.c.

◆ ncn26010WriteReg()

void ncn26010WriteReg ( NetInterface interface,
uint8_t  mms,
uint16_t  address,
uint32_t  data 
)

Write register.

Parameters
[in]interfaceUnderlying network interface
[in]mmsRegister memory map to access
[in]addressRegister address
[in]dataRegister value

Definition at line 736 of file ncn26010_driver.c.

Variable Documentation

◆ ncn26010Driver

const NicDriver ncn26010Driver
#define TRUE
Definition: os_port.h:50
#define FALSE
Definition: os_port.h:46
void ncn26010EventHandler(NetInterface *interface)
NCN26010 event handler.
void ncn26010Tick(NetInterface *interface)
NCN26010 timer handler.
error_t ncn26010Init(NetInterface *interface)
NCN26010 controller initialization.
#define ETH_MTU
Definition: ethernet.h:116
void ncn26010EnableIrq(NetInterface *interface)
Enable interrupts.
error_t ncn26010UpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.
void ncn26010DisableIrq(NetInterface *interface)
Disable interrupts.
error_t ncn26010SendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Send a packet.
@ NIC_TYPE_ETHERNET
Ethernet interface.
Definition: nic.h:83