eLua platform interface - Ethernet support

Overview

NOTE: TCP/IP support is experimental in eLua. Although functional, it's quite incomplete at the moment.

This part of the platform interface groups functions related to accessing the Ethernet interface (internal or external) of the CPU. Note that unlike the other parts of the platform interface this one is dedicated for TCP/IP support and thus it does not correspond directly to an eLua module, although the net module is implemented with functions that rely on this part of the platform interface. Currently only the uIP TCP/IP stack is supported by eLua.

uIP is implemented in eLua using two hardware interrupts (that should be available on your platform): the Ethernet receive interrupt (to handle incoming packets) and a timer interrupt (timers are used internally by uIP). However, the uIP main loop is only called from the Ethernet interrupt handler in eLua, so in order to acknowledge the timer interrupt (as well as to provide some optimizations) a function that "forces" an Ethernet interrupt must also be provided by the platform interface (see here for details).

To put everything together, part of the Ethernet platform interface for the lm3s platform is given below: