beautypg.com

Alt_avalon_sgdma_register_callback(), Alt_avalon_sgdma_start(), Alt_avalon_sgdma_register_callback() -23 – Altera Embedded Peripherals IP User Manual

Page 214: Alt_avalon_sgdma_start() -23

background image

Parameters:

*desc—a pointer to the constructed descriptor to examine.

Returns:

Returns 0 if the descriptor is error-free, not owned by hardware, or a previously

requested transfer completed normally. Other return codes are defined in

errno.h.

Description:

Checks a descriptor previously owned by hardware for any errors reported in a

previous transfer. The routine reports: errors reported by the SG-DMA

controller, the buffer in use.

alt_avalon_sgdma_register_callback()

Prototype:

void alt_avalon_sgdma_register_callback(alt_sgdma_dev *dev, alt_avalon_

sgdma_callback callback, alt_u16 chain_control, void *context)

Thread-safe:

Yes.

Available from

ISR:

Yes.

Include:

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

avalon_sgdma_regs.h>

Parameters:

*dev—a pointer to the SG-DMA device structure.
callback—a pointer to the callback routine to execute at interrupt level.
chain_control—the SG-DMA control register contents.
*context—a pointer used to pass context-specific information to the ISR. context

can point to any ISR-specific information.

Returns:

void

Description:

Associates a user-specific routine with the SG-DMA interrupt handler. If a

callback is registered, all non-blocking transfers enables interrupts that causes

the callback to be executed. The callback runs as part of the interrupt service

routine, and care must be taken to follow the guidelines for acceptable interrupt

service routine behavior as described in the

Nios II Software Developer’s

Handbook

.

To disable callbacks after registering one, call this routine with 0x0 as the

callback argument.

alt_avalon_sgdma_start()

Prototype:

void alt_avalon_sgdma_start(alt_sgdma_dev *dev)

Thread-safe:

No.

Available from

ISR:

Yes.

Include:

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

avalon_sgdma_regs.h>

UG-01085

2014.24.07

alt_avalon_sgdma_register_callback()

21-23

Scatter-Gather DMA Controller Core

Altera Corporation

Send Feedback