Ethernet management for LwIP (threaded mode).
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
#include <string.h>
#include "board.h"
#include "ethernet.h"
#include "sysclk.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"
Functions | |
static void | ethernet_configure_interface (void) |
Configure ethernet interface. More... | |
void | init_ethernet (void) |
Initialize ethernet stask. More... | |
void | status_callback (struct netif *netif) |
Status callback used to print assigned IP address. More... | |
Variables | |
int8_t | g_c_ipconfig [] |
uint32_t | g_ip_mode |
struct netif | gs_net_if |
|
static |
Configure ethernet interface.
References ip_addr::addr, ERR_OK, ethernetif_init(), g_ip_mode, gs_net_if, IP4_ADDR, LWIP_ASSERT, netif_add(), netif_set_default(), netif_set_up(), NULL, status_callback(), and tcpip_input().
Referenced by init_ethernet().
void init_ethernet | ( | void | ) |
Initialize ethernet stask.
Initialize the ethernet interface.
Initialize the lwIP TCP/IP stack with the network interface driver.
References ethernet_configure_interface(), lwip_init(), NULL, sys_init_timing(), and tcpip_init().
void status_callback | ( | struct netif * | netif | ) |
Status callback used to print assigned IP address.
Status callback used to print address given by DHCP.
Callback function used to print the given IP address when the link is up.
netif | Instance to network interface. |
References g_c_ipconfig, g_ip_mode, inet_ntoa, netif::ip_addr, and netif_is_up.
int8_t g_c_ipconfig[] |
Referenced by gfx_task(), and status_callback().
uint32_t g_ip_mode |
Referenced by ethernet_configure_interface(), and status_callback().
struct netif gs_net_if |