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

📄 dss.c

📁 DSP 基于 TMS320C6711 DSK 的功能演示程序
💻 C
字号:
/*
 *  Copyright 2001 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.
 *  U.S. Patent Nos. 5,283,900  5,392,448
 */
/* "@(#) XDAS 2.12 05-21-01 (__imports)" */
/*
 *  ======== dss.c ========
 *
 */

#include <std.h>

#include <dss.h>
#include <pip.h>

Int     DSS_error = 0;

Int     DSS_rxCnt = 0;
Int     DSS_txCnt = 0;

Int     *DSS_rxPtr = NULL;
Int     *DSS_txPtr = NULL;

#ifdef _DMA_
#include <dma.h>
#endif
#ifdef _EDMA_
#include <edma.h>
#endif

/*
 *  ======= DSS_txPrime ========
 */
void DSS_txPrime(void)
{
    PIP_Obj     *txPipe = &DSS_txPipe;
    static int delay = 1;       /* or 2, 3, etc. */
    static Int nested = 0;

    if (nested) {       /* prohibit recursive call via PIP_get() */
        return;
    }

    if (delay) {
        delay--;
        return;
    }

    nested = 1;

    if (DSS_txCnt == 0 && PIP_getReaderNumFrames(txPipe) > 0) {
        PIP_get(txPipe);

        DSS_txPtr = PIP_getReaderAddr(txPipe);/* must set 'Ptr' before 'Cnt' */
        DSS_txCnt = PIP_getReaderSize(txPipe);/* to synchronize with isr() */

#ifdef _DMA_
        DMA_txStart(DSS_txPtr, DSS_txCnt);
#endif
#ifdef _EDMA_
        EDMA_txStart(DSS_txPtr, DSS_txCnt);
#endif
    }

    nested = 0;
}

/*
 *  ======= DSS_rxPrime ========
 */
void DSS_rxPrime(void)
{
    PIP_Obj     *rxPipe = &DSS_rxPipe;
    static Int  nested = 0;

    if (nested) {       /* prohibit recursive call via PIP_alloc() */
        return;
    }

    nested = 1;

    if (DSS_rxCnt == 0 && PIP_getWriterNumFrames(rxPipe) > 0) {
        PIP_alloc(rxPipe);

        DSS_rxPtr = PIP_getWriterAddr(rxPipe);/* must set 'Ptr' before 'Cnt' */
        DSS_rxCnt = PIP_getWriterSize(rxPipe);/* to synchronize with isr() */

#ifdef _DMA_
        DMA_rxStart(DSS_rxPtr, DSS_rxCnt);
#endif
#ifdef _EDMA_
        EDMA_rxStart(DSS_rxPtr, DSS_rxCnt);
#endif
    }

    nested = 0;
}

⌨️ 快捷键说明

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