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

📄 csl_mcaspaux.h

📁 基于ti tms320c672x下音频开发例子程式
💻 H
📖 第 1 页 / 共 5 页
字号:
/** ===========================================================================
 *   @file  csl_mcaspAux.h
 *
 *   @path  $(CSLPATH)\mcasp\src
 *
 *   @desc  API auxilary header file for McASP CSL.
 *
 */

/*  ===========================================================================
 *   Copyright (c) Texas Instruments Inc 2002, 2003, 2004, 2005
 *
 *   Use of this software is controlled by the terms and conditions found in
 *   the license agreement under which this software has been supplied.
 *   ==========================================================================
 */

/*  @(#) PSP/CSL 3.00.01.00[5905] (2005-01-12)  */

/* ============================================================================
 *  Revision History
 *  ===============
 *  12-Jan-2005 asr File Created.
 * ============================================================================
 */

#ifndef _CSL_MCASPAUX_H_
#define _CSL_MCASPAUX_H_

#include <soc.h>
#include <csl_mcasp.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 *  Status Query Functions of McASP
 */

/** ===========================================================================
 *   @n@b CSL_mcaspGetCurrentXSlot
 *
 *   @b Description
 *   @n This function returns the current transmit time slot count
 *
 *   @b Arguments
 *   @verbatim
            hMcasp            Handle to the McASP instance
     @endverbatim
 *
 *   <b> Return Value </b>  Uint16
 *   @li                    Current transmit time slot count
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        Uint16  currentXslot;
        
        currentXslot = CSL_mcaspGetCurrentXSlot (hMcasp);
        
     @endverbatim
 * ============================================================================
 */
static inline
Uint16 CSL_mcaspGetCurrentXSlot (
    CSL_McaspHandle    hMcasp    
)
{
    return((Uint16)CSL_FEXT(hMcasp->regs->XSLOT, MCASP_XSLOT_XSLOTCNT));
}

/** ===========================================================================
 *   @n@b CSL_mcaspGetCurrentRSlot
 *
 *   @b Description
 *   @n This function returns the current receive time slot count
 *
 *   @b Arguments
 *   @verbatim
            hMcasp            Handle to the McASP instance
     @endverbatim
 *
 *   <b> Return Value </b>  Uint16
 *   @li                    Current receive time slot count
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        Uint16  currentRslot;
        
        currentRslot = CSL_mcaspGetCurrentRSlot (hMcasp);
        
     @endverbatim
 * ============================================================================
 */
static inline
Uint16 CSL_mcaspGetCurrentRSlot (
    CSL_McaspHandle    hMcasp    
)
{
    return((Uint16)CSL_FEXT(hMcasp->regs->RSLOT, MCASP_RSLOT_RSLOTCNT));
}

/** ===========================================================================
 *   @n@b CSL_mcaspGetXmtErr
 *
 *   @b Description
 *   @n This function checks whether transmitter error interrupt has occurred
 *      or not
 *
 *   @b Arguments
 *   @verbatim
            hMcasp            Handle to the McASP instance
     @endverbatim
 *
 *   <b> Return Value </b>  Bool
 *   @li                    TRUE  - Transmitter error interrupt has occurred
 *   
 *   @li                    FALSE - Transmitter error interrupt has not 
 *                                  occurred
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim
        Bool    xmtErr;
        
        xmtErr = CSL_mcaspGetXmtErr (hMcasp);
        
     @endverbatim
 * ============================================================================
 */
static inline
Bool CSL_mcaspGetXmtErr (
    CSL_McaspHandle    hMcasp    
)
{
    return((Bool)CSL_FEXT(hMcasp->regs->XSTAT, MCASP_XSTAT_XERR));
}

/** ===========================================================================
 *   @n@b CSL_mcaspGetXmtClkFail
 *
 *   @b Description
 *   @n This function checks whether transmit clock failure flag is set or not
 *
 *   @b Arguments
 *   @verbatim
            hMcasp            Handle to the McASP instance
     @endverbatim
 *
 *   <b> Return Value </b>  Bool
 *   @li                    TRUE  - Transmit clock failure flag is set
 *   
 *   @li                    FALSE - Transmit clock failure flag is not set
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim
        Bool    xmtClkFail;
        
        xmtClkFail = CSL_mcaspGetXmtClkFail (hMcasp);
        
     @endverbatim
 * ============================================================================
 */
static inline
Bool CSL_mcaspGetXmtClkFail (
    CSL_McaspHandle    hMcasp    
)
{
    return((Bool)CSL_FEXT(hMcasp->regs->XSTAT, MCASP_XSTAT_XCKFAIL));
}

/** ===========================================================================
 *   @n@b CSL_mcaspGetXmtSyncErr
 *
 *   @b Description
 *   @n This function checks whether unexpected transmit frame sync flag is set
 *      or not
 *
 *   @b Arguments
 *   @verbatim
            hMcasp            Handle to the McASP instance
     @endverbatim
 *
 *   <b> Return Value </b>  Bool
 *   @li                    TRUE  - Unexpected transmit frame sync error has
 *                                  occurred
 *   
 *   @li                    FALSE - Unexpected transmit frame sync error has
 *                                  not occurred
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim
        Bool    xmtSyncErr;
        
        xmtSyncErr = CSL_mcaspGetXmtSyncErr (hMcasp);
        
     @endverbatim
 * ============================================================================
 */
static inline
Bool CSL_mcaspGetXmtSyncErr (
    CSL_McaspHandle    hMcasp    
)
{
    return((Bool)CSL_FEXT(hMcasp->regs->XSTAT, MCASP_XSTAT_XSYNCERR));
}

/** ===========================================================================
 *   @n@b CSL_mcaspGetXmtUnderrun
 *
 *   @b Description
 *   @n This function checks whether transmitter underrun flag is set or not
 *
 *   @b Arguments
 *   @verbatim
            hMcasp            Handle to the McASP instance
     @endverbatim
 *
 *   <b> Return Value </b>  Bool
 *   @li                    TRUE  - Transmitter underrun flag is set 
 *   
 *   @li                    FALSE - Transmitter underrun flag is not set
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim
        Bool    xmtUnderRun;
        
        xmtUnderRun = CSL_mcaspGetXmtUnderrun (hMcasp);
        
     @endverbatim
 * ============================================================================
 */
static inline
Bool CSL_mcaspGetXmtUnderrun (
    CSL_McaspHandle    hMcasp    
)
{
    return((Bool)CSL_FEXT(hMcasp->regs->XSTAT, MCASP_XSTAT_XUNDRN));
}

/** ===========================================================================
 *   @n@b CSL_mcaspGetXmtDataReady
 *
 *   @b Description
 *   @n This function checks whether transmit data ready flag is set or not
 *
 *   @b Arguments
 *   @verbatim
            hMcasp            Handle to the McASP instance
     @endverbatim
 *
 *   <b> Return Value </b>  Bool
 *   @li                    TRUE  - Transmit data ready flag is set
 *   
 *   @li                    FALSE - Transmit data ready flag is not set
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim
        Bool    xmtDataReady;
        
        xmtDataReady = CSL_mcaspGetXmtDataReady (hMcasp);
        
     @endverbatim
 * ============================================================================
 */
static inline
Bool CSL_mcaspGetXmtDataReady (
    CSL_McaspHandle    hMcasp    
)
{
    return((Bool)CSL_FEXT(hMcasp->regs->XSTAT, MCASP_XSTAT_XDATA));
}

/** ===========================================================================
 *   @n@b CSL_mcaspGetRcvErr
 *
 *   @b Description
 *   @n This function checks whether receiver error interrupt has occurred
 *      or not
 *
 *   @b Arguments
 *   @verbatim
            hMcasp            Handle to the McASP instance
     @endverbatim
 *
 *   <b> Return Value </b>  Bool
 *   @li                    TRUE  - Receiver error interrupt has occurred
 *   
 *   @li                    FALSE - Receiver error interrupt has not occurred
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        Bool    rcvErr;
        
        rcvErr = CSL_mcaspGetRcvErr (hMcasp);
        
     @endverbatim
 * ============================================================================
 */
static inline
Bool CSL_mcaspGetRcvErr (
    CSL_McaspHandle    hMcasp    
)
{
    return((Bool)CSL_FEXT(hMcasp->regs->RSTAT, MCASP_RSTAT_RERR));
}

/** ===========================================================================
 *   @n@b CSL_mcaspGetRcvClkFail
 *
 *   @b Description
 *   @n This function checks whether receive clock failure flag is set or not
 *
 *   @b Arguments
 *   @verbatim
            hMcasp            Handle to the McASP instance
     @endverbatim
 *
 *   <b> Return Value </b>  Bool
 *   @li                    TRUE  - Receive clock failure flag is set
 *   
 *   @li                    FALSE - Receive clock failure flag is not set
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        Bool    rcvClkFail;
        
        rcvClkFail = CSL_mcaspGetRcvClkFail (hMcasp);
        
     @endverbatim
 * ============================================================================
 */
static inline
Bool CSL_mcaspGetRcvClkFail (
    CSL_McaspHandle    hMcasp    
)
{
    return((Bool)CSL_FEXT(hMcasp->regs->RSTAT, MCASP_RSTAT_RCKFAIL));
}

/** ===========================================================================
 *   @n@b CSL_mcaspGetRcvSyncErr
 *
 *   @b Description
 *   @n This function checks whether unexpected receive frame sync flag is set
 *      or not
 *
 *   @b Arguments
 *   @verbatim
            hMcasp            Handle to the McASP instance
     @endverbatim
 *
 *   <b> Return Value </b>  Bool
 *   @li                    TRUE  - Unexpected receive frame sync error has
 *                                  occurred

⌨️ 快捷键说明

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