![]() |
csudma
Vitis Drivers API Documentation
|
Macros | |
#define | XCSUDMA_WORD_SIZE (4U) |
Transfer size conversion to bytes for Versal Net. More... | |
#define | XCSUDMA_H_ |
Prevent circular inclusions by using protection macros. More... | |
#define | XCSUDMA_HW_H_ |
Prevent circular inclusions by using protection macros. More... | |
#define | XCsuDma_In32 Xil_In32 |
Input operation. More... | |
#define | XCsuDma_Out32 Xil_Out32 |
Output operation. More... | |
#define | XCsuDma_ReadReg(BaseAddress, RegOffset) XCsuDma_In32((BaseAddress) + (u32)(RegOffset)) |
This macro reads the given register. More... | |
#define | XCsuDma_WriteReg(BaseAddress, RegOffset, Data) XCsuDma_Out32((BaseAddress) + (u32)(RegOffset), (u32)(Data)) |
This macro writes the value into the given register. More... | |
Enumerations | |
enum | XCsuDma_Channel { XCSUDMA_SRC_CHANNEL = 0U, XCSUDMA_DST_CHANNEL } |
This typedef contains CSU_DMA Channel Types. More... | |
Functions | |
s32 | XCsuDma_CfgInitialize (XCsuDma *InstancePtr, XCsuDma_Config *CfgPtr, UINTPTR EffectiveAddr) |
This function initializes CSU_DMA core. More... | |
void | XCsuDma_Transfer (XCsuDma *InstancePtr, XCsuDma_Channel Channel, u64 Addr, u32 Size, u8 EnDataLast) |
This function sets the starting address and size of the data to be transferred from/to the memory through the AXI interface. More... | |
void | XCsuDma_64BitTransfer (XCsuDma *InstancePtr, XCsuDma_Channel Channel, u32 AddrLow, u32 AddrHigh, u32 Size, u8 EnDataLast) |
This function sets the starting address and size of the data to be transferred from/to the memory through the AXI interface. More... | |
u64 | XCsuDma_GetAddr (XCsuDma *InstancePtr, XCsuDma_Channel Channel) |
This function returns the current address location of the memory, from where it has to read the data(SRC) or the location where it has to write the data (DST) based on the channel selection. More... | |
u32 | XCsuDma_GetSize (XCsuDma *InstancePtr, XCsuDma_Channel Channel) |
This function returns the size of the data yet to be transferred from memory to CSU_DMA or CSU_DMA to memory based on the channel selection. More... | |
void | XCsuDma_Pause (XCsuDma *InstancePtr, XCsuDma_Channel Channel, XCsuDma_PauseType Type) |
This function pauses the Channel data transfer to/from memory or to/from stream based on pause type. More... | |
s32 | XCsuDma_IsPaused (XCsuDma *InstancePtr, XCsuDma_Channel Channel, XCsuDma_PauseType Type) |
This function checks whether Channel memory/stream is paused based on the given pause type. More... | |
void | XCsuDma_Resume (XCsuDma *InstancePtr, XCsuDma_Channel Channel, XCsuDma_PauseType Type) |
This function resumes the channel if it is in paused state and continues where it has left. More... | |
u32 | XCsuDma_GetCheckSum (XCsuDma *InstancePtr) |
This function returns the sum of all the data read from AXI memory. More... | |
void | XCsuDma_ClearCheckSum (XCsuDma *InstancePtr) |
This function clears the check sum of the data read from AXI memory. More... | |
u32 | XCsuDma_WaitForDoneTimeout (XCsuDma *InstancePtr, XCsuDma_Channel Channel) |
This function polls for completion of data transfer periodically until the DMA done bit set or until the timeout occurs. More... | |
void | XCsuDma_SetConfig (XCsuDma *InstancePtr, XCsuDma_Channel Channel, XCsuDma_Configure *ConfigurValues) |
This function configures all the values of CSU_DMA Channels with the values of updated XCsuDma_Configure structure. More... | |
void | XCsuDma_GetConfig (XCsuDma *InstancePtr, XCsuDma_Channel Channel, XCsuDma_Configure *ConfigurValues) |
This function updates XCsuDma_Configure structure members with the configured values of CSU_DMA's Channel. More... | |
u32 | XCsuDma_IntrGetStatus (XCsuDma *InstancePtr, XCsuDma_Channel Channel) |
This function returns interrupt status read from Interrupt Status Register. More... | |
void | XCsuDma_IntrClear (XCsuDma *InstancePtr, XCsuDma_Channel Channel, u32 Mask) |
This function clears interrupt(s). More... | |
void | XCsuDma_EnableIntr (XCsuDma *InstancePtr, XCsuDma_Channel Channel, u32 Mask) |
This function enables the interrupt(s). More... | |
void | XCsuDma_DisableIntr (XCsuDma *InstancePtr, XCsuDma_Channel Channel, u32 Mask) |
This function disables the interrupt(s). More... | |
u32 | XCsuDma_GetIntrMask (XCsuDma *InstancePtr, XCsuDma_Channel Channel) |
This function returns the interrupt mask to know which interrupts are enabled and which of them were disaled. More... | |
s32 | XCsuDma_SelfTest (XCsuDma *InstancePtr) |
This function runs a self-test on the driver and hardware device. More... | |
XCsuDma_Config * | XCsuDma_LookupConfig (u16 DeviceId) |
XCsuDma_LookupConfig returns a reference to an XCsuDma_Config structure based on the unique device id, DeviceId. More... | |
Registers offsets | |
#define | XCSUDMA_ADDR_OFFSET 0x000U |
Address Register Offset. More... | |
#define | XCSUDMA_SIZE_OFFSET 0x004U |
Size Register Offset. More... | |
#define | XCSUDMA_STS_OFFSET 0x008U |
Status Register Offset. More... | |
#define | XCSUDMA_CTRL_OFFSET 0x00CU |
Control Register Offset. More... | |
#define | XCSUDMA_I_STS_OFFSET 0x014U |
Interrupt Status Register Offset. More... | |
Size register bit masks and shifts | |
#define | XCSUDMA_SIZE_MASK 0x1FFFFFFCU |
Mask for size. More... | |
#define | XCSUDMA_LAST_WORD_MASK 0x00000001U |
Last word check bit mask. More... | |
#define | XCSUDMA_SIZE_SHIFT 2U |
Shift for size. More... | |
Interrupt Enable/Disable/Mask/Status registers bit masks | |
#define | XCSUDMA_IXR_FIFO_OVERFLOW_MASK 0x00000001U |
FIFO overflow mask, it is valid only to Destination Channel. More... | |
#define | XCSUDMA_IXR_INVALID_APB_MASK 0x00000040U |
Invalid APB access mask. More... | |
#define | XCSUDMA_IXR_FIFO_THRESHHIT_MASK 0x00000020U |
FIFO threshold hit indicator mask. More... | |
#define | XCSUDMA_IXR_TIMEOUT_MEM_MASK 0x00000010U |
Time out counter expired to access memory mask. More... | |
#define | XCSUDMA_IXR_TIMEOUT_STRM_MASK 0x00000008U |
Time out counter expired to access stream mask. More... | |
#define | XCSUDMA_IXR_AXI_WRERR_MASK 0x00000004U |
AXI Read/Write error mask. More... | |
#define | XCSUDMA_IXR_DONE_MASK 0x00000002U |
Done mask. More... | |
#define | XCSUDMA_IXR_MEM_DONE_MASK 0x00000001U |
Memory done mask, it is valid only for source channel. More... | |
#define | XCSUDMA_IXR_SRC_MASK 0x0000007FU |
((XCSUDMA_IXR_INVALID_APB_MASK)| (XCSUDMA_IXR_FIFO_THRESHHIT_MASK) | (XCSUDMA_IXR_TIMEOUT_MEM_MASK) | (XCSUDMA_IXR_TIMEOUT_STRM_MASK) | (XCSUDMA_IXR_AXI_WRERR_MASK) | (XCSUDMA_IXR_DONE_MASK) | (XCSUDMA_IXR_MEM_DONE_MASK)) More... | |
#define | XCSUDMA_IXR_DST_MASK 0x000000FEU |
((XCSUDMA_IXR_FIFO_OVERFLOW_MASK) | (XCSUDMA_IXR_INVALID_APB_MASK) | (XCSUDMA_IXR_FIFO_THRESHHIT_MASK) | (XCSUDMA_IXR_TIMEOUT_MEM_MASK) | (XCSUDMA_IXR_TIMEOUT_STRM_MASK) | (XCSUDMA_IXR_AXI_WRERR_MASK) | (XCSUDMA_IXR_DONE_MASK)) More... | |
Software done timeout value | |
#define | XCSUDMA_DONE_TIMEOUT_VAL 300000000U |
SW timeout loop value for transfer completion. More... | |
#define XCSUDMA_ADDR_OFFSET 0x000U |
Address Register Offset.
Referenced by XCsuDma_64BitTransfer(), XCsuDma_GetAddr(), and XCsuDma_Transfer().
#define XCSUDMA_CTRL_OFFSET 0x00CU |
Control Register Offset.
Referenced by XCsuDma_GetConfig(), XCsuDma_IsPaused(), XCsuDma_Pause(), XCsuDma_Resume(), XCsuDma_SelfTest(), and XCsuDma_SetConfig().
#define XCSUDMA_DONE_TIMEOUT_VAL 300000000U |
SW timeout loop value for transfer completion.
Referenced by XCsuDma_WaitForDoneTimeout().
#define XCSUDMA_H_ |
Prevent circular inclusions by using protection macros.
#define XCSUDMA_HW_H_ |
Prevent circular inclusions by using protection macros.
#define XCSUDMA_I_STS_OFFSET 0x014U |
Interrupt Status Register Offset.
Referenced by XCsuDma_IntrClear(), XCsuDma_IntrGetStatus(), and XCsuDma_WaitForDoneTimeout().
#define XCsuDma_In32 Xil_In32 |
Input operation.
#define XCSUDMA_IXR_AXI_WRERR_MASK 0x00000004U |
AXI Read/Write error mask.
#define XCSUDMA_IXR_DONE_MASK 0x00000002U |
Done mask.
Referenced by XCsuDma_IntrExample(), XCsuDma_PolledExample(), and XCsuDma_WaitForDoneTimeout().
#define XCSUDMA_IXR_DST_MASK 0x000000FEU |
((XCSUDMA_IXR_FIFO_OVERFLOW_MASK) |
(XCSUDMA_IXR_INVALID_APB_MASK) | (XCSUDMA_IXR_FIFO_THRESHHIT_MASK) | (XCSUDMA_IXR_TIMEOUT_MEM_MASK) | (XCSUDMA_IXR_TIMEOUT_STRM_MASK) | (XCSUDMA_IXR_AXI_WRERR_MASK) | (XCSUDMA_IXR_DONE_MASK))
All interrupt mask for destination
Referenced by XCsuDma_DisableIntr(), XCsuDma_EnableIntr(), and XCsuDma_IntrClear().
#define XCSUDMA_IXR_FIFO_OVERFLOW_MASK 0x00000001U |
FIFO overflow mask, it is valid only to Destination Channel.
#define XCSUDMA_IXR_FIFO_THRESHHIT_MASK 0x00000020U |
FIFO threshold hit indicator mask.
#define XCSUDMA_IXR_INVALID_APB_MASK 0x00000040U |
Invalid APB access mask.
#define XCSUDMA_IXR_MEM_DONE_MASK 0x00000001U |
Memory done mask, it is valid only for source channel.
#define XCSUDMA_IXR_SRC_MASK 0x0000007FU |
((XCSUDMA_IXR_INVALID_APB_MASK)|
(XCSUDMA_IXR_FIFO_THRESHHIT_MASK) | (XCSUDMA_IXR_TIMEOUT_MEM_MASK) | (XCSUDMA_IXR_TIMEOUT_STRM_MASK) | (XCSUDMA_IXR_AXI_WRERR_MASK) | (XCSUDMA_IXR_DONE_MASK) | (XCSUDMA_IXR_MEM_DONE_MASK))
All interrupt mask for source
Referenced by XCsuDma_DisableIntr(), XCsuDma_EnableIntr(), and XCsuDma_IntrClear().
#define XCSUDMA_IXR_TIMEOUT_MEM_MASK 0x00000010U |
Time out counter expired to access memory mask.
#define XCSUDMA_IXR_TIMEOUT_STRM_MASK 0x00000008U |
Time out counter expired to access stream mask.
#define XCSUDMA_LAST_WORD_MASK 0x00000001U |
Last word check bit mask.
Referenced by XCsuDma_64BitTransfer(), and XCsuDma_Transfer().
#define XCsuDma_Out32 Xil_Out32 |
Output operation.
#define XCsuDma_ReadReg | ( | BaseAddress, | |
RegOffset | |||
) | XCsuDma_In32((BaseAddress) + (u32)(RegOffset)) |
This macro reads the given register.
BaseAddress | Base address of the CSU_DMA core. |
RegOffset | Register offset of the register. |
Referenced by XCsuDma_GetAddr(), XCsuDma_GetCheckSum(), XCsuDma_GetConfig(), XCsuDma_GetIntrMask(), XCsuDma_GetSize(), XCsuDma_IntrGetStatus(), XCsuDma_IsPaused(), XCsuDma_Pause(), XCsuDma_Resume(), XCsuDma_SelfTest(), and XCsuDma_SetConfig().
#define XCSUDMA_SIZE_MASK 0x1FFFFFFCU |
Mask for size.
#define XCSUDMA_SIZE_OFFSET 0x004U |
Size Register Offset.
Referenced by XCsuDma_64BitTransfer(), XCsuDma_GetSize(), and XCsuDma_Transfer().
#define XCSUDMA_SIZE_SHIFT 2U |
Shift for size.
Referenced by XCsuDma_64BitTransfer(), XCsuDma_GetSize(), and XCsuDma_Transfer().
#define XCSUDMA_STS_OFFSET 0x008U |
Status Register Offset.
#define XCSUDMA_WORD_SIZE (4U) |
Transfer size conversion to bytes for Versal Net.
Referenced by XCsuDma_64BitTransfer(), and XCsuDma_Transfer().
#define XCsuDma_WriteReg | ( | BaseAddress, | |
RegOffset, | |||
Data | |||
) | XCsuDma_Out32((BaseAddress) + (u32)(RegOffset), (u32)(Data)) |
This macro writes the value into the given register.
BaseAddress | Base address of the CSU_DMA core. |
RegOffset | Register offset of the register. |
Data | 32-bit value to write to the register. |
Referenced by XCsuDma_64BitTransfer(), XCsuDma_ClearCheckSum(), XCsuDma_DisableIntr(), XCsuDma_EnableIntr(), XCsuDma_IntrClear(), XCsuDma_Pause(), XCsuDma_Resume(), XCsuDma_SelfTest(), XCsuDma_SetConfig(), and XCsuDma_Transfer().
enum XCsuDma_Channel |
void XCsuDma_64BitTransfer | ( | XCsuDma * | InstancePtr, |
XCsuDma_Channel | Channel, | ||
u32 | AddrLow, | ||
u32 | AddrHigh, | ||
u32 | Size, | ||
u8 | EnDataLast | ||
) |
This function sets the starting address and size of the data to be transferred from/to the memory through the AXI interface.
This function is useful for pmu processor to execute a 64-bit DMA transfer.
InstancePtr | Pointer to XCsuDma instance to be worked on. |
Channel | Type of channel Source channel - XCSUDMA_SRC_CHANNEL Destination Channel - XCSUDMA_DST_CHANNEL |
AddrLow | Bit variable which holds the starting lower address of data which needs to write into the memory(DST) (or read from the memory(SRC)). |
AddrHigh | 32 bit variable which holds the higher address of data which needs to write into the memory(DST) (or read from the memoroy(SRC)). |
Size | 32 bit variable which represents the number of 4 byte words to be transferred from starting address. |
EnDataLast | Trigger an end of message. Enables or disable data_inp_last signal to stream interface when current command is completed. Only applicable for the source channel; ignored for destination channel.
|
References XCsuDma_Config::BaseAddress, XCsuDma::Config, XCsuDma::IsReady, XCSUDMA_ADDR_OFFSET, XCSUDMA_DST_CHANNEL, XCSUDMA_LAST_WORD_MASK, XCSUDMA_SIZE_MAX, XCSUDMA_SIZE_OFFSET, XCSUDMA_SIZE_SHIFT, XCSUDMA_SRC_CHANNEL, XCSUDMA_WORD_SIZE, and XCsuDma_WriteReg.
s32 XCsuDma_CfgInitialize | ( | XCsuDma * | InstancePtr, |
XCsuDma_Config * | CfgPtr, | ||
UINTPTR | EffectiveAddr | ||
) |
This function initializes CSU_DMA core.
This function must be called prior using a CSU_DMA core. Initialization of an CSU_DMA includes setting up the instance data and ensuring the hardware is in a quiescent state.
InstancePtr | Pointer to the XCsuDma instance. |
CfgPtr | Reference to a structure containing information about a specific XCsuDma instance. |
EffectiveAddr | 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. |
References XCsuDma_Config::BaseAddress, XCsuDma::Config, XCsuDma_Config::DmaType, XCsuDma::IsReady, XCSUDMA_DMATYPEIS_CSUDMA, and XCsuDma_Reset.
Referenced by XCsuDma_IntrExample(), XCsuDma_PolledExample(), and XCsuDma_SelfTestExample().
void XCsuDma_ClearCheckSum | ( | XCsuDma * | InstancePtr | ) |
This function clears the check sum of the data read from AXI memory.
It is valid only for CSU_DMA source channel.
InstancePtr | Pointer to XCsuDma instance to be worked on. |
References XCsuDma_Config::BaseAddress, XCsuDma::Config, and XCsuDma_WriteReg.
void XCsuDma_DisableIntr | ( | XCsuDma * | InstancePtr, |
XCsuDma_Channel | Channel, | ||
u32 | Mask | ||
) |
This function disables the interrupt(s).
Use the XCSUDMA_IXR_*_MASK constants defined in xcsudma_hw.h to create the bit-mask to disable interrupts.
InstancePtr | Pointer to XCsuDma instance to be worked on. |
Channel | Type of channel Source channel - XCSUDMA_SRC_CHANNEL Destination Channel - XCSUDMA_DST_CHANNEL |
Mask | Contains interrupts to be disabled.
|
References XCsuDma_Config::BaseAddress, XCsuDma::Config, XCSUDMA_DST_CHANNEL, XCSUDMA_IXR_DST_MASK, XCSUDMA_IXR_SRC_MASK, XCSUDMA_SRC_CHANNEL, and XCsuDma_WriteReg.
Referenced by XCsuDma_IntrExample().
void XCsuDma_EnableIntr | ( | XCsuDma * | InstancePtr, |
XCsuDma_Channel | Channel, | ||
u32 | Mask | ||
) |
This function enables the interrupt(s).
Use the XCSUDMA_IXR_*_MASK constants defined in xcsudma_hw.h to create the bit-mask to enable interrupts.
InstancePtr | Pointer to XCsuDma instance to be worked on. |
Channel | Type of channel Source channel - XCSUDMA_SRC_CHANNEL Destination Channel - XCSUDMA_DST_CHANNEL |
Mask | Contains interrupts to be enabled.
|
References XCsuDma_Config::BaseAddress, XCsuDma::Config, XCSUDMA_DST_CHANNEL, XCSUDMA_IXR_DST_MASK, XCSUDMA_IXR_SRC_MASK, XCSUDMA_SRC_CHANNEL, and XCsuDma_WriteReg.
Referenced by XCsuDma_IntrExample().
u64 XCsuDma_GetAddr | ( | XCsuDma * | InstancePtr, |
XCsuDma_Channel | Channel | ||
) |
This function returns the current address location of the memory, from where it has to read the data(SRC) or the location where it has to write the data (DST) based on the channel selection.
InstancePtr | Pointer to XCsuDma instance to be worked on. |
Channel | Type of channel Source channel - XCSUDMA_SRC_CHANNEL Destination Channel - XCSUDMA_DST_CHANNEL |
References XCsuDma_Config::BaseAddress, XCsuDma::Config, XCSUDMA_ADDR_OFFSET, XCSUDMA_DST_CHANNEL, XCsuDma_ReadReg, and XCSUDMA_SRC_CHANNEL.
u32 XCsuDma_GetCheckSum | ( | XCsuDma * | InstancePtr | ) |
This function returns the sum of all the data read from AXI memory.
It is valid only when using the CSU_DMA source channel.
InstancePtr | Pointer to XCsuDma instance to be worked on. |
References XCsuDma_Config::BaseAddress, XCsuDma::Config, XCsuDma::IsReady, and XCsuDma_ReadReg.
void XCsuDma_GetConfig | ( | XCsuDma * | InstancePtr, |
XCsuDma_Channel | Channel, | ||
XCsuDma_Configure * | ConfigurValues | ||
) |
This function updates XCsuDma_Configure structure members with the configured values of CSU_DMA's Channel.
InstancePtr | Pointer to XCsuDma instance to be worked on. |
Channel | Type of channel Source channel - XCSUDMA_SRC_CHANNEL Destination Channel - XCSUDMA_DST_CHANNEL |
ConfigurValues | Pointer to the structure XCsuDma_Configure whose members are updated with configurations of CSU_DMA core.
|
References XCsuDma_Configure::Acache, XCsuDma_Configure::ApbErr, XCsuDma_Configure::AxiBurstType, XCsuDma_Config::BaseAddress, XCsuDma::Config, XCsuDma_Configure::EndianType, XCsuDma_Configure::FifoThresh, XCsuDma_Configure::MaxOutCmds, XCsuDma_Configure::RouteBit, XCsuDma_Configure::SssFifoThesh, XCsuDma_Configure::TimeoutEn, XCsuDma_Configure::TimeoutPre, XCsuDma_Configure::TimeoutValue, XCSUDMA_CTRL_OFFSET, XCSUDMA_DST_CHANNEL, XCsuDma_ReadReg, and XCSUDMA_SRC_CHANNEL.
u32 XCsuDma_GetIntrMask | ( | XCsuDma * | InstancePtr, |
XCsuDma_Channel | Channel | ||
) |
This function returns the interrupt mask to know which interrupts are enabled and which of them were disaled.
InstancePtr | Pointer to XCsuDma instance to be worked on. |
Channel | Type of channel Source channel - XCSUDMA_SRC_CHANNEL Destination Channel - XCSUDMA_DST_CHANNEL |
References XCsuDma_Config::BaseAddress, XCsuDma::Config, XCSUDMA_DST_CHANNEL, XCsuDma_ReadReg, and XCSUDMA_SRC_CHANNEL.
u32 XCsuDma_GetSize | ( | XCsuDma * | InstancePtr, |
XCsuDma_Channel | Channel | ||
) |
This function returns the size of the data yet to be transferred from memory to CSU_DMA or CSU_DMA to memory based on the channel selection.
InstancePtr | Pointer to XCsuDma instance to be worked on. |
Channel | Type of channel Source channel - XCSUDMA_SRC_CHANNEL Destination Channel - XCSUDMA_DST_CHANNEL |
References XCsuDma_Config::BaseAddress, XCsuDma::Config, XCSUDMA_DST_CHANNEL, XCsuDma_ReadReg, XCSUDMA_SIZE_OFFSET, XCSUDMA_SIZE_SHIFT, and XCSUDMA_SRC_CHANNEL.
void XCsuDma_IntrClear | ( | XCsuDma * | InstancePtr, |
XCsuDma_Channel | Channel, | ||
u32 | Mask | ||
) |
This function clears interrupt(s).
Every bit set in Interrupt Status Register indicates that a specific type of interrupt is occurring, and this function clears one or more interrupts by writing a bit mask to Interrupt Clear Register.
InstancePtr | Pointer to XCsuDma instance to be worked on. |
Channel | Type of channel Source channel - XCSUDMA_SRC_CHANNEL Destination Channel - XCSUDMA_DST_CHANNEL |
Mask | Mask to clear. Bit positions of 1 will be cleared. Bit positions of 0 will not change the previous interrupt status. This mask is formed by OR'ing XCSUDMA_IXR_* bits defined in xcsudma_hw.h. |
References XCsuDma_Config::BaseAddress, XCsuDma::Config, XCSUDMA_DST_CHANNEL, XCSUDMA_I_STS_OFFSET, XCSUDMA_IXR_DST_MASK, XCSUDMA_IXR_SRC_MASK, XCSUDMA_SRC_CHANNEL, and XCsuDma_WriteReg.
Referenced by XCsuDma_IntrExample(), and XCsuDma_PolledExample().
u32 XCsuDma_IntrGetStatus | ( | XCsuDma * | InstancePtr, |
XCsuDma_Channel | Channel | ||
) |
This function returns interrupt status read from Interrupt Status Register.
Use the XCSUDMA_IXR_*_MASK constants defined in xcsudma_hw.h to interpret the returned value.
InstancePtr | Pointer to XCsuDma instance to be worked on. |
Channel | Type of channel Source channel - XCSUDMA_SRC_CHANNEL Destination Channel - XCSUDMA_DST_CHANNEL |
References XCsuDma_Config::BaseAddress, XCsuDma::Config, XCSUDMA_DST_CHANNEL, XCSUDMA_I_STS_OFFSET, XCsuDma_ReadReg, and XCSUDMA_SRC_CHANNEL.
s32 XCsuDma_IsPaused | ( | XCsuDma * | InstancePtr, |
XCsuDma_Channel | Channel, | ||
XCsuDma_PauseType | Type | ||
) |
This function checks whether Channel memory/stream is paused based on the given pause type.
InstancePtr | Pointer to XCsuDma instance to be worked on. |
Channel | Type of channel Source channel - XCSUDMA_SRC_CHANNEL Destination Channel - XCSUDMA_DST_CHANNEL |
Type | Type of the pause which needs to be checked.
|
References XCsuDma_Config::BaseAddress, XCsuDma::Config, XCSUDMA_CTRL_OFFSET, XCSUDMA_DST_CHANNEL, XCSUDMA_PAUSE_MEMORY, XCSUDMA_PAUSE_STREAM, XCsuDma_ReadReg, and XCSUDMA_SRC_CHANNEL.
XCsuDma_Config* XCsuDma_LookupConfig | ( | u16 | DeviceId | ) |
XCsuDma_LookupConfig returns a reference to an XCsuDma_Config structure based on the unique device id, DeviceId.
The return value will refer to an entry in the device configuration table defined in the xcsudma_g.c file.
DeviceId | Unique device ID of the device for the lookup operation. |
Referenced by XCsuDma_IntrExample(), XCsuDma_PolledExample(), and XCsuDma_SelfTestExample().
void XCsuDma_Pause | ( | XCsuDma * | InstancePtr, |
XCsuDma_Channel | Channel, | ||
XCsuDma_PauseType | Type | ||
) |
This function pauses the Channel data transfer to/from memory or to/from stream based on pause type.
InstancePtr | Pointer to XCsuDma instance to be worked on. |
Channel | Type of channel Source channel - XCSUDMA_SRC_CHANNEL Destination Channel - XCSUDMA_DST_CHANNEL |
Type | Type of pause to be enabled.
|
References XCsuDma_Config::BaseAddress, XCsuDma::Config, XCsuDma::IsReady, XCSUDMA_CTRL_OFFSET, XCSUDMA_DST_CHANNEL, XCSUDMA_PAUSE_MEMORY, XCSUDMA_PAUSE_STREAM, XCsuDma_ReadReg, XCSUDMA_SRC_CHANNEL, and XCsuDma_WriteReg.
void XCsuDma_Resume | ( | XCsuDma * | InstancePtr, |
XCsuDma_Channel | Channel, | ||
XCsuDma_PauseType | Type | ||
) |
This function resumes the channel if it is in paused state and continues where it has left.
Based on the type of pause, there is no effect if it is not in paused state.
InstancePtr | Pointer to XCsuDma instance to be worked on. |
Channel | Type of channel Source channel - XCSUDMA_SRC_CHANNEL Destination Channel - XCSUDMA_DST_CHANNEL |
Type | Type of pause to be resumed if it is paused.
|
References XCsuDma_Config::BaseAddress, XCsuDma::Config, XCsuDma::IsReady, XCSUDMA_CTRL_OFFSET, XCSUDMA_DST_CHANNEL, XCSUDMA_PAUSE_MEMORY, XCSUDMA_PAUSE_STREAM, XCsuDma_ReadReg, XCSUDMA_SRC_CHANNEL, and XCsuDma_WriteReg.
s32 XCsuDma_SelfTest | ( | XCsuDma * | InstancePtr | ) |
This function runs a self-test on the driver and hardware device.
Performs reset of both source and destination channels and checks if reset is working properly or not.
InstancePtr | Pointer to the XCsuDma instance. |
References XCsuDma_Config::BaseAddress, XCsuDma::Config, XCSUDMA_CTRL_OFFSET, XCsuDma_ReadReg, and XCsuDma_WriteReg.
Referenced by XCsuDma_IntrExample(), XCsuDma_PolledExample(), and XCsuDma_SelfTestExample().
void XCsuDma_SetConfig | ( | XCsuDma * | InstancePtr, |
XCsuDma_Channel | Channel, | ||
XCsuDma_Configure * | ConfigurValues | ||
) |
This function configures all the values of CSU_DMA Channels with the values of updated XCsuDma_Configure structure.
InstancePtr | Pointer to XCsuDma instance to be worked on. |
Channel | Type of channel Source channel - XCSUDMA_SRC_CHANNEL Destination Channel - XCSUDMA_DST_CHANNEL |
ConfigurValues | Pointer to the structure XCsuDma_Configure whose values are used to configure CSU_DMA core.
|
References XCsuDma_Configure::Acache, XCsuDma_Configure::ApbErr, XCsuDma_Configure::AxiBurstType, XCsuDma_Config::BaseAddress, XCsuDma::Config, XCsuDma_Configure::EndianType, XCsuDma_Configure::FifoThresh, XCsuDma::IsReady, XCsuDma_Configure::MaxOutCmds, XCsuDma_Configure::RouteBit, XCsuDma_Configure::SssFifoThesh, XCsuDma_Configure::TimeoutEn, XCsuDma_Configure::TimeoutPre, XCsuDma_Configure::TimeoutValue, XCSUDMA_CTRL_OFFSET, XCSUDMA_DST_CHANNEL, XCsuDma_ReadReg, XCSUDMA_SRC_CHANNEL, and XCsuDma_WriteReg.
void XCsuDma_Transfer | ( | XCsuDma * | InstancePtr, |
XCsuDma_Channel | Channel, | ||
u64 | Addr, | ||
u32 | Size, | ||
u8 | EnDataLast | ||
) |
This function sets the starting address and size of the data to be transferred from/to the memory through the AXI interface.
InstancePtr | Pointer to XCsuDma instance to be worked on. |
Channel | Type of channel Source channel - XCSUDMA_SRC_CHANNEL Destination Channel - XCSUDMA_DST_CHANNEL |
Addr | 64 bit variable which holds the starting address of data which needs to write into the memory(DST) (or read from the memory(SRC)). |
Size | 32 bit variable which represents the number of 4 byte words needs to be transferred from starting address. |
EnDataLast | Triggers an end of the message. Enables or disables data_inp_last signal to stream interface when current command is completed. It is applicable only to source channel; ignored for destination channel.
|
References XCsuDma_Config::BaseAddress, XCsuDma::Config, XCsuDma::IsReady, XCSUDMA_ADDR_OFFSET, XCSUDMA_DST_CHANNEL, XCSUDMA_LAST_WORD_MASK, XCSUDMA_SIZE_MAX, XCSUDMA_SIZE_OFFSET, XCSUDMA_SIZE_SHIFT, XCSUDMA_SRC_CHANNEL, XCSUDMA_WORD_SIZE, and XCsuDma_WriteReg.
Referenced by XCsuDma_IntrExample(), and XCsuDma_PolledExample().
u32 XCsuDma_WaitForDoneTimeout | ( | XCsuDma * | InstancePtr, |
XCsuDma_Channel | Channel | ||
) |
This function polls for completion of data transfer periodically until the DMA done bit set or until the timeout occurs.
InstancePtr | Pointer to XCsuDma instance to be worked on. |
Channel | Type of channel Source channel - XCSUDMA_SRC_CHANNEL Destination Channel - XCSUDMA_DST_CHANNEL |
References XCsuDma_Config::BaseAddress, XCsuDma::Config, XCSUDMA_DONE_TIMEOUT_VAL, XCSUDMA_DST_CHANNEL, XCSUDMA_I_STS_OFFSET, XCSUDMA_IXR_DONE_MASK, and XCSUDMA_SRC_CHANNEL.