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

📄 csl_pllcaux.h

📁 基于ti tms320c672x下音频开发例子程式
💻 H
📖 第 1 页 / 共 3 页
字号:
/*  ============================================================================
 *   Copyright (c) Texas Instruments Inc 2002, 2003, 2004
 *
 *   Use of this software is controlled by the terms and conditions found
 *   in the license agreement under which this software has been supplied.
 *   ===========================================================================
 */

/** @file  csl_pllcAux.h
 *
 *  @path $(CSLPATH)\pllc\src
 *
 *  @brief PLL controller CSL implementation. 
 *
 */

/* =============================================================================
 *  Revision History
 *  ===============
 *  23-Nov-2004 GaneshK  File Created.
 * =============================================================================
 */

#ifndef _CSL_PPLCAUX_H_
#define _CSL_PLLCAUX_H_

#include <csl_pllc.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 *	Status query functions of the pllc
 */

/** ============================================================================
 *   @n@b CSL_pllcGetResetStatus
 *
 *   @b Description
 *   @n Gets the reset status of the pllc. (reset released/ asserted)
 *
 *   @b Arguments
 *   @verbatim
            hPllc           Handle to the PLLC instance
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_PllcResetState
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle          hPllc;
        CSL_PllcResetState      response;

        response = CSL_pllcGetResetStatus (hPllc);

     @endverbatim
 * =============================================================================
 */
static inline
CSL_PllcResetState CSL_pllcGetResetStatus (
	CSL_PllcHandle hPllc
)
{
    CSL_PllcResetState response = (CSL_PllcResetState) 0;

    response = (CSL_PllcResetState) CSL_FEXT (hPllc->regs->PLLCSR,
                    PLLC_PLLCSR_PLLRST);
    return response;
}

/** ============================================================================
 *   @n@b CSL_pllcGetPllMode
 *
 *   @b Description
 *   @n Gets the mode of the pllc. (bypass mode/ pll mode)
 *
 *   @b Arguments
 *   @verbatim
            hPllc           Handle to the PLLC instance
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_PllcMode
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle          hPllc;
        CSL_PllcMode      response;

        response = CSL_pllcGetMode (hPllc);

     @endverbatim
 * =============================================================================
 */
static inline
CSL_PllcMode CSL_pllcGetPllMode (
	CSL_PllcHandle hPllc
)
{
    CSL_PllcMode response = (CSL_PllcMode) 0;

    response = (CSL_PllcMode) CSL_FEXT (hPllc->regs->PLLCSR,
                  PLLC_PLLCSR_PLLEN);   
    return response;
}

/** ============================================================================
 *   @n@b CSL_pllcGetPllState
 *
 *   @b Description
 *   @n Gets the state of the pllc. (Operational / Power Down)
 *
 *   @b Arguments
 *   @verbatim
            hPllc           Handle to the PLLC instance
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_PllcState
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle          hPllc;
        CSL_PllcState       response;

        response = CSL_pllcGetPllState (hPllc);

     @endverbatim
 * =============================================================================
 */
static inline
CSL_PllcState CSL_pllcGetPllState (
	CSL_PllcHandle hPllc
)
{
    CSL_PllcState response = (CSL_PllcState) 0;

    response = (CSL_PllcState) CSL_FEXT (hPllc->regs->PLLCSR,
                     PLLC_PLLCSR_PLLPWRDN);
    return response;
}

/** ============================================================================
 *   @n@b CSL_pllcGetOscState
 *
 *   @b Description
 *   @n Gets the state of the pllc Oscillator. (Operational / Power Down)
 *
 *   @b Arguments
 *   @verbatim
            hPllc           Handle to the PLLC instance
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_PllcMode
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle          hPllc;
        CSL_PllcState       response;

        response = CSL_pllcGetOscState (hPllc);

     @endverbatim
 * =============================================================================
 */
static inline
CSL_PllcState CSL_pllcGetOscState (
	CSL_PllcHandle hPllc
)
{
    CSL_PllcState response = (CSL_PllcState) 0;

    response = (CSL_PllcState) CSL_FEXT (hPllc->regs->PLLCSR,
                   PLLC_PLLCSR_OSCPWRDN);
    return response;
}

/** ============================================================================
 *   @n@b CSL_pllcGetOscStableState
 *
 *   @b Description
 *   @n Gets the State of the Oscillator. (Stable / Not Stable)
 *
 *   @b Arguments
 *   @verbatim
            hPllc           Handle to the PLLC instance
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_PllcOscStableState
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle          hPllc;
        CSL_PllcOscStableState      response;

        response = CSL_pllcGetMode (hPllc);

     @endverbatim
 * =============================================================================
 */
static inline
CSL_PllcOscStableState CSL_pllcGetOscStableState (
	CSL_PllcHandle hPllc
)
{
    CSL_PllcOscStableState response = (CSL_PllcOscStableState) 0;

    response = (CSL_PllcOscStableState) CSL_FEXT (hPllc->regs->PLLCSR,
                    PLLC_PLLCSR_STABLE);
    return response;
}

/** ============================================================================
 *   @n@b CSL_pllcGetGoStatus
     *
 *   @b Description
 *   @n Gets the Status of the pllc Go Operation. ( Disabled / In Operation)
 *
 *   @b Arguments
 *   @verbatim
            hPllc           Handle to the PLLC instance
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_PllcGoStatus
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle          hPllc;
        CSL_PllcGoStatus      response;

        response = CSL_pllcGetGoStatus(hPllc);

     @endverbatim
 * =============================================================================
 */
static inline
CSL_PllcGoStatus CSL_pllcGetGoStatus(
	CSL_PllcHandle hPllc
)
{
    CSL_PllcGoStatus response = (CSL_PllcGoStatus) 0;

    response = (CSL_PllcGoStatus) CSL_FEXT(hPllc->regs->PLLCMD,
                    PLLC_PLLSTAT_GOSTAT);
    return response;
}

/** ============================================================================
 *   @n@b CSL_pllcGetPllmMulFactor
     *
 *   @b Description
 *   @n Gets the Multiplier factor of PLLM. 
 *
 *   @b Arguments
 *   @verbatim
            hPllc           Handle to the PLLC instance
     @endverbatim
 *
 *   <b> Return Value </b>  Uint16
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle          hPllc;
        Uint16                response;

        response = CSL_pllcGetPllmMulFactor (hPllc);

     @endverbatim
 * =============================================================================
 */
static inline
Uint16 CSL_pllcGetPllmMulFactor (
	CSL_PllcHandle hPllc
)
{
    Uint16 response ;

    response = (Uint16) CSL_FEXT(hPllc->regs->PLLM,PLLC_PLLM_PLLM);
    return response;
}

/** ============================================================================
 *   @n@b CSL_pllcGetDiv0Ctrl
     *
 *   @b Description
 *   @n Gets the divider control 0 status and its ratio. 
 *
 *   @b Arguments
 *   @verbatim
            hPllc           Handle to the PLLC instance
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_PllcDivCntrl
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle          hPllc;
        CSL_PllcDivCntrl    response;

        response = CSL_pllcGetDiv0Ctrl (hPllc);

     @endverbatim
 * =============================================================================
 */
static inline
CSL_PllcDivCntrl CSL_pllcGetDiv0Ctrl (
	CSL_PllcHandle hPllc
)
{
    CSL_PllcDivCntrl response ;

    response.divNum = CSL_PLLC_DIV0;
    response.divControl.divEnable = (CSL_PllcDivState)
    									CSL_FEXT(hPllc->regs->PLLDIV0,
                                            PLLC_PLLDIV0_D0EN);
    response.divControl.pllDivRatio =  CSL_FEXT(hPllc->regs->PLLDIV0,
                                           PLLC_PLLDIV0_RATIO);
    return response;
}

/** ============================================================================
 *   @n@b CSL_pllcGetDiv1Ctrl
     *
 *   @b Description
 *   @n Gets the divider control 1 status and its ratio. 
 *
 *   @b Arguments
 *   @verbatim
            hPllc           Handle to the PLLC instance
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_PllcDivCntrl
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle          hPllc;
        CSL_PllcDivCntrl    response;

        response = CSL_pllcGetDiv1Ctrl (hPllc);

     @endverbatim
 * =============================================================================
 */
static inline
CSL_PllcDivCntrl CSL_pllcGetDiv1Ctrl (
	CSL_PllcHandle hPllc
)
{
    CSL_PllcDivCntrl response ;

    response.divNum = CSL_PLLC_DIV1;
    response.divControl.divEnable = (CSL_PllcDivState)
    									CSL_FEXT(hPllc->regs->PLLDIV1,
                                            PLLC_PLLDIV1_D1EN);
    response.divControl.pllDivRatio = CSL_FEXT(hPllc->regs->PLLDIV1,
                                           PLLC_PLLDIV1_RATIO);
    return response;
}

/** ============================================================================
 *   @n@b CSL_pllcGetDiv2Ctrl
     *
 *   @b Description
 *   @n Gets the divider control 2 status and its ratio. 
 *
 *   @b Arguments
 *   @verbatim
            hPllc           Handle to the PLLC instance
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_PllcDivCntrl
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle          hPllc;
        CSL_PllcDivCntrl    response;

        response = CSL_pllcGetDiv2Ctrl (hPllc);

     @endverbatim
 * =============================================================================
 */
static inline
CSL_PllcDivCntrl CSL_pllcGetDiv2Ctrl (
	CSL_PllcHandle hPllc
)
{
    CSL_PllcDivCntrl response ;

    response.divNum = CSL_PLLC_DIV2;
    response.divControl.divEnable = (CSL_PllcDivState)
    									CSL_FEXT(hPllc->regs->PLLDIV2,
                                            PLLC_PLLDIV2_D2EN);
    response.divControl.pllDivRatio =  CSL_FEXT(hPllc->regs->PLLDIV2,
                                           PLLC_PLLDIV2_RATIO);
    return response;
}

/** ============================================================================
 *   @n@b CSL_pllcGetDiv3Ctrl
     *
 *   @b Description
 *   @n Gets the divider control 3 status and its ratio. 
 *
 *   @b Arguments
 *   @verbatim
            hPllc           Handle to the PLLC instance
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_PllcDivCntrl
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_PllcHandle          hPllc;
        CSL_PllcDivCntrl    response;

        response = CSL_pllcGetDiv3Ctrl (hPllc);

     @endverbatim
 * =============================================================================
 */
static inline
CSL_PllcDivCntrl CSL_pllcGetDiv3Ctrl (
	CSL_PllcHandle hPllc
)
{
    CSL_PllcDivCntrl response ;

    response.divNum = CSL_PLLC_DIV3;
    response.divControl.divEnable = (CSL_PllcDivState)
    									CSL_FEXT(hPllc->regs->PLLDIV3,
                                        	PLLC_PLLDIV3_D3EN);
    response.divControl.pllDivRatio = CSL_FEXT(hPllc->regs->PLLDIV3,
                                         PLLC_PLLDIV3_RATIO);
    return response;
}

⌨️ 快捷键说明

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