⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 csl_edma.h

📁 TI的DM6446的硬件平台搭建的相关例子
💻 H
📖 第 1 页 / 共 3 页
字号:
/** @brief Edma ParamSetup Structure * *  An object of this type is allocated by the user and *  its address is passed as a parameter to the CSL_edmaParamSetup(). *  This structure is used to program the Param Entry for EDMA/QDMA. */typedef struct CSL_EdmaParamSetup {    Uint32          option;              /**< Options */    Uint32 	   	    srcAddr;      		 /**< Specifies the source address */     Uint32          elmArrCnt;       	 /**< Lower 16 bits are element count 		  						      		  Upper 16 bits are number of arrays*/    Uint32 		    dstAddr;         	 /**< Specifies the destination address */ 	                                           Uint32          srcDstBidx;      	 /**< Lower 16 bits are source b index 					      					  Upper 16 bits are destination b index */    Uint32          linkBcntrld;      	 /**< Lower 16 bits are link of the next param entry					 	     			      Upper 16 bits are b count reload */    Uint32          srcDstCidx;          /**< Lower 16 bits are source c index					      					  Upper 16 bits are destination c index */    Uint32          cCnt;	         	 /**< C count */    Uint8           triggerWord;         /**< Trigger Word. For normal EDMA Channel parameter entries                                               this should be set to CSL_EDMA_TRIGWORD_NONE else                                              for QDMA parameter entries this should be                                               set to CSL_EDMA_TRIGWORD_DEFAULT/Number of the trigger word i.e 0-6                                              */} CSL_EdmaParamSetup;/** @brief Edma Object Structure * *  An object of this type is allocated by the user and *  its address is passed as a parameter to the CSL_edmaOpen() *  The CSL_edmaOpen() updates all the members of the data structure *  and returns the objects address as a @a #CSL_EdmaChanHandle. The *  @a #CSL_EdmaChanHandle is used in all subsequent function calls. */ typedef struct CSL_EdmaChanObj {    CSL_EdmaccRegsOvly      ccregs;          	 /**< Pointer to the Edma Channel Controller module register Overlay structure */	Int                     region;              /**< Region number to which the channel belongs to */     Int                     edmaNum;         	 /**< EDMA instance whose channel is being requested */    Int                     chaNum;          	 /**< Channel Number being requested */} CSL_EdmaChanObj;/** @brief Edma Channel Setup * *  An object of this type is allocated by the user and *  its address is passed as a parameter to the CSL_edmaHwChannelSetup() */typedef struct CSL_EdmaHwChannelSetup {	CSL_EdmaEventQueue que;                      /**< Que number for the channel */	Uint16  paramEntry;							 /**< Parameter entry mapping for the channel */					Uint8   triggerWord;						 /**< Trigger word for the QDMA channels. This is not required to be initialised for 	                                                  EDMA channels */} CSL_EdmaHwChannelSetup;/** EDMA Module Handle  * */typedef volatile CSL_EdmaccRegs *CSL_EdmaHandle;/** CSL Channel Handle * */typedef struct CSL_EdmaChanObj *CSL_EdmaChanHandle;/** @brief Edma Memory Protection Fault Error Status * *  An object of this type is allocated by the user and *  its address is passed as a parameter to the CSL_edmaGetMemoryFaultError() *  / CSL_edmaGetHwStatus() with the relevant command. */#if CSL_EDMA_MEMPROTECT	typedef struct CSL_EdmaMemFaultStatus {    Uint32           addr;           		 /**< Memory Protection Fault Address */    CSL_BitMask16    errorMask;       		 /**< Bit Mask of the Errors */    Uint16           fid;             		 /**< Faulted ID */}CSL_EdmaMemFaultStatus;#endif/** @brief Edma Controller Error Status.  * *  An object of this type is allocated by the user and *  its address is passed as a parameter to the CSL_edmaGetControllerError() *  /CSL_edmaGetHwStatus(). */typedef struct CSL_EdmaccStatus {    CSL_BitMask16    errorMask;       		 /**< Bit Mask of the Queue Threshold Errors */    Bool             exceedTcc;       		 /**< Whether number of permissible outstanding Tcc's     						      				  is exceeded */}CSL_EdmaccStatus;/** @brief Edma Query Structure for querying region specific  *  attributes.  * *  An object of this type is allocated by the user and *  its address is passed as a parameter to the CSL_edmaGetHwStatus *  with the relevant command.    */typedef struct CSL_EdmaCmdQueryRegion {    Int              region;          		 /**< This field needs to be initialized           				    	      			  by the user before issuing the query/command */	CSL_BitMask32    cmdQueryVal;	   		 /**< This needs to be filled by the user in case of issuing a     						      				  COMMAND or it will be filled in by the CSL when 						      					  used with a QUERY */}CSL_EdmaCmdQueryRegion;/** @brief Edma Command Structure for setting region specific  *  attributes. * *  An object of this type is allocated by the user and *  its address is passed as a parameter to the CSL_edmaGetHwStatus *  when  */typedef struct CSL_EdmaCmdDmaRegion {    Int   region;                /**< This field needs to be initialiazed 						      		  by the user before issueing the command specifying 						      		  the region for which attributs are being queried */    CSL_BitMask32     drae;	     /**< DRAE Setting for the region  */    CSL_BitMask32     draeh;	 /**< DRAEH Setting for the region */}CSL_EdmaCmdDmaRegion;/** @brief Edma Command Structure used for setting Event Queue priority level * *  An object of this type is allocated by the user and *  its address is passed as a parameter to the CSL_edmaHwControl API. */typedef struct CSL_EdmaCmdQuePriority {    CSL_EdmaEventQueue         que;              /**< Specifies the Queue whose priority needs to change */    CSL_EdmaEventQueuePri      pri;              /**< Queue priority */}CSL_EdmaCmdQuePriority;    /** @brief Edma Command Structure used for setting Event Queue to Transfer Controller mapping * *  An object of this type is allocated by the user and *  its address is passed as a parameter to the CSL_edmaHwControl API. */typedef struct CSL_EdmaCmdQueTc {    CSL_EdmaEventQueue         que;              /**< Specifies the Queue whose priority needs to change */    CSL_EdmaTc                 tc;               /**< Queue priority */}CSL_EdmaCmdQueTc;    /** @brief Edma Command Structure used for setting Event Queue threshold level * *  An object of this type is allocated by the user and *  its address is passed as a parameter to the CSL_edmaHwControl API. */typedef struct CSL_EdmaCmdQueueThr {    CSL_EdmaEventQueue         que;              /**< Specifies the Queue whose priority needs to change */    CSL_EdmaEventQueueThr      threshold;        /**< Queue threshold setting */}CSL_EdmaCmdQueThr;    /** @brief This will have the base-address information for the module *  instance */typedef struct {	CSL_EdmaccRegsOvly	regs;					/**< Base-address of the peripheral registers */} CSL_EdmaModuleBaseAddress;/** @brief Edma Region parameter structure used for opening a shadow handle */typedef struct {		Int16 regionNum;							/**< Specifies the region number to be opened*/} CSL_EdmaRegionParam;/** @brief Edma Channel parameter structure used for opening a channel  */typedef struct {		Int regionNum;								/**< Region Number */	Int chaNum;									/**< Channel number */} CSL_EdmaChannelParam;/**@}*//**@addtogroup CSL_EDMA_FUNCTION_MODULE@{*//**************************************************************************\* EDMA global function declarations\**************************************************************************//* * ====================================================== *   @func   CSL_edmaInit * ====================================================== *//** @brief  *     This is EDMA module's init function.  *     This initializes the context Object *     variables.  *      *     Needs to be called before using EDMA module. Also,  *     memory and initialization of the context variables are *     done here. * *//* ====================================================== *   @ret  CSL_Status CSL_SOK * * * ======================================================*/CSL_Status    CSL_edmaInit (        CSL_EdmaContext *   pContext);/* * ====================================================== *   @func   CSL_edmaOpen * ====================================================== *//** @brief  *     Returns a handle to the EDMA Module. This handle is further used *     for invoking all module level control APIs.  * *     This function merely returns a handle  *     to the register overlay structure.  *     This call enables the relocatability of code since the handle  *     can now be used for Module level control commands rather than the usage of  *     of the register layer base address directly. * */ /* ====================================================== *   @arg  edmaObj *		Dummy argument  *   @arg  edmaNum *		Instance Number of the EDMA *   @arg  param *		Dummy argument  *   @arg  status *		Status of the API  *   @ret  Module Handle * * ====================================================== */CSL_EdmaHandle  CSL_edmaOpen(    /* EDMA Module Object pointer. This is NULL. */        CSL_EdmaObj              *edmaObj,    /** instance of EDMA */    CSL_InstNum              edmaNum,    /** EDMA Param pointer i.e NULL in this case */    CSL_EdmaModuleParam      *param,    /** CSL Status */    CSL_Status               *status);/* * ====================================================== *   @func   CSL_edmaClose * ====================================================== *//** @brief  *	   The EDMA module hanlde is invalidated and in order to *	   use the EDMA module it needs to be opened again. */ /* ====================================================== *   @arg  Module Handle *		Handle to the EDMA module *   @ret  CSL Status * * ====================================================== */CSL_Status CSL_edmaClose(    CSL_EdmaHandle			 hEdma);/* Module Level Control APIs *//* * ====================================================== *   @func   CSL_edmaHwControl * ====================================================== *//** @brief  *	   Module level control commands are handled by this API. */ /* ====================================================== *   @arg  hMod *		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/CSL_ESYS_BADHANDLE * * ====================================================== */ CSL_Status  CSL_edmaHwControl(	/** Pointer to the object that holds reference to the     * instance of EDMA requested after the call */	CSL_EdmaHandle           hMod,	/** The command to this API which indicates the action to be taken */	CSL_EdmaHwControlCmd     cmd,	/** Optional argument @a void* casted */	void                     *cmdArg);/** @brief Function to get the Base-address of the peripheral instance. * *  This function is used for getting the base-address of the peripheral *  instance. This function will be called inside the @ CSL_edmaOpen()/CSL_edmaChannelOpen() *  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. Please refer the documentation for *        more details. * * @b Example: * @verbatim      CSL_Status status;      CSL_EdmaModuleBaseAddress   baseAddress;       ...      status = CSL_edmaccGetModuleBaseAddr(CSL_EDMACC_0, NULL, &baseAddress);   @endverbatim * * @return Returns the status of the operation (see @a CSL_Status) * */CSL_Status CSL_edmaccGetModuleBaseAddr(        /** Instance number         */        CSL_InstNum  		edmaNum,        /** Module specific parameters         */        CSL_EdmaModuleParam       *pParam,        /** Base address details         */        CSL_EdmaModuleBaseAddress *pBaseAddress);/* * ====================================================== *   @func   CSL_edmaGetHwStatus * ====================================================== *//** @brief  *	   Module level queries to the EDMA module are handled through this API. */ /* ====================================================== *   @arg  hMod *		Module Handle *   @arg  query *		Module myQuery  *   @arg  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. *    @ret  CSL_Status - CSL_SOK/CSL_ESYS_BADHANDLE * * ====================================================== */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);/**@}*//**@addtogroup CSL_EDMA_FUNCTION_SHADOW@{*/          /* * ====================================================== *   @func   CSL_edmaRegionOpen * ====================================================== *//** @brief  *     Opens an EDMA Shadow region to get access to the shadow region  *     resources. On success, returns a valid handle which can be *     used to access the shadow resources. */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -