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 "gmac.h"
#include "ethernet_phy.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 |
|
static |
Set ethernet config.
References ip_addr::addr, ethernetif_init(), gs_net_if, IP4_ADDR, netif_add(), netif_set_default(), 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 NULL, prvlwIPInit(), sys_thread_new(), and vTaskDelete().
|
static |
start lwIP layer.
References sys_sem_free(), sys_sem_new(), sys_sem_wait, tcpip_init(), and tcpip_init_done().
Referenced by portTASK_FUNCTION().
void status_callback | ( | struct netif * | netif | ) |
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 inet_ntoa, netif::ip_addr, and netif_is_up.
|
static |
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 xTaskCreate.
Referenced by main().
struct netif gs_net_if |