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

📄 csl_dmax.h

📁 基于ti tms320c672x下音频开发例子程式
💻 H
📖 第 1 页 / 共 3 页
字号:
 *  pointer to the corresponding data type needs to be passed as argument 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_DmaxHwControlCmd.
 *
 *  <b> Usage Constraints: </b>
 *  Both @a CSL_dmaxInit() and @a CSL_dmaxOpen() must be called successfully
 *  in that order before @a CSL_dmaxHwControl() can be called. For the
 *  argument type that can be @a void* casted & passed with a particular command
 *  refer to @a CSL_DmaxHwControlCmd
 *
 * @b Example:
 * @verbatim
       CSL_DmaxHandle hDmax;
       CSL_Status status;
       ...
       status = CSL_dmaxHwControl(hDmax,
                                    CSL_DMAX_CMD_START,
                                   &command);
   @endverbatim
 *
 *  @return returns the status of the operation (see @a CSL_Status)
 *
 */
CSL_Status  CSL_dmaxHwControl(
    /** Pointer to the object that holds reference to the
     *  instance of DMAX requested after the call
     */
    CSL_DmaxHandle                        hDmax,
    /** The command to this API indicates the action to be taken
     */
    CSL_DmaxHwControlCmd                  cmd,
    /** An optional argument @a void* casted
     */
    void                                 *arg
);

/** =============================================================================
 *   @func CSL_dmaxHwSetupRaw
 *
 *   @desc
 *       This function configures the registers of DMAX as per the values given
 *       in the Config structure.
 *
 *   @arg hDmax
 *        Handle to the DMAX instance
 *
 *   @arg hwConfig
 *        Pointer to DMAX config structure
 *
 *   @ret CSL_Status
 *         CSL_SOK             - Configuration successful
 *         CSL_ESYS_BADHANDLE  - Invalid handle
 *
 *   @eg
 *
 *        CSL_Status            status;
 *        CSL_DmaxConfig     	hwConfig;
 *
 *        status = CSL_dmaxHwsetupRaw (hDmax, &hwConfig);
 *
 * ===========================================================================
 */

extern CSL_Status  CSL_dmaxHwSetupRaw (
    CSL_DmaxHandle           hDmax,
    CSL_DmaxConfig *         config
);

/** This function is used to read the current device configuration, status
 *  flags and the value present associated registers. Following table details
 *  the various status queries supported and the associated data structure to
 *  record the response. 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_DmaxHwStatusQuery
 *
 *  <b> Usage Constraints: </b>
 *  Both @a CSL_dmaxInit() and @a CSL_dmaxOpen() must be called successfully
 *  in that order before @a CSL_dmaxGetHwStatus() can be called. For the
 *  argument type that can be @a void* casted & passed with a particular cmd
 *  refer to @a CSL_DmaxHwStatusQuery
 *
 * @b Example:
 * @verbatim
      CSL_DmaxHandle hDmax;
      CSL_Status status;
      Uint16  *response;
       ...
      status = CSL_dmaxGetHwStatus(hDmax,
                           CSL_DMAX_QUERY_BUS_BUSY,
                                  &response);
   @endverbatim
 *
 * @return Returns the status of the operation (see @a CSL_Status)
 *
 */
CSL_Status  CSL_dmaxGetHwStatus(
    /** Pointer to the object that holds reference to the
     *  instance of DMAX requested after the call
     */
    CSL_DmaxHandle                         hDmax,
    /** The query to this API which indicates the status
     *  to be returned
     */
    CSL_DmaxHwStatusQuery                  query,
    /** Placeholder to return the status. @a void* casted */
    void                                  *response
);


/** ============================================================================
 *   @n@b CSL_dmaxGetBaseAddress
 *
 *   @b Description
 *   @n  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_dmaxOpen()
 *       function call. 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
            dmaxNum          Specifies the instance of DMAX to be opened.

            pDmaxParam       Module specific parameters.

            pBaseAddress    Pointer to baseaddress structure containing base
                            address details.

     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_OK            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
 *   @n    1. The status variable
 *
 *         2. Base address structure is modified.
 *
 *   @b Example
 *   @verbatim
        CSL_Status              status;
        CSL_DmaxBaseAddress  baseAddress;

       ...
      status = CSL_dmaxGetBaseAddress(CSL_DMAX_PER_CNT, NULL, &baseAddress);

    @endverbatim
 * ===========================================================================
 */
extern CSL_Status   CSL_dmaxGetBaseAddress (
        CSL_InstNum            dmaxNum,
        CSL_DmaxParam *         pDmaxParam,
        CSL_DmaxBaseAddress *   pBaseAddress
);

/** =======================================================================
 *   @n@b CSL_dmaxSetupFifoDesc
 *
 *   @b Description
 *   @n This function formats a FIFO Descriptor object.
 *   @a CSL_dmaxSetupFifoDesc.
 *
 *   @b Arguments
 *   @verbatim
 *    
 *          fifoObj   	Pointer to data area in RAM where descriptor is to be stored.
 *          setup  		Pointer to a dMax FIFO descriptor Object.
 *           
 *   @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK - Successful completion of hardware     
 *                                    setup
 *   @li                    CSL_ESYS_ INVPARAMS - Hardware structure is not properly 
 *                                    initialized
 *   @li                    CSL_ESYS_ BADHANDLE - Invalid CSL handle
 *
 *
 *   <b> Pre Condition </b>
 *   @n  Both CSL_dmaxInit() and a CSL_dmaxOpen() must be called
 *
 *   <b> Post Condition </b>
 *   @n  DMAX registers are configured 
 *
 *   @b  Modifies
 *   @n  DMAX registers
 *
 *   @b Example
 *   @verbatim  
      CSL_DmaxFifoDescriptor		fifoObj;
      CSL_DmaxFifoDescriptorSetup	setup;
            
    setup.fifoBaseAddr		= 0x20000100;
    .
    .
    setup.wPtr				= 0x10000000;
    
      CSL_dmaxSetupFifoDesc(&fifoObj, &setup);
     @endverbatim
 * 
 * ============================================================================
 */
extern CSL_Status CSL_dmaxSetupFifoDesc(CSL_DmaxFifoDescriptor *fifoObj, 
                                        CSL_DmaxFifoDescriptorSetup *setup);

                                        
/** =======================================================================
 *   @n@b CSL_dmaxStartAsyncTransferMulti
 *
 *   @b Description
 *   @n This function initiates a dMax data transfer by toggling the appropriate 
 *      bit in the ESR(Event Set Register) register for multiple events.
 *   @a CSL_dmaxStartAsyncTransferMulti.
 *
 *   @b Arguments
 *   @verbatim
 *    
 *          hDmax   		Pointer to the dMax Handle Instance
 *           
 *   @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK - Successful completion
 *   @li                    CSL_EDMAX_BAD_ESR_FLAG - Bad ESR Flag
 *   @li                    CSL_ESYS_ BADHANDLE - Invalid CSL handle
 *
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  DMAX registers are configured 
 *
 *   @b  Modifies
 *   @n  DMAX registers
 *
 *   @b Example
 *   @verbatim  
 *     CSL_DmaxHandle			*hDmax;
 *           
 *     CSL_dmaxStartAsyncTransferMulti(hDmax);
 *    @endverbatim
 * 
 * ============================================================================
 */
 extern CSL_Status CSL_dmaxStartAsyncTransferMulti(CSL_DmaxHandle *hDmax);

/** =======================================================================
 *   @n@b CSL_dmaxGetHwSetupFifoXFRParamEntry
 *
 *   @b Description
 *   @n This function initializes the device registers with the appropriate
 *      values provided through the HwSetup Data structure. After the 
 *      Setup is completed, the device is ready for  operation.      
 *      For information passed through the HwSetup Data structure refer
 *   @a CSL_dmaxHwSetup.
 *
 *   @b Arguments
 *   @verbatim
 *    
 *          paramEntry  Pointer to Prameter Table Entry where data is to be stored
 *          setup  		Pointer to a dmax FIFO Transfer Setup Object
 *           
 *   @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK - Successful completion of hardware     
 *                                    setup
 *   @li                    CSL_ESYS_ INVPARAMS - Hardware structure is not properly 
 *                                    initialized
 *   @li                    CSL_ESYS_ BADHANDLE - Invalid CSL handle
 *
 *
 *   <b> Pre Condition </b>
 *   @n  Both CSL_dmaxInit() and a CSL_dmaxOpen() must be called
 *
 *   <b> Post Condition </b>
 *   @n  DMAX registers are configured 
 *
 *   @b  Modifies
 *   @n  DMAX registers
 *
 *   @b Example
 *   @verbatim  
      CSL_DmaxParameterEntry 	paramEntry;
      CSL_dmaxHwSetup 			hwSetup;
      
    hwSetup.linearReload0 = paramEntry[0];
    .
    .
    hwSetup.delayTabPtr1  = paramEntry[9];
    
      CSL_dmaxGetHwSetupFifoXFRParamEntry(hDmax, &hwSetup);
     @endverbatim
 * 
 * ============================================================================
 */
extern CSL_Status CSL_dmaxGetHwSetupFifoXFRParamEntry(CSL_DmaxParameterEntry *, 
                      						CSL_DmaxFifoParameterSetup *);

/** =======================================================================
 *   @n@b CSL_dmaxGetHwSetupGenXFRParamEntry
 *
 *   @b Description
 *   @n This function formats the parameter table entry for a General Purpose
 *      transfer.
 *   @a CSL_dmaxHwSetup.
 *
 *   @b Arguments
 *   @verbatim
 *    
 *          paramEntry  Pointer to Prameter Table Entry where data is to be stored.
 *			cc			Counter configuration.
 *          setup  		Pointer to a dmax General Purpose Transfer Object.
 *           
 *   @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK - Successful completion of hardware     
 *                                    setup
 *   @li                    CSL_ESYS_ INVPARAMS - Hardware structure is not properly 
 *                                    initialized
 *   @li                    CSL_ESYS_ BADHANDLE - Invalid CSL handle
 *
 *
 *   <b> Pre Condition </b>
 *   @n  Both CSL_dmaxInit() and a CSL_dmaxOpen() must be called
 *
 *   <b> Post Condition </b>
 *   @n  DMAX registers are configured 
 *
 *   @b  Modifies
 *   @n  DMAX registers
 *
 *   @b Example
 *   @verbatim  
      CSL_DmaxParameterEntry 		paramEntry;
      Uint8							cc;
      CSL_DmaxGPXFRParameterSetup 	hwSetup;
      
    hwSetup.srcReloadAddr0  = paramEntry[0];
    .
    .
    hwSetup.dstReloadAddr0 	= paramEntry[1];
    
      CSL_dmaxGetHwSetupGenXFRParamEntry(paramEntry, cc, &hwSetup);
     @endverbatim
 * 
 * ============================================================================
 */
extern CSL_Status CSL_dmaxGetHwSetupGenXFRParamEntry(
                      				CSL_DmaxParameterEntry *,
                      				Uint8 , 
                      				CSL_DmaxGPXFRParameterSetup *);



/******************************************************************************
* FUNCTION NAME: _CSL_dmaxSetDetr                                            *
*                                                                            *
*   Regs Modified     : A0,B4,B5,SP                                          *
*   Regs Used         : A0,A4,B3,B4,B5,SP                                    *
*   Local Frame Size  : 0 Args + 4 Auto + 0 Save = 4 byte                    *
******************************************************************************
*/

extern Uint32 CSL_dmaxSetDetr(Uint32);

/******************************************************************************
* FUNCTION NAME: _CSL_dmaxGetDesr                                            *
*                                                                            *
*   Regs Modified     : A4,B4                                                *
*   Regs Used         : A4,B3,B4                                             *
*   Local Frame Size  : 0 Args + 0 Auto + 0 Save = 0 byte                    *
******************************************************************************
*/
extern Uint32 CSL_dmaxGetDesr();

/** =======================================================================
 *   @n@b CSL_dmaxSetupGeneralXFRParameterEntry
 *
 *   @b Description
 *   @n This function formats the parameter table entry for a General Purpose
 *      transfer.
 *   @a CSL_dmaxHwSetup.
 *
 *   @b Arguments
 ******************************************************************************
*/
CSL_Status CSL_dmaxSetupGeneralXFRParameterEntry(
                      			CSL_DmaxParameterEntry *,
                      			Uint8, 
                      			CSL_DmaxGPXFRParameterSetup *);

/******************************************************************************
 *   @n@b CSL_dmaxHwSetupFifoParam
 *
 *   @b Description
 *   @n This function initializes the device registers with the appropriate
 *      values provided through the HwSetup Data structure. After the 
 *      Setup is completed, the device is ready for  operation.      
 *      For information passed through the HwSetup Data structure refer
 *   @a CSL_dmaxHwSetup.
 *
 *   @b Arguments
 ******************************************************************************
*/
CSL_Status CSL_dmaxSetupFifoXFRParameterEntry(
                      		CSL_DmaxParameterEntry *, 
                      		CSL_DmaxFifoParameterSetup *);
                      			

/**============================================================================
* @func CSL_dmaxGetNextFreeResource
* @desc Searchs for next free resource given resource type
* @arg	uid 
*       CSL UID of resource
* @ret  Next Free Resource Index or CSL_ESYS_OVFL if none was found 
**============================================================================*/

Uint32 CSL_dmaxGetNextFreeParamEntry(Uint32 uid, CSL_Status *st);

#ifdef __cplusplus
}
#endif


#endif

⌨️ 快捷键说明

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