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 1. Parameters
Data direction Parameter name Description

[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 2. Return Values
Return value Description

STATUS_OK

The DMA resource was allocated successfully

STATUS_ERR_NOT_FOUND

DMA resource allocation failed