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.
Data Structures | |
struct | app_udma_init_prms_t |
UDMA init parameters. More... | |
struct | app_udma_create_prms_t |
Parameter to use when creating a logical DMA channel To avoid compatibility issues, user should called appUdmaCreatePrms_Init() to set default values for all params in this structure. More... | |
struct | app_udma_copy_1d_prms_t |
1D transfer request parameters More... | |
struct | app_udma_copy_2d_prms_t |
2D transfer request parameters More... | |
struct | app_udma_copy_nd_prms_t |
ND transfer request parameters. More... | |
Functions | |
void * | appUdmaCsirxCsitxGetObj (void) |
Provides global handle to UDMA Obj BCDMA instance Required for CSIRX/CSITX on J721S2. More... | |
void | appUdmaInitPrmSetDefault (app_udma_init_prms_t *prm) |
Sets default UDMA init parameters. More... | |
int32_t | appUdmaInit (const app_udma_init_prms_t *prms) |
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 | appUdmaTest (void) |
DMA copy test function. 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... | |
Typedefs | |
typedef void * | app_udma_ch_handle_t |
App UDMA channel handle. More... | |
Macros | |
#define | APP_UDMA_ND_CHANNELS_MAX (16U) |
max number of ND copy channels one can open More... | |
#define APP_UDMA_ND_CHANNELS_MAX (16U) |
max number of ND copy channels one can open
typedef void* app_udma_ch_handle_t |
App UDMA channel handle.
void* appUdmaCsirxCsitxGetObj | ( | void | ) |
Provides global handle to UDMA Obj BCDMA instance Required for CSIRX/CSITX on J721S2.
void appUdmaInitPrmSetDefault | ( | app_udma_init_prms_t * | prm | ) |
Sets default UDMA init parameters.
prms | [IN] Pointer to UDMA init params |
int32_t appUdmaInit | ( | const app_udma_init_prms_t * | prms | ) |
Performs initializations needed for UDMA.
prms | [IN] Pointer to UDMA init params |
int32_t appUdmaDeInit | ( | void | ) |
Performs de-initializations needed for UDMA.
void* appUdmaGetObj | ( | void | ) |
Provides global handle to UDMA Obj.
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
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.
int32_t appUdmaCopyDeinit | ( | void | ) |
DMA copy deinit function.
This function frees up the default DMA channel allocated during init.
app_udma_ch_handle_t appUdmaCopyCreate | ( | const app_udma_create_prms_t * | prms | ) |
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.
prms | [IN] Pointer to channel params. Caller should initialize this structure using appUdmaCreatePrms_Init before modifying the content to ensure backward compatibility. |
int32_t appUdmaCopyDelete | ( | app_udma_ch_handle_t | ch_handle | ) |
DMA copy delete channel function.
This function frees-up DMA channel and all associated resources.
ch_handle | [IN] Pointer to channel object already created through appUdmaCopyCreate |
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.
This function will initiate a 1D DMA copy operation.
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. |
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.
This function will initiate a 2D DMA copy operation.
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. |
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.
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
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. |
app_udma_ch_handle_t appUdmaCopyNDGetHandle | ( | uint32_t | ch_idx | ) |
Return handle to ND copy channel, if not already created, CH is created here.
ch_idx | [IN] channel index to use, upto APP_UDMA_ND_CHANNELS_MAX are allowed |
int32_t appUdmaCopyNDReleaseHandle | ( | uint32_t | ch_idx | ) |
Releases reference to channel handle, if found to be last reference deletes the handle.
ch_idx | [IN] channel index to use, upto APP_UDMA_ND_CHANNELS_MAX are allowed |
int32_t appUdmaCopyNDInit | ( | app_udma_ch_handle_t | ch_handle, |
const app_udma_copy_nd_prms_t * | prms_nd | ||
) |
DMA copy ND init function.
This function will setup a N-Dimension (upto 4) DMA copy operation based on "prms_nd" transfer params.
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. |
int32_t appUdmaCopyNDDeinit | ( | app_udma_ch_handle_t | ch_handle | ) |
DMA copy ND de-init function.
This function will setup a N-Dimension (upto 4) DMA copy operation based on "prms_nd" transfer params.
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. |
int32_t appUdmaCopyNDTrigger | ( | app_udma_ch_handle_t | ch_handle | ) |
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.
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. |
int32_t appUdmaCopyNDWait | ( | app_udma_ch_handle_t | ch_handle | ) |
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.
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. |
void appUdmaCopyNDPrmsPrint | ( | app_udma_copy_nd_prms_t * | prm, |
char * | name | ||
) |
Prints params values.
|
inlinestatic |
Set defaults for app_udma_create_prms_t structure.
prms | [OUT] Parameters to init to default value |
|
inlinestatic |
Set defaults for app_udma_copy_1d_prms_t structure.
prms_1d | [OUT] Parameters to init to default value |
|
inlinestatic |
Set defaults for app_udma_copy_2d_prms_t structure.
prms_2d | [OUT] Parameters to init to default value |
|
inlinestatic |
Set defaults for app_udma_copy_nd_prms_t structure.
prms_nd | [OUT] Parameters to init to default value |