enc28j60 library  1.0
platform agnostic enc28j60 driver with asynchronous IO support and fully compliant with errata
Public Attributes | List of all members
enc28j60_header Struct Reference

Structure that has to prefix any variable length data when not using advanced SPI driver (that is when ENC28J60_HAS_ADVANCED_DRIVER is not defined). More...

#include <enc28j60.h>

Public Attributes

uint8_t opcode
 Opcode.
 

Detailed Description

Structure that has to prefix any variable length data when not using advanced SPI driver (that is when ENC28J60_HAS_ADVANCED_DRIVER is not defined).

The correct allocation and usage is as follows:

enc28j60 eth1;
//...
static char data[ENC28J60_MAX_FRAME_LENGTH_ETH + sizeof(enc28j60_header)];
enc28j60_receiveframeblocking(&eth1, data, sizeof(data));
printf("Received frame of length %u\n", eth1.length);
char *frame = &data[sizeof(enc28j60_header)];
printf("First byte is %02X, the last is %02X\n", frame[0], frame[eth1.length-1]);

The documentation for this struct was generated from the following file: