32 #include "lwip/init.h"
35 #include "lwip/memp.h"
36 #include "lwip/tcpip.h"
37 #include "lwip/ip_addr.h"
38 #include "lwip/netif.h"
39 #include "lwip/timers.h"
40 #include "netif/etharp.h"
43 #include "lwip/dhcp.h"
127 ip_addr_t ipaddr, netmask, gw;
128 volatile s32_t tcpipdone = 0;
130 static int prt_ip = 0;
134 LWIP_DEBUGF(LWIP_DBG_ON, (
"Waiting for TCPIP thread to initialize...\n"));
140 LWIP_DEBUGF(LWIP_DBG_ON, (
"Starting LWIP TCP echo server...\n"));
144 IP4_ADDR(&gw, 0, 0, 0, 0);
145 IP4_ADDR(&ipaddr, 0, 0, 0, 0);
146 IP4_ADDR(&netmask, 0, 0, 0, 0);
148 IP4_ADDR(&gw, 10, 1, 10, 1);
149 IP4_ADDR(&ipaddr, 10, 1, 10, 234);
150 IP4_ADDR(&netmask, 255, 255, 255, 0);
156 LWIP_ASSERT(
"Net interface failed to initialize\r\n", 0);
162 NVIC_SetPriority(ETHERNET_IRQn, config_ETHERNET_INTERRUPT_PRIORITY);
163 NVIC_EnableIRQ(ETHERNET_IRQn);
187 NETIF_INIT_SNMP(&
lpc_netif, snmp_ifType_ethernet_csmacd, 100000000);
191 NETIF_INIT_SNMP(&
lpc_netif, snmp_ifType_ethernet_csmacd, 10000000);
200 tcpip_callback_with_block((tcpip_callback_fn) netif_set_link_up,
205 tcpip_callback_with_block((tcpip_callback_fn) netif_set_link_down,
209 DEBUGOUT(
"Link connect status: %d\r\n", ((physts & PHY_LINK_CONNECTED) != 0));
218 static char tmp_buff[16];
219 DEBUGOUT(
"IP_ADDR : %s\r\n", ipaddr_ntoa_r((
const ip_addr_t *) &
lpc_netif.ip_addr, tmp_buff, 16));
220 DEBUGOUT(
"NET_MASK : %s\r\n", ipaddr_ntoa_r((
const ip_addr_t *) &
lpc_netif.netmask, tmp_buff, 16));
221 DEBUGOUT(
"GATEWAY_IP : %s\r\n", ipaddr_ntoa_r((
const ip_addr_t *) &
lpc_netif.gw, tmp_buff, 16));
253 xTaskCreate(vSetupIFTask, (
signed char *)
"SetupIFx",
255 (xTaskHandle *)
NULL);
258 vTaskStartScheduler();