📄 csl_edmahwregioncontrol.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_edmaHwRegionControl.c
*
* @brief File for functional layer of CSL API @a CSL_edmaHwControl()
*
* Description
* - The @a CSL_edmaHwControl() function definition & it's associated
* functions
* @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_edmaHwRegionControl
*
* @b Description
* @n Takes a command with an optional argument & implements it. This function
* is used to carry out/set attributes of the Shadow Region registers
*
*
* @b Arguments
* @verbatim
hRegion Shadow region handle
cmd Shadow region command
cmdarg 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>
* CSL_edmaInit(), CSL_edmaOpen(), CSL_edmaRegionOpen() must have been
* called successfully before this function can be called.
* The user must allocate space for this and this API fills in the system
* specified fields.
*
* @b Example:
* @verbatim
CSL_EdmaRegionObj RegionObj;
CSL_EdmaRegionHndl shHndl;
CSL_EdmaRegionParam regParam;
CSL_EdmaChanObj ChObj;
CSL_EdmaChanHandle chHndl;
CSL_BitMask32 intrEnable[2];
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);
// Region 0 Open
regParam.regionNum = CSL_EDMA_REGION_0;
shHndl = CSL_edmaRegionOpen(&RegionObj,CSL_EDMA_0,®Param,&status);
// Enables the Shadow Region interrupts
intrEnable[0] = 0x0000ffff;
intrEnable[1] = 0xffff0000;
CSL_edmaHwRegionControl(shHndl,
CSL_EDMA_CMD_REGION_INTERRUPT_ENABLE,
intrEnable
);
@endverbatim
*
*
* ============================================================================
*/
#pragma CODE_SECTION (CSL_edmaHwRegionControl, ".text:csl_section:edma");
CSL_Status CSL_edmaHwRegionControl
(
/** Pointer to the object that holds reference to the
* instance of EDMA requested after the call */
CSL_EdmaRegionHandle hSh,
/** The command to this API which indicates the action to be taken */
CSL_EdmaHwRegionControlCmd cmd,
/** Optional argument @a void* casted */
void *cmdArg
)
{
CSL_Status st;
if (hSh == NULL)
return CSL_ESYS_BADHANDLE;
switch(cmd) {
case CSL_EDMA_CMD_REGION_INTERRUPT_CLEAR:
st = CSL_edmaRegionInterruptClear(hSh,
((CSL_BitMask32*)(cmdArg))[0],
((CSL_BitMask32*)(cmdArg))[1]);
break;
case CSL_EDMA_CMD_REGION_INTERRUPT_ENABLE:
st = CSL_edmaRegionInterruptEnable(hSh,
((CSL_BitMask32*)(cmdArg))[0],
((CSL_BitMask32*)(cmdArg))[1]);
break;
case CSL_EDMA_CMD_REGION_INTERRUPT_DISABLE:
st = CSL_edmaRegionInterruptDisable(hSh,
((CSL_BitMask32*)(cmdArg))[0],
((CSL_BitMask32*)(cmdArg))[1]);
break;
case CSL_EDMA_CMD_REGION_INTERRUPT_EVAL:
st = CSL_edmaRegionInterruptEval(hSh);
break;
default:
st = CSL_ESYS_INVCMD;
break;
}
return st;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -