7.6.4.3 Function dma_allocate()

Allocate a DMA with configurations.

enum status_code dma_allocate( struct dma_resource * resource, struct dma_resource_config * config)

This function will allocate a proper channel for a DMA transfer request.

Table 7-8. Parameters
Data directionParameter nameDescription

[in, out]

dma_resource

Pointer to a DMA resource instance

[in]

transfer_config

Configurations of the DMA transfer

Returns

Status of the allocation procedure.

Table 7-9. Return Values
Return valueDescription

STATUS_OK

The DMA resource was allocated successfully

STATUS_ERR_NOT_FOUND

DMA resource allocation failed