xxvethernet
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Typedefs Groups
xxxvethernet_example_intr_mcdma.c File Reference

Overview

Implements examples that utilize the Xxv Ethernet's interrupt driven MCDMA packet transfer mode to send and receive frames.

This example demonstrates how to perform a simple send and receive.

Functional guide to example:

  • XxvEthernetSgDmaIntrSingleFrameExample demonstrates the simplest way to send and receive frames in interrupt driven mode.
MODIFICATION HISTORY:
Ver   Who  Date     Changes


1.0 hk 06/16/17 First release 1.4 rsp 05/12/20 Fix Wint-conversion gcc warning in XxvEthernetSgDmaIntrExample().

 
#include "xxxvethernet_example.h"
#include "xmcdma.h"
#include "xil_cache.h"
#include "xil_exception.h"
#include "stdio.h"
#include "stdlib.h"
#include "xinterrupt_wrap.h"

Functions

int XxvEthernetSgDmaIntrExample (XXxvEthernet *XxvEthernetInstancePtr, XMcdma *DmaInstancePtr, UINTPTR XxvBaseAddress)
 This function demonstrates the usage usage of the Xxv Ethernet by sending and receiving frames in interrupt driven MCDMA mode. More...
 
int XxvEthernetSgDmaIntrSingleFrameExample (XXxvEthernet *XxvEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId)
 This function demonstrates the usage of the Xxv Ethernet by sending and receiving a single frame in interrupt mode using MCDMA. More...
 
int main (void)
 This is the main function for the Xxv Ethernet example. More...
 

Function Documentation

int main ( void  )

This is the main function for the Xxv Ethernet example.

This function is not included if the example is generated from the TestAppGen test tool.

Parameters
None.
Returns
- XST_SUCCESS to indicate success.
  • XST_FAILURE to indicate failure
Note
None.

References XxvEthernetSgDmaIntrExample(), and XxvEthernetUtilErrorTrap().

int XxvEthernetSgDmaIntrExample ( XXxvEthernet XxvEthernetInstancePtr,
XMcdma *  DmaInstancePtr,
UINTPTR  XxvBaseAddress 
)

This function demonstrates the usage usage of the Xxv Ethernet by sending and receiving frames in interrupt driven MCDMA mode.

Parameters
XxvEthernetInstancePtris a pointer to the instance of the XxvEthernet component.
DmaInstancePtris a pointer to the instance of the AXI MCDMA component.
XxvBaseAddresscontains the base address of the XxvEthernet device
Returns
-XST_SUCCESS to indicate success -XST_FAILURE to indicate failure
Note
AxiMcdma hardware must be initialized before initializing XxvEthernet. Since AxiMcdma reset line is connected to the XxvEthernet reset line, a reset of AxiMcdma hardware during its initialization would reset XxvEthernet.

References XXxvEthernet_Config::BaseAddress, XXxvEthernet_Config::XxvDevBaseAddress, XxvEthernetSgDmaIntrSingleFrameExample(), XxvEthernetUtilEnterLocalLoopback(), XxvEthernetUtilErrorTrap(), XXxvEthernet_CfgInitialize(), XXxvEthernet_LookupConfig(), and XXxvEthernet_Stop().

Referenced by main().

int XxvEthernetSgDmaIntrSingleFrameExample ( XXxvEthernet XxvEthernetInstancePtr,
XMcdma *  DmaInstancePtr,
u8  ChanId 
)

This function demonstrates the usage of the Xxv Ethernet by sending and receiving a single frame in interrupt mode using MCDMA.

The source packet will be described by two descriptors. It will be received into a buffer described by a single descriptor.

Parameters
XxvEthernetInstancePtris a pointer to the instance of the Xxv Ethernet component.
DmaInstancePtris a pointer to the instance of the Dma component.
Returns
-XST_SUCCESS to indicate success -XST_FAILURE to indicate failure
Note
None.

References XxvEthernetUtilErrorTrap(), XxvEthernetUtilFrameHdrFormatMAC(), XxvEthernetUtilFrameHdrFormatType(), XxvEthernetUtilFrameMemClear(), XxvEthernetUtilFrameSetPayloadData(), XxvEthernetUtilFrameVerify(), XXxvEthernet_Start(), and XXxvEthernet_Stop().

Referenced by XxvEthernetSgDmaIntrExample().