Nut/OS  5.0.5
API Reference
XgNutArchCm3Lpc17xxEmac

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.

Function Documentation

EMAC_BUFF_STATUS Lpc17xxEmacGetBufferStatus ( EMAC_BUFF_IDX  idx) [inline]

Query buffer status.

Parameters:
idxbuffer index (EMAC_RX_BUFF, EMAC_TX_BUFF)
Returns:
buffer status (EMAC_BUFF_EMPTY, EMAC_BUFF_PARTIAL_FULL, EMAC_BUFF_FULL)

References EMAC_BUFF_EMPTY, EMAC_BUFF_FULL, EMAC_BUFF_PARTIAL_FULL, EMAC_TX_BUFF, and LPC_EMAC.

Referenced by Lpc17xxEmacOutput().

int Lpc17xxEmacOutput ( NUTDEVICE dev,
NETBUF nb 
)

Send Ethernet packet.

Parameters:
devIdentifies the device to use.
nbNetwork buffer structure containing the packet to be sent. The structure must have been allocated by a previous call NutNetBufAlloc().
Returns:
0 on success, -1 in case of any errors.

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.

Here is the call graph for this function:

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().

Parameters:
devIdentifies 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.

Here is the call graph for this function:


Variable Documentation

Initial value:
 {
    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.