LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
lpc18xx_43xx_emac.c File Reference
#include "lwip/opt.h"
#include "lwip/sys.h"
#include "lwip/def.h"
#include "lwip/mem.h"
#include "lwip/pbuf.h"
#include "lwip/stats.h"
#include "lwip/snmp.h"
#include "netif/etharp.h"
#include "netif/ppp_oe.h"
#include "lpc_18xx43xx_emac_config.h"
#include "lpc18xx_43xx_emac.h"
#include "chip.h"
#include "board.h"
#include "lpc_phy.h"
#include <string.h>

Go to the source code of this file.

Data Structures

struct  lpc_enetdata
 Debug output formatter lock define When using FreeRTOS and with LWIP_DEBUG enabled, enabling this define will allow RX debug messages to not interleave with the TX messages (so they are actually readable). Not enabling this define when the system is under load will cause the output to be unreadable. There is a small tradeoff in performance for this so use it only for debug. More...
 

Functions

void msDelay (uint32_t ms)
 MilliSecond delay function based on FreeRTOS.
 
#define tskTXCLEAN_PRIORITY   (TCPIP_THREAD_PRIO - 1)
 Driver transmit and receive thread priorities Thread priorities for receive thread and TX cleanup thread. Alter to prioritize receive or transmit bandwidth. In a heavily loaded system or with LWIP_DEBUG enabled, the priorities might be better the same.
 
#define tskRECPKT_PRIORITY   (TCPIP_THREAD_PRIO - 1)
 
static struct lpc_enetdata lpc_enetdata
 
static uint32_t intMask
 
static void lpc_rxqueue_pbuf (struct lpc_enetdata *lpc_netifdata, struct pbuf *p)
 
static err_t lpc_rx_setup (struct lpc_enetdata *lpc_netifdata)
 
static struct pbuf * lpc_low_level_input (struct netif *netif)
 
static err_t lpc_tx_setup (struct lpc_enetdata *lpc_netifdata)
 
static err_t lpc_low_level_output (struct netif *netif, struct pbuf *sendp)
 
static err_t lpc_etharp_output (struct netif *netif, struct pbuf *q, ip_addr_t *ipaddr)
 
static portTASK_FUNCTION (vPacketReceiveTask, pvParameters)
 
static portTASK_FUNCTION (vTransmitCleanupTask, pvParameters)
 
static err_t low_level_init (struct netif *netif)
 
void lpc_mii_write_noblock (u32_t PhyReg, u32_t Value)
 Write a value via the MII link (non-blocking)
 
err_t lpc_mii_write (u32_t PhyReg, u32_t Value)
 Write a value via the MII link (blocking)
 
u32_t lpc_mii_is_busy (void)
 Reads current MII link busy status.
 
u32_t lpc_mii_read_data (void)
 Read current value in MII data register.
 
void lpc_mii_read_noblock (u32_t PhyReg)
 Starts a read operation via the MII link (non-blocking)
 
err_t lpc_mii_read (u32_t PhyReg, u32_t *data)
 Read a value via the MII link (blocking)
 
s32_t lpc_rx_queue (struct netif *netif)
 Attempt to allocate and requeue a new pbuf for RX.
 
void lpc_enetif_input (struct netif *netif)
 Attempt to read a packet from the EMAC interface.
 
void lpc_tx_reclaim (struct netif *netif)
 Call for freeing TX buffers that are complete.
 
s32_t lpc_tx_ready (struct netif *netif)
 Polls if an available TX descriptor is ready.
 
void ETH_IRQHandler (void)
 EMAC interrupt handler.
 
void lpc_emac_set_duplex (int full_duplex)
 Set up the MAC interface duplex.
 
void lpc_emac_set_speed (int mbs_100)
 Set up the MAC interface speed.
 
err_t lpc_enetif_init (struct netif *netif)
 LWIP 18xx/43xx EMAC initialization function.