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

📄 csl_uhpiaux.h

📁 基于ti tms320c672x下音频开发例子程式
💻 H
📖 第 1 页 / 共 2 页
字号:
/*  ============================================================================
 *   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_uhpiAux.h
 *
 *  @path $(CSLPATH)\uhpi\v1\src
 *
 *  @brief PLL controller CSL implementation on DSP side. 
 *
 */

/* =============================================================================
 *  Revision History
 *  ===============
 *  04-FEB-2005 asr  File Created.
 * =============================================================================
 */

#ifndef _CSL_UHPIAUX_H_
#define _CSL_UHPIAUX_H_

#include <csl_uhpi.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 *  Status query functions of the uhpi
 */

/** ============================================================================
 *   @n@b CSL_uhpiSetGpint
 *
 *   @b Description
 *   @n Gets the GPINT_ENx control status of the uhpi.
 *
 *   @b Arguments
 *   @verbatim
            hUhpi           Handle to the UHPI instance
     @endverbatim
 *
 *   <b> Return Value </b>  
 *	 @n  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_UhpiHandle          hUhpi;

        CSL_uhpiSetGpint (hUhpi , 0x4);

     @endverbatim
 * =============================================================================
 */
static inline
void CSL_uhpiSetGpint(
        CSL_UhpiHandle  hUhpi,
        Uint32          loadVal
)
{
	CSL_FINSR (hUhpi->regs->GPINT_CTRL,2,0,loadVal);
}       

/** ============================================================================
 *   @n@b CSL_uhpiSetGpintInv
 *
 *   @b Description
 *   @n Gets the GPINT_INVx Invert status of the uhpi.
 *
 *   @b Arguments
 *   @verbatim
            hUhpi           Handle to the UHPI instance
     @endverbatim
 *
 *   <b> Return Value </b>
 *	 @n  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_UhpiHandle          hUhpi;

        CSL_uhpiSetGpint (hUhpi , 0x4);

     @endverbatim
 * =============================================================================
 */
static inline
void CSL_uhpiSetGpintInv(
        CSL_UhpiHandle  hUhpi,
        Uint32          loadVal
)
{
    CSL_FINSR (hUhpi->regs->GPINT_CTRL,18,16,loadVal);
}

/** ============================================================================
 *   @n@b CSL_uhpiGpioEnable
 *
 *   @b Description
 *   @n Gets the GPIO Enable status of the uhpi.
 *
 *   @b Arguments
 *   @verbatim
            hUhpi           Handle to the UHPI instance
     @endverbatim
 *
 *   <b> Return Value </b>
 *	 @n  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_UhpiHandle          hUhpi;

        CSL_uhpiGpioEnable (hUhpi , 0x4);

     @endverbatim
 * =============================================================================
 */

static inline
void CSL_uhpiGpioEnable(
        CSL_UhpiHandle  hUhpi,
        Uint32          loadVal
)
{
    hUhpi->regs->GPIO_EN = loadVal;
}

/** ============================================================================
 *   @n@b CSL_uhpiSetGpioDir1
 *
 *   @b Description
 *   @n Gets the GPIO Direction status of the uhpi.
 *
 *   @b Arguments
 *   @verbatim
            hUhpi           Handle to the UHPI instance
     @endverbatim
 *
 *   <b> Return Value </b>
 *	 @n  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_UhpiHandle          hUhpi;

        CSL_uhpiSetGpioDir1 (hUhpi , 0xFF);

     @endverbatim
 * =============================================================================
 */
static inline
void CSL_uhpiSetGpioDir1(
        CSL_UhpiHandle  hUhpi,
        Uint32          dirVal
)
{
    hUhpi->regs->GPIO_DIR1 = dirVal;
}

/** ============================================================================
 *   @n@b CSL_uhpiSetGpioDir2
 *
 *   @b Description
 *   @n Gets the GPIO Direction2 status of the uhpi.
 *
 *   @b Arguments
 *   @verbatim
            hUhpi           Handle to the UHPI instance
     @endverbatim
 *
 *   <b> Return Value </b>
 *	 @n  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_UhpiHandle          hUhpi;

        CSL_uhpiSetGpioDir2 (hUhpi , 0xFF);

     @endverbatim
 * =============================================================================
 */
 
static inline
void CSL_uhpiSetGpioDir2(
        CSL_UhpiHandle  hUhpi,
        Uint16          dirVal
)
{
    hUhpi->regs->GPIO_DIR2 = dirVal;
}

