#include "xaxidma_bdring.h"
#include <string.h>
#include "xil_cache.h"
Classes | |
struct | XAxiDma |
struct | XAxiDma_Config |
Defines | |
#define | XAxiDma_GetTxRing(InstancePtr) (&((InstancePtr)->TxBdRing)) |
#define | XAxiDma_GetRxRing(InstancePtr) (&((InstancePtr)->RxBdRing[0])) |
#define | XAxiDma_GetRxIndexRing(InstancePtr, RingIndex) (&((InstancePtr)->RxBdRing[RingIndex])) |
#define | XAxiDma_HasSg(InstancePtr) ((InstancePtr)->HasSg) ? TRUE : FALSE |
#define | XAxiDma_IntrEnable(InstancePtr, Mask, Direction) |
#define | XAxiDma_IntrGetEnabled(InstancePtr, Direction) |
#define | XAxiDma_IntrDisable(InstancePtr, Mask, Direction) |
#define | XAxiDma_IntrGetIrq(InstancePtr, Direction) |
#define | XAxiDma_IntrAckIrq(InstancePtr, Mask, Direction) |
Functions | |
XAxiDma_Config * | XAxiDma_LookupConfig (u32 DeviceId) |
int | XAxiDma_CfgInitialize (XAxiDma *InstancePtr, XAxiDma_Config *Config) |
void | XAxiDma_Reset (XAxiDma *InstancePtr) |
int | XAxiDma_ResetIsDone (XAxiDma *InstancePtr) |
int | XAxiDma_Pause (XAxiDma *InstancePtr) |
int | XAxiDma_Resume (XAxiDma *InstancePtr) |
u32 | XAxiDma_Busy (XAxiDma *InstancePtr, int Direction) |
int | XAxiDma_SimpleTransfer (XAxiDma *InstancePtr, u32 BuffAddr, u32 Length, int Direction) |
int | XAxiDma_SelectKeyHole (XAxiDma *InstancePtr, int Direction, int Select) |
int | XAxiDma_SelectCyclicMode (XAxiDma *InstancePtr, int Direction, int Select) |
#define XAxiDma_GetRxIndexRing | ( | InstancePtr, | |||
RingIndex | ) | (&((InstancePtr)->RxBdRing[RingIndex])) |
Get Receive (Rx) Ring ptr of a Index
Warning: This has a different API than the LLDMA driver. It now returns the pointer to the BD ring.
InstancePtr | is a pointer to the DMA engine instance to be worked on. | |
RingIndex | is the channel Index. |
#define XAxiDma_GetRxRing | ( | InstancePtr | ) | (&((InstancePtr)->RxBdRing[0])) |
Get Receive (Rx) Ring ptr
Warning: This has a different API than the LLDMA driver. It now returns the pointer to the BD ring.
InstancePtr | is a pointer to the DMA engine instance to be worked on. |
#define XAxiDma_GetTxRing | ( | InstancePtr | ) | (&((InstancePtr)->TxBdRing)) |
Get Transmit (Tx) Ring ptr
Warning: This has a different API than the LLDMA driver. It now returns the pointer to the BD ring.
InstancePtr | is a pointer to the DMA engine instance to be worked on. |
#define XAxiDma_HasSg | ( | InstancePtr | ) | ((InstancePtr)->HasSg) ? TRUE : FALSE |
This function checks whether system is configured as Simple or Scatter Gather mode
InstancePtr | is a pointer to the DMA engine instance to be worked on. |
#define XAxiDma_IntrAckIrq | ( | InstancePtr, | |||
Mask, | |||||
Direction | ) |
XAxiDma_WriteReg((InstancePtr)->RegBase + \ (XAXIDMA_RX_OFFSET * Direction), XAXIDMA_SR_OFFSET, \ (Mask) & XAXIDMA_IRQ_ALL_MASK)
This function acknowledges the interrupts that are specified in Mask
InstancePtr | is the driver instance we are working on | |
Mask | is the mask for the interrupts to be acknowledge | |
Direction | is DMA transfer direction, valid values are
|
#define XAxiDma_IntrDisable | ( | InstancePtr, | |||
Mask, | |||||
Direction | ) |
XAxiDma_WriteReg((InstancePtr)->RegBase + \ (XAXIDMA_RX_OFFSET * Direction), XAXIDMA_CR_OFFSET, \ (XAxiDma_ReadReg((InstancePtr)->RegBase + \ (XAXIDMA_RX_OFFSET * Direction), XAXIDMA_CR_OFFSET)) \ & ~(Mask & XAXIDMA_IRQ_ALL_MASK))
This function disables interrupts specified by the Mask. Interrupts that are not in the mask are not affected.
InstancePtr | is the driver instance we are working on | |
Mask | is the mask for the interrupts to be disabled | |
Direction | is DMA transfer direction, valid values are
|
#define XAxiDma_IntrEnable | ( | InstancePtr, | |||
Mask, | |||||
Direction | ) |
XAxiDma_WriteReg((InstancePtr)->RegBase + \ (XAXIDMA_RX_OFFSET * Direction), XAXIDMA_CR_OFFSET, \ (XAxiDma_ReadReg((InstancePtr)->RegBase + \ (XAXIDMA_RX_OFFSET * Direction), XAXIDMA_CR_OFFSET)) \ | (Mask & XAXIDMA_IRQ_ALL_MASK))
This function enables interrupts specified by the Mask in specified direction, Interrupts that are not in the mask are not affected.
InstancePtr | is the driver instance we are working on | |
Mask | is the mask for the interrupts to be enabled | |
Direction | is DMA transfer direction, valid values are
|
#define XAxiDma_IntrGetEnabled | ( | InstancePtr, | |||
Direction | ) |
XAxiDma_ReadReg((InstancePtr)->RegBase + \ (XAXIDMA_RX_OFFSET * Direction), XAXIDMA_CR_OFFSET) &\ XAXIDMA_IRQ_ALL_MASK)
This function gets the mask for the interrupts that are currently enabled
InstancePtr | is the driver instance we are working on | |
Direction | is DMA transfer direction, valid values are
|
#define XAxiDma_IntrGetIrq | ( | InstancePtr, | |||
Direction | ) |
(XAxiDma_ReadReg((InstancePtr)->RegBase + \ (XAXIDMA_RX_OFFSET * Direction), XAXIDMA_SR_OFFSET) &\ XAXIDMA_IRQ_ALL_MASK)
This function gets the interrupts that are asserted.
InstancePtr | is the driver instance we are working on | |
Direction | is DMA transfer direction, valid values are
|
u32 XAxiDma_Busy | ( | XAxiDma * | InstancePtr, | |
int | Direction | |||
) |
This function checks whether specified DMA channel is busy
InstancePtr | is the driver instance we are working on | |
Direction | is DMA transfer direction, valid values are
|
int XAxiDma_CfgInitialize | ( | XAxiDma * | InstancePtr, | |
XAxiDma_Config * | Config | |||
) |
This function initializes a DMA engine. This function must be called prior to using a DMA engine. Initializing a engine includes setting up the register base address, setting up the instance data, and ensuring the hardware is in a quiescent state.
InstancePtr | is a pointer to the DMA engine instance to be worked on. | |
Config | is a pointer to an XAxiDma_Config structure. It contains the information about the hardware build, including base address,and whether status control stream (StsCntrlStrm), MM2S and S2MM are included in the build. |
XAxiDma_Config* XAxiDma_LookupConfig | ( | u32 | DeviceId | ) |
Look up the hardware configuration for a device instance
DeviceId | is the unique device ID of the device to lookup for |
int XAxiDma_Pause | ( | XAxiDma * | InstancePtr | ) |
Pause DMA transactions on both channels.
If the engine is running and doing transfers, this function does not stop the DMA transactions immediately, because then hardware will throw away our previously queued transfers. All submitted transfers will finish. Transfers submitted after this function will not start until XAxiDma_BdRingStart() or XAxiDma_Resume() is called.
InstancePtr | is a pointer to the DMA engine instance to be worked on. |
void XAxiDma_Reset | ( | XAxiDma * | InstancePtr | ) |
Reset both TX and RX channels of a DMA engine.
Reset one channel resets the whole AXI DMA engine.
Any DMA transaction in progress will finish gracefully before engine starts reset. Any other transactions that have been submitted to hardware will be discarded by the hardware.
InstancePtr | is a pointer to the DMA engine instance to be worked on. |
int XAxiDma_ResetIsDone | ( | XAxiDma * | InstancePtr | ) |
Check whether reset is done
InstancePtr | is a pointer to the DMA engine instance to be worked on. |
int XAxiDma_Resume | ( | XAxiDma * | InstancePtr | ) |
Resume DMA transactions on both channels.
InstancePtr | is a pointer to the DMA engine instance to be worked on. |
int XAxiDma_SelectCyclicMode | ( | XAxiDma * | InstancePtr, | |
int | Direction, | |||
int | Select | |||
) |
This function Enable or Disable Cyclic Mode Feature
InstancePtr | is the driver instance we are working on | |
Direction | is DMA transfer direction, valid values are
|
int XAxiDma_SelectKeyHole | ( | XAxiDma * | InstancePtr, | |
int | Direction, | |||
int | Select | |||
) |
This function Enable or Disable KeyHole Feature
InstancePtr | is the driver instance we are working on | |
Direction | is DMA transfer direction, valid values are
|
int XAxiDma_SimpleTransfer | ( | XAxiDma * | InstancePtr, | |
u32 | BuffAddr, | |||
u32 | Length, | |||
int | Direction | |||
) |
This function does one simple transfer submission
It checks in the following sequence:
InstancePtr | is the pointer to the driver instance | |
BuffAddr | is the address of the source/destination buffer | |
Length | is the length of the transfer | |
Direction | is DMA transfer direction, valid values are
|
Copyright © 1995-2014 Xilinx, Inc. All rights reserved.