Download library here.

Check the tutorial page for an explanation about Ethernet.

For this example we choose to show only the main.c Ethernet is a very complex subject, all the modification that have to be done are explained in the tutorial. To make this code a bit more interesting and handier, we placed the Ethernet handler in a timer interrupt. In this way there is more time for other applications.

 
ETHERNET

 
#include "LPC17xx.h"
#include "GPIO.h"
#include "adc.h"
#include "uIP/ethernet.h"
#include "timer.h"
 

int main(void)
{
   /* Init Ethernet */
    initethernet();
   
    /*Init timer interrupt every 0.125 seconds and start interrupting*/
    TimerInit(0,15000000);
    enable_timer(0);

  
    while(1)
    {
         /* Place other code here */
    }
}

 

void TIMER0_IRQHandler (void)
{
 
    /* Set new timer interrupt */
    TIMER0_interrupt();                   
   
    /* Take care of Ethernet */
    handleethernet();

}


Copyright 2011. Joomla 1.7 templates - Joomla template maker. The Simplecortex is developed by BRC-Electronics