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

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

?? boardops.c

?? dsp DM642 pci 詳細的開發例程
?? C
字號:
// BoardOps.c
//////////////////////////////////////////////////////////////////////////////
////
////  Copyright (c) 2003, Valley Technologies, Inc.
////  All rights reserved.
////
//////////////////////////////////////////////////////////////////////////////
////
////  $Header $
////
////  $ReleaseClass: src $
////
////  Original Author                 : ebersole
////  Most Recent Contributing $Author: ebersole $
////
//////////////////////////////////////////////////////////////////////////////
////
////  This file contains the routines necessary to open, close, change,
////    and find DM642 cards.  The routines in this file interact with the
////    user to obtain certain information.  The routines pass this info
////    on into the DM642 Library, which does the lower-level dirty work.
////
//////////////////////////////////////////////////////////////////////////////


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


// Includes
#include <stdio.h>
#include <dm642_lib.h>
#include "Dm642App.h"

//############################################################################
//                           Global Variables
//############################################################################


int   gnBoardsFound = 2;
DWORD g_dwBoardNum  = -1;


//############################################################################
//                        Static (PRIVATE) Functions
//############################################################################


//////////////////////////////////////////////////////////////////////////////
////
////  Name: getVendorAndDeviceIDsFromUser
////
////  Purpose: This routine gets the Vendor ID and Device ID (of a PCI
////           device) from the user.
////
////  Input Parameters: none
////
////  Output Parameters:
////      pdwVendorID -- The PCI Vendor ID that the user entered
////      pdwDeviceID -- The PCI Device ID that the user entered
////
////  Return Value(s):
////      -1 => ERROR => invalid Vendor ID from user
////                     If this value is returned, none of the output
////                     parameters will be set/changed.
////       0 => SUCCESS
////
//////////////////////////////////////////////////////////////////////////////

static int getVendorAndDeviceIDsFromUser( DWORD *pdwVendorID,
                                          DWORD *pdwDeviceID )
{
    char  line[80];
    DWORD dwVendorID, dwDeviceID;


    printf ("Enter VendorID: ");

    fgets (line, sizeof(line), stdin);
    sscanf(line, "%x",         &dwVendorID);

    if (dwVendorID == 0)
    {
        return (-1);
    }

    printf ("Enter DeviceID: ");

    fgets (line, sizeof(line), stdin);
    sscanf(line, "%x",         &dwDeviceID);

    *pdwVendorID = dwVendorID;
    *pdwDeviceID = dwDeviceID;

    return (0);

}       // END getVendorAndDeviceIDsFromUser()

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


//////////////////////////////////////////////////////////////////////////////
////
////  Name: getCardNumberFromUser
////
////  Purpose: This routine gets, from user, the number of the DM642 card
////           to use/activate.  An invalid choice by the user causes the
////           routine to return a default selection of '0'.
////
////  Input Parameters:
////      nNumCards -- Total number of DM642 cards found by the most recent
////                   scan of the PCI bus.
////
////  Output Parameters: none
////
////  Return Value(s):
////       0                 Either card #0 was selected, or a bad selection
////                         resulted in an auto-select of card #0
////       1..(nNumCards-1)  The number of the card selectd by the user.
////
//////////////////////////////////////////////////////////////////////////////

static DWORD getCardNumberFromUser(DWORD nNumCards)
{
    char  line[80];
    DWORD nMyCard;


    //--------------------------------------
    // Prompt the user to select a card #
    //--------------------------------------
    printf ("Found %u matching PCI cards\n", (UINT)nNumCards);
    printf ("Select card (0-%u): ",          (UINT)nNumCards - 1);

    //----------------------------------
    // Flush/Clean the input 'buffers'
    //----------------------------------
    nMyCard = 0;
    fflush(stdin);

    //-------------------------
    // Get the card # ...
    //-------------------------
    fgets (line, sizeof(line), stdin);
    sscanf(line, "%d",         &nMyCard);

    //---------------------------------------------
    // Verify that the user's choice is valid
    //   If so, return that choice to the caller
    //---------------------------------------------
    if ((nMyCard >= 0) && (nMyCard < nNumCards))
    {
        return(nMyCard);
    }

    printf ("Choice is out of range\n");

    //------------------------------------------------
    // If the user selects an invalid card, use
    //   card #0 as his/her selection.
    //------------------------------------------------
    return (0);

}       // End getCardNumberFromUser()

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


//////////////////////////////////////////////////////////////////////////////
////
////  Name: DM642LocateBoard
////
////  Purpose: This routine determines which DM642 card to use/activate.
////           It will get input from the user, as necesary.
////
////  Input Parameters:
////      pdwVendorID -- The PCI Vendor ID to locate
////                     [if 0, user is prompted for a VID+DID]
////      pdwDeviceID -- The PCI Device ID to locate
////                     [undefined if pdwVendorID == NULL/0]
////
////  Output Parameters:
////      pdwVendorID -- PCI Vendor ID, as entered by the user
////      pdwDeviceID -- PCI Device ID, as entered by the user
////
////  Return Value(s):
////       < 0: ERROR
////      >= 0: The number of the card to use/activate
////
//////////////////////////////////////////////////////////////////////////////

static DWORD DM642LocateBoard(DWORD *pdwVendorID, DWORD *pdwDeviceID)
{
    DWORD  nNumCards,
           nCardSelected;


    //------------------------------------------------------------------------
    // If an invalid Vendor ID was entered, then get BOTH the Vendor ID and
    //   the Device ID from the user.
    //------------------------------------------------------------------------
    if (pdwVendorID == NULL || *pdwVendorID == 0)
    {
        if (getVendorAndDeviceIDsFromUser(pdwVendorID, pdwDeviceID) < 0)
        {
            // ERROR -- invalid VID or DID ...
            return (-1);
        }
    }

    //---------------------------------------------------------------
    // Count the number of cards in the chassis that have the given 
    //   VID & DID combo ...
    //---------------------------------------------------------------
    nNumCards = DM642CountCards (*pdwVendorID, *pdwDeviceID);

    //-----------------------------------------
    // Not finding any cards is an error ...
    //-----------------------------------------
    if (nNumCards == 0)
    {
        printf ("%s", DM642_ErrorString);
        return (-1);
    }

    //---------------------------------------------------
    // Finding one card makes choosing superfluous ...
    //---------------------------------------------------
    if (nNumCards == 1)
    {
        return (0);
    }

    //---------------------------------------------------
    // Finding more than one card requires the user to
    //   choose which one to use/activate
    //---------------------------------------------------
    nCardSelected = getCardNumberFromUser(nNumCards);

    return (nCardSelected);

}       // END DM642LocateBoard()


//############################################################################
//                        Non-Static (PUBLIC) Functions
//############################################################################


//////////////////////////////////////////////////////////////////////////////
////
////  Name: DM642OpenBoard
////
////  Purpose: Opens/Activates the given DM642 board.  If this fails,
////           the routine prints an error message.
////
////  Input Parameters:
////      pdwVendorID -- The PCI Vendor ID of the DM642 board to open/enable
////      pdwDeviceID -- The PCI Device ID of the DM642 board to open/enable
////      dwBoardNum  -- The number of the DM642 board to open/enable
////
////  Output Parameters: none
////
////  Return Value(s):
////      NULL    : ERROR opening the card
////      non-NULL: Handle to the DM642 board just opened
////
//////////////////////////////////////////////////////////////////////////////

DM642_HANDLE DM642OpenBoard(DWORD dwVendorID, DWORD dwDeviceID, DWORD dwBoardNum)
{
    DM642_HANDLE hDM642 = NULL;


    //----------------------------------------------------------------------
    // Attempt to open the indicated DM642.
    // If this fails, print an error message (constructed inside the DM642
    //   library) and bail.
    //----------------------------------------------------------------------
    if (!DM642Open (&hDM642, dwVendorID, dwDeviceID, dwBoardNum))
    {
        printf ("%s", DM642_ErrorString);
        return (NULL);
    }

    printf ("DM642 PCI card opened!\n");

    //--------------------------------------------------------
    // If we do open the DM642 successfully, set our global
    //   board-number constant to the open card's number
    //--------------------------------------------------------
    g_dwBoardNum = dwBoardNum;

    return (hDM642);

}       // END DM642OpenBoard()

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


//////////////////////////////////////////////////////////////////////////////
////
////  Name: DM642CloseBoard
////
////  Purpose: This routine closes/deactivates an open DM642 card.
////           The occurs iff the given card is already open.
////
////  Input Parameters:
////      phDM642 - POINTER to handle of currently-open DM642 board
////
////  Output Parameters:
////      phDM642 - POINTER to handle of a DM642 board
////                Will be set to NULL.
////
////  Return Value(s)  : none
////
//////////////////////////////////////////////////////////////////////////////

void DM642CloseBoard(DM642_HANDLE *phDM642)
{
    if (*phDM642 != NULL)
    {
        DM642Close(*phDM642);
    }

    *phDM642     = NULL;
    g_dwBoardNum = -1;

}       // End DM642CloseBoard()

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


