15 / 30
iSense Ethernet Gateway User Guide
coalesenses
research to innovate
Status code indicating whether the desired block-operation was successful or not. The upper three bits
are don’t care bits, the lower 5 indicate the status. A value of
5
indicates success.
5.
Enc28J60 API Description
The Ethernet Gateway comes with an Enc28J60 Ethernet chip, allowing the device to send and receive
packets using existing LAN infrastructure.
The
Enc28J60
class in the
isense
namespace contains all software functionality for operating the
SDCard-specific features, including
•
sending packets via Ethernet,
•
receiving packets via Ethernet
The
ENC28J60
class is defined in
src/isense/modules/ethernet_module/enc28j60.h
in the
iSense
directory.
Beneath the low-level send and receive functionality as described in this document, there also exist a
high level API which enables the Ethernet Gateway to communicate with other network devices using
IPv4 / IPv6 as network layer protocol and TCP / UDP for transport. For further information on how to
use IP-based communication with the Ethernet Gateway please refer to [7].
Required modules:
Enc28J60 Module*
#define ISENSE_ENABLE_ETHERNET_MODULE
SPI*
#define ISENSE_ENABLE_SPI
GPIO*
#define ISENSE_ENABLE_GPIO
5.1.
constructor
Enc28J60::Enc28J60( Os& os, uint64 mac_address, uint16 rx_buffer_size,
bool full_duplex );
Description:
Constructor of the Ethernet Module
Parameter:
os
Reference to the current Os
mac_address
Desired 48-bits MAC-Address for this interface
rx_buffer_size
Desired size of the receive buffer (6000 is a good choice)
full_duplex
If
true
the full duplex mode will be turned on, half duplex when
false