axidma
Vitis Drivers API Documentation
xaxidma_bdring.h File Reference

Data Structures

struct  XAxiDma_BdRing
 Container structure for descriptor storage control. More...
 

Macros

#define XAxiDma_BdRingCntCalc(Alignment, Bytes)   (uint32_t)((Bytes)/((sizeof(XAxiDma_Bd)+((Alignment)-1))&~((Alignment)-1)))
 Use this macro at initialization time to determine how many BDs will fit within the given memory constraints. More...
 
#define XAxiDma_BdRingMemCalc(Alignment, NumBd)   (int)((sizeof(XAxiDma_Bd)+((Alignment)-1)) & ~((Alignment)-1))*(NumBd)
 Use this macro at initialization time to determine how many bytes of memory are required to contain a given number of BDs at a given alignment. More...
 
#define XAxiDma_BdRingGetCnt(RingPtr)   ((RingPtr)->AllCnt)
 Return the total number of BDs allocated by this channel with XAxiDma_BdRingCreate(). More...
 
#define XAxiDma_BdRingGetFreeCnt(RingPtr)   ((RingPtr)->FreeCnt)
 Return the number of BDs allocatable with XAxiDma_BdRingAlloc() for pre- processing. More...
 
#define XAxiDma_BdRingSnapShotCurrBd(RingPtr)
 Snap shot the latest BD a BD ring is processing. More...
 
#define XAxiDma_BdRingGetCurrBd(RingPtr)
 Get the BD a BD ring is processing. More...
 
#define XAxiDma_BdRingNext(RingPtr, BdPtr)
 Return the next BD in the ring. More...
 
#define XAxiDma_BdRingPrev(RingPtr, BdPtr)
 Return the previous BD in the ring. More...
 
#define XAxiDma_BdRingGetSr(RingPtr)   XAxiDma_ReadReg((RingPtr)->ChanBase, XAXIDMA_SR_OFFSET)
 Retrieve the contents of the channel status register. More...
 
#define XAxiDma_BdRingGetError(RingPtr)
 Get error bits of a DMA channel. More...
 
#define XAxiDma_BdRingHwIsStarted(RingPtr)
 Check whether a DMA channel is started, meaning the channel is not halted. More...
 
#define XAxiDma_BdRingBusy(RingPtr)
 Check if the current DMA channel is busy with a DMA operation. More...
 
#define XAxiDma_BdRingIntEnable(RingPtr, Mask)
 Set interrupt enable bits for a channel. More...
 
#define XAxiDma_BdRingIntGetEnabled(RingPtr)
 Get enabled interrupts of a channel. More...
 
#define XAxiDma_BdRingIntDisable(RingPtr, Mask)
 Clear interrupt enable bits for a channel. More...
 
#define XAxiDma_BdRingGetIrq(RingPtr)
 Retrieve the contents of the channel's IRQ register XAXIDMA_SR_OFFSET. More...
 
#define XAxiDma_BdRingAckIrq(RingPtr, Mask)
 Acknowledge asserted interrupts. More...
 
#define XAxiDma_BdRingEnableCyclicDMA(RingPtr)   (RingPtr->Cyclic = 1)
 Enable Cyclic DMA Mode. More...
 

Functions

int XAxiDma_StartBdRingHw (XAxiDma_BdRing *RingPtr)
 Start a DMA channel and Allow DMA transactions to commence on a given channel if descriptors are ready to be processed. More...
 
int XAxiDma_UpdateBdRingCDesc (XAxiDma_BdRing *RingPtr)
 Update Current Descriptor. More...
 
u32 XAxiDma_BdRingCreate (XAxiDma_BdRing *RingPtr, UINTPTR PhysAddr, UINTPTR VirtAddr, u32 Alignment, int BdCount)
 Using a memory segment allocated by the caller, This fundtion creates and setup the BD ring. More...
 
int XAxiDma_BdRingClone (XAxiDma_BdRing *RingPtr, XAxiDma_Bd *SrcBdPtr)
 Clone the given BD into every BD in the ring. More...
 
int XAxiDma_BdRingAlloc (XAxiDma_BdRing *RingPtr, int NumBd, XAxiDma_Bd **BdSetPtr)
 Reserve locations in the BD ring. More...
 
int XAxiDma_BdRingUnAlloc (XAxiDma_BdRing *RingPtr, int NumBd, XAxiDma_Bd *BdSetPtr)
 Fully or partially undo an XAxiDma_BdRingAlloc() operation. More...
 
int XAxiDma_BdRingToHw (XAxiDma_BdRing *RingPtr, int NumBd, XAxiDma_Bd *BdSetPtr)
 Enqueue a set of BDs to hardware that were previously allocated by XAxiDma_BdRingAlloc(). More...
 
int XAxiDma_BdRingFromHw (XAxiDma_BdRing *RingPtr, int BdLimit, XAxiDma_Bd **BdSetPtr)
 Returns a set of BD(s) that have been processed by hardware. More...
 
int XAxiDma_BdRingFree (XAxiDma_BdRing *RingPtr, int NumBd, XAxiDma_Bd *BdSetPtr)
 Frees a set of BDs that had been previously retrieved with XAxiDma_BdRingFromHw(). More...
 
int XAxiDma_BdRingStart (XAxiDma_BdRing *RingPtr)
 Start a DMA channel, updates current descriptors and Allow DMA transactions to commence on a given channel if descriptors are ready to be processed. More...
 
int XAxiDma_BdRingSetCoalesce (XAxiDma_BdRing *RingPtr, u32 Counter, u32 Timer)
 Set interrupt coalescing parameters for the given descriptor ring channel. More...
 
void XAxiDma_BdRingGetCoalesce (XAxiDma_BdRing *RingPtr, u32 *CounterPtr, u32 *TimerPtr)
 Retrieve current interrupt coalescing parameters from the given descriptor ring channel. More...
 
int XAxiDma_BdRingCheck (XAxiDma_BdRing *RingPtr)
 Check the internal data structures of the BD ring for the provided channel. More...
 
void XAxiDma_BdRingDumpRegs (XAxiDma_BdRing *RingPtr)
 Dump the registers for a channel. More...