DMA
Direct Memory Access (DMA) APIs. More...
Modules | |
Types | |
DMA data types. | |
Functions | |
gos_result_t | gos_dma_alloc (gos_handler_t callback, void *arg, gos_dma_channel_t *channel_ptr) |
Allocate a DMA channel. More... | |
gos_result_t | gos_dma_free (gos_dma_channel_t channel) |
Free a DMA channel. More... | |
Detailed Description
Direct Memory Access (DMA) APIs.
Function Documentation
◆ gos_dma_alloc()
gos_result_t gos_dma_alloc | ( | gos_handler_t | callback, |
void * | arg, |
||
gos_dma_channel_t * | channel_ptr |
||
) |
Allocate a DMA channel.
Allocates a DMA channel from the kernel. The returned channel will be exclusively available to the user application.
- Note
- It is imperative to use this API to allocate channels which will be manually accessed by the application to prevent conflicts with the kernel's use of DMA.
- You must use gos_dma_free() to de-allocate the channel once it is no longer needed.
- Parameters
-
[in] callback
function to be called when a DMA transfer on the channel returned by this function is complete. This function will execute in the IRQ context. [in] arg
argument to pass to callback function [out] channel_ptr
Pointer to hold channel number of allocated DMA channel
- Returns
- result of API call
◆ gos_dma_free()
gos_result_t gos_dma_free | ( | gos_dma_channel_t | channel | ) |
Free a DMA channel.
Release a channel allocated by gos_dma_alloc.
- Parameters
-
[in] channel
DMA channel to free
- Returns
- result of API call