亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dmacli.c

?? dsp DM642 pci 詳細的開發例程
?? C
?? 第 1 頁 / 共 2 頁
字號:
// dm642_cli.c
//////////////////////////////////////////////////////////////////////////////
////
////  Copyright (c) 2003, Valley Technologies, Inc.
////  All rights reserved.
////
//////////////////////////////////////////////////////////////////////////////
////
////  $Header $
////
////  $ReleaseClass: src $
////
////  Original Author                 : ebersole
////  Most Recent Contributing $Author: ebersole $
////
//////////////////////////////////////////////////////////////////////////////
////
////  This file contains 
////
//////////////////////////////////////////////////////////////////////////////

//############################################################################


#include <stdio.h>

#include <dm642_lib.h>
#include "Dm642Cli.h"


//############################################################################
//                           Function Prototypes
//############################################################################


static void copyDmaSpaceToFile( DM642_HANDLE hDM642,
                                DMA_HANDLE   hDma,
                                int          nBufType );

static void copyDmaSpaceFromFile( DM642_HANDLE hDM642,
                                  DMA_HANDLE   hDma,
                                  int          nBufType );


//############################################################################
//                            Start of Functions
//############################################################################


//////////////////////////////////////////////////////////////////////////////
////
////  Name: PrintDMASubMenu
////
////  Purpose: Displays the DMA Sub-Menu to the screen.
////
////  Input  Parameters:
////      hDM642 -- Handle of the currently-open DM642 board/card
////
////  Output Parameters: none
////
////  Return Value(s)  : none
////
//////////////////////////////////////////////////////////////////////////////

void PrintDMASubMenu(DM642_HANDLE hDM642)
{
    extern DWORD g_dwBoardNum;

    printf ("\n");
    printf ("********************** DMA Menu **********************\n");
    printf ("\n");
    printf ("Using board #%d (EVM-DM642)\n", g_dwBoardNum);
    printf ("\n");
    printf (" Host Buffer Functions                             \n");
    printf ("-----------------------------                      \n");
    printf ("1:  Fill Host Buffer with Address values           \n");
    printf ("2:  Fill Host Buffer with repeating data           \n");
    printf ("3:  Display Host Buffer values                     \n");
    printf ("4:  Get Host's Physical DMA Address                \n");
    printf ("5:  Get Host's Virtual  DMA Address                \n");
    printf ("6:  Copy Host Buffer to File                       \n");
    printf ("7:  Copy File to Host Buffer                       \n");
    printf ("                                                   \n");
    printf (" DSP<-->PCI_Device Functions                       \n");
    printf ("-----------------------------                      \n");
    printf ("8:   Set DSP R/W Address (absolute address)        \n");
    printf ("9:   Set PCI R/W Address (absolute address)        \n");
    printf ("10:  Start DMA Transfer                            \n");
    printf ("11:  Check Transfer Status                         \n");
    printf ("                                                   \n");
    printf (" DSP<-->Host_Buffer Functions                      \n");
    printf ("------------------------------------               \n");
    printf ("12:  Set DSP  R/W Address (absolute address)       \n");
    printf ("13:  Set Host R/W Address (via offset)             \n");
    printf ("14:  Start DMA Xfer                                \n");
    printf ("15:  Check Transfer Status                         \n");
    printf ("                                                   \n");
    printf ("q:  Quit                                           \n");
    printf ("                                                   \n");
    printf (">>");

}       // End PrintDMASubMenu()

//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
////
////  Name: RunDMASubMenu
////
////  Purpose:  Displays the DMA SubMenu.  Gets the user's choice
////            from said menu.  Processes that choice.
////
////  Input  Parameters:
////      hDM642 - Handle of the currently-open DM642 board/card
////
////  Output Parameters: none
////
////  Return Value(s)  : none
////
//////////////////////////////////////////////////////////////////////////////

void RunDMASubMenu(DM642_HANDLE hDM642)
{
    char         sChoice [80];
    int          nStatus      = 0;
    int          nOffset      = 0;
    int          nSize        = 0;
    int          nValue       = 0;
    int          nTest        = 0;
    unsigned int nVal1        = 0;
    DMA_HANDLE   hDma         = NULL;
    unsigned     nDmaBufType;
    unsigned     nDmaSizeW    = 0;
    unsigned    *pDmaBuf      = NULL;
    DWORD        nDmaPhysAddr = 0;
    DWORD        nDmaVirtAddr = 0;


    if (kNoError == nStatus)
    {
        // Get the desired DMA buffer size from the user
        nStatus = getInt("Enter the desired Host DMA Buffer size (in 32-bit Words) >>", 
                         "%x",
                         &nDmaSizeW);
    }

    if (kNoError == nStatus)
    {
         // Get the DMA buffering strategy from the user
         nStatus = getInt("Enter the desired buffering strategy [1 = Contig, 2 = Scat-Gath] >>",
                          "%x",
                          &nDmaBufType);
    }

    if (kNoError == nStatus)
    {
        //-------------------------------------------------------------
        // If the buffering strategy is Scatter-Gather we need to
        // allocate the memory
        //-------------------------------------------------------------
        if (kDmaBufType_ScatGath == nDmaBufType)
        {
            // Allocate the buffer memory
            nStatus = allocateMem(nDmaSizeW, kBytesPerWord, &pDmaBuf);
            if (nStatus != kNoError)
            {
                printf("ERROR: Could not allocate Scat-Gath buffer!\n");
            }
        }
    }

    if (kNoError == nStatus)
    {
        //--------------------------------------------------------------------
        // Create/Lock the Host DMA buffer space
        // When pDmaBuf is a NULL pointer the DM642DmaOpen funtion allocates
        // the Host DMA buffer memory and uses the contiguous buffer strategy
        //--------------------------------------------------------------------
        nStatus = DM642DmaOpen(hDM642,
                              &hDma,
                               nDmaBufType,
                               pDmaBuf,
                               nDmaSizeW * kBytesPerWord,
                               kDmaChan_0);
        if (nStatus != kNoError)
        {
            printf("ERROR: Could not open/initialize DMA!\n");
        }
    }

    if (kNoError == nStatus)
    {
        //-------------------------------------------------------------
        // Get the Physical address. This address is used to tell the
        // DM642 DSP the location of the Host DMA buffer
        //-------------------------------------------------------------
        nDmaPhysAddr = DM642DmaGetPhysicalAddr(hDma);

        //-------------------------------------------------------------
        // Get the Virtual address. This address is used to tell the
        // Host the location of the Host DMA buffer
        //-------------------------------------------------------------
        nDmaVirtAddr = DM642DmaGetVirtualAddr(hDma);

        // Print the address values
        printf("Obtained DMA buffer: %u bytes @ Virtual: 0x%08x => Phys: 0x%08x\n\n",
                nDmaSizeW * kBytesPerWord,
                nDmaVirtAddr,
                nDmaPhysAddr);
    }

    // Perform the main DMA sub-menu processing ....

    while (kNoError == nStatus)
    {
        // Print the menu
        PrintDMASubMenu(hDM642);

        // Get the users choice
        scanf ("%s", sChoice);
        printf ("\n");

        // Fill Host DMA Space with address values
        if (0 == strcmp (sChoice, "1"))
        {
            //-------------------------------------------------------------
            // hDma is the DMA structure that contains the address values
            // returned by the DMA Open function
            //-------------------------------------------------------------
            DM642DmaFillDmaSpaceWithAddrs (hDma);
        }

        // Fills Host DMA memory with a repeating, unchanging value
        if (0 == strcmp (sChoice, "2"))
        {
            unsigned int nValue;
            int          nNumWords;
            int          nMyStatus = kNoError;

            if (kNoError == nMyStatus)
            {
                // Get the starting memory address offset from the user
                nMyStatus = getInt ("Enter the memory address offset (HEX) >>", "%x",
                                    &nOffset);
            }

            if (kNoError == nMyStatus)
            {
                // Get the value to write into the Host DMA buffer
                nMyStatus = getInt ("Enter the Hex value to write >> ", "%x",
                                    &nValue);
            }

            if (kNoError == nMyStatus)
            {
                // Get the number of words to write
                nMyStatus = getInt ("Enter the number of 32-bit Words to write >> ", "%x",
                                    &nNumWords);
            }

            if (kNoError == nMyStatus)
            {
                // Fill the Host DMA buffer space
                DM642DmaFillDmaSpace (hDma, nOffset, nValue, nNumWords);
            }
        }

        // Display values from the Host DMA Buffer space
        if (0 == strcmp (sChoice, "3"))
        {
            int nMyStatus = kNoError;

            if (kNoError == nMyStatus)
            {
                // Get the starting memory address offset from the user
                nMyStatus = getInt ("Enter the memory address offset (HEX) ", "%x",
                                    &nOffset);
            }

            if (kNoError == nMyStatus)
            {
                // Get the number of words to write
                nMyStatus = getInt ("Enter the number of 32-bit words to read (HEX) ", "%x",
                                    &nSize);
            }

            printf("\n");

            if (kNoError == nMyStatus)
            {
                // Read the Host DMA buffer space
                DM642DmaDumpDmaSpace(hDma, nOffset, nSize);
            }
        }

        // Gets the Host DMA Buffer physical address.
        if (0 == strcmp (sChoice, "4"))
        {
            //-------------------------------------------------------------
            // Get the Physical address. This address is used to tell the
            // DM642 DSP the location of the Host DMA buffer
            //-------------------------------------------------------------
            nDmaPhysAddr = DM642DmaGetPhysicalAddr(hDma);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品区一区二区| 久久先锋影音av鲁色资源| 国产老妇另类xxxxx| 黄网站免费久久| 久久疯狂做爰流白浆xx| 日本欧美肥老太交大片| 日韩1区2区3区| 久久精品国产精品亚洲综合| 精品亚洲porn| 国产乱码精品一区二区三区忘忧草| 成人一区二区在线观看| 国产成人免费av在线| 国v精品久久久网| 成人免费va视频| 欧美做爰猛烈大尺度电影无法无天| 亚洲区小说区图片区qvod| 亚洲三级在线免费| 亚洲国产精品一区二区久久| 亚洲福利视频一区二区| 麻豆精品视频在线| 蜜桃91丨九色丨蝌蚪91桃色| 国产一区二区三区免费看| 福利电影一区二区三区| 91黄色免费版| 91精品久久久久久久99蜜桃 | 成人午夜电影小说| a级高清视频欧美日韩| 欧洲日韩一区二区三区| 欧美精品成人一区二区三区四区| 成人黄色电影在线| 欧美日韩不卡视频| 久久综合资源网| 亚洲一区精品在线| 国产精品一区二区久激情瑜伽| 亚洲国产婷婷综合在线精品| 精品午夜久久福利影院| 99久久精品国产观看| 欧美美女视频在线观看| 久久久久国产精品厨房| 亚洲综合久久久| 国产成人欧美日韩在线电影| 欧美日韩一区二区三区高清| 国产午夜精品一区二区三区嫩草| 日韩一区二区三区观看| 中文av一区二区| 美女视频黄免费的久久| 欧美系列日韩一区| 国产精品久久久久久久久免费桃花| 国产午夜精品一区二区三区视频 | 成人av网站在线观看免费| 欧美午夜一区二区三区 | 国产精品人成在线观看免费 | 国产欧美精品一区aⅴ影院| 亚洲人吸女人奶水| 成人激情午夜影院| 日韩欧美电影一区| 午夜精品免费在线| 99精品视频在线播放观看| 精品国产一区二区国模嫣然| 午夜精品aaa| 欧美三日本三级三级在线播放| 波多野结衣在线一区| 精品欧美黑人一区二区三区| 亚洲成a人在线观看| 成av人片一区二区| 久久精品亚洲一区二区三区浴池| 国产精品乱人伦| 激情成人午夜视频| 精品卡一卡二卡三卡四在线| 午夜精品久久久久久不卡8050| 日韩中文字幕麻豆| 欧美日韩免费观看一区三区| 亚洲综合男人的天堂| 91在线精品一区二区| 国产欧美视频在线观看| 国产精品一二一区| 国产亚洲综合性久久久影院| 国产一区二区不卡在线| 国产亚洲成aⅴ人片在线观看| 国产精品欧美久久久久无广告| 亚洲欧洲制服丝袜| 99在线精品视频| 国产精品电影一区二区| 99精品视频一区| 亚洲日本在线天堂| 在线免费观看日本一区| 无码av中文一区二区三区桃花岛| 久久国产人妖系列| 国产无人区一区二区三区| 成人永久免费视频| 依依成人精品视频| 欧美日韩免费一区二区三区视频| 日韩一级成人av| 国产永久精品大片wwwapp| 中文一区在线播放| 欧洲国产伦久久久久久久| 美女被吸乳得到大胸91| 国产亚洲欧美在线| 欧美综合在线视频| 日本美女一区二区| 国产欧美视频一区二区| 91论坛在线播放| 喷水一区二区三区| 国产精品福利一区二区三区| 91成人看片片| 国产毛片精品国产一区二区三区| 欧美精品日韩综合在线| 国产一区激情在线| 一区二区三区在线不卡| 久久只精品国产| 色综合天天综合网国产成人综合天 | 在线观看一区二区视频| 免费国产亚洲视频| 国产欧美精品一区aⅴ影院| 欧美午夜在线观看| 成人午夜碰碰视频| 亚洲最大成人网4388xx| 久久新电视剧免费观看| 欧美日本一区二区| 不卡大黄网站免费看| 精品一二三四在线| 五月婷婷久久综合| 亚洲日本丝袜连裤袜办公室| 精品盗摄一区二区三区| 欧美性猛交xxxxxxxx| 国产精品一区二区三区四区| 日韩精品欧美成人高清一区二区| 在线观看网站黄不卡| 国产精品538一区二区在线| 亚洲大片在线观看| 亚洲日本成人在线观看| 久久精品水蜜桃av综合天堂| 欧美性欧美巨大黑白大战| 成人在线综合网| 国产一区二区免费视频| 蜜桃久久精品一区二区| 天天影视涩香欲综合网| 一级女性全黄久久生活片免费| 91久久精品国产91性色tv | 亚洲一区在线视频观看| 久久久久国色av免费看影院| 欧美日韩小视频| 日本二三区不卡| 一本到不卡免费一区二区| 成人免费视频caoporn| 国产精品一区2区| 国产成人亚洲综合a∨婷婷图片| 亚洲国产精品t66y| 国产日韩欧美在线一区| 日韩欧美一区在线| 日韩小视频在线观看专区| 这里只有精品视频在线观看| 91麻豆精品国产91久久久资源速度 | 欧美精品xxxxbbbb| 在线成人免费视频| 欧美美女直播网站| 欧美美女一区二区在线观看| 欧美日本国产一区| 在线电影院国产精品| 日韩一级免费观看| 精品av综合导航| 久久丝袜美腿综合| 中文字幕国产一区| 自拍偷拍国产精品| 亚洲丶国产丶欧美一区二区三区| 欧美变态tickling挠脚心| 精品三级在线观看| 国产精品萝li| 亚洲一区二区美女| 韩国午夜理伦三级不卡影院| 国产成人免费视频精品含羞草妖精| 亚洲男同性恋视频| 五月婷婷激情综合| 韩国精品一区二区| 99久久免费国产| 日本韩国精品在线| 欧美大片国产精品| 欧美国产成人精品| 亚洲一卡二卡三卡四卡无卡久久| 国产视频一区二区在线| 国产精品传媒入口麻豆| 亚洲第一久久影院| 国产91在线看| 欧美日韩高清不卡| 久久这里只有精品6| 亚洲人成小说网站色在线| 免费国产亚洲视频| 色呦呦一区二区三区| 精品乱人伦一区二区三区| 视频一区视频二区中文字幕| 国产综合色在线视频区| 在线免费观看日韩欧美| 国产校园另类小说区| 无码av中文一区二区三区桃花岛| 亚洲资源在线观看| 国产mv日韩mv欧美| 欧美色网一区二区| 中文字幕一区二区视频| 久久精品国产在热久久| 欧美日韩中文字幕一区二区|