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

📄 dss_priv.h

📁 基于DSP的实时语音信号处理系统设计实例
💻 H
字号:
/*
 *  Copyright 2002 by Texas Instruments Incorporated.
 *  All rights reserved. Property of Texas Instruments Incorporated.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
 *  
 */
/* "@(#) DSP/BIOS 4.80.208 12-06-02 (barracuda-l19)" */
/*
 *  ======== dss_priv.h ========
 *  This header contains internal implementation declarations that
 *  should never be seen by a client using DSS
 */

#ifndef DSS_PRIV_
#define DSS_PRIV_

#include <clk.h>
#include <sts.h>
#include <trc.h>

#include "dsscfg.h"

#ifdef _EVM5510_
extern Void DSS_rxPrime(Arg Arg_calledByISR);
extern Void DSS_txPrime(Arg Arg_calledByISR);
#else
extern Void DSS_rxPrime(Bool calledByISR);
extern Void DSS_txPrime(Bool calledByISR);
#endif


extern Int	*DSS_rxPtr;
extern Int	*DSS_txPtr;

extern Int	DSS_rxCnt;
extern Int	DSS_txCnt;

#if defined(_DMA_) || defined(_EDMA_) || defined(_EVM5510_)
extern Void DSS_dmaInit(Void);
extern void DSS_dmaRxStart(void *ptr, Int nwords);
extern void DSS_dmaTxStart(void *ptr, Int nwords);

extern Uns DSS_spRead(Void);
extern Void DSS_spWrite(Uns data);

/*
 *  ======== DSS_computePhase ========
 *  Compute phase difference between input and output
 */
static inline Void DSS_computePhase(Int channel)
{
    static LgUns inTime = 0, outTime = 0;
    static Uns inCount = 0, outCount = 0;
    LgUns tmp;

    tmp = CLK_gethtime();
    if (channel & DSS_RXDONE) {
	inTime = tmp;
	inCount++;
    }
    if (channel & DSS_TXDONE) {
	outTime = tmp;
	outCount++;
    }
    if (inCount == outCount) {
	if (TRC_query(TRC_STSPIP) == 0) {
	    STS_add(&DSS_ioPhase,
		(outTime > inTime) ?
		(outTime - inTime) : (inTime - outTime));
	}
    }
}
#else
/*
 *  ======== DSS_computePhase ========
 *  Compute phase difference between input and output
 */
static inline Void DSS_computePhase(Int frameSize)
{
    extern Int DSS_phaseDiff;
    Int delta;
    Int tmp;

    if (TRC_query(TRC_STSPIP) == 0) {
	delta = DSS_phaseDiff < 0 ? -DSS_phaseDiff : DSS_phaseDiff;
	tmp = (sizeof (Int) / sizeof (MdInt)) * frameSize - delta;
	if (tmp < delta) {
	    delta = tmp;
	}
	
	STS_add(&DSS_ioPhase, delta);
    }
}

#endif

#endif

⌨️ 快捷键说明

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