📄 csl_edmaaux.h
字号:
modStatus = CSL_edmaInit(NULL);
...
hModHndl = CSL_edmaOpen(NULL,CSL_EDMA_0,NULL,&modStatus);
// Module Control API
status = CSL_edmaDmaRegionAccessDisable(hModHndl,
CSL_EDMA_REGION_0,0x000000FF,0x000000FF);
@endverbatim
*
* ===========================================================================
*/
//#pragma CODE_SECTION (CSL_edmaDmaRegionAccessDisable, ".text:csl_section:edma");
CSL_IDEF_INLINE CSL_Status CSL_edmaDmaRegionAccessDisable(
/** module handle to EDMA */
CSL_EdmaHandle hMod,
/** region needing the Memory protection */
Int edmaRegion,
/** drae bits to be disabled */
CSL_BitMask32 drae,
/** draeh bits to be disabled */
CSL_BitMask32 draeh
)
{
int cs;
if (edmaRegion == CSL_EDMA_REGION_GLOBAL)
return CSL_ESYS_INVPARAMS;
cs = _CSL_beginCriticalSection() ;
hMod->DRA[edmaRegion].DRAE &= ~drae;
hMod->DRA[edmaRegion].DRAEH &= ~draeh;
_CSL_endCriticalSection(cs) ;
return CSL_SOK;
}
/** =============================================================================
* @n@b CSL_edmaQdmaRegionAccessEnable
*
* @b Description
* @n This API sets the QRAE BitMask.
*
* @b Arguments
* @verbatim
hMod Module Handle
edmaRegion region - this may be specified as one of the many view
supported by the chip or the global memory protection
attributes themselves.
access region bits to be programmed
qrae Bitmask to be enabled in QRAE
@endverbatim
*
* <b> Return Value <b/>
* Status (CSL_SOK/CSL_ESYS_INVPARAMS)
*
* <b> Pre Condition </b>
* @n @a CSL_edmaOpen() must be called before usage of this API.
*
* <b> Post Condition </b>
* @n None
*
* @b Modifies
* @n None
*
*
* <b> Usage Constraints: </b>
* The EDMA must be succesfully initializedvia @a CSL_edmaInit().
* CSL_edmaOpen() must be called before usage of this API.
*
*
* @b Example:
* @verbatim
CSL_EdmaHandle hModHndl;
CSL_Status modStatus;
// Initialize
modStatus = CSL_edmaInit(NULL);
...
hModHndl = CSL_edmaOpen(NULL,CSL_EDMA_0,NULL,&modStatus);
// Module Control API
// ALL 8 Channels allowed
status = CSL_edmaQdmaRegionAccessEnable(hModHndl,
CSL_EDMA_REGION_0,0x000000FF);
@endverbatim
*
* ===========================================================================
*/
//#pragma CODE_SECTION (CSL_edmaQdmaRegionAccessEnable, ".text:csl_section:edma");
CSL_IDEF_INLINE CSL_Status CSL_edmaQdmaRegionAccessEnable(
/** module handle to EDMA */
CSL_EdmaHandle hMod,
/** region needing the Memory protection */
Int edmaRegion,
/** drae bits to be enabled */
CSL_BitMask32 qrae
)
{
int cs;
if (edmaRegion == CSL_EDMA_REGION_GLOBAL)
return CSL_ESYS_INVPARAMS;
cs = _CSL_beginCriticalSection() ;
hMod->QRAE[edmaRegion] |= qrae;
_CSL_endCriticalSection(cs) ;
return CSL_SOK;
}
/** =============================================================================
* @n@b CSL_edmaQdmaRegionAccessDisable
*
* @b Description
* @n This API clears the QRAE BitMask.
*
* @b Arguments
* @verbatim
hMod Module Handle
edmaRegion region - this may be specified as one of the many view
supported by the chip or the global memory protection
attributes themselves.
access region bits to be programmed
qrae Bitmask to be disabled in QRAE
@endverbatim
*
* <b> Return Value <b/>
* Status (CSL_SOK/CSL_ESYS_INVPARAMS)
*
* <b> Pre Condition </b>
* @n @a CSL_edmaOpen() must be called before usage of this API.
*
* <b> Post Condition </b>
* @n None
*
* @b Modifies
* @n None
*
*
* <b> Usage Constraints: </b>
* The EDMA must be succesfully initializedvia @a CSL_edmaInit().
* CSL_edmaOpen() must be called before usage of this API.
*
*
* @b Example:
* @verbatim
CSL_EdmaHandle hModHndl;
CSL_Status modStatus;
// Initialize
modStatus = CSL_edmaInit(NULL);
...
hModHndl = CSL_edmaOpen(NULL,CSL_EDMA_0,NULL,&modStatus);
// Module Control API
// ALL 8 Channels disallowed
status = CSL_edmaQdmaRegionAccessDisable(hModHndl,
CSL_EDMA_REGION_0,0x000000FF);
@endverbatim
*
* ===========================================================================
*/
//#pragma CODE_SECTION (CSL_edmaQdmaRegionAccessDisable, ".text:csl_section:edma");
CSL_IDEF_INLINE CSL_Status CSL_edmaQdmaRegionAccessDisable(
/** module handle to EDMA */
CSL_EdmaHandle hMod,
/** region needing the Memory protection */
Int edmaRegion,
/** qrae bits to be disabled */
CSL_BitMask32 qrae
)
{
int cs;
if (edmaRegion == CSL_EDMA_REGION_GLOBAL)
return CSL_ESYS_INVPARAMS;
cs = _CSL_beginCriticalSection() ;
hMod->QRAE[edmaRegion] &= ~qrae;
_CSL_endCriticalSection(cs) ;
return CSL_SOK;
}
/** =============================================================================
* @n@b CSL_edmaEventQueuePrioritySet
*
* @b Description
* @n This API sets the Queue priority level to the appropriate value.
*
* @b Arguments
* @verbatim
hMod Module Handle
que Event queue
pri Priority needed to be set for above Event queue
@endverbatim
*
* <b> Return Value <b/>
* Status (CSL_SOK/CSL_ESYS_INVPARAMS)
*
* <b> Pre Condition </b>
* @n @a CSL_edmaOpen() must be called before usage of this API.
*
* <b> Post Condition </b>
* @n None
*
* @b Modifies
* @n None
*
*
* <b> Usage Constraints: </b>
* The EDMA must be succesfully initializedvia @a CSL_edmaInit().
* CSL_edmaOpen() must be called before usage of this API.
*
*
* @b Example:
* @verbatim
CSL_EdmaHandle hModHndl;
CSL_Status modStatus;
// Initialize
modStatus = CSL_edmaInit(NULL);
...
hModHndl = CSL_edmaOpen(NULL,CSL_EDMA_0,NULL,&modStatus);
status = CSL_edmaEventQueuePrioritySet(hModHndl,
CSL_EDMA_EVT_QUE0,
CSL_EDMA_VBUSM_PRI2
);
@endverbatim
*
* ===========================================================================
*/
//#pragma CODE_SECTION (CSL_edmaEventQueuePrioritySet, ".text:csl_section:edma");
CSL_IDEF_INLINE CSL_Status CSL_edmaEventQueuePrioritySet(
/** module handle to EDMA */
CSL_EdmaHandle hMod,
/** Queue for which priority level is required to be set */
CSL_EdmaEventQueue que,
/** priority to be set */
CSL_EdmaEventQueuePri pri
)
{
int cs;
cs = _CSL_beginCriticalSection() ;
CSL_FINSR(hMod->QUEPRI, (4*que + 2),(4*que),pri);
_CSL_endCriticalSection(cs);
return CSL_SOK;
}
/** =============================================================================
* @n@b CSL_EdmaEventQueueTcMap
*
* @b Description
* @n This API does the Event Queue to TC Mapping
*
* @b Arguments
* @verbatim
hMod Module Handle
que Event queue
tc transfer controller number
@endverbatim
*
* <b> Return Value <b/>
* Status (CSL_SOK/CSL_ESYS_INVPARAMS)
*
* <b> Pre Condition </b>
* @n @a CSL_edmaOpen() must be called before usage of this API.
*
* <b> Post Condition </b>
* @n None
*
* @b Modifies
* @n None
*
*
* <b> Usage Constraints: </b>
* The EDMA must be succesfully initializedvia @a CSL_edmaInit().
* CSL_edmaOpen() must be called before usage of this API.
*
*
* @b Example:
* @verbatim
CSL_EdmaHandle hModHndl;
CSL_Status modStatus;
// Initialize
modStatus = CSL_edmaInit(NULL);
...
hModHndl = CSL_edmaOpen(NULL,CSL_EDMA_0,NULL,&modStatus);
status = CSL_edmaEventQueueTcMap(hModHndl,
CSL_EDMA_EVT_QUE0,
CSL_EDMA_TC2
);
@endverbatim
*
* ===========================================================================
*/
//#pragma CODE_SECTION (CSL_edmaEventQueueTcMap, ".text:csl_section:edma");
CSL_IDEF_INLINE CSL_Status CSL_edmaEventQueueTcMap(
/** module handle to EDMA */
CSL_EdmaHandle hMod,
/** Queue for which priority level is required to be set */
CSL_EdmaEventQueue que,
/** bitMask of the Memory Protection Attributes */
CSL_EdmaTc tc
)
{
int cs;
cs = _CSL_beginCriticalSection() ;
CSL_FINSR(hMod->QUETCMAP, (4*que + 2),(4*que),tc);
_CSL_endCriticalSection(cs);
return CSL_SOK;
}
/** =============================================================================
* @n@b CSL_EdmaEventQueueThresholdSet
*
* @b Description
* @n This API sets the Queue threshold to the appropriate level
*
* @b Arguments
* @verbatim
hMod Module Handle
que Event queue
threshold target threshold value for the above queue
@endverbatim
*
* <b> Return Value <b/>
* Status (CSL_SOK/CSL_ESYS_INVPARAMS)
*
* <b> Pre Condition </b>
* @n @a CSL_edmaOpen() must be called before usage of this API.
*
* <b> Post Condition </b>
* @n None
*
* @b Modifies
* @n None
*
*
* <b> Usage Constraints: </b>
* The EDMA must be succesfully initializedvia @a CSL_edmaInit().
* CSL_edmaOpen() must be called before usage of this API.
*
*
* @b Example:
* @verbatim
CSL_EdmaHandle hModHndl;
CSL_Status modStatus;
// Initialize
modStatus = CSL_edmaInit(NULL);
...
hModHndl = CSL_edmaOpen(NULL,CSL_EDMA_0,NULL,&modStatus);
status = CSL_edmaEventQueueThresholdSet(hModHndl,
CSL_EDMA_EVT_QUE0,
CSL_EDMA_QUETHRESH_10
);
@endverbatim
*
* ===========================================================================
*/
//#pragma CODE_SECTION (CSL_edmaEventQueueThresholdSet, ".text:csl_section:edma");
CSL_IDEF_INLINE CSL_Status CSL_edmaEventQueueThresholdSet(
/** module handle to EDMA */
CSL_EdmaHandle hMod,
/** Queue for which priority level is required to be set */
CSL_EdmaEventQueue que,
/** Threshold to be set */
CSL_EdmaEventQueueThr threshold
)
{
int cs;
cs = _CSL_beginCriticalSection() ;
if (que < ((CSL_EdmaEventQueue)4))
CSL_FINSR(hMod->QWMTHRA, (8*que + 4),(8*que),threshold);
else
CSL_FINSR(hMod->QWMTHRB, (8 * (que-4) + 4),(8 * (que-4)),threshold);
_CSL_endCriticalSection(cs);
return CSL_SOK;
}
/** =============================================================================
* @n@b CSL_edmaErrorEval
*
* @b Description
* @n This API enables enables evaluation of errros for the specified
* view/shadow Region
*
* @b Arguments
* @verbatim
hMod Module Handle
@endverbatim
*
* <b> Return Value <b/>
* Status (CSL_SOK/CSL_ESYS_INVPARAMS)
*
* <b> Pre Condition </b>
* @n @a CSL_edmaOpen() must be called before usage of this API.
*
* <b> Post Condition </b>
* @n None
*
* @b Modifies
* @n None
*
*
* <b> Usage Constraints: </b>
* The EDMA must be succesfully initializedvia @a CSL_edmaInit().
* CSL_edmaOpen() must be called before usage of this API.
*
*
* @b Example:
* @verbatim
CSL_EdmaHandle hModHndl;
CSL_Status modStatus;
// Initialize
modStatus = CSL_edmaInit(NULL);
...
hModHndl = CSL_edmaOpen(NULL,CSL_EDMA_0,NULL,&modStatus);
// Module Control API
status = CSL_edmaErrorEval(hModHndl);
@endverbatim
*
* ===========================================================================
*/
//#pragma CODE_SECTION (CSL_edmaErrorEval, ".text:csl_section:edma");
CSL_IDEF_INLINE CSL_Status CSL_edmaErrorEval(
/** module handle to EDMA */
CSL_EdmaHandle hMod
)
{
hMod->EEVAL = 1;
return CSL_SOK;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -