csl_cfc.h

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

H
688
字号
 *      status = CSL_cfcInit (NULL);
 * =============================================================================
 */
CSL_Status CSL_cfcInit (
    CSL_CfcContext * pContext
);

/*
 * =============================================================================
 *   @func   CSL_cfcOpen
 *
 *   @desc
 *     Open CFC instance (passed as an integer) to access the hardware resource. 
 *     On success, returns a valid handle which can be used to access the CFC
 *     resources. On failure returns NULL.
 *
 *   @arg  cfcObj
 *              Pointer to the CFC object - to be allocated by the user
 *   @arg  cfcNum
 *              Instance Number of the CFC
 *   @arg  pCfcParam
 *              Module specific parameters.
 *   @arg  status
 *              Pointer to CSL Error Status. Possible values for status after
 *              function call returns are:
 *              CSL_SOK            : Open call is successful
 *              CSL_ESYS_FAIL      : Invalid Instance
 *
 *   @ret  CSL_CfcHandle
 *              Valid handle, if status is CSL_SOK
 *
 *   @eg
 *          CSL_status          status;
 *          CSL_CfcObj          cfcObj;
 *          CSL_CfcHandle       hCfc;
 *
 *          hCfc = CSL_cfcOpen (&cfcObj, CSL_CFC, NULL, &status);
 *          ...
 *
 * =============================================================================
 */
CSL_CfcHandle CSL_cfcOpen (
    CSL_CfcObj*             cfcObj,
    CSL_InstNum             cfcNum,
    CSL_CfcParam *			pCfcParam,
    CSL_Status*             status
);

/** ============================================================================
 *   @n@b CSL_cfcGetBaseAddress
 *
 *   @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_cfcOpen()
 *       function call.
 *
 *   @b Arguments
 *   @verbatim      
            hCfc            Pointer to the peripheral data object for CFC
 
            cfcNum          Specifies the instance of the CFC to be opened.
 
            pCfcParam       Module specific parameters.
 
            pBaseAddress    Pointer to base address structure containing base 
                            address details.
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li				    CSL_OK            Open call is successful
 *   @li					CSL_ESYS_FAIL     The CFC instance is not available.
 *
 *   <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_CfcBaseAddress  baseAddress;

       ...
      status = CSL_cfcGetBaseAddress(CSL_CFC, NULL, &baseAddress);

    @endverbatim
 * ===========================================================================
 */
extern CSL_Status CSL_cfcGetBaseAddress (
        CSL_InstNum  			cfcNum,
        CSL_CfcParam *			pCfcParam,
        CSL_CfcBaseAddress *	pBaseAddress
);

/*
 * =============================================================================
 *   @func   CSL_cfcHwSetup
 *
 *   @desc
 *     Configures a particular CFC instance (passed as handle) using the
 *     configurations specified in the structure CSL_CfcHwSetup. The function 
 *     will return an error if it cannot complete the request.
 *
 *   @arg  hCfc
 *              Handle to the CFC instance
 *   @arg  hwSetup
 *              Hardware setup structure for the CFC
 *
 *   @ret  CSL_Status
 *              CSL_SOK            : Successful, desired operation is done.
 *              CSL_ESYS_INVPARAMS : Parameters passed is NULL.
 *
 *   @eg
 *          CSL_Status          status;
 *          CSL_CfcHwSetup      hwSetup;
 *          CSL_CfcHandle       hCfc;
 *
 *          ...
 *
 *          status = CSL_cfcHwSetup (hCfc, &hwSetup);
 *
 *          ...
 *
 * =============================================================================
 */
CSL_Status CSL_cfcHwSetup (
    CSL_CfcHandle           hCfc,
    CSL_CfcHwSetup*         hwSetup
);

/*
 * ============================================================================
 *   @func CSL_cfcGetHwSetup
 *
 *   @desc
 *        It retrieves the hardware setup parameters 
 *
 *   @arg hCfc
 *        Handle to the CFC instance
 *
 *   @arg hwSetup
 *        Pointer to hardware setup structure
 *
 *   @ret CSL_Status
 *        CSL_SOK             - Get hardware setup successful
 *        CSL_ESYS_BADHANDLE  - Invalid handle
 *
 *   @eg
 *        CSL_status        status;
 *        CSL_CfcHwSetup    hwSetup;
 *        
 *        status = CSL_cfcGetHwsetup (hCfc, &hwSetup);
 *
 * ===========================================================================
 */

extern CSL_Status CSL_cfcGetHwSetup (
    CSL_CfcHandle       hCfc,
    CSL_CfcHwSetup *    hwSetup
);


