Microchip® Advanced Software Framework

raw_http_basic_example/network/ethernet.c File Reference

Ethernet management for the lwIP Raw HTTP basic example.

Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.

#include <string.h>
#include "board.h"
#include "ethernet.h"
#include "timer_mgt.h"
#include "lwip/sys.h"
#include "lwip/api.h"
#include "lwip/tcp.h"
#include "lwip/tcpip.h"
#include "lwip/memp.h"
#include "lwip/dhcp.h"
#include "lwip/dns.h"
#include "lwip/stats.h"
#include "lwip/init.h"
#include "lwip/ip_frag.h"
#include "lwip/inet.h"
#include "lwip/tcp_impl.h"
#include "netif/etharp.h"

Data Structures

struct  timers_info
 Timer for calling lwIP tmr functions without system. More...
 

Typedefs

typedef struct timers_info timers_info_t
 

Functions

static void ethernet_configure_interface (void)
 Configure network interface driver. More...
 
void ethernet_task (void)
 Process incoming ethernet frames, then update timers. More...
 
void init_ethernet (void)
 Initialize the lwIP TCP/IP stack with the network interface driver. More...
 
void status_callback (struct netif *netif)
 Callback function used to print the given IP address when the link is up. More...
 
static void timers_update (void)
 Timer management function. More...
 

Variables

struct netif gs_net_if
 
static timers_info_t gs_timers_table []
 

typedef struct timers_info timers_info_t

static void ethernet_configure_interface ( void  )
static
void ethernet_task ( void  )

Process incoming ethernet frames, then update timers.

Manage the ethernet packets, if any received process them.

Referenced by main(), and webserver_task().

void init_ethernet ( void  )

Initialize the lwIP TCP/IP stack with the network interface driver.

Initialize the ethernet interface.

Referenced by gfx_task(), and main().

void status_callback ( struct netif netif)

Callback function used to print the given IP address when the link is up.

Status callback used to print address given by DHCP.

Parameters
netifThe network interface instance.

Referenced by ethernet_configure_interface().

static void timers_update ( void  )
static

struct netif gs_net_if
timers_info_t gs_timers_table[]
static
Initial value:
= {
{0, TCP_TMR_INTERVAL, tcp_tmr},
{0, IP_TMR_INTERVAL, ip_reass_tmr},
{0, ARP_TMR_INTERVAL, etharp_tmr},
}

Referenced by timers_update().