emaclite
Vitis Drivers API Documentation
xemaclite_polled_example.c File Reference

Overview

This file contains an example for using the EmacLite hardware and driver.

This file contains an polled mode example outlining the transmission/reception of an Ethernet frame of 1000 bytes of payload.

If the MDIO interface is NOT configured in the EmacLite core then this example will only transmit a frame. If the MDIO interface is configured in the EmacLite core then this example will enable the MAC loopback in the PHY device, then transmit the frame and compare the received frame.

Note
MODIFICATION HISTORY:
Ver   Who  Date     Changes


1.01a ecm 21/05/04 First release 1.01a sv 06/06/05 Minor changes to comply to Doxygen and coding guidelines 2.00a ktn 02/25/09 Updated to use PHY loop back if MDIO is configured in core and updated to be used in Test App 3.00a ktn 10/22/09 Updated example to use the macros that have been changed in the driver to remove _m from the name of the macro. 3.01a ktn 07/08/10 Updated example to support Little Endian MicroBlaze. 4.3 ms 01/23/17 Added xil_printf statement in main function to ensure that "Successfully ran" and "Failed" strings are available in all examples. This is a fix for CR-965028. 4.4 rsp 11/04/18 Fix poll example failure when I/D cache is disabled. It's a corner case when on network there is a packet reception before send i.e during phy loopback setup.

 

Functions

int EmacLitePolledExample (u16 DeviceId)
 The main entry point for the EmacLite driver example in polled mode. More...
 
int main ()
 This function is the main function of the EmacLite polled example. More...
 

Function Documentation

int EmacLitePolledExample ( u16  DeviceId)

The main entry point for the EmacLite driver example in polled mode.

This function will transmit/receive the Ethernet frames and verify the data in the received frame (if the MDIO interface is configured in the EmacLite core). This function simply transmits a frame if the MDIO interface is not configured in the EmacLite core.

Parameters
DeviceIdis device ID of the XEmacLite Device , typically XPAR_<EMAC_instance>_DEVICE_ID value from xparameters.h.
Returns
XST_SUCCESS to indicate success, XST_FAILURE otherwise.
Note
None.

References XEmacLite_Config::BaseAddress, EmacLiteDisablePhyLoopBack(), EmacLiteEnablePhyLoopBack(), EmacLitePhyDetect(), XEmacLite_CfgInitialize(), XEmacLite_FlushReceive(), XEmacLite_IsMdioConfigured, XEmacLite_LookupConfig(), XEmacLite_Recv(), XEmacLite_SetMacAddress(), and XEmacLite_TxBufferAvailable().

Referenced by main().

int main ( void  )

This function is the main function of the EmacLite polled example.

Parameters
None.
Returns
XST_SUCCESS to indicate success, otherwise XST_FAILURE .
Note
None.

References EmacLitePolledExample().