dm9000_driver.c File Reference

DM9000A/B Ethernet controller. More...

#include "core/net.h"
#include "core/ethernet.h"
#include "drivers/eth/dm9000_driver.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   NIC_TRACE_LEVEL
 

Functions

error_t dm9000Init (NetInterface *interface)
 DM9000 controller initialization. More...
 
void dm9000Tick (NetInterface *interface)
 DM9000 timer handler. More...
 
void dm9000EnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void dm9000DisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
bool_t dm9000IrqHandler (NetInterface *interface)
 DM9000 interrupt service routine. More...
 
void dm9000EventHandler (NetInterface *interface)
 DM9000 event handler. More...
 
error_t dm9000SendPacket (NetInterface *interface, const NetBuffer *buffer, size_t offset)
 Send a packet to DM9000. More...
 
error_t dm9000ReceivePacket (NetInterface *interface)
 Receive a packet. More...
 
error_t dm9000UpdateMacAddrFilter (NetInterface *interface)
 Configure MAC address filtering. More...
 
void dm9000WriteReg (uint8_t address, uint8_t data)
 Write DM9000 register. More...
 
uint8_t dm9000ReadReg (uint8_t address)
 Read DM9000 register. More...
 
void dm9000WritePhyReg (uint8_t address, uint16_t data)
 Write DM9000 PHY register. More...
 
uint16_t dm9000ReadPhyReg (uint8_t address)
 Read DM9000 PHY register. More...
 
uint32_t dm9000CalcCrc (const void *data, size_t length)
 CRC calculation. More...
 

Variables

const NicDriver dm9000Driver
 DM9000 driver. More...
 

Detailed Description

DM9000A/B Ethernet controller.

License

Copyright (C) 2010-2018 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
1.9.0

Definition in file dm9000_driver.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   NIC_TRACE_LEVEL

Definition at line 30 of file dm9000_driver.c.

Function Documentation

◆ dm9000CalcCrc()

uint32_t dm9000CalcCrc ( const void *  data,
size_t  length 
)

CRC calculation.

Parameters
[in]dataPointer to the data over which to calculate the CRC
[in]lengthNumber of bytes to process
Returns
Resulting CRC value

Definition at line 670 of file dm9000_driver.c.

◆ dm9000DisableIrq()

void dm9000DisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 207 of file dm9000_driver.c.

◆ dm9000EnableIrq()

void dm9000EnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 195 of file dm9000_driver.c.

◆ dm9000EventHandler()

void dm9000EventHandler ( NetInterface interface)

DM9000 event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 292 of file dm9000_driver.c.

◆ dm9000Init()

error_t dm9000Init ( NetInterface interface)

DM9000 controller initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 70 of file dm9000_driver.c.

◆ dm9000IrqHandler()

bool_t dm9000IrqHandler ( NetInterface interface)

DM9000 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 220 of file dm9000_driver.c.

◆ dm9000ReadPhyReg()

uint16_t dm9000ReadPhyReg ( uint8_t  address)

Read DM9000 PHY register.

Parameters
[in]addressPHY register address
Returns
Register value

Definition at line 643 of file dm9000_driver.c.

◆ dm9000ReadReg()

uint8_t dm9000ReadReg ( uint8_t  address)

Read DM9000 register.

Parameters
[in]addressRegister address
Returns
Register value

Definition at line 602 of file dm9000_driver.c.

◆ dm9000ReceivePacket()

error_t dm9000ReceivePacket ( NetInterface interface)

Receive a packet.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 433 of file dm9000_driver.c.

◆ dm9000SendPacket()

error_t dm9000SendPacket ( NetInterface interface,
const NetBuffer buffer,
size_t  offset 
)

Send a packet to DM9000.

Parameters
[in]interfaceUnderlying network interface
[in]bufferMulti-part buffer containing the data to send
[in]offsetOffset to the first data byte
Returns
Error code

Definition at line 368 of file dm9000_driver.c.

◆ dm9000Tick()

void dm9000Tick ( NetInterface interface)

DM9000 timer handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 185 of file dm9000_driver.c.

◆ dm9000UpdateMacAddrFilter()

error_t dm9000UpdateMacAddrFilter ( NetInterface interface)

Configure MAC address filtering.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 529 of file dm9000_driver.c.

◆ dm9000WritePhyReg()

void dm9000WritePhyReg ( uint8_t  address,
uint16_t  data 
)

Write DM9000 PHY register.

Parameters
[in]addressPHY register address
[in]dataRegister value

Definition at line 617 of file dm9000_driver.c.

◆ dm9000WriteReg()

void dm9000WriteReg ( uint8_t  address,
uint8_t  data 
)

Write DM9000 register.

Parameters
[in]addressRegister address
[in]dataRegister value

Definition at line 587 of file dm9000_driver.c.

Variable Documentation

◆ dm9000Driver

const NicDriver dm9000Driver
Initial value:
=
{
NULL,
NULL,
NULL,
}
void dm9000EventHandler(NetInterface *interface)
DM9000 event handler.
void dm9000Tick(NetInterface *interface)
DM9000 timer handler.
error_t dm9000Init(NetInterface *interface)
DM9000 controller initialization.
Definition: dm9000_driver.c:70
#define TRUE
Definition: os_port.h:48
void dm9000DisableIrq(NetInterface *interface)
Disable interrupts.
#define ETH_MTU
Definition: ethernet.h:82
Ethernet interface.
Definition: nic.h:69
void dm9000EnableIrq(NetInterface *interface)
Enable interrupts.
error_t dm9000UpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.
#define FALSE
Definition: os_port.h:44
error_t dm9000SendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset)
Send a packet to DM9000.

DM9000 driver.

Definition at line 43 of file dm9000_driver.c.