/*
 * =============================================================================
 *   @func CSL_cfcHwSetupRaw
 *
 *   @desc
 *       This function configures the registers of CFC as per the values given
 *		 in the config structure.  
 *
 *   @arg hCfc
 *        Handle to the CFC instance
 *
 *   @arg hwConfig
 *        Pointer to CFC config structure
 *
 *   @ret CSL_Status
 *         CSL_SOK             - Configuration successful
 *         CSL_ESYS_BADHANDLE  - Invalid handle
 *
 *   @eg
 *        CSL_status            status;
 *        CSL_CfcConfig	        hwConfig = CSL_CFC_CONFIG_DEFAULTS;
 *
 *        status = CSL_cfcHwsetupRaw (hCfc, &hwConfig);
 *
 * =============================================================================
 */
extern CSL_Status  CSL_cfcHwSetupRaw (
    CSL_CfcHandle           hCfc,
    CSL_CfcConfig *         config
);


/*
 * =============================================================================
 *   @func   CSL_cfcHwControl
 *
 *   @desc   
 *     Controls the parameters of a particular CFC instance (passed as handle)
 *
 *     Usage Constraints:
 *       Instance should have been opened before 
 *
 *     Following operations can be done here:
 *      1) Chip Select configuration
 *      2) Reset the card
 *      3) Bring out the card from reset
 *      4) Disable all chip selects for CF access
 *
 *     The function will return an error, if it cannot complete the request
 *
 *   @arg  hCfc
 *              Handle to the instance
 *   @arg  cmd
 *              The operation to be performed.
 *   @arg  arg
 *              This is a void pointer. It is used to pass the argument
 *              associated with the control command. Based on the control
 *              command it is typcast to appropriate data type.
 *
 *   @ret  CSL_Status
 *         CSL_SOK             : Command successful
 *         CSL_ESYS_BADHANDLE  : Invalid handle
 *         CSL_ESYS_INVCMD     : Invalid command   
 *         CSL_ESYS_INVPARAMS  : Invalid parameters
 *
 *   @eg
 *      CSL_Status          status;
 *      CSL_CfcHandle       hCfc;
 *      CSL_CfcCsCfg        csCfg;
 *
 *      ...
 *
 *      status  = CSL_cfcHwControl (hCfc, CSL_CFC_CMD_CONFIG_CS,
 *                                  (void*) &csCfg);
 *
 *      ...
 *
 * =============================================================================
 */
CSL_Status CSL_cfcHwControl (
    CSL_CfcHandle           hCfc,
    CSL_CfcHwControlCmd     cmd,
    void*                   arg
);


/*
 * =============================================================================
 *   @func   CSL_cfcGetHwStatus
 *
 *   @desc
 *     Retrieves the various parameters of CFC instance 
 *     (passed as handle)
 *
 *     Usage Constraints:
 *     Instance should have been opened before.
 *
 *     The are various Operations that can be done here are:
 *       1) Get last read access status
 *       2) Get last write access status
 *       3) Get CS configuration
 *       4) Get card reset status
 *       5) Get card detect status
 *
 *       The function will return an error if cannot complete
 *       the request
 *
 *   @arg  hCfc
 *              Handle to the CFC instance
 *   @arg  query
 *              The status query command
 *   @arg  arg
 *              This is a void pointer. It is used to pass the argument
 *              associated with the status command. Based on the query command
 *              it is typcast to appropritate data type.
 *
 *   @ret  CSL_Status
 *              CSL_SOK            : Successful Retrieve, (* arg) will have
 *                                    the desired value.
 *              CSL_ESYS_INVQUERY  : Query Command is not supported.
 *              CSL_ESYS_BADHANDLE : Invalid handle
 *              CSL_ESYS_INVQUERY  : Invalid query
 *              CSL_ESYS_INVPARAMS : Invalid parameters
 *
 *   @eg
 *      CSL_Status          status;
 *      CSL_CfcCsCfg        csCfg;
 *      CSL_CfcHandle       hCfc;
 *
 *      ...
 *
 *      status = CSL_cfcGetHwStatus (hCfc, CSL_CFC_GET_CS_CFG,
 *                                   (void*) &csCfg);
 *
 *      ...
 *
 * =============================================================================
*/
CSL_Status CSL_cfcGetHwStatus (
    CSL_CfcHandle           hCfc,
    CSL_CfcHwStatusQuery    query,
    void*                   arg
);

/*
 * =============================================================================
 *   @func   CSL_cfcClose
 *
 *   @desc   
 *     This function marks that CSL for the CFC instance is closed. CSL for the
 *     CFC instance need to be reopened before using any CFC CSL API again.
 *
 *   @arg  hCfc
 *              Handle to CFC instance
 *
 *   @ret  CSL_Status
 *              CSL_SOK            : Successful, desired operation is done.
 *              CSL_ESYS_BADHANDLE : Handle is Invalid.
 *
 *   @eg
 *      status = CSL_cfcClose (hCfc);
 *
 * =============================================================================
*/
CSL_Status CSL_cfcClose (
    CSL_CfcHandle       hCfc
);


#ifdef __cplusplus
}
#endif

#endif  /* _CSL_CFC_H_ */

⌨️ 快捷键说明

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