dmaps: Dmaps_v2_5

| dmaps Xilinx SDK Drivers API Documentation

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

Data Structures | Macros | Typedefs | Functions | Variables
Dmaps_v2_5

## Data Structures
struct | XDmaPs_Config
| This typedef contains configuration information for the device. More...
struct | XDmaPs_ChanCtrl
| DMA channle control structure. More...
struct | XDmaPs_BD
| DMA block descriptor stucture. More...
struct | XDmaPs_Cmd
| A DMA command consisits of a channel control struct, a block descriptor, a user defined program, a pointer pointing to generated DMA program, and execution result. More...
struct | XDmaPs_ProgBuf
| The XDmaPs_ProgBuf is the struct for a DMA program buffer. More...
struct | XDmaPs_ChannelData
| The XDmaPs_ChannelData is a struct to book keep individual channel of the DMAC. More...
struct | XDmaPs
| The XDmaPs driver instance data structure. More...

## Macros
#define | XDmaPs_WriteReg(BaseAddress, RegOffset, RegisterValue) Xil_Out32((BaseAddress) + (RegOffset), (RegisterValue))
| Write a DMAC register. More...

## Typedefs
typedef void(* | XDmaPsDoneHandler )(unsigned int Channel, XDmaPs_Cmd *DmaCmd, void *CallbackRef)
| It's the done handler a user can set for a channel. More...
typedef void(* | XDmaPsFaultHandler )(unsigned int Channel, XDmaPs_Cmd *DmaCmd, void *CallbackRef)
| It's the fault handler a user can set for a channel. More...

## Functions
int | XDmaPs_CfgInitialize (XDmaPs *InstPtr, XDmaPs_Config *Config, u32 EffectiveAddr)
| Initializes a specific XDmaPs instance such that it is ready to be used. More...
int | XDmaPs_ResetManager (XDmaPs *InstPtr)
| Reset the DMA Manager. More...
int | XDmaPs_ResetChannel (XDmaPs *InstPtr, unsigned int Channel)
| Reset the specified DMA Channel. More...
void | XDmaPs_FaultISR (XDmaPs *InstPtr)
| Driver fault interrupt service routine This is the one that connects the GIC. More...
int | XDmaPs_SetDoneHandler (XDmaPs *InstPtr, unsigned Channel, XDmaPsDoneHandler DoneHandler, void *CallbackRef)
| Set the done handler for a channel. More...
int | XDmaPs_SetFaultHandler (XDmaPs *InstPtr, XDmaPsFaultHandler FaultHandler, void *CallbackRef)
| Set the fault handler for a channel. More...
int | XDmaPs_Instr_DMARMB (char *DmaProg)
| Construction function for DMARMB instruction. More...
int | XDmaPs_Instr_DMAWMB (char *DmaProg)
| Construction function for DMAWMB instruction. More...
u32 | XDmaPs_ToCCRValue (XDmaPs_ChanCtrl *ChanCtrl)
| Conversion function from PL330 bus transfer descriptors to CCR value. More...
int | XDmaPs_ConstructSingleLoop (char *DmaProgStart, int CacheLength, char *DmaProgLoopStart, int LoopCount)
| Construct a loop with only DMALD and DMAST as the body using loop counter 0. More...
int | XDmaPs_ConstructNestedLoop (char *DmaProgStart, int CacheLength, char *DmaProgLoopStart, unsigned int LoopCountOuter, unsigned int LoopCountInner)
| Construct a nested loop with only DMALD and DMAST in the inner loop body. More...
int | XDmaPs_GenDmaProg (XDmaPs *InstPtr, unsigned int Channel, XDmaPs_Cmd *Cmd)
| Generate a DMA program based for the DMA command, the buffer will be pointed by the GeneratedDmaProg field of the command. More...
int | XDmaPs_FreeDmaProg (XDmaPs *InstPtr, unsigned int Channel, XDmaPs_Cmd *Cmd)
| Free the DMA program buffer that is pointed by the GeneratedDmaProg field of the command. More...
int | XDmaPs_Start (XDmaPs *InstPtr, unsigned int Channel, XDmaPs_Cmd *Cmd, int HoldDmaProg)
| Start a DMA command. More...
int | XDmaPs_IsActive (XDmaPs *InstPtr, unsigned int Channel)
| Checks whether the DMA channel is active or idle. More...
void | XDmaPs_DoneISR_0 (XDmaPs *InstPtr)
| Driver done interrupt service routine for channel 0. More...
void | XDmaPs_DoneISR_1 (XDmaPs *InstPtr)
| Driver done interrupt service routine for channel 1. More...
void | XDmaPs_DoneISR_2 (XDmaPs *InstPtr)
| Driver done interrupt service routine for channel 2. More...
void | XDmaPs_DoneISR_3 (XDmaPs *InstPtr)
| Driver done interrupt service routine for channel 3. More...
void | XDmaPs_DoneISR_4 (XDmaPs *InstPtr)
| Driver done interrupt service routine for channel 4. More...
void | XDmaPs_DoneISR_5 (XDmaPs *InstPtr)
| Driver done interrupt service routine for channel 5. More...
void | XDmaPs_DoneISR_6 (XDmaPs *InstPtr)
| Driver done interrupt service routine for channel 6. More...
void | XDmaPs_DoneISR_7 (XDmaPs *InstPtr)
| Driver done interrupt service routine for channel 7. More...
void | XDmaPs_Print_DmaProg (XDmaPs_Cmd *Cmd)
| Print the Dma Prog Contents. More...
XDmaPs_Config * | XDmaPs_LookupConfig (u16 DeviceId)
| Looks up the device configuration based on the unique device ID. More...
int | XDmaPs_SelfTest (XDmaPs *InstPtr)
| This function runs a self-test on the driver and hardware device. More...
void | XDmaPs_ResetHw (u32 BaseAddress)
| This function perform the reset sequence to the given dmaps interface by configuring the appropriate control bits in the dmaps specifc registers the dmaps reset squence involves the following steps Disable all the interuupts Clear the pending interrupts Kill all the active channel threads Kill the manager thread. More...

## Variables
XDmaPs_Config | XDmaPs_ConfigTable []
| Each XDmaPs device in the system has an entry in this table. More...
XDmaPs_Config | XDmaPs_ConfigTable []
| Each XDmaPs device in the system has an entry in this table. More...

## Register Map
Register offsets for the DMAC.
#define | XDMAPS_DS_OFFSET 0x000 /* DMA Status Register */
#define | XDMAPS_DPC_OFFSET 0x004 /* DMA Program Counter Rregister */
#define | XDMAPS_INTEN_OFFSET 0X020 /* DMA Interrupt Enable Register */
#define | XDMAPS_ES_OFFSET 0x024 /* DMA Event Status Register */
#define | XDMAPS_INTSTATUS_OFFSET
#define | XDMAPS_INTCLR_OFFSET 0x02c /* DMA Interrupt Clear Register */
#define | XDMAPS_FSM_OFFSET
#define | XDMAPS_FSC_OFFSET
#define | XDMAPS_FTM_OFFSET 0x038 /* DMA Fault Type DMA Manager Register */
#define | XDMAPS_FTC0_OFFSET 0x040 /* DMA Fault Type for DMA Channel 0 */
#define | XDmaPs_FTCn_OFFSET(ch) (XDMAPS_FTC0_OFFSET + (ch) * 4)
#define | XDMAPS_CS0_OFFSET 0x100 /* Channel Status for DMA Channel 0 */
#define | XDmaPs_CSn_OFFSET(ch) (XDMAPS_CS0_OFFSET + (ch) * 8)
#define | XDMAPS_CPC0_OFFSET
#define | XDmaPs_CPCn_OFFSET(ch) (XDMAPS_CPC0_OFFSET + (ch) * 8)
#define | XDMAPS_SA_0_OFFSET
#define | XDmaPs_SA_n_OFFSET(ch) (XDMAPS_SA_0_OFFSET + (ch) * 0x20)
#define | XDMAPS_DA_0_OFFSET
#define | XDmaPs_DA_n_OFFSET(ch) (XDMAPS_DA_0_OFFSET + (ch) * 0x20)
#define | XDMAPS_CC_0_OFFSET
#define | XDmaPs_CC_n_OFFSET(ch) (XDMAPS_CC_0_OFFSET + (ch) * 0x20)
#define | XDMAPS_LC0_0_OFFSET 0x40C /* Loop Counter 0 for DMA Channel 0 */
#define | XDmaPs_LC0_n_OFFSET(ch) (XDMAPS_LC0_0_OFFSET + (ch) * 0x20)
#define | XDMAPS_LC1_0_OFFSET 0x410 /* Loop Counter 1 for DMA Channel 0 */
#define | XDmaPs_LC1_n_OFFSET(ch) (XDMAPS_LC1_0_OFFSET + (ch) * 0x20)
#define | XDMAPS_DBGSTATUS_OFFSET 0xD00 /* Debug Status Register */
#define | XDMAPS_DBGCMD_OFFSET 0xD04 /* Debug Command Register */
#define | XDMAPS_DBGINST0_OFFSET 0xD08 /* Debug Instruction 0 Register */
#define | XDMAPS_DBGINST1_OFFSET 0xD0C /* Debug Instruction 1 Register */
#define | XDMAPS_CR0_OFFSET 0xE00 /* Configuration Register 0 */
#define | XDMAPS_CR1_OFFSET 0xE04 /* Configuration Register 1 */
#define | XDMAPS_CR2_OFFSET 0xE08 /* Configuration Register 2 */
#define | XDMAPS_CR3_OFFSET 0xE0C /* Configuration Register 3 */
#define | XDMAPS_CR4_OFFSET 0xE10 /* Configuration Register 4 */
#define | XDMAPS_CRDN_OFFSET 0xE14 /* Configuration Register Dn */
#define | XDMAPS_PERIPH_ID_0_OFFSET
#define | XDMAPS_PERIPH_ID_1_OFFSET
#define | XDMAPS_PERIPH_ID_2_OFFSET
#define | XDMAPS_PERIPH_ID_3_OFFSET
#define | XDMAPS_PCELL_ID_0_OFFSET
#define | XDMAPS_PCELL_ID_1_OFFSET
#define | XDMAPS_PCELL_ID_2_OFFSET
#define | XDMAPS_PCELL_ID_3_OFFSET
#define | XDMAPS_DS_DMA_STATUS 0x0F /* DMA status mask */
#define | XDMAPS_DS_DMA_STATUS_STOPPED 0x00 /* debug status busy mask */
#define | XDMAPS_DBGSTATUS_BUSY 0x01 /* debug status busy mask */
#define | XDMAPS_CS_ACTIVE_MASK
#define | XDMAPS_CR1_I_CACHE_LEN_MASK 0x07 /* i_cache_len mask */
#define | XDmaPs_DBGINST0(b1, b0, ch, dbg_th) (((b1) << 24) | ((b0) << 16) | (((ch) & 0x7) << 8) | ((dbg_th & 0x1)))

## Macro Definition Documentation

#define XDmaPs_WriteReg | ( |  | BaseAddress,
|  |  | RegOffset,
|  |  | RegisterValue
| ) |  | Xil_Out32((BaseAddress) + (RegOffset), (RegisterValue))

Write a DMAC register.

Parameters

  BaseAddress | contains the base address of the device.
  RegOffset | contains the offset from the base address of the device.
  RegisterValue | is the value to be written to the register.

Returns
  None.

Note
  C-Style signature: void XDmaPs_WriteReg(u32 BaseAddress, int RegOffset, u32 RegisterValue)

Referenced by XDmaPs_ResetHw(), and XDmaPs_Start().

## Typedef Documentation

typedef void(* XDmaPsDoneHandler)(unsigned int Channel, XDmaPs_Cmd *DmaCmd, void *CallbackRef)

It's the done handler a user can set for a channel.

typedef void(* XDmaPsFaultHandler)(unsigned int Channel, XDmaPs_Cmd *DmaCmd, void *CallbackRef)

It's the fault handler a user can set for a channel.

## Function Documentation

int XDmaPs_CfgInitialize | ( | XDmaPs * | InstPtr,
|  | XDmaPs_Config * | Config,
|  | u32 | EffectiveAddr
| ) |  |

Initializes a specific XDmaPs instance such that it is ready to be used.

The data format of the device is setup for 8 data bits, 1 stop bit, and no parity by default. The baud rate is set to a default value specified by Config->DefaultBaudRate if set, otherwise it is set to 19.2K baud. The receive FIFO threshold is set for 8 bytes. The default operating mode of the driver is polled mode.

