API Documentation
Direct Memory Access support¶
-
group
dma
Typedefs
-
typedef uint32_t
dma_transfer_handle_t
¶ DMA transfer handle
The DMA transfer handle is used when calling the DMA functions
Enums
-
enum
dma_success_t
¶ OpTiMSoC dma success code
The OpTiMSoC dma success code indicated the success of an operation.
Values:
-
enumerator
DMA_SUCCESS
¶ Successful operation
-
enumerator
DMA_ERR_NOTINITIALIZED
¶ Driver not initialized
-
enumerator
DMA_ERR_NOSLOT
¶ No slot available
-
enumerator
DMA_ERR_NOTALLOCATED
¶ Slot not allocated
-
enumerator
Functions
-
void
dma_init
(void)¶ Initialize DMA driver
Initialize the DMA driver. Necessary before calling it the first time
-
dma_success_t
dma_alloc
(dma_transfer_handle_t *id)¶ Allocate a DMA transfer slot and get handle
This function allocates a DMA slot. DMA transfers are handled asynchronously and each of the ongoing transfers is controlled by one slot in the DMA controller. You therefore need to allocate a slot before starting transfers.
- Return
Success code
- Parameters
[out] id
: The handle of this slot
-
dma_success_t
dma_free
(dma_transfer_handle_t id)¶ Free a pre-allocated DMA transfer slot
- Return
DMA_SUCCESS if successful, any other value indicates an error
- Parameters
id
: the handle to free
-
dma_success_t
dma_transfer
(void *local, uint32_t remote_tile, void *remote, size_t size, dma_direction_t dir, dma_transfer_handle_t id)¶ Initiate a DMA transfer
This function initiates a DMA transfer between the local address in this tile to remote_tile address remote of size. The direction of the transfer is determined by dir. The slot id will be used for this transfer.
- Return
Success code
- Parameters
local
: Local addressremote_tile
: Remote tileremote
: Remote addresssize
: Size of the transferdir
: Direction of the transferid
: Handle of the slot as allocated by dma_alloc
-
dma_success_t
dma_wait
(dma_transfer_handle_t id)¶ Blocking wait for DMA transfer
Wait for a DMA transfer to finish and block.
- Return
Success code
- Parameters
id
: The handle of the transfer slot
-
typedef uint32_t