Microchip® Advanced Software Framework

ethernet.c File Reference

Ethernet management for the lwIP Raw HTTP basic example.

Copyright (c) 2014-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
 

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

Configure network interface driver.

References ERR_OK, ethernetif_init(), gs_net_if, LWIP_ASSERT, netif_add(), netif_set_default(), netif_set_up(), NULL, printf, and status_callback().

Referenced by init_ethernet().

void ethernet_task ( void  )

Process incoming ethernet frames, then update timers.

References ethernetif_input(), gs_net_if, and timers_update().

Referenced by main().

void init_ethernet ( void  )

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

References ethernet_configure_interface(), lwip_init(), and sys_init_timing().

Referenced by main().

void status_callback ( struct netif netif)

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

Parameters
netifThe network interface instance.

References inet_ntoa(), netif::ip_addr, netif_is_up, and printf.

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().