⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 csl_pllcaux.h

📁 基于ti tms320c672x下音频开发例子程式
💻 H
📖 第 1 页 / 共 3 页
字号:

/** ============================================================================
 *   @n@b CSL_pllcGetAuxClkStatus
     *
 *   @b Description
 *   @n Gets the AUXCLK Status. ( Enable / Disable )
 *
 *   @b Arguments
 *   @verbatim
            hPllc           Handle to the PLLC instance
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_PllcClockStatus
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle          hPllc;
        CSL_PllcClockStatus    response;

        response = CSL_pllcGetClkStatus (hPllc);

     @endverbatim
 * =============================================================================
 */
static inline
CSL_PllcClockStatus CSL_pllcGetAuxClkStatus (
    CSL_PllcHandle hPllc
)
{
    CSL_PllcClockStatus response  ;

    response = (CSL_PllcClockStatus)
    							CSL_FEXT(hPllc->regs->CKEN,PLLC_CKEN_AUXEN);
    return response;
}

/** ============================================================================
 *   @n@b CSL_pllcGetSysClk1Status
     *
 *   @b Description
 *   @n Gets the SYSCLK1 Status. ( Gated / On )
 *
 *   @b Arguments
 *   @verbatim
            hPllc           Handle to the PLLC instance
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_PllcSysClkStatus
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle          hPllc;
        CSL_PllcSysClkStatus    response;

        response = CSL_pllcGetSysClk1Status (hPllc);

     @endverbatim
 * =============================================================================
 */
static inline
CSL_PllcSysClkStatus CSL_pllcGetSysClk1Status (
CSL_PllcHandle hPllc
)
{
    CSL_PllcSysClkStatus response  ;

    response.sysClk = CSL_PLLC_SYSCLK1;
    response.pllClkState = (CSL_PllcClockStatus)
    						 CSL_FEXT(hPllc->regs->SYSTAT,PLLC_SYSTAT_SYS1ON);
    return response;
}

/** ============================================================================
 *   @n@b CSL_pllcGetSysClk2Status
     *
 *   @b Description
 *   @n Gets the SYSCLK2 Status. ( Gated / On )
 *
 *   @b Arguments
 *   @verbatim
            hPllc           Handle to the PLLC instance
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_PllcSysClkStatus
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle          hPllc;
        CSL_PllcSysClkStatus    response;

        response = CSL_pllcGetSysClk2Status (hPllc);

     @endverbatim
 * =============================================================================
 */
static inline
CSL_PllcSysClkStatus CSL_pllcGetSysClk2Status (
CSL_PllcHandle hPllc
)
{
    CSL_PllcSysClkStatus response  ;

    response.sysClk = CSL_PLLC_SYSCLK2;
    response.pllClkState = (CSL_PllcClockStatus)
    						CSL_FEXT(hPllc->regs->SYSTAT,PLLC_SYSTAT_SYS2ON);
    return response;
}

/** ============================================================================
 *   @n@b CSL_pllcGetSysClk3Status
     *
 *   @b Description
 *   @n Gets the SYSCLK3 Status. ( Gated / On )
 *
 *   @b Arguments
 *   @verbatim
            hPllc           Handle to the PLLC instance
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_PllcSysClkStatus
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle          hPllc;
        CSL_PllcSysClkStatus    response;

        response = CSL_pllcGetSysClk3Status (hPllc);

     @endverbatim
 * =============================================================================
 */
static inline
CSL_PllcSysClkStatus CSL_pllcGetSysClk3Status (
CSL_PllcHandle hPllc
)
{
    CSL_PllcSysClkStatus response ;

    response.sysClk = CSL_PLLC_SYSCLK3;
    response.pllClkState = (CSL_PllcClockStatus)
    						 CSL_FEXT(hPllc->regs->SYSTAT,PLLC_SYSTAT_SYS3ON);
    return response;
}

/**
 *	Control command functions of the pllc
 */

/** ============================================================================
 *   @n@b CSL_pllcSetMode
 *
 *   @b Description
 *      Controls the mode of the PLL.
 * 
 *   @b Arguments
 *   @verbatim
        hPllc     	 Handle to the PLLC instance
        loadVal      Value to be loaded to pllc control/status register
     @endverbatim
 *
 *   <b> Return Value </b> 
 *       None 
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  pllc mode will be PLL Mode / ByPass.
 *
 *   @b Modifies
 *   @n pllc PLLCSR register.
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle      hPllc;
        CSL_PllcMode        loadVal = CSL_PLLC_PLLCSR_PLLEN_PLL_MODE;
        ...
        CSL_pllcSetMode (hPllc, loadVal);
        ...
     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_pllcSetMode (
	CSL_PllcHandle         hPllc,
	CSL_PllcMode           loadVal
)
{   
    CSL_FINS (hPllc->regs->PLLCSR,PLLC_PLLCSR_PLLEN,loadVal);            
}

/** ============================================================================
 *   @n@b CSL_pllcSetPllState
 *
 *   @b Description
 *      Controls the State of the PLL.
 * 
 *   @b Arguments
 *   @verbatim
        hPllc     	 Handle to the PLLC instance
        loadVal      Value to be loaded to pllc control/status register
     @endverbatim
 *
 *   <b> Return Value </b> 
 *       None 
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  pllc state is operational / Powerdown.
 *
 *   @b Modifies
 *   @n pllc PLLCSR register.
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle      hPllc;
        CSL_PllcState  loadVal = CSL_PLLC_PLLCSR_PLLPWRDN_PLLSEL_OPRN;
        ...
        CSL_pllcSetPllState (hPllc, loadVal);
        ...
     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_pllcSetPllState (
	CSL_PllcHandle         hPllc,
	CSL_PllcState           loadVal
)
{   
    CSL_FINS (hPllc->regs->PLLCSR,PLLC_PLLCSR_PLLPWRDN,loadVal);            
}

/** ============================================================================
 *   @n@b CSL_pllcSetOscState
 *
 *   @b Description
 *      Controls the State of the Oscillator.
 * 
 *   @b Arguments
 *   @verbatim
        hPllc     	 Handle to the PLLC instance
        loadVal      Value to be loaded to pllc control/status register
     @endverbatim
 *
 *   <b> Return Value </b> 
 *       None 
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  pllc Osicllator is Operational/ Powerdown.
 *
 *   @b Modifies
 *   @n pllc PLLCSR register.
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle      hPllc;
        CSL_PllcState  loadVal = CSL_PLLC_PLLCSR_PLLPWRDN_PLLSEL_OPRN;
        ...
        CSL_pllcSetOscState (hPllc, loadVal);
        ...
     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_pllcSetOscState (
	CSL_PllcHandle         hPllc,
	CSL_PllcState           loadVal
)
{   
    CSL_FINS (hPllc->regs->PLLCSR,PLLC_PLLCSR_OSCPWRDN,loadVal);            
}

/** ============================================================================
 *   @n@b CSL_pllcResetControl
 *
 *   @b Description
 *      Controls reset of pllc.
 * 
 *   @b Arguments
 *   @verbatim
        hPllc     	 Handle to the PLLC instance
        loadVal          Value to be loaded to pllc control/status register
     @endverbatim
 *
 *   <b> Return Value </b> 
 *       None 
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  pllc reset is asserted/ released.
 *
 *   @b Modifies
 *   @n pllc PLLCSR register.
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle      hPllc;
        CSL_PllcResetState  loadVal = CSL_PLLC_PLLCSR_ASSERT;
        ...
        CSL_pllcResetControl (hPllc, loadVal);
        ...
     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_pllcResetControl (
	CSL_PllcHandle hPllc,
	CSL_PllcResetState loadVal
)
{   
    /* author Original code:
     * volatile unsigned int loopCount;
     */

    /* author Added the following code according to review comment no. 1
     * for file csl_pllcAux.h
     */

    Uint32 loopCount;

    CSL_FINS (hPllc->regs->PLLCSR, PLLC_PLLCSR_PLLRST, loadVal);
    
    /* author Original code:
     * loopCount = 3000;
     */

    /* author Added following code to use #define value instead
     * of directly using the number according to review comment no.2 
     * for file csl_pllcAux.h
     */

    /* Fixed time delay - waiting for the PLL to re-lock */
    loopCount = DELAY_100MS;
    while(loopCount--)
	    asm("	NOP");
}

/** ============================================================================
 *   @n@b CSL_pllcSetGoOperation
 *
 *   @b Description
 *      Enables Go operation of PLLC
 * 
 *   @b Arguments
 *   @verbatim
        hPllc     	 Handle to the PLLC instance
     @endverbatim
 *
 *   <b> Return Value </b> 
 *       None 
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Go operation is triggerd.
 *
 *   @b Modifies
 *   @n pllc PLLCMD register.
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle      hPllc;
         
         ...
        CSL_pllcSetGoOperation (hPllc);
        ...
     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_pllcSetGoOperation (
	CSL_PllcHandle         hPllc
)
{
	Uint32 loopCount;
	   
    CSL_FINS (hPllc->regs->PLLCMD,PLLC_PLLCMD_GOSET,CSL_PLLC_PLLCMD_GOSET_SET);  

     /* Fixed time delay - waiting for the PLL to re-lock */
    loopCount = DELAY_100MS;
    while(loopCount--)
	    asm("	NOP");
}

/** ============================================================================
 *   @n@b CSL_pllcSetSysClk1AlignControl
 *
 *   @b Description
 *      Set the Alignment of SycClk1 to align with SYSCLK of the PLL.
 * 
 *   @b Arguments
 *   @verbatim
        hPllc     	 Handle to the PLLC instance
     @endverbatim
 *
 *   <b> Return Value </b> 
 *       None 
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  pllc SysClk1 is aligned.
 *
 *   @b Modifies
 *   @n pllc ALNCTL register.
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle      hPllc;
        ...
        CSL_pllcSetSysClk1AlignControl (hPllc);
        ...
     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_pllcSetSysClk1AlignControl (
	CSL_PllcHandle         hPllc
)
{   
    CSL_FINS (hPllc->regs->ALNCTL,PLLC_ALNCTL_ALN1,CSL_PLLC_ALNCTL_ALN1_ALIGN);            
}

/** ============================================================================
 *   @n@b CSL_pllcSetSysClk2AlignControl
 *
 *   @b Description
 *      Set the Alignment of SycClk2 to align with SYSCLK of the PLL.
 * 
 *   @b Arguments
 *   @verbatim
        hPllc     	 Handle to the PLLC instance
     @endverbatim
 *
 *   <b> Return Value </b> 
 *       None 
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  pllc SysClk2 is aligned.
 *
 *   @b Modifies
 *   @n pllc ALNCTL register.
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle      hPllc;
        ...
        CSL_pllcSetSysClk2AlignControl (hPllc);
        ...
     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_pllcSetSysClk2AlignControl (
	CSL_PllcHandle         hPllc
)
{   
    CSL_FINS (hPllc->regs->ALNCTL,PLLC_ALNCTL_ALN2,CSL_PLLC_ALNCTL_ALN2_ALIGN);            
}

/** ============================================================================
 *   @n@b CSL_pllcSetSysClk3AlignControl
 *
 *   @b Description
 *      Set the Alignment of SycClk3 to align with SYSCLK of the PLL.
 * 
 *   @b Arguments
 *   @verbatim
        hPllc     	 Handle to the PLLC instance
     @endverbatim
 *
 *   <b> Return Value </b> 
 *       None 
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  pllc SysClk3 is aligned.
 *
 *   @b Modifies
 *   @n pllc ALNCTL register.
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle      hPllc;

⌨️ 快捷键说明

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