csl_emiff.h

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

H
1,042
字号
 *  this call. This object must be retained while usage of this peripheral. * *  @b Example: *  @verbatim	  CSL_EmiffObj     emiffObj;	  CSL_Status       status; 		...	  hEmiff = CSL_emiffOpen(&emiffObj,                          CSL_EMIFF_1,                          NULL,                          &status);   @endverbatim * * @return returns a handle @a CSL_EmiffHandle to the requested instance of * EMIFF if the call is successful, otherwise, a @a NULL is returned. * */CSL_EmiffHandle CSL_emiffOpen (    /** Pointer to the object that holds reference to the     *  instance of EMIFF requested after the call     */    CSL_EmiffObj*		    pEmiffObj,    /** Instance of EMIFF to which a handle is requested     */    CSL_InstNum              emiffNum,    /** Module specific parameters;     * Currently there are none; the user should pass 'NULL'     */    CSL_EmiffParam          *pEmiffParam,    /** 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. * */ CSL_Status  CSL_emiffClose(    /** Pointer to the object that holds reference to the       instance of EMIFF requested after the call	 */    CSL_EmiffHandle	      hEmiff);/** * 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_EmiffHwSetup. * * <b> Usage Constraints:</b> * Both @a CSL_emiffInit() and @a CSL_emiffOpen() must be called successfully * in that order before CSL_emiffHwSetup() 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_EmiffHwSetup hwSetup;  	// Inititialize DLL control setup structure with some values  	CSL_EmiffDllControl dllControl = {0x1, 0x5, CSL_EMIFF_DLLEN_ENABLE, CSL_EMIFF_DLLPHASE_90,  									  0x2, 0x6, CSL_EMIFF_DLLEN_DISABLE, CSL_EMIFF_DLLPHASE_72,  									  0x4, 0x8, CSL_EMIFF_DLLEN_ENABLE, CSL_EMIFF_DLLPHASE_90};  	// Inititialize Consecutive Acces setup structure with some values  	CSL_EmiffConsecAccess consecAccess = {4, 3, 2, 1};  	// Inititialize Dynamic Arbitration Priority Timeout structure with some values  	CSL_EmiffDynPriTimeout dynPriTimeout = {0x11, 0x22, 0x33, 0x44};  	//Initialize SDRAM config setup structure with default values  	CSL_EmiffSdramConfig sdramConfig = CSL_EMIFF_DEFAULTS_SDRAMCONFIG ;  	//Initialize SDRAM Operation setup structure with default values  	CSL_EmiffSdramOperation operation = {0x10, 0x20, 0x30, 0x40, CSL_EMIFF_SDRAMOPMODE_HPHB }  ;  	// Modify the SDRAM config setup with values corresponding to 1610 EVM.  	//And construct the overall setup object  	sdramConfig.arcv = 0x32 ;  	sdramConfig.sdramDataBusSize = CSL_EMIFF_SDRAMDATABUSSIZE_16 ;  	sdramConfig.sdramBankCnt = CSL_EMIFF_SDRAMBANKCNT_4 ;  	sdramConfig.sdramMemSize = CSL_EMIFF_SDRAMMEMSIZE_128 ;  	hwSetup.sdramDevType = CSL_EMIFF_SDRAMDEVTYPE_MOBILE_SDR ; //CSL_EMIFF_SDRAM_DEVICE_MOBILE_DDR ;  	hwSetup.consecAccess = &consecAccess ;  	hwSetup.dllControl = &dllControl ;  	hwSetup.dynPriTimeout = &dynPriTimeout;  	hwSetup.sdramConfig = &sdramConfig ;  	hwSetup.sdramOperation = &operation;  	//Obtain handle to EMIFF object  	hEmiff = CSL_emiffOpen(&emiffObj, CSL_EMIFF_0, CSL_EXCLUSIVE, NULL, &status);    //Setup the EMIFF    CSL_emiffHwSetup(hEmiff, &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_emiffHwSetup(    /** Pointer to the object that holds reference to the     *  instance of EMIFF requested after the call	 */    CSL_EmiffHandle	      hEmiff,    /** Pointer to setup structure which contains the     *  information to program EMIFF to a useful state	 */    CSL_EmiffHwSetup	      *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_EmiffConfig. * *  <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_EmiffHandle hEmiff;     CSL_EmiffConfig config;     config.CR = 0x1234;     config.OPR = 0x0078;     ....     ....     ....     CSL_emiffHwSetupRaw(hEmiff, &config);  @endverbatim * * @return Returns the status of the setup operation * */ CSL_Status  CSL_emiffHwSetupRaw(    CSL_EmiffHandle     hEmiff,    CSL_EmiffConfig *   setup);/** Gets the current hardware setup of EMIFF. The obtaining of setup through * this API is the reverse operation of @a CSL_emiffHwSetup() function. * * <b> Usage Constraints: </b> * Both @a CSL_emiffInit() and @a CSL_emiffOpen() must be called successfully * in that order before @a CSL_emiffGetHwSetup() 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_EmiffHwSetup  setup;		setup.sdramConfig  = {鄛 ;		setup.consecAccess = {鄛 ;		setup.dynPriTimeout = {鄛 ;		setup. sdramOperation = {...} ;		setup.dllControl = {鄛 ;        CSL_emiffGetHwSetup(hEmiff, &etup);   @endverbatim * * @return returns the status of the operation * */CSL_Status  CSL_emiffGetHwSetup(    /** pointer to the object that holds reference to the     * instance of EMIFF requested after the call */    CSL_EmiffHandle                         hEmiff,    /** the query to this API which indicates the status/setup     * to be returned */    CSL_EmiffHwSetup                        *setup);/** * Initializes external SDRAM for use * * @b Example: * @verbatim     CSL_EmiffSdramDevType sdramDevType = CSL_EMIFF_SDRAMDEVTYPE_STANDARD_SDR ; 	  CSL_EmiffHandle myhEmiff ;     CSL_EmiffObj emiffObj ; 	  CSL_Status status;     .......     myhEmiff = CSL_emiffOpen(&emiffObj, 0, CSL_EXCLUSIVE, NULL, status);     if(myhEmiff != NULL)     { 	 // Your code goes here 		...... 		...... 	CSL_emiffSdramInit(myhEmiff, sdramDevType); 		......     }   @endverbatim * @return Returns a handle @a CSL_emiffHandle to the requested instance of * EMIFF if the call is successful, otherwise, a @a NULL is returned. * Please check for the appropriate status condition. Status field will * contain: *	CSL_SOK  - if open call is success. */ CSL_Status  CSL_emiffSdramInit(    /** Pointer to the object that holds reference to the     *  instance of EMIFF requested after the call	 */    CSL_EmiffHandle	      hEmiff,    /**	SDRAM type (SDR/DDR) */    CSL_EmiffSdramDevType     sdramDevType);/** *  Control operations for the EMIFF. 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_EmiffHwControlCmd * *	<b> Usage Constraints:</b> *  Both @a CSL_emiffInit() and @a CSL_emiffOpen() must be called successfully *  in that order before CSL_emiffHwControl() can be called. For the *  argument type that can be @a void* casted & passed with a particular command *  refer to @a CSL_EmiffHwControlCmd * *  @b Example: *  @verbatim        CSL_EmiffHandle hEmiff;        CSL_Status status;        ...        status = CSL_EmiffHwControl(hEmiff, CSL_EMIFF_HWCTRLCMD_SDRAMCMD, CSL_EMIFF_SDRAM_COMMAND_AUTOREFRESH);    @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 EMIFF * */ CSL_Status  CSL_emiffHwControl(    /** Pointer to the object that holds reference to the     *  instance of EMIFF requested after the call	 */    CSL_EmiffHandle	      hEmiff,    /** The command to this API, which indicates the action to be taken	 */    CSL_EmiffHwControlCmd     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_EmiffHwStatusQuery. * *  <b> Usage Constraints: </b> *  Both @a CSL_emiffInit() and @a CSL_emiffOpen() must be called successfully *  in that order before @a CSL_emiffGetHwStatus() can be called. For the *  argument type that can be void* casted & passed with a particular command, *  refer to @a CSL_EmiffHwStatusQuery * *  @b Example: *  @verbatim        Code snippet to get EMIFF abort status 		CSL_EmiffAbortStatus abortStatus; 		CSL_EmiffGetHwStatus(hEmiff, CSL_EMIFF_HWQUERY_ABORTSTATUS, &abortStatus);    @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_emiffGetHwStatus(    /** Pointer to the object that holds reference to the     *  instance of EMIFF requested after the call	 */    CSL_EmiffHandle	      hEmiff,    /** The query to this API, which indicates the status     *  to be returned	 */    CSL_EmiffHwStatusQuery    query,    /** Placeholder to return the status; @a void* casted	 */    void		      *voidPtr);/** @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_emiffOpen() *  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_EmiffBaseAddress   baseAddress;       ...      status = CSL_emiffGetBaseAddress(CSL_EMIFF_1, NULL, &baseAddress);   @endverbatim * * @return Returns the status of the operation (see @a CSL_Status) * */CSL_Status CSL_emiffGetBaseAddress(        /** Instance number         */        CSL_InstNum  		emiffNum,        /** Module specific parameters         */        CSL_EmiffParam *		pEmiffParam,        /** Base address details         */        CSL_EmiffBaseAddress *	pBaseAddress);#ifdef __cplusplus}#endif#endif

⌨️ 快捷键说明

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