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 |
IP mode: 0 unselected, 1 static, 2 dhcp. More... | |
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.
Initialize lwIP
Set hw and IP parameters, initialize MAC too
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[] |
uint32_t g_ip_mode |
IP mode: 0 unselected, 1 static, 2 dhcp.
struct netif gs_net_if |