Ethernet management for the FreeRTOS with lwIP example.
Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.
#include <string.h>
#include "FreeRTOS.h"
#include "task.h"
#include "partest.h"
#include "conf_lwip_threads.h"
#include "ethernet.h"
#include "netif/ethernetif.h"
#include "conf_eth.h"
#include "emac.h"
#include "ethernet_phy.h"
#include "BasicWEB.h"
#include "BasicTFTP.h"
#include "lwip/sys.h"
#include "lwip/api.h"
#include "lwip/tcpip.h"
#include "lwip/memp.h"
#include <lwip/dhcp.h>
#include <lwip/dns.h>
#include <lwip/netif.h>
#include "lwip/stats.h"
#include "lwip/init.h"
#include "lwip/inet.h"
Data Structures | |
struct | timers_info |
Typedefs | |
typedef struct timers_info | timers_info_t |
Functions | |
static void | ethernet_configure_interface (void) |
Set ethernet config. More... | |
portTASK_FUNCTION (vStartEthernetTask, pvParameters) | |
create ethernet task, for ethernet management. More... | |
static void | prvlwIPInit (void) |
start lwIP layer. More... | |
void | status_callback (struct netif *netif) |
Status callback used to print address given by DHCP. More... | |
static void | tcpip_init_done (void *arg) |
Callback executed when the TCP/IP init is done. More... | |
void | vStartEthernetTaskLauncher (unsigned portBASE_TYPE uxPriority) |
Create the vStartEthernetTask task. More... | |
Variables | |
struct netif | gs_net_if |
typedef struct timers_info timers_info_t |
Set ethernet config.
References ip_addr::addr, dhcp_start(), ETHERNET_CONF_GATEWAY_ADDR0, ETHERNET_CONF_GATEWAY_ADDR1, ETHERNET_CONF_GATEWAY_ADDR2, ETHERNET_CONF_GATEWAY_ADDR3, ETHERNET_CONF_IPADDR0, ETHERNET_CONF_IPADDR1, ETHERNET_CONF_IPADDR2, ETHERNET_CONF_IPADDR3, ETHERNET_CONF_NET_MASK0, ETHERNET_CONF_NET_MASK1, ETHERNET_CONF_NET_MASK2, ETHERNET_CONF_NET_MASK3, ethernet_input(), ethernetif_init(), gs_net_if, IP4_ADDR, netif_add(), netif_set_default(), netif_set_status_callback(), netif_set_up(), NULL, and status_callback().
Referenced by tcpip_init_done().
portTASK_FUNCTION | ( | vStartEthernetTask | , |
pvParameters | |||
) |
create ethernet task, for ethernet management.
uxPriority | Input. priority for the task, it should be low |
References lwipBASIC_SMTP_CLIENT_PRIORITY, lwipBASIC_SMTP_CLIENT_STACK_SIZE, lwipBASIC_TFTP_SERVER_PRIORITY, lwipBASIC_TFTP_SERVER_STACK_SIZE, lwipBASIC_WEB_SERVER_PRIORITY, lwipBASIC_WEB_SERVER_STACK_SIZE, NULL, prvlwIPInit(), sys_thread_new(), and vTaskDelete().
start lwIP layer.
References sys_sem_free(), sys_sem_new(), sys_sem_wait, tcpip_init(), and tcpip_init_done().
Referenced by portTASK_FUNCTION().
Status callback used to print address given by DHCP.
netif | Instance to network interface. |
References inet_ntoa, netif::ip_addr, and netif_is_up.
Referenced by ethernet_configure_interface(), and netif_set_status_callback().
Callback executed when the TCP/IP init is done.
References ethernet_configure_interface(), and sys_sem_signal().
Referenced by prvlwIPInit().
void vStartEthernetTaskLauncher | ( | unsigned portBASE_TYPE | uxPriority | ) |
Create the vStartEthernetTask task.
uxPriority | Input; priority of the task to create. |
References configMINIMAL_STACK_SIZE, NULL, and xTaskHandle.
Referenced by main().
struct netif gs_net_if |
Referenced by ethernet_configure_interface().