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"
128 ip_addr_t ipaddr, netmask, gw;
129 volatile s32_t tcpipdone = 0;
131 static int prt_ip = 0;
135 LWIP_DEBUGF(LWIP_DBG_ON, (
"Waiting for TCPIP thread to initialize...\n"));
141 LWIP_DEBUGF(LWIP_DBG_ON, (
"Starting LWIP TCP echo server...\n"));
145 IP4_ADDR(&gw, 0, 0, 0, 0);
146 IP4_ADDR(&ipaddr, 0, 0, 0, 0);
147 IP4_ADDR(&netmask, 0, 0, 0, 0);
149 IP4_ADDR(&gw, 10, 1, 10, 1);
150 IP4_ADDR(&ipaddr, 10, 1, 10, 234);
151 IP4_ADDR(&netmask, 255, 255, 255, 0);
157 LWIP_ASSERT(
"Net interface failed to initialize\r\n", 0);
163 NVIC_SetPriority(ETHERNET_IRQn, config_ETHERNET_INTERRUPT_PRIORITY);
164 NVIC_EnableIRQ(ETHERNET_IRQn);
189 NETIF_INIT_SNMP(&
lpc_netif, snmp_ifType_ethernet_csmacd, 100000000);
193 NETIF_INIT_SNMP(&
lpc_netif, snmp_ifType_ethernet_csmacd, 10000000);
202 tcpip_callback_with_block((tcpip_callback_fn) netif_set_link_up,
207 tcpip_callback_with_block((tcpip_callback_fn) netif_set_link_down,
211 DEBUGOUT(
"Link connect status: %d\r\n", ((physts & PHY_LINK_CONNECTED) != 0));
220 static char tmp_buff[16];
221 DEBUGOUT(
"IP_ADDR : %s\r\n", ipaddr_ntoa_r((
const ip_addr_t *) &
lpc_netif.ip_addr, tmp_buff, 16));
222 DEBUGOUT(
"NET_MASK : %s\r\n", ipaddr_ntoa_r((
const ip_addr_t *) &
lpc_netif.netmask, tmp_buff, 16));
223 DEBUGOUT(
"GATEWAY_IP : %s\r\n", ipaddr_ntoa_r((
const ip_addr_t *) &
lpc_netif.gw, tmp_buff, 16));
255 xTaskCreate(vSetupIFTask, (
signed char *)
"SetupIFx",
257 (xTaskHandle *)
NULL);
260 vTaskStartScheduler();