enc624j600_driver.c File Reference

ENC624J600/ENC424J600 Ethernet controller. More...

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

Go to the source code of this file.

Macros

#define TRACE_LEVEL   NIC_TRACE_LEVEL
 

Functions

error_t enc624j600Init (NetInterface *interface)
 ENC624J600 controller initialization. More...
 
void enc624j600Tick (NetInterface *interface)
 ENC624J600 timer handler. More...
 
void enc624j600EnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void enc624j600DisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
bool_t enc624j600IrqHandler (NetInterface *interface)
 ENC624J600 interrupt service routine. More...
 
void enc624j600EventHandler (NetInterface *interface)
 ENC624J600 event handler. More...
 
error_t enc624j600SendPacket (NetInterface *interface, const NetBuffer *buffer, size_t offset)
 Send a packet. More...
 
error_t enc624j600ReceivePacket (NetInterface *interface)
 Receive a packet. More...
 
error_t enc624j600UpdateMacAddrFilter (NetInterface *interface)
 Configure MAC address filtering. More...
 
void enc624j600UpdateMacConfig (NetInterface *interface)
 Adjust MAC configuration parameters for proper operation. More...
 
error_t enc624j600SoftReset (NetInterface *interface)
 Reset ENC624J600 controller. More...
 
void enc624j600WriteReg (NetInterface *interface, uint8_t address, uint16_t data)
 Write ENC624J600 register. More...
 
uint16_t enc624j600ReadReg (NetInterface *interface, uint8_t address)
 Read ENC624J600 register. More...
 
void enc624j600WritePhyReg (NetInterface *interface, uint8_t address, uint16_t data)
 Write PHY register. More...
 
uint16_t enc624j600ReadPhyReg (NetInterface *interface, uint8_t address)
 Read PHY register. More...
 
void enc624j600WriteBuffer (NetInterface *interface, uint8_t opcode, const NetBuffer *buffer, size_t offset)
 Write SRAM buffer. More...
 
void enc624j600ReadBuffer (NetInterface *interface, uint8_t opcode, uint8_t *data, size_t length)
 Read SRAM buffer. More...
 
void enc624j600SetBit (NetInterface *interface, uint8_t address, uint16_t mask)
 Set bit field. More...
 
void enc624j600ClearBit (NetInterface *interface, uint8_t address, uint16_t mask)
 Clear bit field. More...
 
uint32_t enc624j600CalcCrc (const void *data, size_t length)
 CRC calculation using the polynomial 0x4C11DB7. More...
 
void enc624j600DumpReg (NetInterface *interface)
 Dump registers for debugging purpose. More...
 
void enc624j600DumpPhyReg (NetInterface *interface)
 Dump PHY registers for debugging purpose. More...
 

Variables

const NicDriver enc624j600Driver
 ENC624J600 driver. More...
 

Detailed Description

ENC624J600/ENC424J600 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 enc624j600_driver.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   NIC_TRACE_LEVEL

Definition at line 30 of file enc624j600_driver.c.

Function Documentation

◆ enc624j600CalcCrc()

uint32_t enc624j600CalcCrc ( const void *  data,
size_t  length 
)

CRC calculation using the polynomial 0x4C11DB7.

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 848 of file enc624j600_driver.c.

◆ enc624j600ClearBit()

void enc624j600ClearBit ( NetInterface interface,
uint8_t  address,
uint16_t  mask 
)

Clear bit field.

Parameters
[in]interfaceUnderlying network interface
[in]addressRegister address
[in]maskBits to clear in the target register

Definition at line 823 of file enc624j600_driver.c.

◆ enc624j600DisableIrq()

void enc624j600DisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 198 of file enc624j600_driver.c.

◆ enc624j600DumpPhyReg()

void enc624j600DumpPhyReg ( NetInterface interface)

Dump PHY registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface

Definition at line 922 of file enc624j600_driver.c.

◆ enc624j600DumpReg()

void enc624j600DumpReg ( NetInterface interface)

Dump registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface

Definition at line 882 of file enc624j600_driver.c.

◆ enc624j600EnableIrq()

void enc624j600EnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 186 of file enc624j600_driver.c.

◆ enc624j600EventHandler()

void enc624j600EventHandler ( NetInterface interface)

ENC624J600 event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 273 of file enc624j600_driver.c.

◆ enc624j600Init()

error_t enc624j600Init ( NetInterface interface)

