csl_clkrst.h
来自「dsp在音频处理中的运用」· C头文件 代码 · 共 731 行 · 第 1/2 页
H
731 行
Uint32 ARM_IDLECT2; /**< ARM idle control register 2 */ Uint32 ARM_EWUPCT; /**< ARM power control register */ Uint32 ARM_RSTCT1; /**< ARM reset control register 1 */ Uint32 ARM_RSTCT2; /**< ARM reset control register 2 */ Uint32 ARM_SYSST; /**< ARM system status register */ Uint32 ARM_CKOUT1; /**< ARM clock out register 1 */ Uint32 ARM_IDLECT3; /**< ARM idle control register 3 */} CSL_ClkrstConfig;/** The default value for @a CSL_ClkrstHwSetup structure */#define CSL_CLKRST_HWSETUP_DEFAULTS { \ NULL, \ NULL, \ NULL \ }/** The default value for @a CSL_ClkrstHwSetupClk structure */#define CSL_CLKRST_HWSETUP_CLK_DEFAULTS { \ NULL, \ NULL, \ NULL, \ NULL \ }/** The default value for @a CSL_ClkrstHwSetupClkCkout structure */#define CSL_CLKRST_HWSETUP_CLK_CKOUT_DEFAULTS { \ CSL_CLKRST_CKOUTTYPE_DOMAIN_CKGEN, \ CSL_CLKRST_CKOUTTYPE_DOMAIN_CKGEN, \ CSL_CLKRST_CKOUTTYPE_DOMAIN_CKGEN \ }/** The default value for @a CSL_ClkrstHwSetupClkClkScheme structure */#define CSL_CLKRST_HWSETUP_CLK_CLKSCHEME_DEFAULTS { \ CSL_CLKRST_CLKSCHEME_FULLSYNC, \ { \ 0, \ 0, \ 0, \ 0, \ 0, \ 0 \ } \ }/** The default value for @a CSL_ClkrstHwSetupPwrctl structure */#define CSL_CLKRST_HWSETUP_PWRCTL_DEFAULTS { \ 0, \ CSL_CLKRST_RESPWRTCIDLEENTRY_INDEPENDENT \ }/** The default value for @a CSL_ClkrstConfig structure */#define CSL_CLKRST_CONFIG_DEFAULTS { \ CSL_CLKRST_ARM_CKCTL_RESETVAL, \ CSL_CLKRST_ARM_IDLECT1_RESETVAL, \ CSL_CLKRST_ARM_IDLECT2_RESETVAL, \ CSL_CLKRST_ARM_EWUPCT_RESETVAL, \ CSL_CLKRST_ARM_RSTCT1_RESETVAL, \ CSL_CLKRST_ARM_RSTCT2_RESETVAL, \ CSL_CLKRST_ARM_SYSST_RESETVAL, \ CSL_CLKRST_ARM_CKOUT1_RESETVAL, \ CSL_CLKRST_ARM_IDLECT3_RESETVAL \}/** @brief Peripheral specific initialization function. * * This is the peripheral specific intialization function. This function is * idempotent in that calling it many times is same as calling it once. * This function initializes the CSL data structures, and doesn't touches * the hardware. * * <b> Usage Constraints: </b> * This function should be called before using any of the CSL APIs in the CLKRST * module. * * Note: As CLKRST doesn't have any context based information, currently, the function * just returns CSL_SOK. User is expected to pass NULL in the function call. * * @b Example: * @verbatim ... if (CSL_SOK != CSL_clkrstInit(NULL)) { return; } @endverbatim * * @return returns the status of the operation * */CSL_Status CSL_clkrstInit( /** CLKRST specific context information */ CSL_ClkrstContext * pContext );/** @brief Opens the instance of CLKRST requested. * * The open call sets up the data structures for the particular instance of * CLKRST device. The device can be re-opened anytime after it has been normally * closed if so required. The handle returned by this call is input as an * essential argument for rest of the APIs described for this module. * * <b> Usage Constraints: </b> * CLKRST must be successfully initialized via @a CSL_clkrstInit() before calling * this function. Memory for the @a CSL_clkrstObj must be allocated outside * this call. This object must be retained while usage of this peripheral. * * @b Example: * @verbatim CSL_ClkrstObj clkrstObj; CSL_Status status; ... hClkrst = CSL_clkrstOpen(&clkrstObj, CSL_CLKRST_1, NULL, &status); @endverbatim * * @return returns a handle @a CSL_ClkrstHandle to the requested instance of * CLKRST if the call is successful, otherwise, a @a NULL is returned. * */CSL_ClkrstHandle CSL_clkrstOpen ( /** Pointer to the object that holds reference to the * instance of CLKRST requested after the call */ CSL_ClkrstObj* pClkrstObj, /** Instance of CLKRST to which a handle is requested */ CSL_InstNum clkrstNum, /** Module specific parameters; * Currently there are none; the user should pass 'NULL' */ CSL_ClkrstParam *pClkrstParam, /** This returns the status (success/errors) of the call. * Could be 'NULL' if the user does not want status information. */ CSL_Status *pStatus );/** @brief closes the instance of CLKRST requested * * Unreserves the clkrst identified by the handle. * * <b> Usage Constraints: </b> * Both @a CSL_clkrstInit() and @a CSL_clkrstOpen() must be called successfully in that order before @a CSL_clkrstClose() can be called. * * @b Example: * @verbatim CSL_ClkrstHandle hClkrst; ... CSL_clkrstClose(hClkrst); @endverbatim * * @return returns the status of the operation (see @a CSL_Status) * */CSL_Status CSL_clkrstClose( /** pointer to the object that holds reference to the required instance of CLKRST */ CSL_ClkrstHandle hClkrst);/** Configures the CLKRST using the values passed in through the setup structure. The setup structure consists of pointers to substructures. If these pointers are set to @a NULL, then the setup corresponding to that sub-structure is not done. * * <b> Usage Constraints: </b> * Both @a CSL_clkrstInit() and @a CSL_clkrstOpen() must be called successfully in that order before this function can be called. The main setup structure consists of pointers to sub-structures. The user has to allocate space for & fill in the main setup structure & it's sub-structures appropriately before calling this function. If some part of CLKRST is not to be configured, then the corresponding setup sub-structure pointers must be set to @a NULL * * @b Example: * @verbatim CSL_ClkrstHandle hClkrst; CSL_ClkrstHwSetup hwSetup = CSL_CLKRST_HWSETUP_DEFAULTS; CSL_ClkrstHwSetupPwrctl hwSetpPwrctl = CSL_CLKRST_HWSETUP_PWRCTL_DEFAULTS; ... hwSetupPwrctl.delayRespwrActiveToClkStart = 4; hwSetup.pwrctlPtr = &hwSetupPwrctl; CSL_clkrstHwSetup(hClkrst, &hwSetup); @endverbatim * * @return returns the status of the setup operation * */CSL_Status CSL_clkrstHwSetup( /** pointer to the object that holds reference to the required instance of CLKRST */ CSL_ClkrstHandle hClkrst, /** pointer to setup structure which contains the information to program CLKRST to a useful state */ CSL_ClkrstHwSetup *setup);/** Gets the configuration of the CLKRST into the setup structure. The setup structure consists of pointers to substructures. If these pointers are set to @a NULL, then the setup corresponding to that sub-structure is not fetched. * * <b> Usage Constraints: </b> * Both @a CSL_clkrstInit() and @a CSL_clkrstOpen() must be called successfully in that order before this function can be called. The main setup structure consists of pointers to sub-structures. The user has to allocate space for & fill in the main setup structure & it's sub-structures appropriately before calling this function. Those parts of CLKRST whose information is not required should have their correspondinf setup sub-structures set to NULL * * @b Example: * @verbatim CSL_ClkrstHandle hClkrst; CSL_ClkrstHwSetup hwSetup = CSL_CLKRST_HWSETUP_DEFAULTS; CSL_ClkrstHwSetupPwrctl hwSetpPwrctl = CSL_CLKRST_HWSETUP_PWRCTL_DEFAULTS; ... hwSetup.pwrctlPtr = &hwSetpPwrctl; CSL_clkrstGetHwSetup(hClkrst, &hwSetup); @endverbatim * * @return returns the status of the setup operation * */CSL_Status CSL_clkrstGetHwSetup( /** pointer to the object that holds reference to the required instance of CLKRST */ CSL_ClkrstHandle hClkrst, /** pointer to setup structure which contains the information to program CLKRST to a useful state */ CSL_ClkrstHwSetup *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_ClkrstConfig. * * <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_ClkrstHandle hClkrst; CSL_ClkrstConfig config = CSL_CLKRST_CONFIG_DEFAULTS; ... CSL_clkrstHwSetupRaw(hClkrst, &config); @endverbatim * * @return Returns the status of the setup operation * */ CSL_Status CSL_clkrstHwSetupRaw( /** pointer to the object that holds reference to the * instance of CLKRST requested after the call */ CSL_ClkrstHandle hClkrst, /** pointer to the object that holds reference to the * config structure */ CSL_ClkrstConfig * setup);/** Takes a command with an optional argument & implements it. This function is used to carry out the different operations performed by clkrst. * * <b> Usage Constraints: </b> * Both @a CSL_clkrstInit() and @a CSL_clkrstOpen() must be called successfully in that order before @a CSL_clkrstHwControl() can be called. For the argument type that can be @a void* casted & passed with a particular command refer to @a CSL_clkrstHwControlCmd * * @b Example: * @verbatim CSL_clkrstHandle hclkrst; CSL_Status status; Uint16 clkEn = (CSL_CLKRST_MODULE_MPU | CSL_CLKRST_MODULE_PER | CSL_CLKRST_MODULE_OCPI) ... status = CSL_clkrstHwControl(hclkrst, CSL_CLKRST_CMD_CLK_ENABLE, &clkEn); @endverbatim * * @return returns the status of the operation * */CSL_Status CSL_clkrstHwControl( /** pointer to the object that holds reference to the required instance of CLKRST */ CSL_ClkrstHandle hClkrst, /** the command to this API which indicates the action to be taken */ CSL_ClkrstHwControlCmd cmd, /** an optional argument @a void* casted */ void *arg);/** Gets the status of the different operations or the current setup of CLKRST. The status is returned through @a CSL_ClkrstHwSetup. The obtaining of status * is the reverse operation of @a CSL_clkrstHwSetup() function. * * <b> Usage Constraints: </b> * Both @a CSL_clkrstInit() and @a CSL_clkrstOpen() must be called successfully in that order before @a CSL_clkrstGetHwStatus() can be called. For the argument type that can be @a void* casted & passed with a particular command refer to @a CSL_ClkrstHwStatusQuery * * @b Example: * @verbatim CSL_ClkrstHandle hClkrst; CSL_Status status; Uint16 response; ... status = CSL_clkrstGetHwStatus(hClkrst, CSL_CLKRST_QUERY_CLK_SETTING, &response); @endverbatim * * @return returns the status of the operation * */CSL_Status CSL_clkrstGetHwStatus( /** pointer to the object that holds reference to the required instance of CLKRST */ CSL_ClkrstHandle hClkrst, /** the query to this API which indicates the status/setup to be returned */ CSL_ClkrstHwStatusQuery query, /** placeholder to return the status; @a void* casted */ void *response);/** @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_clkrstOpen() * 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_ClkrstBaseAddress baseAddress; ... status = CSL_clkrstGetBaseAddress(CSL_CLKRST_1, NULL, &baseAddress); @endverbatim * * @return Returns the status of the operation (see @a CSL_Status) * */CSL_Status CSL_clkrstGetBaseAddress( /** Instance number */ CSL_InstNum clkrstNum, /** Module specific parameters */ CSL_ClkrstParam * pClkrstParam, /** Base address details */ CSL_ClkrstBaseAddress * pBaseAddress);#ifdef __cplusplus}#endif#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?