Parameters

  InstPtr | is a pointer to the XDmaPs instance.
  Config | is a reference to a structure containing information about a specific XDmaPs driver.
  EffectiveAddr | is the device base address in the virtual memory address space. The caller is responsible for keeping the address mapping from EffectiveAddr to the device physical base address unchanged once this function is invoked. Unexpected errors may occur if the address mapping changes after this function is called. If address translation is not used, pass in the physical address instead.

Returns

          - XST_SUCCESS on initialization completion

Note
  None.

References XDmaPs_Config::BaseAddress, XDmaPs::CacheLength, XDmaPs_ChannelData::ChanId, XDmaPs::Chans, XDmaPs::Config, XDmaPs_Config::DeviceId, XDmaPs_ChannelData::DevId, and XDmaPs::IsReady.

Referenced by XDmaPs_Example_W_Intr().

int XDmaPs_ConstructNestedLoop | ( | char * | DmaProgStart,
|  | int | CacheLength,
|  | char * | DmaProgLoopStart,
|  | unsigned int | LoopCountOuter,
|  | unsigned int | LoopCountInner
| ) |  |

Construct a nested loop with only DMALD and DMAST in the inner loop body.

It uses loop counter 1 for the outer loop and loop counter 0 for the inner loop.

Parameters

  DmaProgStart | is the very start address of the DMA program. This is used to calculate whether the loop is in a cache line.
  CacheLength | is the icache line length, in terms of bytes. If it's zero, the performance enhancement feature will be turned off.
  DmaProgLoopStart | The starting address of the loop (DMALP).
  LoopCountOuter | The outer loop count. Loop count - 1 will be used to initialize the loop counter.
  LoopCountInner | The inner loop count. Loop count - 1 will be used to initialize the loop counter.

Returns
  The number byes the nested loop program has.

Note
  None.

References XDmaPs_ConstructSingleLoop().

int XDmaPs_ConstructSingleLoop | ( | char * | DmaProgStart,
|  | int | CacheLength,
|  | char * | DmaProgLoopStart,
|  | int | LoopCount
| ) |  |

Construct a loop with only DMALD and DMAST as the body using loop counter 0.

The function also makes sure the loop body and the lpend is in the same cache line.

Parameters

  DmaProgStart | is the very start address of the DMA program. This is used to calculate whether the loop is in a cache line.
  CacheLength | is the icache line length, in terms of bytes. If it's zero, the performance enhancement feature will be turned off.
  DmaProgLoopStart | The starting address of the loop (DMALP).
  LoopCount | The inner loop count. Loop count - 1 will be used to initialize the loop counter.

Returns
  The number of bytes the loop has.

Note
  None.

Referenced by XDmaPs_ConstructNestedLoop().

void XDmaPs_DoneISR_0 | ( | XDmaPs * | InstPtr | ) |

Driver done interrupt service routine for channel 0.

To avoid linking error,Declare all inline functions as extern for IAR compiler.

We need this done ISR mainly because the driver needs to release the DMA program buffer. This is the one that connects the GIC

Parameters

  InstPtr | is the DMA instance.

Returns
  None.

Note
  None.

Driver done interrupt service routines for the channels. We need this done ISR mainly because the driver needs to release the DMA program buffer. This is the one that connects the GIC

Referenced by SetupInterruptSystem().

void XDmaPs_DoneISR_1 | ( | XDmaPs * | InstPtr | ) |

Driver done interrupt service routine for channel 1.

We need this done ISR mainly because the driver needs to release the DMA program buffer. This is the one that connects the GIC

Parameters

  InstPtr | is the DMA instance.

Returns
  None.

Note
  None.

Referenced by SetupInterruptSystem().

void XDmaPs_DoneISR_2 | ( | XDmaPs * | InstPtr | ) |

Driver done interrupt service routine for channel 2.

We need this done ISR mainly because the driver needs to release the DMA program buffer. This is the one that connects the GIC

Parameters

  InstPtr | is the DMA instance.

Returns
  None.

Note
  None.

Referenced by SetupInterruptSystem().

void XDmaPs_DoneISR_3 | ( | XDmaPs * | InstPtr | ) |

Driver done interrupt service routine for channel 3.

We need this done ISR mainly because the driver needs to release the DMA program buffer. This is the one that connects the GIC

Parameters

  InstPtr | is the DMA instance.

