This section contains APIs for UDMA initialization.
Few utility APIs to copy/fill frames are implemented in this library
using the UDMA LLD for convenience of application code.
For algorithms it is recommended to use the UDMA LLD APIs directly
or UDMA DMA copy API present in PDK to avoid additional layer of
software overhead.
|
| int32_t | appUdmaInit (void) |
| | Performs initializations needed for UDMA. More...
|
| |
| int32_t | appUdmaDeInit (void) |
| | Performs de-initializations needed for UDMA. More...
|
| |
| void * | appUdmaGetObj (void) |
| | Provides global handle to UDMA Obj. More...
|
| |
| int32_t | appUdmaCopyInit (void) |
| | DMA copy init function. More...
|
| |
| int32_t | appUdmaCopyDeinit (void) |
| | DMA copy deinit function. More...
|
| |
| app_udma_ch_handle_t | appUdmaCopyCreate (const app_udma_create_prms_t *prms) |
| | DMA copy create channel function. More...
|
| |
| int32_t | appUdmaCopyDelete (app_udma_ch_handle_t ch_handle) |
| | DMA copy delete channel function. More...
|
| |
| int32_t | appUdmaCopy1D (app_udma_ch_handle_t ch_handle, const app_udma_copy_1d_prms_t *prms_1d) |
| | DMA copy 1D DMA copy function. More...
|
| |
| int32_t | appUdmaCopy2D (app_udma_ch_handle_t ch_handle, const app_udma_copy_2d_prms_t *prms_2d, uint32_t num_transfers) |
| | DMA copy 2D DMA copy function. More...
|
| |
| int32_t | appUdmaFill2D (app_udma_ch_handle_t ch_handle, const app_udma_copy_2d_prms_t *prms_2d, uint32_t num_transfers) |
| | DMA copy 2D DMA memfill function. More...
|
| |
| app_udma_ch_handle_t | appUdmaCopyNDGetHandle (uint32_t ch_idx) |
| | Return handle to ND copy channel, if not already created, CH is created here. More...
|
| |
| int32_t | appUdmaCopyNDReleaseHandle (uint32_t ch_idx) |
| | Releases reference to channel handle, if found to be last reference deletes the handle. More...
|
| |
| int32_t | appUdmaCopyNDInit (app_udma_ch_handle_t ch_handle, const app_udma_copy_nd_prms_t *prms_nd) |
| | DMA copy ND init function. More...
|
| |
| int32_t | appUdmaCopyNDDeinit (app_udma_ch_handle_t ch_handle) |
| | DMA copy ND de-init function. More...
|
| |
| int32_t | appUdmaCopyNDTrigger (app_udma_ch_handle_t ch_handle) |
| | DMA copy ND trigger function. More...
|
| |
| int32_t | appUdmaCopyNDWait (app_udma_ch_handle_t ch_handle) |
| | DMA copy ND wait function. More...
|
| |
| void | appUdmaCopyNDPrmsPrint (app_udma_copy_nd_prms_t *prm, char *name) |
| | Prints params values. More...
|
| |
| static void | appUdmaCreatePrms_Init (app_udma_create_prms_t *prms) |
| | Set defaults for app_udma_create_prms_t structure. More...
|
| |
| static void | appUdmaCopy1DPrms_Init (app_udma_copy_1d_prms_t *prms_1d) |
| | Set defaults for app_udma_copy_1d_prms_t structure. More...
|
| |
| static void | appUdmaCopy2DPrms_Init (app_udma_copy_2d_prms_t *prms_2d) |
| | Set defaults for app_udma_copy_2d_prms_t structure. More...
|
| |
| static void | appUdmaCopyNDPrms_Init (app_udma_copy_nd_prms_t *prms_nd) |
| | Set defaults for app_udma_copy_nd_prms_t structure. More...
|
| |
| int32_t | appUdmaTest (void) |
| | DMA copy test function. More...
|
| |
◆ APP_UDMA_ND_CHANNELS_MAX
| #define APP_UDMA_ND_CHANNELS_MAX (16U) |
max number of ND copy channels one can open
◆ app_udma_ch_handle_t
◆ appUdmaInit()
| int32_t appUdmaInit |
( |
void |
| ) |
|
Performs initializations needed for UDMA.
- Returns
- 0 incase of success else returns failure code
◆ appUdmaDeInit()
| int32_t appUdmaDeInit |
( |
void |
| ) |
|
Performs de-initializations needed for UDMA.
- Returns
- 0 incase of success else returns failure code
◆ appUdmaGetObj()
| void* appUdmaGetObj |
( |
void |
| ) |
|
Provides global handle to UDMA Obj.
- Returns
- 0 incase of success else returns failure code
◆ appUdmaCopyInit()
| int32_t appUdmaCopyInit |
( |
void |
| ) |
|
DMA copy init function.
This should be called before calling other function. This function creates the default DMA channel required for API which passes NULL as the channel object.
- Returns
- 0 incase of success else returns failure code
◆ appUdmaCopyDeinit()
| int32_t appUdmaCopyDeinit |
( |
void |
| ) |
|
DMA copy deinit function.
This function frees up the default DMA channel allocated during init.
- Returns
- 0 incase of success else returns failure code
◆ appUdmaCopyCreate()
DMA copy create channel function.
This function allocates a memcpy DMA channel and initialize the DMA channel for data transfer. This is an optional function which can be used to create more DMA channel apart from the default DMA channel allocated during init.
- Parameters
-
| prms | [IN] Pointer to channel params. Caller should initialize this structure using appUdmaCreatePrms_Init before modifying the content to ensure backward compatibility. |
- Returns
- Pointer to channel object which will get initialized and contexts are stored. The channel object memory is allocated by this call and returned. This API returns NULL incase of failure.
◆ appUdmaCopyDelete()
DMA copy delete channel function.
This function frees-up DMA channel and all associated resources.
- Parameters
-
- Returns
- 0 incase of success else returns failure code
◆ appUdmaCopy1D()
DMA copy 1D DMA copy function.
This function will initiate a 1D DMA copy operation.
- Parameters
-
| ch_handle | [IN] Pointer to channel object already created through appUdmaCopyCreate. If NULL is passed, the API will use the default handle created during init. |
| prms_1d | [IN] Pointer to 1D transfer params. This can't be NULL. |
- Returns
- 0 incase of success else returns failure code
◆ appUdmaCopy2D()
DMA copy 2D DMA copy function.
This function will initiate a 2D DMA copy operation.
- Parameters
-
| ch_handle | [IN] Pointer to channel object already created through appUdmaCopyCreate. If NULL is passed, the API will use the default handle created during init. |
| prms_2d | [IN] Pointer to 2D transfer params. This can't be NULL. This could be an array of params depending on num_transfers parameter |
| num_transfers | [IN] The API will iterate through this many number of transfers. |
- Returns
- 0 incase of success else returns failure code
◆ appUdmaFill2D()
DMA copy 2D DMA memfill function.
This function will initiate a 2D DMA memfill operation. The only difference between this and appUdmaCopy2D is that this API assumes that the source buffer is just oneline worth of data and will setup the DMA parameter such that the DMA keeps reading the same one line source buffer and fill the destination buffer
- Parameters
-
| ch_handle | [IN] Pointer to channel object already created through appUdmaCopyCreate. If NULL is passed, the API will use the default handle created during init. |
| prms_2d | [IN] Pointer to 2D transfer params. This can't be NULL. This could be an array of params depending on num_transfers parameter |
| num_transfers | [IN] The API will iterate through this many number of transfers. |
- Returns
- 0 incase of success else returns failure code
◆ appUdmaCopyNDGetHandle()
Return handle to ND copy channel, if not already created, CH is created here.
- Parameters
-
| ch_idx | [IN] channel index to use, upto APP_UDMA_ND_CHANNELS_MAX are allowed |
- Returns
- Pointer to channel object, if unable to create CH then NULL is returned;
◆ appUdmaCopyNDReleaseHandle()
| int32_t appUdmaCopyNDReleaseHandle |
( |
uint32_t |
ch_idx | ) |
|
Releases reference to channel handle, if found to be last reference deletes the handle.
- Parameters
-
| ch_idx | [IN] channel index to use, upto APP_UDMA_ND_CHANNELS_MAX are allowed |
- Returns
- 0 incase of success else returns failure code
◆ appUdmaCopyNDInit()
DMA copy ND init function.
This function will setup a N-Dimension (upto 4) DMA copy operation based on "prms_nd" transfer params.
- Parameters
-
| ch_handle | [IN] Pointer to channel object already created through appUdmaCopyCreate. If NULL is passed, the API will use the default handle created during init. |
| prms_nd | [IN] Pointer to ND transfer params. This can't be NULL. |
- Returns
- 0 incase of success else returns failure code
◆ appUdmaCopyNDDeinit()
DMA copy ND de-init function.
This function will setup a N-Dimension (upto 4) DMA copy operation based on "prms_nd" transfer params.
- Parameters
-
| ch_handle | [IN] Pointer to channel object already created through appUdmaCopyCreate. If NULL is passed, the API will use the default handle created during init. |
- Returns
- 0 incase of success else returns failure code
◆ appUdmaCopyNDTrigger()
DMA copy ND trigger function.
This function will initiate a N-Dimension (upto 4) DMA copy operation based on "copy_mode" option set in prms_nd transfer params.
- Parameters
-
| ch_handle | [IN] Pointer to channel object already created through appUdmaCopyCreate. If NULL is passed, the API will use the default handle created during init. |
- Returns
- 0 incase of success else returns failure code
◆ appUdmaCopyNDWait()
DMA copy ND wait function.
This function will wait for a N-Dimension (upto 4) DMA copy operation based on "copy_mode" option set in prms_nd transfer params.
- Parameters
-
| ch_handle | [IN] Pointer to channel object already created through appUdmaCopyCreate. If NULL is passed, the API will use the default handle created during init. |
- Returns
- 0 incase of success else returns failure code
◆ appUdmaCopyNDPrmsPrint()
◆ appUdmaCreatePrms_Init()
◆ appUdmaCopy1DPrms_Init()
◆ appUdmaCopy2DPrms_Init()
◆ appUdmaCopyNDPrms_Init()
◆ appUdmaTest()
| int32_t appUdmaTest |
( |
void |
| ) |
|
DMA copy test function.
This function tests basic features of DMA copy. This could be called from vision apps test function. And not to be used by other application
- Returns
- 0 incase of success else returns failure code