Microchip ENC28J60 driver
[Hardware drivers]


Files

file  enc28j60_config.h
 Microchip ENC28J60 I/O configuration header (license: GPLv2).
file  enc28j60_init.c
 Microchip ENC28J60 initialization (license: GPLv2).
file  enc28j60_init.h
 Microchip ENC28J60 initialization header (license: GPLv2).
file  enc28j60_io.c
 Microchip ENC28J60 I/O implementation (license: GPLv2).
file  enc28j60_io.h
 Microchip ENC28J60 I/O header (license: GPLv2).
file  enc28j60_packet.c
 Microchip ENC28J60 packet handling (license: GPLv2).
file  enc28j60_packet.h
 Microchip ENC28J60 packet handling header (license: GPLv2).
file  enc28j60_status.c
 Microchip ENC28J60 status implementation (license: GPLv2).
file  enc28j60_status.h
 Microchip ENC28J60 status header (license: GPLv2).

Functions

bool enc28j60_init (const uint8_t *mac)
 Reset and initialize the ENC28J60 and starts packet transmission/reception.
uint16_t enc28j60_receive_packet (uint8_t *buffer, uint16_t buffer_len)
 Fetches a pending packet from the RAM buffer of the ENC28J60.
bool enc28j60_send_packet (uint8_t *buffer, uint16_t buffer_len)
 Writes a packet to the RAM buffer of the ENC28J60 and starts transmission.
bool enc28j60_link_up ()
 Checks wether the link is up and has been continuously up since the last call.


Function Documentation

bool enc28j60_init ( const uint8_t *  mac  ) 

Reset and initialize the ENC28J60 and starts packet transmission/reception.

Parameters:
[in] mac A pointer to a 6-byte buffer containing the MAC address.
Returns:
true on success, false on failure.

uint16_t enc28j60_receive_packet ( uint8_t *  buffer,
uint16_t  buffer_len 
)

Fetches a pending packet from the RAM buffer of the ENC28J60.

The packet is written into the given buffer and the size of the packet (ethernet header plus payload, exclusive the CRC) is returned.

Zero is returned in the following cases:

  • There is no packet pending.
  • The packet is too large to completely fit into the buffer.
  • Some error occured.

Parameters:
[out] buffer The pointer to the buffer which receives the packet.
[in] buffer_len The length of the buffer.
Returns:
The packet size in bytes on success, 0 in the cases noted above.

bool enc28j60_send_packet ( uint8_t *  buffer,
uint16_t  buffer_len 
)

Writes a packet to the RAM buffer of the ENC28J60 and starts transmission.

The packet buffer contains the ethernet header and the payload without CRC. The checksum is automatically generated by the on-chip calculator.

Parameters:
[in] buffer A pointer to the buffer containing the packet to be sent.
[in] buffer_len The length of the ethernet packet header plus payload.
Returns:
true if the packet was sent, false otherwise.

bool enc28j60_link_up (  ) 

Checks wether the link is up and has been continuously up since the last call.

Returns:
TRUE if the network link is and has been up, FALSE otherwise.


Generated on Thu May 22 18:12:37 2008 for mega-eth by  doxygen 1.5.5