emaclite
Vitis Drivers API Documentation
xemaclite_phy_loopback_example.c File Reference

Overview

This file contains a example for using EmacLite hardware and driver.

This file contains an interrupt example outlining the use of interrupts and callbacks in the transmission/reception of Ethernet frames using MAC loop back in the PHY device with an incrementing payload from 1 byte to 1500 bytes (excluding Ethernet Header and FCS).

This example assumes that there is an interrupt controller in the hardware system and the EmacLite device is connected to the interrupt controller.

Note

None

MODIFICATION HISTORY:
Ver   Who  Date     Changes


2.00a ktn 02/25/09 First release 2.01a ktn 07/20/09 Updated the example to wait for either Transmit complete or Rx packet reception. 3.00a ktn 10/22/09 Updated the example to use the HAL APIs/macros. 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.

Functions

int EmacLitePhyLoopbackExample (u16 DeviceId)
 The main entry point for the EmacLite driver PHY loop back example in interrupt mode. More...
 
int main ()
 This function is the main function of the EmacLite PHY loop back example in interrupt mode. More...
 

Function Documentation

int EmacLitePhyLoopbackExample ( u16  DeviceId)

The main entry point for the EmacLite driver PHY loop back example in interrupt mode.

This function will transmit/receive the frame using MAC interface loop back (in the PHY device) and verify the data in the received frame.

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

References XEmacLite_Config::BaseAddress, EmacLiteDisablePhyLoopBack(), EmacLiteEnablePhyLoopBack(), EmacLitePhyDetect(), XEL_MTU_SIZE, XEmacLite_CfgInitialize(), XEmacLite_DisableInterrupts(), XEmacLite_EnableInterrupts(), XEmacLite_FlushReceive(), XEmacLite_InterruptHandler(), XEmacLite_IsMdioConfigured, XEmacLite_LookupConfig(), XEmacLite_SetMacAddress(), XEmacLite_SetRecvHandler(), XEmacLite_SetSendHandler(), and XEmacLite_TxBufferAvailable().

Referenced by main().

int main ( void  )

This function is the main function of the EmacLite PHY loop back example in interrupt mode.

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

References EmacLitePhyLoopbackExample().