csl_dma.h

来自「dsp在音频处理中的运用」· C头文件 代码 · 共 1,054 行 · 第 1/3 页

H
1,054
字号
    CSL_DmaObj*		    pDmaObj,    /** Instance of DMA to which a handle is requested     */    CSL_InstNum              dmaNum,    /** Module specific parameters;     * Currently there are none; the user should pass 'NULL'     */    CSL_DmaParam          *pDmaParam,    /** This returns the status (success/errors) of the call.     * Could be 'NULL' if the user does not want status information.     */    CSL_Status              *pStatus	);/** *  The Close call releases the resource and appropriate shared pins. * *  <b> Usage Constraints: </b> *  Both @a CSL_dmaInit() and @a CSL_dmaOpen() must be called successfully *  in that order before CSL_dmaClose() can be called. * *  @b Example: *  @verbatim      CSL_DmaHandle hDma;      ...      CSL_dmaClose(hDma);    @endverbatim * * @return returns the status of the operation (see @a CSL_Status) * Status is: *		CSL_SOK, if close function succeeds. *		CSL_ESYS_BADHANDLE, if the handle is not valid. * */ CSL_Status  CSL_dmaClose(    /** Pointer to the object that holds reference to the     *  instance of DMA channel requested after the CSL_dmaOpen(...) call	 */    CSL_DmaHandle         hDma);/** * This function initializes the device registers with * the appropriate values provided through the HwSetup Data structure. * This function needs to be called only if the HwSetup Structure was * not previously passed through the Open call. * For information passed through the HwSetup Data structure refer * @a CSL_DmaHwSetup. * * <b> Usage Constraints:</b> * Both @a CSL_dmaInit() and @a CSL_dmaOpen() must be called successfully * in that order before CSL_dmaHwSetup() can be called. The user has to * allocate space for & fill in the main setup structure appropriately before * calling this function * * @b Example: * @verbatim     CSL_DmaHandle hDma;     CSL_Status status;     CSL_DmaHwSetup  setup;	 CSL_DmaHwSetupGlobal  globalSetup = {鄛;	 CSL_DmaHwSetupSrcPort srcSetup = {鄛;	 CSL_DmaHwSetupDstPort dstSetup = {鄛;	 CSL_DmaHwSetupChannel channelSetup = {鄛 ;	 CSL_DmaHwSetupIntr intrSetup = {鄛;	 setup.srcStruct  = &srcSetup ;	 setup.dstStruct  = &dstSetup ;	 setup.channelStruct  = &channelSetup ;	 setup.globalStruct  = &globalSetup ;     status = CSL_dmaHwSetup (hDma, &hwSetup);   @endverbatim * * @return Returns the status of the setup operation (see @a CSL_Status) * Status is: * CSL_SOK - successful completion of the setup * CSL_ESYS_INVPARAMS - hwSetup structure is not initialized. */ CSL_Status  CSL_dmaHwSetup(    /** Pointer to the object that holds reference to the     *  instance of DMA channel requested after the call	 */    CSL_DmaHandle         hDma,    /** Pointer to setup structure which contains the     *  information to program DMA to a useful state	 */    CSL_DmaHwSetup        *setup);/** This function initializes the device registers with the register-values *  provided through the Config Data structure.  For information passed through *  the Config Data structure refer to @a CSL_DmaConfig. * *  <b> Usage Constraints: </b> *  The user has to allocate space for & fill in the main setup structure *  appropriately before calling this function. * * @b Example: * @verbatim     CSL_DmaHandle hDma;     CSL_DmaConfig config;     config.channel.CSSAL = 0x1234;     config.channel.CSSAU = 0x0078;     ....     ....     ....     CSL_dmaHwSetupRaw(hDma, &config);  @endverbatim * * @return Returns the status of the setup operation * */ CSL_Status  CSL_dmaHwSetupRaw(    CSL_DmaHandle     hDma,    CSL_DmaConfig *   setup);/** Gets the current hardware setup of DMA. The obtaining of setup through * this API is the reverse operation of @a CSL_dmaHwSetup() function. * * <b> Usage Constraints: </b> * Both @a CSL_dmaInit() and @a CSL_dmaOpen() must be called successfully * in that order before @a CSL_dmaGetHwSetup() can be called. The argument * is a setup structure which consists of pointers to sub-structures & so on. * Only those sub-structures which are required should be populated. The other * pointers must be set to NULL. * * @b Example: * @verbatim    CSL_DmaHandle hDma;    CSL_DmaHwSetup  setup;	CSL_DmaHwSetupGlobal  globalSetup ;	CSL_DmaHwSetupSrcPort srcSetup ;	CSL_DmaHwSetupDstPort dstSetup ;	CSL_DmaHwSetupChannel channelSetup '	CSL_DmaHwSetupIntr intrSetup ;	setup.srcStruct  = &srcSetup ;	setup.dstStruct  = &dstSetup ;	setup.channelStruct  = &channelSetup ;	setup.globalStruct  = &globalSetup ;	setup.intrStruct = NULL ;    ...    ...	CSL_dmaGetHwSetup(hDma, &hwSetup);   @endverbatim * * @return returns the status of the operation * */CSL_Status  CSL_dmaGetHwSetup(    /** pointer to the object that holds reference to the     * instance of DMA requested after the call */    CSL_DmaHandle                         hDma,    /** the query to this API which indicates the status/setup     * to be returned */    CSL_DmaHwSetup                        *setup);/** *  Control operations for the DMA channel. For a particular control *  operation, the pointer to the corresponding data type needs *  to be passed as argument in HwControl function Call. All the *  arguments (Structure elements included) passed to  the HwControl *  function are inputs. For the list of commands supported and argument *  type that can be @a void* casted & passed with a particular command *  refer to @a CSL_DmaHwControlCmd * *	<b> Usage Constraints:</b> *  Both @a CSL_dmaInit() and @a CSL_dmaOpen() must be called successfully *  in that order before CSL_dmaHwControl() can be called. For the *  argument type that can be @a void* casted & passed with a particular command *  refer to @a CSL_DmaHwControlCmd * *  @b Example: *  @verbatim    1. Code snippet to start data transfer:        CSL_DmaHandle hDma;        CSL_Status status;        ...        status = CSL_dmaHwControl(hDma, CSL_DMA_CMD_START, NULL);	2. Code snippet to change source address:	    CSL_Uint32 srcAddr2 = 0x3017;	    status = CSL_dmaHwControl(hDma, CSL_DMA_CMD_CHNG_SRC, &srcAddr2);    @endverbatim * * @return Returns the status of the operation (see @a CSL_Status) * Status is: *	CSL_SOK - successful completion of the operation. *  CSL_ESYS_INVCMD - command passed is not a valid control command for DMA * */ CSL_Status  CSL_dmaHwControl(    /** Pointer to the object that holds reference to the     *  instance of DMA channel requested after the call	 */    CSL_DmaHandle     hDma,    /** The command to this API, which indicates the action to be taken	 */    CSL_DmaHwControlCmd   cmd,    /** An optional argument @a void* casted	 */    void          *voidPtr);/** *  This function is used to read the current device configuration *  and the value present in associated registers. User should allocate *  memory for the said data type and pass its pointer as an unadorned *  void* argument to the status query call. For details about the various *  status queries supported and the associated data structure to record the *  response, refer to @a CSL_DmaHwStatusQuery. * *  <b> Usage Constraints: </b> *  Both @a CSL_dmaInit() and @a CSL_dmaOpen() must be called successfully *  in that order before @a CSL_dmaGetHwStatus() can be called. For the *  argument type that can be void* casted & passed with a particular command, *  refer to @a CSL_DmaHwStatusQuery * *  @b Example: *  @verbatim     Code snippet to get DMA status     CSL_DmaHandle hDma;     CSL_Status status;     CSL_DmaStatus dmaStatus ;     ...     status = CSL_dmaGetHwStatus(hDma,                                  CSL_DMA_QUERY_STATUS,                                  &dmaStatus);   @endverbatim * *  @return Returns the status of the operation (see @a CSL_Status) * Status is: *		CSL_SOK - successful completion of the query *		CSL_ESYS_INVQUERY - query command not supported */ CSL_Status  CSL_dmaGetHwStatus(    /** Pointer to the object that holds reference to the     *  instance of DMA channel requested after the call	 */    CSL_DmaHandle           hDma,    /** The query to this API, which indicates the status     *  to be returned	 */    CSL_DmaHwStatusQuery    query,    /** Placeholder to return the status; @a void* casted	 */    void                    *response);/** *  This function is used to read the chip context info. User should allocate *  memory for the said data type and pass its pointer as an unadorned *  void* argument to the status query call. For details about the various *  status queries supported and the associated data structure to record the *  response, refer to @a CSL_DmaChipCtxtQuery. * *  <b> Usage Constraints: </b> *  Both @a CSL_dmaInit() and @a CSL_dmaOpen() must be called successfully *  in that order before @a CSL_dmaGetHwStatus() can be called. For the *  argument type that can be void* casted & passed with a particular command, *  refer to @a CSL_DmaChipCtxtQuery * *  @b Example: *  @verbatim     Code snippet to get event ID     CSL_DmaHandle hDma;     CSL_Status status;     CSL_IntcEventId eventId ;     ...     status = CSL_DmaChipCtxtQuery(hDma,                                  CSL_DMA_CHIPCTXTQUERY_EVENTID,                                  &eventId);   @endverbatim * *  @return Returns the status of the operation (see @a CSL_Status) *  Status is: *		CSL_SOK - successful completion of the query *		CSL_ESYS_INVQUERY - query command not supported */ CSL_Status  CSL_dmaGetChipCtxt(    /** Pointer to the object that holds reference to the     *  instance of DMA channel requested after the call	 */    CSL_DmaHandle           hDma,    /** The chip context query, which indicates the chip context     *  to be returned	 */    CSL_DmaChipCtxtQuery    query,    /** Placeholder to return the chip context; @a void* casted	 */    void                    *response);/** @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_dmaOpen() *  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_DmaBaseAddress   baseAddress;       ...      status = CSL_dmaGetBaseAddress(CSL_DMA_1, NULL, &baseAddress);   @endverbatim * * @return Returns the status of the operation (see @a CSL_Status) * */CSL_Status CSL_dmaGetBaseAddress(        /** Instance number         */        CSL_InstNum  		dmaNum,        /** Module specific parameters         */        CSL_DmaParam *		pDmaParam,        /** Base address details         */        CSL_DmaBaseAddress *	pBaseAddress);#ifdef __cplusplus}#endif#endif

⌨️ 快捷键说明

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