csl_ledpg.h

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

H
550
字号
 *   @desc
 *     This function populates the peripheral data object for the instance and
 *     returns a handle to the instance
 *
 *   @arg   hLedpgObj
 *          Pointer to the LEDPG instance object 
 *
 *   @arg   ledpgNum
 *          Instance of the LEDPG to be opened
 *
 *   @arg   pLedpgParam
 *          Pointer to module specific parameters
 *
 *   @arg   pStatus
 *          pointer for returning status of the function call
 *
 *   @ret   CSL_LedpgHandle
 *          Valid LEDPG instance handle will be returned if status value is
 *          equal to CSL_SOK.
 *
 *   @eg
 *          CSL_status              status;
 *          CSL_LedpgObj            hLedpgObj;
 *          CSL_LedpgHandle         hLedpg;
 *
 *          hLedpg = CSL_ledpgOpen (&hLedpgObj, CSL_LEDPG_1, NULL, &status);
 * =============================================================================
 */
extern CSL_LedpgHandle  CSL_ledpgOpen (
    CSL_LedpgObj             *hLedpgObj,
    CSL_InstNum              ledpgNum,
    CSL_LedpgParam           *pLedpgParam,
    CSL_Status               *pstatus
);

/*
 * =============================================================================
 *   @func   CSL_ledpgClose
 *
 *   @desc
 *      This function closes the LEDPG instance specified by its handle.
 *
 *   @arg   hLedpg
 *          The handle to the LEDPG instance.
 *
 *   @ret   CSL_Status
 *          CSL_SOK : Successful, desired operation is done.
 *          CSL_ESYS_BADHANDLE : handle pass is invalid.
 *
 *   @eg
 *          status = CSL_ledpgClose(hLedpg);
 * =============================================================================
 */
extern CSL_Status  CSL_ledpgClose(
    CSL_LedpgHandle           hLedpg
);

/*
 * =============================================================================
 *   @func   CSL_ledpgHwSetup
 *
 *   @desc
 *      This function sets the specified LEDPG H/W parameters
 *
 *   @arg   hLedpg
 *          The handle to the LEDPG instance
 *
 *   @arg   setup
 *          The setup structure used to setup LEDPG device
 *
 *   @ret   CSL_Status
 *          CSL_SOK : Desired operation is done successful
 *          CSL_ESYS_INVPARAMS : Parameters passed is NULL.
 *
 *   @eg
 *          CSL_LedpgHwSetup     setup = CSL_LEDPG_HWSETUP_DEFAULTS;
 *          
 *          status = CSL_ledpgHwSetup(hLedpg, &setup);
 * =============================================================================
 */
extern CSL_Status  CSL_ledpgHwSetup (
    CSL_LedpgHandle           hLedpg,
    CSL_LedpgHwSetup          *setup
);

/*
 * =============================================================================
 *   @func CSL_ledpgHwSetupRaw
 *
 *   @desc
 *      This function configures the registers of LEDPG instance as per the 
 *      values given in the Config structure.  
 *
 *   @arg   hLedpg
 *          Handle to the LEDPG instance
 *
 *   @arg   ledpgConfig
 *          Pointer to the LEDPG config structure
 *
 *   @ret   CSL_Status
 *          CSL_SOK - Configuration successful
 *          CSL_ESYS_BADHANDLE - Invalid handle
 *
 *   @eg
 *          CSL_status          status;
 *          CSL_LedpgConfig       ledpgConfig = CSL_LEDPG_CONFIG_DEFAULTS;
 *          
 *          status = CSL_ledpgHwsetupRaw (hLedpg, &ledpgConfig);
 * =============================================================================
 */

 extern CSL_Status CSL_ledpgHwSetupRaw (
     CSL_LedpgHandle    hLedpg,
     CSL_LedpgConfig    *ledpgConfig
 );

/*
 * =============================================================================
 *   @func CSL_ledpgGetHwSetup
 *
 *   @desc
 *      This function is for quering the hardware setup parameters. It 
 *      passes back the setup paramters.
 *
 *   @arg   hLedpg
 *          Handle to the LEDPG instance
 *
 *   @arg   setup
 *          Pointer to hardware setup structure
 *
 *   @ret   CSL_Status
 *          CSL_SOK : Successful, desired operation is done.
 *          CSL_ESYS_BADHANDLE : handle pass is invalid.
 *
 *   @eg
 *          CSL_Status              status;
 *          CSL_LedpgHandle         hLedpg;
 *          CSL_LedpgHwSetup        setup;
 *
 *          status = CSL_ledpgGetHwSetup (hLedpg, &setup);      
 * =============================================================================
 */

extern CSL_Status  CSL_ledpgGetHwSetup(
    CSL_LedpgHandle       hLedpg,
    CSL_LedpgHwSetup      *setup
);

/*
 * =============================================================================
 *   @func   CSL_ledpgHwControl
 *   @desc
 *      Function controls the LEDPG peripheral specified by the hanldle.
 *      Operation done is based on the "cmd".
 *
 *   @arg   hLedpg
 *          The handle to the LEDPG instance
 *
 *   @arg   cmd
 *          Control command which needs to performed
 *
 *   @arg   cmdArgs
 *          Argument related to the command
 *
 *   @ret   CSL_Status
 *          CSL_SOK : Desired operation is done successful
 *          CSL_ESYS_INVCMD : Control command is not supported
 *
 *   @eg
 *          CSL_Status  status;
 *
 *          status = CSL_ledpgHwControl(hledpg, CSL_LEDPG_CMD_ON, NULL);
 *
 * =============================================================================
 */
extern CSL_Status  CSL_ledpgHwControl(
    CSL_LedpgHandle             hLedpg,
    CSL_LedpgHwControlCmd       cmd,
    void                        *cmdArg
);

/*
 * =============================================================================
 *   @func   CSL_ledpgGetHwStatus
 *
 *   @desc
 *      This function query's the H/W - LEDPG specified by the handle, 
 *      query is specified by the CSL_LedpgHwQuery command.
 *
 *   @arg   hLedpg
 *          Handle to LEDPG object instance
 *
 *   @arg   myQuery
 *          User's query
 *
 *   @arg   response
 *          Slot for saving response to query placed
 *
 *   @ret   CSL_Status
 *          CSL_SOK : Successful Retreive, response will have the desired value
 *          CSL_ESYS_INVQUERY : Query option is not supported
 *
 *   @eg
 *          CSL_Status  status;
 *          void        *response;
 *          ...
 *          status = CSL_ledpgGetHwStatus(hLedpg, CSL_LEDPG_QUERY_PERIOD, 
 *                                      (void *)&response);
 * =============================================================================
 */
extern CSL_Status  CSL_ledpgGetHwStatus(
    CSL_LedpgHandle             hLedpg,
    CSL_LedpgHwStatusQuery      myQuery,
    void                        *response
);

/** ============================================================================
 *   @n@b CSL_ledpgGetBaseAddress
 *
 *   @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_ledpgOpen()
 *       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      
            ledpgNum        Specifies the instance of LEDPG to be opened
 
            pLedpgParam     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  Base address structure is modified
 *
 *   @b Example
 *   @verbatim
        CSL_Status              status;
        CSL_LedpgBaseAddress    baseAddress;

        ...
        status = CSL_ledpgGetBaseAddress(CSL_LEDPG_1, NULL, &baseAddress);

    @endverbatim
 * =============================================================================
 */
extern CSL_Status   CSL_ledpgGetBaseAddress (    
        CSL_InstNum             ledpgNum,
        CSL_LedpgParam          *pLedpgParam,
        CSL_LedpgBaseAddress    *pBaseAddress 
);

#ifdef __cplusplus
}
#endif

#endif

⌨️ 快捷键说明

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