📄 csl_edmaaux.h
字号:
modStatus = CSL_edmaInit(NULL);
...
edmaHndl = CSL_edmaOpen(NULL,CSL_EDMA_0,NULL,&modStatus);
// Get Controller Error
edmaStatus = CSL_edmaGetControllerError(edmaHndl,&ccError);
@endverbatim
*
* ===========================================================================
*/
//#pragma CODE_SECTION (CSL_edmaGetControllerError, ".text:csl_section:edma");
CSL_IDEF_INLINE CSL_Status CSL_edmaGetControllerError(
/** module handle to EDMA */
CSL_EdmaHandle hMod,
/** a place holder for the Controller Error */
CSL_EdmaccStatus *ccStat
)
{
ccStat->errorMask = hMod->CCERR & 0xFF ;
ccStat->exceedTcc = (Bool)(CSL_FEXT(hMod->CCERR, EDMACC_CCERR_TCCERR)) ;
/* Clears the errors */
hMod->CCERRCLR = ccStat->exceedTcc << 16 | ccStat->errorMask;
return CSL_SOK;
}
/** =============================================================================
* @n@b CSL_edmaGetIntrPendStatus
*
* @b Description
* @n Queries the interrupt status of the interrupts. This is read from the
* Global Channel Register.
*
* @b Arguments
* @verbatim
hMod Module Handle
intrLo status 0-31 of the interrupts
intrHi status 32-63 of the interrupts
@endverbatim
*
* <b> Return Value <b/>
* Status CSL_SOK - Alwaya returns
*
* <b> Pre Condition </b>
* @n @a CSL_edmaInit() must be called successfully.
*
* <b> Post Condition </b>
* @n None
*
* @b Modifies
* @n None
*
*
* <b> Usage Constraints: </b>
* All @a CSL_edmaInit(), @a CSL_edmaOpen(), must be
* called successfully in that order before @a CSL_edmaGetIntrPendStatus() can
* be called.
*
*
* @b Example:
* @verbatim
CSL_EdmaHandle edmaHndl;
CSL_Status modStatus;
Uint32 edmaIntrLo,edmaIntrHi;
// Initialize
modStatus = CSL_edmaInit(NULL);
...
edmaHndl = CSL_edmaOpen(NULL,CSL_EDMA_0,NULL,&modStatus);
// Get interrupt pend status
edmaStatus = CSL_edmaGetIntrPendStatus(edmaHndl,&edmaIntrLo. &edmaIntrHi);
@endverbatim
*
* ===========================================================================
*/
//#pragma CODE_SECTION (CSL_edmaGetIntrPendStatus, ".text:csl_section:edma");
CSL_IDEF_INLINE CSL_Status CSL_edmaGetIntrPendStatus(
/** module handle to EDMA */
CSL_EdmaHandle hMod,
/** place holder for the interrupt status 0-31*/
CSL_BitMask32 *intrLo,
/** place holder for the interrupt status 32-63*/
CSL_BitMask32 *intrHi
)
{
*intrLo = hMod->IPR;
*intrHi = hMod->IPRH;
return CSL_SOK;
}
#if CSL_EDMA_MEMPROTECT
/** =============================================================================
* @n@b CSL_edmaGetMemoryProtectionAttrib
*
* @b Description
* @n Queries the Memory Access rights of the specified region. This
* may be global/view.
*
* @b Arguments
* @verbatim
hMod Module Handle
region region queried. This may refer to the global channel
register space or a specific region/view.
@endverbatim
*
* <b> Return Value <b/>
* CSL_BitMask32 - MPPAG/MPPA[0/1../n] value
*
* <b> Pre Condition </b>
* @n @a CSL_edmaInit() must be called successfully.
*
* <b> Post Condition </b>
* @n None
*
* @b Modifies
* @n None
*
*
* <b> Usage Constraints: </b>
* All @a CSL_edmaInit(), @a CSL_edmaOpen(), must be
* called successfully in that order before @a CSL_edmaGetMemoryProtectAttrib() can
* be called.
*
*
* @b Example:
* @verbatim
CSL_EdmaHandle edmaHndl;
CSL_Status modStatus;
Uint32 edmaIntrLo,edmaIntrHi;
Uint32 memProt;
// Initialize
modStatus = CSL_edmaInit(NULL);
...
edmaHndl = CSL_edmaOpen(NULL,CSL_EDMA_0,NULL,&modStatus);
// Get memory protection attributes
memProt = CSL_edmaGetMemoryProtectAttrib(edmaHndl,CSL_EDMA_REGION_2);
@endverbatim
*
* ===========================================================================
*/
//#pragma CODE_SECTION (CSL_edmaGetMemoryProtectionAttrib, ".text:csl_section:edma");
CSL_IDEF_INLINE CSL_BitMask32 CSL_edmaGetMemoryProtectionAttrib(
/** module handle to EDMA */
CSL_EdmaHandle hMod,
/** interrupt queried */
Int region
)
{
CSL_BitMask32 mppa;
if (region < 0)
mppa = hMod->MPPAG;
else
mppa = hMod->MPPA[region];
return mppa;
}
/** =============================================================================
* @n@b CSL_edmaGetMemoryFaultError
*
* @b Description
* @n Queries the Channel controllers memory fault error and the
* Error attributes
*
* @b Arguments
* @verbatim
hMod Module Handle
memFault this points to a structure alloctaed by the user program
that can hold the queried the memory fault status values.
@endverbatim
*
* <b> Return Value <b/>
* Status (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> Usage Constraints: </b>
* All @a CSL_edmaInit(), @a CSL_edmaOpen(), must be
* called successfully in that order before @a CSL_edmaGetMemoryFaultError() can
* be called.
*
*
* @b Example:
* @verbatim
CSL_EdmaMemFaultStatus memFault;
CSL_EdmaHandle edmaHndl;
CSL_Status modStatus;
// Initialize
modStatus = CSL_edmaInit(NULL);
...
edmaHndl = CSL_edmaOpen(NULL,CSL_EDMA_0,NULL,&modStatus);
// Get memory protection attributes
memStatus CSL_edmaGetMemoryFaultError(edmaHndl,&memFault);
@endverbatim
*
* ===========================================================================
*/
//#pragma CODE_SECTION (CSL_edmaGetMemoryFaultError, ".text:csl_section:edma");
CSL_IDEF_INLINE CSL_Status CSL_edmaGetMemoryFaultError(
/** module handle to EDMA */
CSL_EdmaHandle hMod,
/** a place holder for the memory fault Error status */
CSL_EdmaMemFaultStatus *memFault
)
{
/* Reading the Memory Fault Status registers */
memFault->addr = hMod->MPFAR;
memFault->errorMask = CSL_FEXTR(hMod->MPFSR, 8, 0);
memFault->fid = CSL_FEXTR(hMod->MPFSR, 12, 9);
/* Clearing the Memory Fault Error */
hMod->MPFCR = 1;
return CSL_SOK;
}
#endif
/** =============================================================================
* @n@b CSL_edmaSetMemoryProtectionAttrib
*
* @b Description
* @n Sets specified memory protection attributes for the specifed region.
*
* @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.
mpa Value to be programmed into the MPPAG/MPPA[0/1/2/../n].
This is a Bitmask of the protection attributes.
@endverbatim
*
* <b> Return Value <b/>
* Status (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> 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 edmaHndl;
CSL_Status modStatus;
// Initialize
modStatus = CSL_edmaInit(NULL);
...
edmaHndl = CSL_edmaOpen(NULL,CSL_EDMA_0,NULL,&modStatus);
// Module Control API
modStatus = CSL_edmaSetMemoryProtectionAttrib(edmaHndl,CSL_EDMA_REGION_0,
(CSL_EDMA_MEMACCESS_UX|CSL_EDMA_MEMACCESS_UW|CSL_EDMA_MEMACCESS_UR|
CSL_EDMA_MEMACCESS_AID2));
@endverbatim
*
* ===========================================================================
*/
#if CSL_EDMA_MEMPROTECT
//#pragma CODE_SECTION (CSL_edmaSetMemoryProtectionAttrib, ".text:csl_section:edma");
CSL_IDEF_INLINE CSL_Status CSL_edmaSetMemoryProtectionAttrib(
/** module handle to EDMA */
CSL_EdmaHandle hMod,
/** region needing the Memory protection */
Int edmaRegion,
/** bitMask of the Memory Protection Attributes */
CSL_BitMask32 mpa
)
{
if (edmaRegion == CSL_EDMA_REGION_GLOBAL)
hMod->MPPAG = mpa;
else
hMod->MPPA[edmaRegion] = mpa;
return CSL_SOK;
}
#endif
/** =============================================================================
* @n@b CSL_edmaDmaRegionAccessEnable
*
* @b Description
* @n This API sets the DRAE/DRAEH 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
drae Bitmask to be enabled in DRAE
draeh Bitmask to be enabled in DRAEH
@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_edmaDmaRegionAccessEnable(hModHndl,
CSL_EDMA_REGION_0,0x000000FF, 0x000000FF);
@endverbatim
*
* ===========================================================================
*/
//#pragma CODE_SECTION (CSL_edmaDmaRegionAccessEnable, ".text:csl_section:edma");
CSL_IDEF_INLINE CSL_Status CSL_edmaDmaRegionAccessEnable(
/** module handle to EDMA */
CSL_EdmaHandle hMod,
/** region needing the Memory protection */
Int edmaRegion,
/** drae bits to be enabled */
CSL_BitMask32 drae,
/** draeh bits to be enabled */
CSL_BitMask32 draeh
)
{
int cs;
if (edmaRegion == CSL_EDMA_REGION_GLOBAL)
return CSL_ESYS_INVPARAMS;
cs = _CSL_beginCriticalSection();
// asm(" dint");
hMod->DRA[edmaRegion].DRAE |= drae;
hMod->DRA[edmaRegion].DRAEH |= draeh;
_CSL_endCriticalSection(cs) ;
return CSL_SOK;
}
/** =============================================================================
* @n@b CSL_edmaDmaRegionAccessDisable
*
* @b Description
* @n This API clears the DRAE/DRAEH 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
drae Bitmask to be disabled in DRAE
draeh Bitmask to be disabled in DRAEH
@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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -