📄 csl_edma3.h
字号:
* CSL_ESYS_BADHANDLE - Invalid handle
* CSL_ESYS_INVPARAMS - Hardware structure is not
* properly initialized
*
* @eg
* CSL_Edma3Handle hModule;
CSL_Edma3Obj edmaObj;
CSL_Edma3Context context;
CSL_Edma3HwSetup hwSetup;
CSL_Status status;
CSL_Edma3HwDmaChannelSetup dmahwSetup[CSL_EDMA3_NUM_DMACH] =
CSL_EDMA3_DMACHANNELSETUP_DEFAULT;
CSL_Edma3HwQdmaChannelSetup qdmahwSetup[CSL_EDMA3_NUM_QDMACH] =
CSL_EDMA3_QDMACHANNELSETUP_DEFAULT;
// Module Initialization
CSL_edma3Init(&context);
// Module Level Open
hModule = CSL_edma3Open(&edmaObj,CSL_EDMA3,NULL,&status);
// Module Setup
hwSetup.dmaChaSetup = &dmahwSetup[0];
hwSetup.qdmaChaSetup = &qdmaSetup[0];
CSL_edma3HwSetup(hModule,&hwSetup);
...
*
* ===========================================================================
*/
extern CSL_Status CSL_edma3HwSetup (
CSL_Edma3Handle hMod,
CSL_Edma3HwSetup *setup
);
/*
* =============================================================================
* @func CSL_edma3GetHwSetup
*
* @desc
* Obtains the module level HW setup of EDMA. This reads the
* Channel to Param mapping.Channel to Que map and the trigger word
* (if applicable) of ALL channels (DMA, QDMA) into the placeholder
* provided by the user.
*
* @arg hMod
* Edma Module Handle
*
* @arg setup
* Pointer to the Module Setup structure
*
* @ret CSL_Status
* CSL_SOK - Hardware setup successful
* CSL_ESYS_BADHANDLE - Invalid handle
* CSL_ESYS_INVPARAMS - Hardware structure is not
* properly initialized
*
* @eg
* CSL_Edma3Handle hModule;
CSL_Edma3Obj edmaObj;
CSL_Edma3Context context;
CSL_Status status;
CSL_Edma3HwSetup hwSetup, gethwSetup;
CSL_Edma3HwDmaChannelSetup dmahwSetup[CSL_EDMA3_NUM_DMACH] =
CSL_EDMA3_DMACHANNELSETUP_DEFAULT;
CSL_Edma3HwQdmaChannelSetup qdmahwSetup[CSL_EDMA3_NUM_QDMACH] =
CSL_EDMA3_QDMACHANNELSETUP_DEFAULT;
// Module Initialization
CSL_edma3Init(&context);
// Module Level Open
hModule = CSL_edma3Open(&edmaObj,CSL_EDMA3,NULL,&status);
// Module Setup
hwSetup.dmaChaSetup = &dmahwSetup[0];
hwSetup.qdmaChaSetup = &qdmaSetup[0];
CSL_edma3HwSetup(hModule,&hwSetup);
// Get Module Setup
gethwSetup.dmaChaSetup = &getdmahwSetup[0];
gethwSetup.qdmaChaSetup = NULL;
CSL_edma3GetHwSetup(hModule,&gethwSetup);
...
*
* ===========================================================================
*/
extern CSL_Status CSL_edma3GetHwSetup (
CSL_Edma3Handle hMod,
CSL_Edma3HwSetup *setup
);
/*
* =============================================================================
* @func CSL_edma3HwControl
*
* @desc
* Module level control commands are handled by this API.
*
* @arg hMod
* Edma Module Handle
*
* @arg cmd
* Module Command
*
* @arg 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.
*
* @ret CSL_Status
* CSL_SOK - Command execution successful.
* CSL_ESYS_BADHANDLE - Invalid handle
* CSL_ESYS_INVCMD - Invalid command
*
* @eg
* CSL_Edma3Handle hModule;
CSL_Edma3Obj edmaObj;
CSL_Edma3Context context;
CSL_Status status;
CSL_Edma3HwSetup hwSetup, gethwSetup;
CSL_Edma3CmdDrae regionAccess;
CSL_Edma3HwDmaChannelSetup dmahwSetup[CSL_EDMA3_NUM_DMACH] =
CSL_EDMA3_DMACHANNELSETUP_DEFAULT;
CSL_Edma3HwQdmaChannelSetup qdmahwSetup[CSL_EDMA3_NUM_QDMACH] =
CSL_EDMA3_QDMACHANNELSETUP_DEFAULT;
// Module Initialization
CSL_edma3Init(&context);
// Module Level Open
hModule = CSL_edma3Open(&edmaObj,CSL_EDMA3,NULL,&status);
// Module Setup
hwSetup.dmaChaSetup = &dmahwSetup[0];
hwSetup.qdmaChaSetup = &qdmaSetup[0];
CSL_edma3HwSetup(hModule,&hwSetup);
// DRAE Enable(Bits 0-15) for the Shadow Region 0.
regionAccess.region = CSL_EDMA3_REGION_0 ;
regionAccess.drae = 0xFFFF ;
regionAccess.draeh = 0x0000 ;
CSL_edma3HwControl(hModule,CSL_EDMA3_CMD_DMAREGION_ENABLE, \
®ionAccess);
...
*
* ===========================================================================
*/
extern CSL_Status CSL_edma3HwControl (
CSL_Edma3Handle hMod,
CSL_Edma3HwControlCmd cmd,
void *cmdArg
);
/** ============================================================================
* @n@b CSL_edma3ccGetModuleBaseAddr
*
* @b Description
* @n This function is used for getting the base-address of the peripheral
* instance. This function will be called inside the @ CSL_edma3Open()
* /CSL_edma3ChannelOpen() 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.
*
* @b Arguments
* @verbatim
edmaNum Specifies the instance of the edma to be opened.
pAttr Module specific parameters.
pBaseAddress Pointer to baseaddress structure containing base
address details.
@endverbatim
*
* <b> Return Value </b> CSL_Status
* @li CSL_SOK Open call is successful
* @li CSL_ESYS_FAIL The instance number is invalid.
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Base Address structure is populated
*
* @b Modifies
* @li The status variable
* @li Base address structure is modified.
*
* @b Example
* @verbatim
CSL_Status status;
CSL_Edma3ModuleBaseAddress baseAddress;
...
status = CSL_edma3ccGetModuleBaseAddr(CSL_EDMA3, NULL, &baseAddress);
@endverbatim
* ===========================================================================
*/
extern CSL_Status CSL_edma3ccGetModuleBaseAddr (
CSL_InstNum edmaNum,
CSL_Edma3ModuleAttr *pAttr,
CSL_Edma3ModuleBaseAddress *pBaseAddress
);
/*
* =============================================================================
* @n@b CSL_edma3GetHwStatus
*
* @desc
* Module level queries to the EDMA module are handled through this API
*
* @arg hMod
* Edma Module Handle
*
* @arg myQuery
* Query to be performed.
*
* @arg response
* Pointer to buffer to return the data requested by the query passed
*
* @arg CSL_Status
* CSL_SOK - Successful completion of the query
* CSL_ESYS_BADHANDLE - Invalid handle
* CSL_ESYS_INVQUERY - Query command not supported
*
* @eg
* CSL_Edma3Handle hModule;
CSL_Edma3HwSetup hwSetup,gethwSetup;
CSL_Edma3Obj edmaObj;
CSL_Edma3QueryInfo info;
CSL_Edma3CmdIntr regionIntr;
CSL_Edma3CmdDrae regionAccess;
CSL_Edma3Context context;
CSL_Edma3HwDmaChannelSetup dmahwSetup[CSL_EDMA3_NUM_DMACH] = \
CSL_EDMA3_DMACHANNELSETUP_DEFAULT;
CSL_Edma3HwDmaChannelSetup getdmahwSetup[CSL_EDMA3_NUM_DMACH];
CSL_Status status;
Uint32 i,passStatus = 1;
// Module Initialization
CSL_edma3Init(&context);
// Module Level Open
hModule = CSL_edma3Open(&edmaObj,CSL_EDMA3,NULL,&status);
// Module Setup
hwSetup.dmaChaSetup = &dmahwSetup[0];
hwSetup.qdmaChaSetup = NULL;
CSL_edma3HwSetup(hModule,&hwSetup);
// Query Module Info
CSL_edma3GetHwStatus(hModule,CSL_EDMA3_QUERY_INFO,&info);
...
*
* ===========================================================================
*/
extern CSL_Status CSL_edma3GetHwStatus (
CSL_Edma3Handle hMod,
CSL_Edma3HwStatusQuery myQuery,
void *response
);
/*
*============================================================================
* @func CSL_edma3ChannelOpen
*
* @desc
* Opens an EDMA channel to get access to the resources for a
* particular channel.
*
* @arg edmaObj
* Pointer to the EDMA Handle Object - to be allocated by the user
*
* @arg edmaNum
* Instance Number of the EDMA
*
* @arg param
* Channel specific parameters
*
* @arg status
* Pointer to CSL Status
*
* @ret CSL_Edma3ChannelHandle
* Valid edma channel handle will be returned if status value is
* equal to CSL_SOK
*
* @eg
* CSL_Edma3Handle hModule;
CSL_Edma3Obj edmaObj;
CSL_Edma3Context context;
CSL_Status status;
CSL_Edma3ChannelAttr chAttr;
CSL_Edma3ChannelHandle hChannel;
// Module Initialization
CSL_edma3Init(&context);
// Module Level Open
hModule = CSL_edma3Open(&edmaObj,CSL_EDMA3,NULL,&status);
// Channel 0 Open in context of Shadow region 0
chAttr.regionNum = CSL_EDMA3_REGION_0;
chAttr.chaNum = CSL_EDMA3_CHA_DSPINT;
hChannel = CSL_edma3ChannelOpen(&ChObj, CSL_EDMA3, &chAttr, &status);
...
*
* ===========================================================================
*/
extern CSL_Edma3ChannelHandle CSL_edma3ChannelOpen (
CSL_Edma3ChannelObj *edmaObj,
CSL_InstNum edmaNum,
CSL_Edma3ChannelAttr *chAttr,
CSL_Status *status
);
/*
*============================================================================
* @func CSL_edma3ChannelClose
*
* @desc
* Closes (Invalidates) an EDMA channel (passed as handle) after it has
* finished operating. The channel cannot be accessed any more.
*
* @arg hEdma
* Channel Handle
*
* @ret CSL_Status
* CSL_SOK - Close successful
* CSL_ESYS_BADHANDLE - Invalid handle
*
* @eg
* CSL_Edma3Handle hModule;
CSL_Edma3Obj edmaObj;
CSL_Edma3Context context;
CSL_Status status;
// Module Initialization
CSL_edma3Init(&context);
// Module Level Open
hModule = CSL_edma3Open(&edmaObj,CSL_EDMA3,NULL,&status);
// Channel 0 Open in context of Shadow region 0
chAttr.regionNum = CSL_EDMA3_REGION_0;
chAttr.chaNum = CSL_EDMA3_CHA_DSPINT;
hChannel = CSL_edma3ChannelOpen(&ChObj, CSL_EDMA3, &chAttr, &status);
// Close Module
CSL_edma3Close(hModule);
//Close channel
CSL_edma3ChannelClose (hChannel);
*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -