csl_uwire.h

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

H
660
字号
typedef struct CSL_UwireObj {
    
    CSL_UwireRegsOvly regs;
	/** This is a pointer to the registers of the instance of UWIRE
     *  referred to by this object
     */
	CSL_InstNum  	perNum;
	/** This is the instance of UWIRE being referred to by this object  */
		
	} CSL_UwireObj;
	
typedef struct CSL_UwireObj *CSL_UwireHandle;

/** @brief This will have the base-address information for the peripheral
 *  instance
 */
 
typedef struct {

    CSL_UwireRegsOvly	regs;
    /** Base-address of the Configuration registers of the peripheral
	 */
		
	} CSL_UwireBaseAddress;
	
/*
 * =============================================================================
 *   @func CSL_uwireInit
 *   @desc
 *         This is UWIRE module's initialization function. 
 *         Currently this function is doing nothing.
 *         This needs to be called before using UWIRE module.
 *
 *   @arg  pContext 
 *         UWIRE specific context information
 *
 *   @ret  CSL_Status
 *         CSL_SOK : Successful, desired operation is done.
 *
 *   @eg
 *         status = CSL_uwireInit(NULL);
 *
 * =============================================================================
*/


CSL_Status CSL_uwireInit(
	
	CSL_UwireContext * pContext
);

/*
 * ============================================================================
 *   @func CSL_uwireOpen
 *
 *   @desc
 *   @n    This function returns the handle to the specified UWIRE instance. 
 *
 *   @arg pUwireObj
 *                Pointer to the object that holds reference to the
 *		          instance of UWIRE requested after the call.
 *
 *   @arg uwireNum	              
 *                Instance of UWIRE to which a handle is requested
 *
 *   @arg pUwireParam	       
 *                Module specific parameters; currently there are no module
 *                specificparameters and the user should pass 'NULL'
 *   @arg pStatus      
 *	 		      This returns the status (success/error)  of the call      
 *                The user may pass NULL,if status information is not required.
 *               
 *   @ret CSL_UwireHandle 		           
 *                handle to the UWIRE instance
 * 
 *   @eg
 *        CSL_Status status;
 *		  CSL_UwireObj uwireObj;
 *        status = CSL_uwireOpen (&uwireObj, CSL_UWIRE_1, NULL, &status);;
 *    
 * =============================================================================
 */

CSL_UwireHandle CSL_uwireOpen (
    CSL_UwireObj            *pUwireObj,
    CSL_InstNum             uwireNum,
    CSL_UwireParam          *pUwireParam,
    CSL_Status              *pStatus
);

/*
 * ============================================================================
 *   @func   CSL_uwireClose
 *   @desc   
 *        Close UWIRE instance (passed as handle) after it has finished
 *        operating. The instance cannot be accessed any more.
 *
 *   @arg  hUwire  
 *              Handle to UWIRE instance
 *
 *   @ret  CSL_Status
 *             CSL_SOK : Successful, desired operation is done.
 *             CSL_ESYS_BADHANDLE : Handle pass is INVALID.
 *   @eg
 *        status = CSL_uwireClose(hUwire);
 *
 * ============================================================================
*/

CSL_Status  CSL_uwireClose(
    CSL_UwireHandle           hUwire
    );

/*
 * ===========================================================================
 *   @func   CSL_uwireHwSetup
 *   @desc
 *       Configures a UWIRE instance using the different  config structures.  
 *       Sets up a particular UWIRE instance (passed as handle) using the
 *       configurations specified in the structure CSL_uwireHwSetup.
 *       The function will return an error if cannot complete the request.
 *
 *   @arg  hUwire   
 *              Handle to the DSP mmu instance
 *              
 *   @arg  hwSetup  
 *              UWIRE's setup structure
 *              
 *   @ret  CSL_Status
 *              CSL_SOK : Successful, desired operation is done.
 *              CSL_ESYS_INVPARAMS : Parameters passed is NULL.
 *   @eg
 *      status = CSL_uwireHwSetup (hUwire, &hwSetup);
 *
 * ============================================================================
*/

CSL_Status  CSL_uwireHwSetup(
    CSL_UwireHandle           hUwire,
    CSL_UwireHwSetup          *setup
);
    
/*
 * ============================================================================
 *   @func   CSL_uwireGetHwSetup
 *   @desc
 *     Retrieves UWIRE instance's current register field value configuration. 
 *     The function will return an error if cannot complete  the request
 *
 *   @arg  hUwire
 *              Handle to the UWIRE instance
 *   @arg  hwSetup
 *              Pointer to place holder for the UWIRE 
 *              hwsetup structure
 *   @ret  CSL_Status
 *         CSL_SOK : Successful, desired operation is done.
 *         CSL_ESYS_INVPARAMS : Parameters passed is NULL.
 *   @eg
 *      status = CSL_uwireGetHwSetup (hUwire, &uwireHwSetup);
 *
 * ============================================================================
*/

