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

📄 dss.c

📁 使用在dsp TI DSK6711中 很多controller 的例子
💻 C
字号:
/*

 *  Copyright 2003 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.

 *

 *  @(#) XDAS 2.51.00 11-29-2003 (xdas-2.50.00.9)

 */

/*

 *  ======== 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 + -