/** ============================================================================
 *   @n@b CSL_uhpiSetGpioDir3
 *
 *   @b Description
 *   @n Gets the GPIO Direction3 status of the uhpi.
 *
 *   @b Arguments
 *   @verbatim
            hUhpi           Handle to the UHPI instance
     @endverbatim
 *
 *   <b> Return Value </b>
 *	 @n  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_UhpiHandle          hUhpi;

        CSL_uhpiSetGpioDir3 (hUhpi , 0xFF);

     @endverbatim
 * =============================================================================
 */
static inline
void CSL_uhpiSetGpioDir3(
        CSL_UhpiHandle  hUhpi,
        Uint32          dirVal
)
{
    hUhpi->regs->GPIO_DIR3 = dirVal;
}

/** ============================================================================
 *   @n@b CSL_uhpiSetDspInt
 *
 *   @b Description
 *   @n Gets the HPIC Host-to-DSP Interrupt status of the uhpi.
 *
 *   @b Arguments
 *   @verbatim
            hUhpi           Handle to the UHPI instance
     @endverbatim
 *
 *   <b> Return Value </b>
 *	 @n  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_UhpiHandle          hUhpi;

        CSL_uhpiSetDspInt (hUhpi , 1);

     @endverbatim
 * =============================================================================
 */
static inline
void CSL_uhpiSetDspInt(
        CSL_UhpiHandle  hUhpi
)
{
    CSL_FINS (hUhpi->regs->HPIC,HPI_HPIC_DSP_INT,TRUE); 
}       
/** ============================================================================
 *   @n@b CSL_uhpiResetDspInt
 *
 *   @b Description
 *   @n Gets the Reset HPIC Host-to-DSP Interrupt status of the uhpi.
 *
 *   @b Arguments
 *   @verbatim
            hUhpi           Handle to the UHPI instance
     @endverbatim
 *
 *   <b> Return Value </b>
 *	 @n  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_UhpiHandle          hUhpi;

        CSL_uhpiResetDspInt (hUhpi , 0);

     @endverbatim
 * =============================================================================
 */

static inline
void CSL_uhpiResetDspInt(
        CSL_UhpiHandle  hUhpi
)
{
    CSL_FINS (hUhpi->regs->HPIC,HPI_HPIC_DSP_INT,FALSE);
}       

/** ============================================================================
 *   @n@b CSL_uhpiSetHint
 *
 *   @b Description
 *   @n Gets the HPIC DSP-to-Host Interrupt status of the uhpi.
 *
 *   @b Arguments
 *   @verbatim
            hUhpi           Handle to the UHPI instance
     @endverbatim
 *
 *   <b> Return Value </b>
 *	 @n  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_UhpiHandle          hUhpi;

        CSL_uhpiSetHint (hUhpi , 1);

     @endverbatim
 * =============================================================================
 */

static inline
void CSL_uhpiSetHint(
        CSL_UhpiHandle  hUhpi
)
{
    CSL_FINS (hUhpi->regs->HPIC,HPI_HPIC_HINT,TRUE);    
}       

/** ============================================================================
 *   @n@b CSL_uhpiResetHint
 *
 *   @b Description
 *   @n Gets the Reset HPIC DSP-to-Host Interrupt status of the uhpi.
 *
 *   @b Arguments
 *   @verbatim
            hUhpi           Handle to the UHPI instance
     @endverbatim
 *
 *   <b> Return Value </b>
 *	 @n  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_UhpiHandle          hUhpi;

        CSL_uhpiSetHint (hUhpi , 0);

     @endverbatim
 * =============================================================================
 */
 
static inline
void CSL_uhpiResetHint(
        CSL_UhpiHandle  hUhpi
)
{
    CSL_FINS (hUhpi->regs->HPIC,HPI_HPIC_HINT,FALSE);   
}       

/** ===========================================================================
 *   @n@b CSL_uhpiGetPidRev
 *
 *   @b Description
 *   @n This function  gets the Peripheral ID Revision.
 *
 *   @b Arguments
 *   @verbatim

            hUhpi           Handle to UHPI instance

            response        Placeholder to return status.

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_uhpiGetPidRev (hUhpi, &response);

     @endverbatim
 * ===========================================================================
 */

static inline
void CSL_uhpiGetPidRev(
        CSL_UhpiHandle  hUhpi,
        void *          response
)
{
    /*Read the peripheral revision from PID */
    *((Uint32 *)response) = CSL_FEXT(hUhpi->regs->PID, HPI_PID_REV);
}

/** ===========================================================================
 *   @n@b CSL_uhpiGetPidClass
 *
 *   @b Description
 *   @n This function  gets the Peripheral ID Class.
 *
 *   @b Arguments
 *   @verbatim

            hUhpi           Handle to UHPI instance

            response        Placeholder to return status.

     @endverbatim
 *
 *   <b> Return Value </b>  None

⌨️ 快捷键说明

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