📄 csl_edma.h
字号:
*
* @b Example
* @verbatim
...
CSL_sysInit( NULL );
if (CSL_SOK != CSL_edmaInit( NULL )) {
return;
}
@endverbatim
*
*
* ============================================================================
*/
CSL_Status
CSL_edmaInit (
CSL_EdmaContext * pContext
);
/** =============================================================================
* @n@b CSL_edmaOpen
*
* @b Description
* @n Returns a handle to the EDMA Module. This handle is further used
* for invoking all module level control APIs.
* This function merely returns a handle to the register overlay structure.
* This call enables the relocatability of code since the handle can be
* subsequently used for Module level control commands rather than the
* usage of the register layer base address directly.
*
* @b Arguments
* @verbatim
hEdma Handle to EDMA instance
pEdmaObj Pointer to the EDMA instance object
edmaNum Instance of the EDMA to be opened.
pEdmaParam Pointer to module specific parameters
pStatus pointer for returning status of the function call
@endverbatim
*
* <b> Return Value </b>
* CSL_EdmaHandle
* Valid EDMA instance handle will be returned if status value is
* equal to CSL_SOK.
*
* <b> Pre Condition </b>
* @n @a CSL_edmaInit() must be called successfully.
*
* <b> Post Condition </b>
* @n None
*
* @b Modifies
* @n None
*
* @b Example:
* @verbatim
CSL_status status;
CSL_EdmaObj edmaObj;
CSL_EdmaHandle hEdma;
hEdma = CSL_EdmaOpen (&edmaObj, CSL_EDMA, NULL, &status);
@endverbatim
*
* ===========================================================================
*/
CSL_EdmaHandle CSL_edmaOpen(
/* EDMA Module Object pointer. This is NULL. */
CSL_EdmaObj *edmaObj,
/** instance of EDMA */
CSL_InstNum edmaNum,
/** EDMA Param pointer i.e NULL in this case */
CSL_EdmaModuleParam *param,
/** CSL Status */
CSL_Status *status
);
/** ===========================================================================
* @n@b CSL_edmaClose
*
* @brief
* The EDMA module handlde is invalidated and in order to
* use the EDMA module it needs to be opened again.
*
* @b Arguments
* @verbatim
hEdma Handle to the EDMA instance
@endverbatim
*
* <b> Return Value CSL_Status
* @li CSL_SOK - EDMA is closed
* successfully
*
* @li CSL_ESYS_BADHANDLE - The handle passed is invalid
*
* <b> Pre Condition
* @n None
*
* <b> Post Condition
* @n 1. The EDMA CSL APIs can not be called until the EDMA
* CSL is reopened again using CSL_uartOpen()
*
* @b Modifies
* @n None
*
* <b> Usage Constraints: </b>
* Both @a CSL_edmaInit() and @a CSL_edmaOpen() must be called successfully
* in that order before @a CSL_edmaClose() can be called.
*
* @b Example:
* @verbatim
CSL_EdmaHandle hEdma;
...
CSL_edmaClose(hEdma);
@endverbatim
*
*
* ============================================================================
*/
CSL_Status CSL_edmaClose(
CSL_EdmaHandle hEdma
);
/* Module Level Control APIs */
/** ============================================================================
* @n@b CSL_emdaHwControl
*
* @b Description
* @n Takes a command with an optional argument & implements it. This function is
* used to carry out the different operations performed by EDMA
*
*
* @b Arguments
* @verbatim
hEdma Handle to the EDMA instance
cmd Operation to be performed on the EDMA
arg Additional command arguments are passed to the API
using this. The CSL function type casts to the
appropriate arguments type depending on
* the cmd.
@endverbatim
*
* <b> Return Value </b> CSL_Status
* @li CSL_SOK - Command execution successful.
* @li CSL_ESYS_BADHANDLE - Invalid handle
* @li CSL_ESYS_INVCMD - Invalid command
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Registers of the EDMA instance are configured according to the command
* and the command arguments. The command determines which registers are
* modified.
*
* @b Modifies
* @n Registers determined by the command
*
* <b> Usage Constraints: </b>
* Both CSL_edmaInit() and CSL_edmaOpen() must be called successfully
* in that order before CSL_edmaHwControl() can be called. For the
* argument type that can be void* casted & passed with a particular command
* refer to CSL_EdmaHwControlCmd
*
* @b Example:
* @verbatim
CSL_EdmaHandle hModHndl;
CSL_Status modStatus;
// Initialize
modStatus = CSL_edmaInit(NULL);
...
hModHndl = CSL_edmaOpen(NULL,CSL_EDMA_0,NULL,&modStatus);
// Interrupt 5,6,7 enable
intrEn[0] = 0xE0;
intrEn[1] = 0x00;
status = CSL_edmaHwControl(hModHndl,CSL_EDMA_CMD_INTERRUPT_ENABLE, intrEn);
@endverbatim
*
*
* ============================================================================
*/
CSL_Status CSL_edmaHwControl
(
/** Pointer to the object that holds reference to the
* instance of EDMA requested after the call */
CSL_EdmaHandle hMod,
/** The command to this API which indicates the action to be taken */
CSL_EdmaHwControlCmd cmd,
/** Optional argument @a void* casted */
void *cmdArg
);
/** ============================================================================
* @n@b CSL_edmaccGetModuleBaseAddr
*
* @b Description
* @n This function is used for getting the base-address of the peripheral
* instance. This function will be called inside the @ CSL_edmaOpen()/
* CSL_edmaChannelOpen()/CSL_edmaRegionOpen()
* function call.
*
* Note: This function is open for re-implementing if the user wants to modify
* the base address of the peripheral object to point to a different
* location and there by allow CSL initiated write/reads into peripheral
* MMR's go to an alternate location. Please refer the documentation for
* more details.
*
* @b Arguments
* @verbatim
hEdma Pointer to the peripheral data object of the
external memory interface instance
emdaNum Specifies the instance of the external memory
interface for which the base address is requested
pEdmaParam Module specific parameters.
pBaseAddress Pointer to the base address structure to return the
base address details.
@endverbatim
*
* <b> Return Value </b> CSL_Status
* @li CSL_OK Open call is successful
* @li CSL_ESYS_FAIL The external memory interface
* instance is not available.
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Base address structure is populated
*
* @b Modifies
* @n 1. The status variable
*
* 2. Base address structure.
*
* @b Example:
* @verbatim
CSL_Status status;
CSL_EdmaModuleBaseAddress baseAddress;
...
status = CSL_edmaccGetModuleBaseAddr(CSL_EDMACC_0, NULL, &baseAddress);
@endverbatim
*
* ============================================================================
*/
CSL_Status CSL_edmaccGetModuleBaseAddr(
/** Instance number
*/
CSL_InstNum edmaNum,
/** Module specific parameters
*/
CSL_EdmaModuleParam *pParam,
/** Base address details
*/
CSL_EdmaModuleBaseAddress *pBaseAddress
);
/** ============================================================================
* @n@b CSL_emdaGetHwStatus
*
* @b Description
* @n Gets the status of the different operations or the current setup of EDMA
* module
*
* @b Arguments
* @verbatim
hEdma Handle to the EDMA instance
myQuery Query to be performed
response Additional query arguments are passed to the API
using the response structure. The query response is
passed back to the user program using this pointer.
Depending on the 'myQuery' this argument is type
casted appropriately.
@endverbatim
*
* <b> Return Value </b> CSL_Status
* @li CSL_SOK - Successful completion of the
* query
*
* @li CSL_ESYS_BADHANDLE - Invalid handle
*
* @li CSL_ESYS_INVQUERY - Query command not supported
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* Data requested by the query is returned through the variable "response"
*
* @b Modifies
* @n The input arguement "response" is modified
*
* <b> Usage Constraints: </b>
* Both CSL_edmaInit() and CSL_edmaOpen() must be called successfully
* in that order before CSL_edmaGetHwStatus() can be called. For the
* argument type that can be void* casted & passed with a particular command
* refer to CSL_EdmaHwStatusQuery
*
* @b Example:
* @verbatim
CSL_EdmaHandle hModHndl;
CSL_Status modStatus;
// Initialize
modStatus = CSL_edmaInit(NULL);
...
hModHndl = CSL_edmaOpen(NULL,CSL_EDMA_0,NULL,&modStatus);
// Hw Status Revision
modStatus = CSL_edmaGetHwStatus(hModHndl,CSL_EDMA_QUERY_REVISION,&revision);
@endverbatim
*
* ============================================================================
*/
CSL_Status CSL_edmaGetHwStatus(
/** Pointer to the object that holds reference to the
* instance of EDMA */
CSL_EdmaHandle hMod,
/** The query to this API which indicates the status/setup
* to be returned */
CSL_EdmaHwStatusQuery myQuery,
/** Placeholder to return the status; @a void* casted */
void *response
);
/**
@}
*/
/**
@addtogroup CSL_EDMA_FUNCTION_SHADOW
@{
*/
/** ============================================================================
* @n@b CSL_edmaRegionOpen
*
* @b Description
* @n Acquires the shadow region requested. If the shadow region can be
* allocated a valid handle to the shadow region is returned else a NULL
* handle is returned.
*
* @b Arguments
* @verbatim
hRegion Shadow region handle
edmaShObj Pointer to the shadow EDMA instance object
edmaNum Instance of the EDMA to be opened.
pEdmaParam Pointer to module specific shadow parameters
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -