📄 csl_edmagethwmodulestatus.c
字号:
/* ============================================================================
* Copyright (c) Texas Instruments Inc 2002, 2003, 2004, 2005
*
* Use of this software is controlled by the terms and conditions found in the
* license agreement under which this software has been supplied.
* ===========================================================================
*/
/** @file csl_edmaGetHwModuleStatus.c
*
* @brief File for functional layer of CSL API @a CSL_edmaGetHwStatus()
*
* @date 29th May, 2004
* @author Ruchika Kharwar
*/
/* =============================================================================
* Revision History
* ===============
* 10-Aug-2005 brn Updated for doxygen documentation and butification
* =============================================================================
*/
#include <csl_edma.h>
#include <csl_edmaAux.h>
/** ============================================================================
* @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
*
* ============================================================================
*/
#pragma CODE_SECTION (CSL_edmaGetHwStatus, ".text:csl_section:edma");
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
)
{
CSL_Status st = CSL_SOK;
if (hMod == NULL)
return CSL_ESYS_BADHANDLE;
if (response == NULL)
return CSL_ESYS_INVPARAMS;
switch(myQuery) {
case CSL_EDMA_QUERY_REVISION:
*((Uint32*)response) = CSL_edmaGetRevision(hMod);
break;
#if CSL_EDMA_MEMPROTECT
case CSL_EDMA_QUERY_MEMFAULT:
st = CSL_edmaGetMemoryFaultError(hMod,
(CSL_EdmaMemFaultStatus*)response);
break;
case CSL_EDMA_QUERY_MEMPROTECT:
((CSL_EdmaCmdQueryRegion*)response)->cmdQueryVal = \
CSL_edmaGetMemoryProtectionAttrib(hMod,
((CSL_EdmaCmdQueryRegion*)response)->region);
break;
#endif
case CSL_EDMA_QUERY_CTRLERROR:
st = CSL_edmaGetControllerError(hMod,(CSL_EdmaccStatus*)response);
break;
case CSL_EDMA_QUERY_INTERRUPT_PENDSTATUS:
st = CSL_edmaGetIntrPendStatus(hMod,
&((CSL_BitMask32*)response)[0],
&((CSL_BitMask32*)response)[1]);
break;
case CSL_EDMA_QUERY_INTERRUPT_MISSED:
st = \
CSL_edmaGetEventsMissed(hMod,
&((CSL_BitMask32*)response)[0],
&((CSL_BitMask32*)response)[1],
&((CSL_BitMask32*)response)[2]);
break;
default:
st = CSL_ESYS_INVQUERY;
break;
}
return st;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -