Webserver+3d print

Dependents:   Nucleo

Embed: (wiki syntax)

« Back to documentation index

enc28j60.h File Reference

enc28j60.h File Reference

ENC28J60 Ethernet controller. More...

Go to the source code of this file.

Data Structures

struct  Enc28j60Context
 ENC28J60 driver context. More...

Functions

error_t enc28j60Init (NetInterface *interface)
 ENC28J60 controller initialization.
void enc28j60Tick (NetInterface *interface)
 ENC28J60 timer handler.
void enc28j60EnableIrq (NetInterface *interface)
 Enable interrupts.
void enc28j60DisableIrq (NetInterface *interface)
 Disable interrupts.
bool_t enc28j60IrqHandler (NetInterface *interface)
 ENC28J60 interrupt service routine.
void enc28j60EventHandler (NetInterface *interface)
 ENC28J60 event handler.
error_t enc28j60SendPacket (NetInterface *interface, const NetBuffer *buffer, size_t offset)
 Send a packet.
error_t enc28j60ReceivePacket (NetInterface *interface)
 Receive a packet.
error_t enc28j60SetMulticastFilter (NetInterface *interface)
 Configure multicast MAC address filtering.
void enc28j60SoftReset (NetInterface *interface)
 ENC28J60 controller reset.
void enc28j60SelectBank (NetInterface *interface, uint16_t address)
 Bank selection.
void enc28j60WriteReg (NetInterface *interface, uint16_t address, uint8_t data)
 Write ENC28J60 register.
uint8_t enc28j60ReadReg (NetInterface *interface, uint16_t address)
 Read ENC28J60 register.
void enc28j60WritePhyReg (NetInterface *interface, uint16_t address, uint16_t data)
 Write PHY register.
uint16_t enc28j60ReadPhyReg (NetInterface *interface, uint16_t address)
 Read PHY register.
void enc28j60WriteBuffer (NetInterface *interface, const NetBuffer *buffer, size_t offset)
 Write SRAM buffer.
void enc28j60ReadBuffer (NetInterface *interface, uint8_t *data, size_t length)
 Read SRAM buffer.
void enc28j60SetBit (NetInterface *interface, uint16_t address, uint16_t mask)
 Set bit field.
void enc28j60ClearBit (NetInterface *interface, uint16_t address, uint16_t mask)
 Clear bit field.
uint32_t enc28j60CalcCrc (const void *data, size_t length)
 CRC calculation using the polynomial 0x4C11DB7.
void enc28j60DumpReg (NetInterface *interface)
 Dump registers for debugging purpose.
void enc28j60DumpPhyReg (NetInterface *interface)
 Dump PHY registers for debugging purpose.

Variables

const NicDriver enc28j60Driver
 ENC28J60 driver.

Detailed Description

ENC28J60 Ethernet controller.

License

Copyright (C) 2010-2017 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.7.6

Definition in file enc28j60.h.


Function Documentation

uint32_t enc28j60CalcCrc ( 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 920 of file enc28j60.c.

void enc28j60ClearBit ( NetInterface *  interface,
uint16_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 898 of file enc28j60.c.

void enc28j60DisableIrq ( NetInterface *  interface )

Disable interrupts.

Parameters:
[in]interfaceUnderlying network interface

Definition at line 256 of file enc28j60.c.

void enc28j60DumpPhyReg ( NetInterface *  interface )

Dump PHY registers for debugging purpose.

Parameters:
[in]interfaceUnderlying network interface

Definition at line 1003 of file enc28j60.c.

void enc28j60DumpReg ( NetInterface *  interface )

Dump registers for debugging purpose.

Parameters:
[in]interfaceUnderlying network interface

Definition at line 954 of file enc28j60.c.

void enc28j60EnableIrq ( NetInterface *  interface )

Enable interrupts.

Parameters:
[in]interfaceUnderlying network interface

Definition at line 244 of file enc28j60.c.

void enc28j60EventHandler ( NetInterface *  interface )

ENC28J60 event handler.

Parameters:
[in]interfaceUnderlying network interface

Definition at line 331 of file enc28j60.c.

error_t enc28j60Init ( NetInterface *  interface )

ENC28J60 controller initialization.

Parameters:
[in]interfaceUnderlying network interface
Returns:
Error code

Definition at line 70 of file enc28j60.c.

bool_t enc28j60IrqHandler ( NetInterface *  interface )

ENC28J60 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 269 of file enc28j60.c.

void enc28j60ReadBuffer ( NetInterface *  interface,
uint8_t *  data,
size_t  length 
)

Read SRAM buffer.

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

Definition at line 849 of file enc28j60.c.

uint16_t enc28j60ReadPhyReg ( NetInterface *  interface,
uint16_t  address 
)

Read PHY register.

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

Definition at line 765 of file enc28j60.c.

uint8_t enc28j60ReadReg ( NetInterface *  interface,
uint16_t  address 
)

Read ENC28J60 register.

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

Definition at line 708 of file enc28j60.c.

error_t enc28j60ReceivePacket ( NetInterface *  interface )

Receive a packet.

Parameters:
[in]interfaceUnderlying network interface
Returns:
Error code

Definition at line 468 of file enc28j60.c.

void enc28j60SelectBank ( NetInterface *  interface,
uint16_t  address 
)

Bank selection.

Parameters:
[in]interfaceUnderlying network interface
[in]addressRegister address

Definition at line 630 of file enc28j60.c.

error_t enc28j60SendPacket ( 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 405 of file enc28j60.c.

void enc28j60SetBit ( NetInterface *  interface,
uint16_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 876 of file enc28j60.c.

error_t enc28j60SetMulticastFilter ( NetInterface *  interface )

Configure multicast MAC address filtering.

Parameters:
[in]interfaceUnderlying network interface
Returns:
Error code

Definition at line 548 of file enc28j60.c.

void enc28j60SoftReset ( NetInterface *  interface )

ENC28J60 controller reset.

Parameters:
[in]interfaceUnderlying network interface

Definition at line 611 of file enc28j60.c.

void enc28j60Tick ( NetInterface *  interface )

ENC28J60 timer handler.

Parameters:
[in]interfaceUnderlying network interface

Definition at line 234 of file enc28j60.c.

void enc28j60WriteBuffer ( NetInterface *  interface,
const NetBuffer buffer,
size_t  offset 
)

Write SRAM buffer.

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

Definition at line 796 of file enc28j60.c.

void enc28j60WritePhyReg ( NetInterface *  interface,
uint16_t  address,
uint16_t  data 
)

Write PHY register.

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

Definition at line 743 of file enc28j60.c.

void enc28j60WriteReg ( NetInterface *  interface,
uint16_t  address,
uint8_t  data 
)

Write ENC28J60 register.

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

Definition at line 683 of file enc28j60.c.


Variable Documentation

ENC28J60 driver.

Definition at line 43 of file enc28j60.c.