![]() |
csudma
Vitis Drivers API Documentation
|
This file contains a design example using the XCsuDma driver in interrupt mode.
It sends data and expects to receive the same data through the device using the local loop back mode.
MODIFICATION HISTORY:
Ver Who Date Changes
1.0 vnsld 22/10/14 First release 1.2 adk 11/22/17 Added peripheral test app support. 1.4 adk 04/12/17 Added support for PMC DMA. adk 11/01/18 Declared static array rather than hard code memory for buffers. adk 18/01/18 Remove unnecessary column in XIntc_Connect() API. 1.5 adk 09/05/19 Added volatile keyword for DstDone variable to disable optimizations. 1.6 hk 11/18/19 Correct Versal INTR definition. 1.9 sk 12/23/20 Add the documentation for XCsuDma_IntrExample() function parameters to fix the doxygen warning. 1.11 sk 12/20/21 Add interrupt device id support for A78 and R52 processors. 1.14 adk 05/04/23 Added support for system device-tree flow.
#include "xcsudma.h"#include "xparameters.h"#include "xil_exception.h"#include "xinterrupt_wrap.h"Macros | |
| #define | CSU_SSS_CONFIG_OFFSET 0x008 |
| CSU SSS_CFG Offset. More... | |
| #define | CSUDMA_LOOPBACK_CFG 0x00000050 |
| LOOP BACK configuration macro. More... | |
| #define | PMC_SSS_CONFIG_OFFSET 0x500 |
| CSU SSS_CFG Offset. More... | |
| #define | PMCDMA0_LOOPBACK_CFG 0x0000000D |
| LOOP BACK configuration macro for PMCDMA0. More... | |
| #define | PMCDMA1_LOOPBACK_CFG 0x00000090 |
| LOOP BACK configuration macro for PMCDMA1. More... | |
| #define | SIZE 0x100 |
| Size of the data to be transferred. More... | |
Functions | |
| int | XCsuDma_IntrExample (XCsuDma *CsuDmaInstance, UINTPTR BaseAddress) |
| This function performs data transfer in loop back mode in interrupt mode and verify the data. More... | |
| void | IntrHandler (void *CallBackRef) |
| This function sets up the interrupt system so interrupts can occur for the CSU DMA. More... | |
| int | main (void) |
| Main function to call the example. More... | |
Variables | |
| u32 | DstBuf [SIZE] |
| Destination buffer. More... | |
| u32 | SrcBuf [SIZE] |
| Source buffer. More... | |
| XCsuDma | CsuDma |
| Instance of the Csu_Dma Device. More... | |
| #define CSU_SSS_CONFIG_OFFSET 0x008 |
CSU SSS_CFG Offset.
| #define CSUDMA_LOOPBACK_CFG 0x00000050 |
LOOP BACK configuration macro.
| #define PMC_SSS_CONFIG_OFFSET 0x500 |
CSU SSS_CFG Offset.
| #define PMCDMA0_LOOPBACK_CFG 0x0000000D |
LOOP BACK configuration macro for PMCDMA0.
| #define PMCDMA1_LOOPBACK_CFG 0x00000090 |
LOOP BACK configuration macro for PMCDMA1.
| #define SIZE 0x100 |
Size of the data to be transferred.
| void IntrHandler | ( | void * | CallBackRef | ) |
This function sets up the interrupt system so interrupts can occur for the CSU DMA.
This function is application-specific. The user should modify this function to fit the application.
| IntcInstancePtr | is a pointer to the instance of the INTC. |
| InstancePtr | contains a pointer to the instance of the CSU DMA driver which is going to be connected to the interrupt controller. |
| IntrId | is the interrupt Id and is typically XPAR_<CSUDMA_instance>_INTR value from xparameters.h. |
This function is the interrupt handler for the CSU_DMA driver.
This handler reads the interrupt status from the Status register, determines the source of the interrupts, calls according callbacks, and finally clears the interrupts.
| CallBackRef | is the callback reference passed from the interrupt handler, which in our case is a pointer to the driver instance. |
| int main | ( | void | ) |
Main function to call the example.
| int XCsuDma_IntrExample | ( | XCsuDma * | CsuDmaInstance, |
| UINTPTR | BaseAddress | ||
| ) |
This function performs data transfer in loop back mode in interrupt mode and verify the data.
| CsuDmaInstance | contains a pointer to the CSU DMA instance which is going to be connected to the interrupt controller. |
| BaseAddress | contains the base address of the CsuDma device |
| XCsuDma CsuDma |
Instance of the Csu_Dma Device.
| u32 DstBuf[SIZE] |
Destination buffer.
| u32 SrcBuf[SIZE] |
Source buffer.