//////////////////////////////////////////////////////////////////////////////
////
////  Name: ChangeBoard
////
////  Purpose: This routine changes the currently active/open DM642 to a
////           different one.  Any necessary info is obtained from the user.
////           If no boards are open, this routine will just open the newly
////           selected DM642 (ie, it can be used at boot/init)
////
////  Input Parameters:
////      phDM642     - POINTER to handle of currently-open DM642 board
////      pdwVendorID - The PCI Vendor ID of the board to change to
////      pdwDeviceID - The PCI Device ID of the board to change to
////
////  Output Parameters:
////      phDM642 - POINTER to handle of a DM642 board
////                NULL     if opening a new board fails
////                non-NULL (valid board handle) otherwise
////
////  Return Value(s):
////      -1 : ERROR     (either invalid input OR board-open failed)
////       0 : SUCCESS
////
//////////////////////////////////////////////////////////////////////////////

int ChangeBoard(DM642_HANDLE *phDM642, DWORD dwVendorID, DWORD dwDeviceID)
{
    DWORD dwBoardNum;


    ///--------------------------------------
    // Determine which DM642 to switch to.
    ///--------------------------------------
    dwBoardNum = DM642LocateBoard(&dwVendorID, &dwDeviceID);

    //------------------------------------------------------------------------
    // If an error (including invalid user input) occurred while determining
    //  the new board number to use, bail w/o changing a thing.
    //------------------------------------------------------------------------
    if (dwBoardNum < 0)
    {
        return (-1);
    }

    //----------------------------------------------------------
    // ASSERT: dwBoardNum (newly selected board number) >= 0
    //         IE, the new board number is valid.
    //----------------------------------------------------------

    //------------------------------------------------------------
    // Skip the Close()-then-Open() sequence if we actually are
    //   not changing boards.  We already have the desired board
    //   opened, in that case.
    //------------------------------------------------------------
    if (g_dwBoardNum == dwBoardNum)
    {
        return (0);
    }

    //--------------------------------------------
    // Close the old board and Open the new one
    //--------------------------------------------
    DM642CloseBoard(phDM642);
    *phDM642 = DM642OpenBoard(dwVendorID, dwDeviceID, dwBoardNum);
    if (NULL == *phDM642)
    {
        return (-1);
    }

    return (0);

}       // END ChangeBoard()


//############################################################################
//                             End of Functions
//############################################################################

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩国产色站一区二区三区| 日韩欧美激情一区| 欧美在线免费播放| 欧美二区乱c少妇| 国产亚洲精品资源在线26u| 亚洲欧美日韩久久| 日本欧美肥老太交大片| 国产综合色精品一区二区三区| 成人av网站在线观看免费| 99久久er热在这里只有精品66| 欧美亚洲丝袜传媒另类| 久久久久国产一区二区三区四区| 一区二区三区欧美激情| 激情欧美日韩一区二区| 色综合天天天天做夜夜夜夜做| 在线精品观看国产| 欧美极品美女视频| 久久精品国产精品亚洲综合| 色婷婷综合视频在线观看| 久久你懂得1024| 天天综合色天天| 91福利在线播放| 国产人妖乱国产精品人妖| 日本欧美肥老太交大片| 日本高清不卡在线观看| 欧美国产视频在线| 国产一区二区女| 日韩视频免费观看高清在线视频| 伊人色综合久久天天人手人婷| 美女性感视频久久| 欧美日韩夫妻久久| 伊人色综合久久天天人手人婷| 国产98色在线|日韩| 久久先锋影音av鲁色资源网| 亚洲综合免费观看高清完整版在线 | 亚洲精选免费视频| 国产精品1024| 久久综合国产精品| 九九九精品视频| 日韩欧美一级二级三级久久久| 午夜伊人狠狠久久| 在线综合+亚洲+欧美中文字幕| 中文字幕在线免费不卡| 成人aaaa免费全部观看| 国产精品福利电影一区二区三区四区| 国产一区二区导航在线播放| 精品不卡在线视频| 国产成人日日夜夜| 久久久亚洲精品一区二区三区| 精一区二区三区| 久久久精品免费观看| 国产乱理伦片在线观看夜一区| 久久综合资源网| 国产麻豆精品在线观看| 欧美经典三级视频一区二区三区| 国产精品亚洲成人| 日韩一区欧美小说| 在线观看网站黄不卡| 亚洲精品成人在线| 欧美精品日韩综合在线| 青青草97国产精品免费观看无弹窗版| 717成人午夜免费福利电影| 麻豆视频观看网址久久| 久久精品男人的天堂| 国产在线不卡视频| 国产精品午夜免费| 91黄色免费网站| 日韩av电影天堂| 精品少妇一区二区三区在线视频 | 91小视频免费观看| 亚洲一二三区在线观看| 欧美精品在欧美一区二区少妇| 一级日本不卡的影视| 日韩一区二区不卡| 成人免费高清在线| 亚洲国产美女搞黄色| 欧美精品一区二区三区蜜桃| 99视频精品在线| 天天操天天干天天综合网| 日韩欧美国产一区在线观看| 成人高清伦理免费影院在线观看| 亚洲香肠在线观看| 国产情人综合久久777777| 国产成人精品一区二| 亚洲免费观看高清完整版在线 | 欧美中文字幕不卡| 久久爱www久久做| 中文字幕永久在线不卡| 97精品电影院| 久久99国产精品久久99果冻传媒| 亚洲色图视频免费播放| 久久五月婷婷丁香社区| 99久久综合精品| 久久精品国产免费| 亚洲综合成人在线视频| 精品盗摄一区二区三区| 91国偷自产一区二区开放时间 | 国产视频一区在线播放| 91黄色在线观看| 国产91高潮流白浆在线麻豆 | 不卡电影免费在线播放一区| 午夜天堂影视香蕉久久| 中文字幕欧美三区| xvideos.蜜桃一区二区| 97精品国产97久久久久久久久久久久| 久久99精品久久久久婷婷| 亚洲午夜久久久久久久久久久| 国产日韩欧美在线一区| 欧美高清性hdvideosex| 在线亚洲一区观看| 99精品视频一区二区| 国产成人在线电影| 日本麻豆一区二区三区视频| 亚洲一区二区三区四区五区黄 | 91精品国产91综合久久蜜臀| 亚洲女女做受ⅹxx高潮| 国产亚洲午夜高清国产拍精品| 日韩美女在线视频| 久久久777精品电影网影网| www国产成人| 中文字幕av一区二区三区高 | 国产精品一区一区三区| 国产一区 二区 三区一级| 国产美女在线精品| 99视频有精品| 欧美丝袜丝交足nylons| 欧美蜜桃一区二区三区| 欧美一级精品大片| 久久久精品国产99久久精品芒果| 久久精品一区二区三区不卡| 国产精品免费视频网站| 亚洲最新在线观看| 免费三级欧美电影| 国产一区二区三区日韩| 97久久精品人人做人人爽50路| 色哟哟亚洲精品| 日韩一区二区视频| 久久蜜桃av一区精品变态类天堂 | 国产女人水真多18毛片18精品视频| 国产精品三级av| 一级日本不卡的影视| 蜜桃视频免费观看一区| 国精品**一区二区三区在线蜜桃| www.日本不卡| 欧美久久久久久久久中文字幕| 精品国精品国产| 亚洲三级理论片| 久久黄色级2电影| av亚洲精华国产精华精华| 欧美色图第一页| 久久蜜桃av一区精品变态类天堂| 国产精品家庭影院| 美国三级日本三级久久99 | 国产专区综合网| 91美女片黄在线观看| 日韩欧美激情四射| 亚洲美女免费视频| 国产精选一区二区三区| 在线观看网站黄不卡| 国产日本欧洲亚洲| 日韩影院精彩在线| 一本久久综合亚洲鲁鲁五月天| 日韩欧美不卡一区| 亚洲综合色婷婷| 成人av网在线| 精品1区2区在线观看| 亚洲国产欧美另类丝袜| 成人性生交大片免费看中文| 日韩写真欧美这视频| 亚洲精品日韩综合观看成人91| 国产精一品亚洲二区在线视频| 在线不卡欧美精品一区二区三区| 亚洲欧洲另类国产综合| 国内精品伊人久久久久影院对白| 欧美日韩一区二区欧美激情 | 青草av.久久免费一区| 欧美性欧美巨大黑白大战| 国产精品人人做人人爽人人添| 久久国产剧场电影| 欧美日韩大陆一区二区| 亚洲精品一二三区| www.久久精品| 国产精品久久综合| 国产超碰在线一区| www成人在线观看| 韩国女主播成人在线| 日韩一区二区精品| 看片网站欧美日韩| 日韩精品一区二区三区在线播放| 午夜视频在线观看一区| 精品视频999| 午夜视频一区二区三区| 欧美人牲a欧美精品| 亚洲大片一区二区三区| 欧美日韩国产高清一区二区| 午夜日韩在线观看| 欧美一级黄色录像| 久久精品国产一区二区三区免费看| 91精品国产综合久久香蕉麻豆| 日韩精品乱码免费|