ENC624J600 controller initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 69 of file enc624j600_driver.c.

◆ enc624j600IrqHandler()

bool_t enc624j600IrqHandler ( NetInterface interface)

ENC624J600 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 211 of file enc624j600_driver.c.

◆ enc624j600ReadBuffer()

void enc624j600ReadBuffer ( NetInterface interface,
uint8_t  opcode,
uint8_t *  data,
size_t  length 
)

Read SRAM buffer.

Parameters
[in]interfaceUnderlying network interface
[in]opcodeSRAM buffer operation
[in]dataBuffer where to store the incoming data
[in]lengthNumber of data to read

Definition at line 771 of file enc624j600_driver.c.

◆ enc624j600ReadPhyReg()

uint16_t enc624j600ReadPhyReg ( NetInterface interface,
uint8_t  address 
)

Read PHY register.

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

Definition at line 691 of file enc624j600_driver.c.

◆ enc624j600ReadReg()

uint16_t enc624j600ReadReg ( NetInterface interface,
uint8_t  address 
)

Read ENC624J600 register.

Parameters
[in]interfaceUnderlying network interface
[in]addressRegister address
Returns
Register value

Definition at line 641 of file enc624j600_driver.c.

◆ enc624j600ReceivePacket()

error_t enc624j600ReceivePacket ( NetInterface interface)

Receive a packet.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 409 of file enc624j600_driver.c.

◆ enc624j600SendPacket()

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

Send a packet.

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 353 of file enc624j600_driver.c.

◆ enc624j600SetBit()

void enc624j600SetBit ( NetInterface interface,
uint8_t  address,
uint16_t  mask 
)

Set bit field.

Parameters
[in]interfaceUnderlying network interface
[in]addressRegister address
[in]maskBits to set in the target register

Definition at line 798 of file enc624j600_driver.c.

◆ enc624j600SoftReset()

error_t enc624j600SoftReset ( NetInterface interface)

Reset ENC624J600 controller.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 577 of file enc624j600_driver.c.

◆ enc624j600Tick()

void enc624j600Tick ( NetInterface interface)

ENC624J600 timer handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 176 of file enc624j600_driver.c.

◆ enc624j600UpdateMacAddrFilter()

error_t enc624j600UpdateMacAddrFilter ( NetInterface interface)

Configure MAC address filtering.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 488 of file enc624j600_driver.c.

◆ enc624j600UpdateMacConfig()

void enc624j600UpdateMacConfig ( NetInterface interface)

Adjust MAC configuration parameters for proper operation.

Parameters
[in]interfaceUnderlying network interface

Definition at line 543 of file enc624j600_driver.c.

◆ enc624j600WriteBuffer()

void enc624j600WriteBuffer ( NetInterface interface,
uint8_t  opcode,
const NetBuffer buffer,
size_t  offset 
)

Write SRAM buffer.

Parameters
[in]interfaceUnderlying network interface
[in]opcodeSRAM buffer operation
[in]bufferMulti-part buffer containing the data to be written
[in]offsetOffset to the first data byte

Definition at line 719 of file enc624j600_driver.c.

◆ enc624j600WritePhyReg()

void enc624j600WritePhyReg ( 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 672 of file enc624j600_driver.c.

◆ enc624j600WriteReg()

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

Write ENC624J600 register.

Parameters
[in]interfaceUnderlying network interface
[in]addressRegister address
[in]dataRegister value

Definition at line 616 of file enc624j600_driver.c.

Variable Documentation

◆ enc624j600Driver

const NicDriver enc624j600Driver
Initial value:
=
{
NULL,
NULL,
NULL,
}
error_t enc624j600Init(NetInterface *interface)
ENC624J600 controller initialization.
void enc624j600DisableIrq(NetInterface *interface)
Disable interrupts.
#define TRUE
Definition: os_port.h:48
error_t enc624j600UpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.
void enc624j600EnableIrq(NetInterface *interface)
Enable interrupts.
#define ETH_MTU
Definition: ethernet.h:82
Ethernet interface.
Definition: nic.h:69
void enc624j600Tick(NetInterface *interface)
ENC624J600 timer handler.
error_t enc624j600SendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset)
Send a packet.
void enc624j600EventHandler(NetInterface *interface)
ENC624J600 event handler.
#define FALSE
Definition: os_port.h:44

ENC624J600 driver.

Definition at line 42 of file enc624j600_driver.c.