Alt_avalon_sgdma_construct_mem_to_mem_desc(), Alt_avalon_sgdma_construct_mem_to_mem_desc() -19 – Altera Embedded Peripherals IP User Manual

Page 210

Advertising
background image

Thread-safe:

No.

Available from

ISR:

Not recommended.

Include:

<altera_avalon_sgdma.h>, <altera_avalon_sgdma_descriptor.h>, <altera_

avalon_sgdma_regs.h>

Parameters:

*dev—a pointer to an SG-DMA device structure.
*desc—a pointer to a single, constructed descriptor. The descriptor must have its

“next” descriptor field initialized either to a non-ready descriptor, or to the next

descriptor in the chain.

Returns:

Returns the contents of the status register.

Description:

Sends a fully formed descriptor or list of descriptors to the SG-DMA controller

for transfer. This function blocks both before transfer, if the SG-DMA controller

is busy, and until the requested transfer has completed. If an error is detected

during the transfer, it is abandoned and the controller’s status register contents

are returned to the caller. Additional error information is available in the status

bits of each descriptor that the SG-DMA processed. The user application

searches through the descriptor or list of descriptors to gather specific error

information. The run bit is cleared before the begining of the transfer and is set

to 1 to restart a new descriptor chain.

alt_avalon_sgdma_construct_mem_to_mem_desc()

Prototype:

void alt_avalon_sgdma_construct_mem_to_mem_desc(alt_sgdma_descriptor

*desc, alt_sgdma_descriptor *next, alt_u32 *read_addr, alt_u32 *write_addr, alt_

u16 length, int read_fixed, int write_fixed)

Thread-safe:

Yes.

Available from

ISR:

Yes.

Include:

<altera_avalon_sgdma.h>, <altera_avalon_sgdma_descriptor.h>, <altera_

avalon_sgdma_regs.h>

Parameters:

*desc—a pointer to the descriptor being constructed.
*next—a pointer to the “next” descriptor. This does not need to be a complete or

functional descriptor, but must be properly allocated.
*read_addr—the first read address for the SG-DMA transfer.
*write_addr—the first write address for the SG-DMA transfer.
length—the number of bytes for the transfer.
read_fixed—if non-zero, the SG-DMA reads from a fixed address.
write_fixed—if non-zero, the SG-DMA writes to a fixed address.

Returns:

void

UG-01085

2014.24.07

alt_avalon_sgdma_construct_mem_to_mem_desc()

21-19

Scatter-Gather DMA Controller Core

Altera Corporation

Send Feedback

Advertising