| emaclite Vitis Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Functions
xemaclite_internal_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 internal loop back 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

    1.01a ecm  05/21/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 internal loop back feature
    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 | EmacLiteIntrLoopbackExample (u16 DeviceId)
| The main entry point for the EmacLite driver in interrupt mode example. More...
int | main ()
| This function is the main function of the EmacLite example in interrupt mode. More...

## Function Documentation

int EmacLiteIntrLoopbackExample | ( | u16 | DeviceId | ) |

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

This function will transmit/receive the frame using internal loop back and verify the data in the received frame.

Parameters

  DeviceId | is device ID of the XEmacLite Device , typically XPAR_<EMAC_instance>_DEVICE_ID value from xparameters.h.

Returns
  XST_SUCCESS to indicate success, otherwise XST_FAILURE.

Note
  None.

References XEmacLite_Config::BaseAddress, XEL_MTU_SIZE, XEmacLite_CfgInitialize(), XEmacLite_DisableInterrupts(), XEmacLite_DisableLoopBack(), XEmacLite_EnableInterrupts(), XEmacLite_EnableLoopBack(), XEmacLite_FlushReceive(), XEmacLite_InterruptHandler(), 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 example in interrupt mode.

Parameters

  None. |

Returns
  XST_SUCCESS to indicate success, otherwise XST_FAILURE.

Note
  None.

References EmacLiteIntrLoopbackExample().