Functions | |
EMAC_BUFF_STATUS | Lpc17xxEmacGetBufferStatus (EMAC_BUFF_IDX idx) |
Query buffer status. | |
void | Lpc17xxEmacRxThread (void *arg) |
int | Lpc17xxEmacOutput (NUTDEVICE *dev, NETBUF *nb) |
Send Ethernet packet. | |
int | Lpc17xxEmacInit (NUTDEVICE *dev) |
Initialize Ethernet hardware. | |
Variables | |
NUTDEVICE | devLpc17xxEmac |
Device information structure. |
EMAC_BUFF_STATUS Lpc17xxEmacGetBufferStatus | ( | EMAC_BUFF_IDX | idx | ) | [inline] |
Query buffer status.
idx | buffer index (EMAC_RX_BUFF, EMAC_TX_BUFF) |
References EMAC_BUFF_EMPTY, EMAC_BUFF_FULL, EMAC_BUFF_PARTIAL_FULL, EMAC_TX_BUFF, and LPC_EMAC.
Referenced by Lpc17xxEmacOutput().
void Lpc17xxEmacRxThread | ( | void * | arg | ) |
References _NUTDEVICE::dev_dcb, _NUTDEVICE::dev_icb, EMAC_INT_RX_DONE, EMAC_INT_RX_ERR, EMAC_INT_RX_FIN, EMAC_INT_RX_OVERRUN, EMAC_INT_TX_DONE, EMAC_INT_TX_ERR, EMAC_INT_TX_FIN, EMAC_INT_TX_UNDERRUN, EMAC_LINK_LOOPS, EMPRINTF, ETHER_IS_UNICAST, ifnet::if_mac, ifnet::if_recv, LPC_EMAC, _NETBUF::nb_dl, _EMACINFO::ni_insane, _EMACINFO::ni_mutex, _EMACINFO::ni_rx_rdy, NutEventPost(), NutEventWait(), NutIrqEnable(), NutNetBufFree(), NutSleep(), NutThreadSetPriority(), sig_EMAC, and _NBDATA::sz.
Referenced by Lpc17xxEmacInit().
Send Ethernet packet.
dev | Identifies the device to use. |
nb | Network buffer structure containing the packet to be sent. The structure must have been allocated by a previous call NutNetBufAlloc(). |
References _NUTDEVICE::dev_dcb, EMAC_BUFF_FULL, EMAC_TX_BUFF, Lpc17xxEmacGetBufferStatus(), _EMACINFO::ni_insane, _EMACINFO::ni_mutex, _EMACINFO::ni_tx_rdy, NutEventPost(), NutEventWait(), and rc.
int Lpc17xxEmacInit | ( | NUTDEVICE * | dev | ) |
Initialize Ethernet hardware.
Applications should do not directly call this function. It is automatically executed during during device registration by NutRegisterDevice().
dev | Identifies the device to initialize. |
References CLKPWR_PCONP_PCENET, _NUTDEVICE::dev_dcb, EMAC_LINK_LOOPS, EMPRINTF, GPIO_CFG_PERIPHERAL1, GpioPinConfigSet(), Lpc17xxEmacRxThread(), memset(), NULL, NUT_THREAD_NICRXSTACK, NUT_THREAD_STACK_ADD, NUT_THREAD_STACK_MULT, NUTGPIO_PORT1, NutRegisterIrqHandler(), NutThreadCreate(), sig_EMAC, and SysCtlPeripheralClkEnable.
{ 0, {'e', 't', 'h', '0', 0, 0, 0, 0, 0}, IFTYP_NET, 0, 0, &ifn_eth0, &dcb_eth0, Lpc17xxEmacInit, 0, 0, 0, 0, 0, 0, 0 }
Device information structure.
A pointer to this structure must be passed to NutRegisterDevice() to bind this Ethernet device driver to the Nut/OS kernel. An application may then call NutNetIfConfig() with the name eth0 of this driver to initialize the network interface.