CSL_Status  CSL_uwireGetHwSetup(
    CSL_UwireHandle          hUwire,
    CSL_UwireHwSetup         *hwSetup
);

/*
 * ============================================================================
 *   @func   CSL_uwireHwSetupRaw
 *   @desc
 *     Configures a UWIRE instance using the register values specified in config 
 *     structure.The function will return an error if it cannot complete 
 *     the request.
 *
 *   @arg  hUwire
 *              Handle to the DSP mmu instance
 *   @arg  config
 *              Pointer to UWIRE's config structure
 *   @ret  CSL_Status
 *             CSL_SOK : Successful, desired operation is done.
 *             CSL_ESYS_INVPARAMS : Parameters passed is NULL.
 *   @eg
 *      status = CSL_uwireHwSetupRaw (hUwire, &uwireConfig);
 *
 * ============================================================================
*/


CSL_Status  CSL_uwireHwSetupRaw(
    CSL_UwireHandle     hUwire,
    CSL_UwireConfig *   setup
);

/*
 * ============================================================================
 *   @func   CSL_uwireHwControl
 *   @desc   
 *     Controls the parameters of a particular UWIRE instance (passed as handle)
 *     Usage Constraints:
 *              Instance should have been opened before with a valid handle
 *   @arg  hUwire
 *              Handle to the instance
 *   @arg  cmd
 *              The operation to be performed.
 *   @arg  cmdArg
 *              This is a void pointer, and will be cast to the 
 *              required type.
 *   @ret  CSL_Status
 *   @eg
       status = CSL_uwireHwControl(hUwire, CSL_UWIRE_CMD_START, NULL);
 *  
 *=============================================================================
 */

CSL_Status  CSL_uwireHwControl(
    CSL_UwireHandle           hUwire,
    CSL_UwireHwControlCmd 	  cmd,
    void                      *cmdArg
);


/*
 * ============================================================================
 *   @func   CSL_uwireGetHwStatus
 *   @desc
 *     Traces the various parameters of UWIRE instance 
 *     (passed as handle)
 *
 *     Usage Constraints:
 *     Instance should have been opened before with a valid
 *     handle. We should know that the registers can be
 *     read back.
 *   @arg  hUwire
 *              Handle to the UWIRE instance
 *   @arg  myQuery
 *              The Values to be traced back
 *   @arg  response
 *              This is a void pointer, and will be cast to 
 *              the required type.
 *   @ret  CSL_Status
 *              CSL_SOK : Successful Retreive, 
 *                       (* cmdArg) will have the desired value.
 *              CSL_ESYS_INVQUERY : Query Command is not supported.
 *
 *   @eg
	   status = CSL_uwireGetHwStatus(hUwire, 
	                                 CSL_UWIRE_QUERY_RDRB, &cmdArg);
 * ============================================================================
 */

CSL_Status  CSL_uwireGetHwStatus(
    CSL_UwireHandle           hUwire,
    CSL_UwireHwStatusQuery    myQuery,
    void                      *response
);


/** ===========================================================================
 *   @n@b CSL_uwireGetBaseAddress
 *
 *   @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_uwireOpen()
 *      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 Arguments
 *   @verbatim
            uwireNum         Handle to the UWIRE instance
 
            pUwireParam      Pointer to module specific param structure
            
            pBaseAddress     Pointer to place holder for base address
 
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK - Hardware setup successful
 *   @li                    CSL_ESYS_FAIL - Invalid instance number
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n   1. The status is returned. If status
 *           returned is
 *   @li            CSL_OK                Hardware setup successful
 *   @li            CSL_ESYS_FAIL         Invalid instance number
 *
 *        2. "pUwireParam" & "pBaseAddress" are populated
 *
 *
 *   @b Modifies
 *   @n   1. Module specific param structure "pUwireParam" & 
 *            base address structure "pBaseAddress"
 *
 *
 *   @b Example
 * @verbatim

      CSL_Status             status;
      CSL_UwireBaseAddress   baseAddress;
      ...
      status = CSL_uwireGetBaseAddress(CSL_UWIRE, NULL, &baseAddress);
   @endverbatim
 * ===========================================================================
 */

CSL_Status CSL_uwireGetBaseAddress(
        CSL_InstNum  		    uwireNum,
        CSL_UwireParam *		pUwireParam,
        CSL_UwireBaseAddress *	pBaseAddress
);

#ifdef __cplusplus
}
#endif


#endif /*_CSL_UWIRE_H_*/		

⌨️ 快捷键说明

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