Returns
  None.

Note
  None.

Referenced by SetupInterruptSystem().

void XDmaPs_DoneISR_4 | ( | XDmaPs * | InstPtr | ) |

Driver done interrupt service routine for channel 4.

We need this done ISR mainly because the driver needs to release the DMA program buffer. This is the one that connects the GIC

Parameters

  InstPtr | is the DMA instance.

Returns
  None.

Note
  None.

Referenced by SetupInterruptSystem().

void XDmaPs_DoneISR_5 | ( | XDmaPs * | InstPtr | ) |

Driver done interrupt service routine for channel 5.

We need this done ISR mainly because the driver needs to release the DMA program buffer. This is the one that connects the GIC

Parameters

  InstPtr | is the DMA instance.

Returns
  None.

Note
  None.

Referenced by SetupInterruptSystem().

void XDmaPs_DoneISR_6 | ( | XDmaPs * | InstPtr | ) |

Driver done interrupt service routine for channel 6.

We need this done ISR mainly because the driver needs to release the DMA program buffer. This is the one that connects the GIC

Parameters

  InstPtr | is the DMA instance.

Returns
  None.

Note
  None.

Referenced by SetupInterruptSystem().

void XDmaPs_DoneISR_7 | ( | XDmaPs * | InstPtr | ) |

Driver done interrupt service routine for channel 7.

We need this done ISR mainly because the driver needs to release the DMA program buffer. This is the one that connects the GIC

Parameters

  InstPtr | is the DMA instance.

Returns
  None.

Note
  None.

Referenced by SetupInterruptSystem().

void XDmaPs_FaultISR | ( | XDmaPs * | InstPtr | ) |

Driver fault interrupt service routine This is the one that connects the GIC.

Driver fault interrupt service routine.

Parameters

  InstPtr | is the DMA instance.

Returns
  None.

Note
  None.

References XDmaPs_Config::BaseAddress, XDmaPs_Cmd::ChanFaultPCAddr, XDmaPs_Cmd::ChanFaultType, XDmaPs::Chans, XDmaPs::Config, XDmaPs_Config::DeviceId, XDmaPs_ChannelData::DmaCmdFromHw, XDmaPs_ChannelData::DmaCmdToHw, XDmaPs_Cmd::DmaStatus, XDmaPs::FaultHandler, XDmaPs::FaultRef, XDmaPs_Cmd::GeneratedDmaProg, XDmaPs_ChannelData::HoldDmaProg, and XDmaPs_ChannelData::ProgBufPool.

Referenced by SetupInterruptSystem().

int XDmaPs_FreeDmaProg | ( | XDmaPs * | InstPtr,
|  | unsigned int | Channel,
|  | XDmaPs_Cmd * | Cmd
| ) |  |

Free the DMA program buffer that is pointed by the GeneratedDmaProg field of the command.

Parameters

  InstPtr | is then DMA instance.
  Channel | is the DMA channel number.
  Cmd | is the DMA command.

Returns
  XST_SUCCESS on success. XST_FAILURE if there is any error.

Note
  None.

References XDmaPs::Chans, XDmaPs_Cmd::GeneratedDmaProg, XDmaPs_Cmd::GeneratedDmaProgLength, and XDmaPs_ChannelData::ProgBufPool.

int XDmaPs_GenDmaProg | ( | XDmaPs * | InstPtr,
|  | unsigned int | Channel,
|  | XDmaPs_Cmd * | Cmd
| ) |  |

Generate a DMA program based for the DMA command, the buffer will be pointed by the GeneratedDmaProg field of the command.

Parameters

  InstPtr | is then DMA instance.
  Channel | is the DMA channel number.
  Cmd | is the DMA command.

Returns
  - XST_SUCCESS on success.
  - XST_FAILURE if it fails

Note
  None.

References XDmaPs_Cmd::BD, XDmaPs::CacheLength, XDmaPs_Cmd::ChanCtrl, XDmaPs::Chans, XDmaPs_BD::DstAddr, XDmaPs_ChanCtrl::DstBurstLen, XDmaPs_ChanCtrl::DstBurstSize, XDmaPs_ChanCtrl::DstInc, XDmaPs_Cmd::GeneratedDmaProg, XDmaPs_Cmd::GeneratedDmaProgLength, XDmaPs_ChannelData::ProgBufPool, XDmaPs_BD::SrcAddr, XDmaPs_ChanCtrl::SrcBurstLen, XDmaPs_ChanCtrl::SrcBurstSize, XDmaPs_ChanCtrl::SrcInc, and XDmaPs_Print_DmaProg().

Referenced by XDmaPs_Start().

int XDmaPs_Instr_DMARMB | ( | char * | DmaProg | ) |

Construction function for DMARMB instruction.

This function fills the program buffer with the constructed instruction.

Parameters

  DmaProg | is the DMA program buffer, it's the starting address for the instruction being constructed

Returns
  The number of bytes for this instruction which is 1.

Note
  None.

int XDmaPs_Instr_DMAWMB | ( | char * | DmaProg | ) |

Construction function for DMAWMB instruction.

This function fills the program buffer with the constructed instruction.

Parameters

  DmaProg | is the DMA program buffer, it's the starting address for the instruction being constructed

Returns
  The number of bytes for this instruction which is 1.

Note
  None.

int XDmaPs_IsActive | ( | XDmaPs * | InstPtr,
|  | unsigned int | Channel
| ) |  |

Checks whether the DMA channel is active or idle.

Parameters

  InstPtr | is the DMA instance.
  Channel | is the DMA channel number.

Returns
  0: if the channel is idle 1: otherwise

Note
  None.

References XDmaPs::Chans, and XDmaPs_ChannelData::DmaCmdToHw.

Referenced by XDmaPs_Start().

XDmaPs_Config * XDmaPs_LookupConfig | ( | u16 | DeviceId | ) |

Looks up the device configuration based on the unique device ID.

The table contains the configuration info for each device in the system.

Parameters

  DeviceId | contains the ID of the device

Returns

A pointer to the configuration structure or NULL if the specified device is not in the system.

Note

None.

Referenced by XDmaPs_Example_W_Intr().

void XDmaPs_Print_DmaProg | ( | XDmaPs_Cmd * | Cmd | ) |

Print the Dma Prog Contents.

Parameters

  Cmd | is the command buffer.

Returns
  None.

Note
  None.

References XDmaPs_Cmd::GeneratedDmaProg, XDmaPs_Cmd::GeneratedDmaProgLength, XDmaPs_Cmd::UserDmaProg, and XDmaPs_Cmd::UserDmaProgLength.

Referenced by XDmaPs_GenDmaProg().

int XDmaPs_ResetChannel | ( | XDmaPs * | InstPtr,
|  | unsigned int | Channel
| ) |  |

Reset the specified DMA Channel.

Parameters

  InstPtr | is the DMA instance.
  Channel | is the channel to be reset.

Returns
  0 on success, -1 on time out

Note
  None.

References XDmaPs_Config::BaseAddress, and XDmaPs::Config.

void XDmaPs_ResetHw | ( | u32 | BaseAddress | ) |

This function perform the reset sequence to the given dmaps interface by configuring the appropriate control bits in the dmaps specifc registers the dmaps reset squence involves the following steps Disable all the interuupts Clear the pending interrupts Kill all the active channel threads Kill the manager thread.

Parameters

  BaseAddress | of the interface

Returns
  N/A

Note
  This function will not modify the slcr registers that are relavant for dmaps controller

References XDmaPs_WriteReg.

int XDmaPs_ResetManager | ( | XDmaPs * | InstPtr | ) |

Reset the DMA Manager.

Parameters

  InstPtr | is the DMA instance.

Returns
  0 on success, -1 on time out

Note
  None.

References XDmaPs_Config::BaseAddress, and XDmaPs::Config.

int XDmaPs_SelfTest | ( | XDmaPs * | InstPtr | ) |

This function runs a self-test on the driver and hardware device.

This self test performs a local loopback and verifies data can be sent and received.

The time for this test is proportional to the baud rate that has been set prior to calling this function.

The mode and control registers are restored before return.

Parameters

  InstPtr | is a pointer to the XDmaPs instance

Returns

          - XST_SUCCESS if the test was successful
          - XST_FAILURE if the test failed

Note

This function can hang if the hardware is not functioning properly.

References XDmaPs_Config::BaseAddress, and XDmaPs::Config.

int XDmaPs_SetDoneHandler | ( | XDmaPs * | InstPtr,
|  | unsigned | Channel,
|  | XDmaPsDoneHandler | DoneHandler,
|  | void * | CallbackRef
| ) |  |

Set the done handler for a channel.

Parameters

  InstPtr | is the DMA instance.
  Channel | is the channel number.
  DoneHandler | is the done interrupt handler.
  CallbackRef | is the callback reference data.

Returns
  None.

Note
  None.

References XDmaPs::Chans, XDmaPs_ChannelData::DoneHandler, and XDmaPs_ChannelData::DoneRef.

Referenced by XDmaPs_Example_W_Intr().

int XDmaPs_SetFaultHandler | ( | XDmaPs * | InstPtr,
|  | XDmaPsFaultHandler | FaultHandler,
|  | void * | CallbackRef
| ) |  |

Set the fault handler for a channel.

Parameters

  InstPtr | is the DMA instance.
  FaultHandler | is the fault interrupt handler.
  CallbackRef | is the callback reference data.

Returns
  None.

Note
  None.

References XDmaPs::FaultHandler, and XDmaPs::FaultRef.

int XDmaPs_Start | ( | XDmaPs * | InstPtr,
|  | unsigned int | Channel,
|  | XDmaPs_Cmd * | Cmd,
|  | int | HoldDmaProg
| ) |  |

Start a DMA command.

The command can only be invoked when the channel is idle. The driver takes the command, generates DMA program if needed, then pass the program to DMAC to execute.

Parameters

  InstPtr | is then DMA instance.
  Channel | is the DMA channel number.
  Cmd | is the DMA command.
  HoldDmaProg | is tag indicating whether the driver can release the allocated DMA buffer or not. If a user wants to examine the generated DMA program, the flag should be set to 1. After the DMA program is finished, a user needs to explicity free the buffer.

Returns
  - XST_SUCCESS on success
  - XST_DEVICE_BUSY if DMA is busy
  - XST_FAILURE on other failures

Note
  None.

References XDmaPs_Config::BaseAddress, XDmaPs_Cmd::BD, XDmaPs_Cmd::ChanCtrl, XDmaPs::Chans, XDmaPs::Config, XDmaPs_ChannelData::DmaCmdToHw, XDmaPs_Cmd::DmaStatus, XDmaPs_BD::DstAddr, XDmaPs_ChanCtrl::DstInc, XDmaPs_Cmd::GeneratedDmaProg, XDmaPs_ChannelData::HoldDmaProg, XDmaPs_BD::Length, XDmaPs_BD::SrcAddr, XDmaPs_ChanCtrl::SrcInc, XDmaPs_Cmd::UserDmaProg, XDmaPs_GenDmaProg(), XDmaPs_IsActive(), and XDmaPs_WriteReg.

Referenced by XDmaPs_Example_W_Intr().

u32 XDmaPs_ToCCRValue | ( | XDmaPs_ChanCtrl * | ChanCtrl | ) |

Conversion function from PL330 bus transfer descriptors to CCR value.

All the values passed to the functions are in terms of assembly languages, not in terms of the register bit encoding.

Parameters

  ChanCtrl | is the Instance of XDmaPs_ChanCtrl.

Returns
  The 32-bit CCR value.

Note
  None.

References XDmaPs_ChanCtrl::DstBurstLen, XDmaPs_ChanCtrl::DstBurstSize, XDmaPs_ChanCtrl::DstCacheCtrl, XDmaPs_ChanCtrl::DstInc, XDmaPs_ChanCtrl::DstProtCtrl, XDmaPs_ChanCtrl::EndianSwapSize, XDmaPs_ChanCtrl::SrcBurstLen, XDmaPs_ChanCtrl::SrcBurstSize, XDmaPs_ChanCtrl::SrcCacheCtrl, XDmaPs_ChanCtrl::SrcInc, and XDmaPs_ChanCtrl::SrcProtCtrl.

## Variable Documentation

XDmaPs_Config XDmaPs_ConfigTable[]

Each XDmaPs device in the system has an entry in this table.

XDmaPs_Config XDmaPs_ConfigTable[]

Initial value:
= {
{
XPAR_XDMAPS_0_DEVICE_ID,
XPAR_XDMAPS_0_BASEADDR,
},
}

Each XDmaPs device in the system has an entry in this table.