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

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

?? dscdaconvert.c

?? PC/104擴展模塊DIAMOND-MM-16-AT驅動程序
?? C
字號:
//=============================================================================
// (c) Copyright 2005 Diamond Systems Corporation. Use of this source code
// is subject to the terms of Diamond Systems' Software License Agreement.
// Diamond Systems provides no warranty of proper performance if this
// source code is modified.
//
// File: DSCDAConvert.c   v5.9
// Desc: Sample program that demonstrates how to perform a DA conversion
// Created by KL
//=============================================================================

#include <stdio.h>

#ifdef _WIN32
#ifndef _WIN32_WCE
#include <conio.h>
#endif

#include <windows.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
// diamond driver includes
#include "dscud.h"
#endif


#ifdef _WIN32_WCE

#include <string.h>
#include <Winsock2.h>

static int kbhit()
{
	int i;
	int result=0;

	
	result |= GetAsyncKeyState(VK_RETURN);
	result |= GetAsyncKeyState(VK_SPACE);

	if (result != 0)
	{
		getchar();
		return 1;
	}

	//number keys, 0-9
	for (i=48; i<=57; i++)
		result |= GetAsyncKeyState(i);

	if (result != 0)
	{
		getchar();
		return 1;
	}

	//capital character keys, A-Z
	for (i=65; i<=90; i++)
		result |= GetAsyncKeyState(i);

	if (result != 0)
	{
		getchar();
		return 1;
	}

	//lower case keys, a-z
	for (i=97; i<=122; i++)
		result |= GetAsyncKeyState(i);

	if (result != 0)
	{
		getchar();
		return 1;
	}

	return result;
}

#endif


// DOS
#ifdef __BORLANDC__
#include <conio.h>
#include <dos.h>
#include <stdlib.h>
#include <math.h>
// diamond driver includes
#include "../../../../current/dev/source/dscud.h"
#endif

// Linux and QNX
#if defined(linux) || defined(__QNXNTO__) || defined(_WRS_VXWORKS_5_X)
#include <stdlib.h>
#include <math.h>
#include <time.h>
// diamond driver includes
#include "dscud.h"


#ifdef _WRS_VXWORKS_5_X
#include <selectLib.h>
#define main DMM16ATDSCDAConvert
#else
#include <sys/time.h>
#endif

static int kbhit()
{
	struct timeval timeout;
	fd_set rfds;

	timeout.tv_sec = 0;
	timeout.tv_usec = 0;

	FD_ZERO(&rfds);
	FD_SET(0, &rfds);

	if ( select(0+1, &rfds, NULL, NULL, &timeout) > 0 )
		return getchar();

	return 0;
}
#endif


// var declarations
BYTE result;  // returned error code
DSCB dscb;    // handle used to refer to the board
DSCCB dsccb;  // structure containing board settings
BYTE channel; // selected output channel
DWORD output_code;     // DA code for desired output voltage
ERRPARAMS errorParams; // structure for returning error code and error string
int intBuff;  // temp variable of size int
int i;        // miscellaneous counter

//=============================================================================
// Name: main()
// Desc: Starting function that calls the driver functions used
//
//		 NOTE: By convention, you should capture the BYTE return value for each
//		 driver API call, and check the error code.
//
//     STEPS TO FOLLOW:
//
//	     I. Driver Initialization
//	    II. Board Initialization
//	   III. DA Conversion and Output
//	    IV. Cleanup
//
//=============================================================================

int main( void )
{
	//=========================================================================
	// I. DRIVER INITIALIZATION
	//
	//    Initializes the DSCUD library.
	//
	//    STEPS TO FOLLOW:
	//
	//	  1. initialize the driver, using the driver version for validation
	//=========================================================================

	if( dscInit( DSC_VERSION ) != DE_NONE )
	{
		dscGetLastError(&errorParams);
		fprintf( stderr, "dscInit error: %s %s\n", dscGetErrorString(errorParams.ErrCode), errorParams.errstring );
		return 0;
	}

	//=========================================================================
	// II. BOARD INITIALIZATION
	//
	//	   Initialize the DMM-16-AT board. This function passes the various
	//	   hardware parameters to the driver and resets the hardware.
	//
	//     STEPS TO FOLLOW:
	//
	//	   1. set the board type to DSC_DMM16AT for DMM-16-AT board
	//	   2. set the base address
	//	   3. set the interrupt level
	//	   4. intialize and register the board with the driver, after which
	//		  the struct, dscb, now holds the handle for the board
	//=========================================================================

	printf( "\nDMM16AT BOARD INITIALIZATION:\n" );

	printf("Enter the base address (default 0x300) : ");
	scanf( "%hx", &dsccb.base_address );

	dsccb.int_level = 5;

	if(dscInitBoard(DSC_DMM16AT, &dsccb, &dscb)!= DE_NONE)
	{
		dscGetLastError(&errorParams);
		fprintf( stderr, "dscInitBoard error: %s %s\n", dscGetErrorString(errorParams.ErrCode), errorParams.errstring );
		return 0;
	}

	getchar();

	//=========================================================================
	// III. DA CONVERSION AND OUTPUT
	//
	//	    Perform the actual DA conversion, then take an AD sample to verify
	//	    and output the results. Note that in order to verify the conversion
	//	    process on a particular output channel, we must set the input
	//	    channel on the AD conversion to (Output Channel + 4). To calculate
	//	    the output code to obtain a particular input voltage, we must use
	//	    one of the formulas located in the manual for your board (under the
	//	    the section, "Generating an Analog Output"). For example, the
	//	    formula for bipolar mode is:
	//
	//	    Output code = Output Voltage / Full-Scale Voltage * 2048 + 2048
	//
	//	    To calculate the actual input voltages from sample codes, we must
	//	    convert the sample code (which must be cast to a short to get the
	//	    correct code) and then plug it into one of the formulas located in
	//	    the manual for your board (under "A/D Conversion Formulas"). For
	//	    example, if you are using a bipolar input range and 32-bit signed
	//	    integers:
	//
	//	    Input voltage = (AD Code / 32768) x Full-Scale Voltage
	//
	//	    STEPS TO FOLLOW:
	//
	//	    1. set the channel (must be between 0-1)
	//	    2. set the output code
	//	    3. write the output value to the selected output channel
	//	    4. repeat step 3 until a key is pressed
	//=========================================================================

	/* PRE-FILLED EXAMPLE
	channel = 0;
	output_code = 2048;
	*/

	do 
	{
		printf( "\nDA CONVERSION AND OUTPUT\n" );
	
		printf( "Enter the channel (0-3): " );
		scanf("%d", &intBuff);
		channel = (BYTE) intBuff;

		printf( "Enter the output code: " );
		scanf("%d", &intBuff);
		output_code = (DWORD)intBuff;

		printf( "\nSending output code, %d, to channel %d...\n", (int)output_code, channel );

		if( ( result = dscDAConvert( dscb, channel, output_code ) ) != DE_NONE )
		{
			dscGetLastError(&errorParams);
			fprintf( stderr, "dscDAConvert error: %s %s\n", dscGetErrorString(errorParams.ErrCode), errorParams.errstring );
			return 0;
		}
		
		printf("Press q to quit or ENTER to continue ");
		
	}while(getchar() != 'q');

	//=========================================================================
	// IV. CLEANUP
	//
	//	   Cleanup any remnants left by the program and free the resources used
	//	   by the driver.
	//
	//     STEPS TO FOLLOW:
	//
	//	   1. free the driver resources
	//=========================================================================

	dscFree();

	printf( "\nDSCDAConvert completed.\n" );

	return 0;
} // end main()


#ifdef _WIN32_WCE
int WINAPI WinMain(	HINSTANCE hInstance,
					HINSTANCE hPrevInstance,
					LPTSTR    lpCmdLine,
					int       nCmdShow)
{
	main();

	return 0;
}

#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品剧情v国产在线观看在线| 欧美成人精品二区三区99精品| 久久不见久久见免费视频7 | 国产精品久久一级| 欧美在线free| 色综合咪咪久久| 91国偷自产一区二区三区观看| 一本一道综合狠狠老| 日本高清免费不卡视频| 欧美猛男gaygay网站| 91精品一区二区三区在线观看| 日韩欧美国产一区二区在线播放| 精品国产伦一区二区三区免费| 久久久精品一品道一区| 亚洲天堂a在线| 午夜精品久久久久久久久久| 麻豆精品在线播放| 国产欧美精品一区| 成人免费毛片片v| 成人avav影音| 91丨porny丨首页| 91社区在线播放| 91.麻豆视频| 久久亚洲私人国产精品va媚药| 国产欧美视频一区二区| 欧美剧在线免费观看网站 | 亚洲国产综合人成综合网站| jizz一区二区| 国产欧美日韩中文久久| 国产超碰在线一区| 久久女同性恋中文字幕| 国产一区二区三区四区五区美女 | 国产三级精品在线| 亚洲sss视频在线视频| 在线一区二区三区| 一区二区三区四区激情| 91视频91自| 亚洲图片欧美色图| 精品视频一区二区三区免费| 亚洲一区视频在线| 欧美精品1区2区3区| 午夜婷婷国产麻豆精品| 欧美巨大另类极品videosbest| 日韩在线一区二区| 精品国产乱码久久| 懂色av一区二区三区蜜臀| 久久亚洲欧美国产精品乐播 | 久久久久久久久久久久久女国产乱| 麻豆国产91在线播放| 久久爱另类一区二区小说| 欧美性大战久久久久久久| 亚洲综合在线观看视频| 欧美视频一区二区在线观看| 亚洲 欧美综合在线网络| 日韩区在线观看| 蜜桃传媒麻豆第一区在线观看| 欧美α欧美αv大片| 国产成人免费在线观看不卡| 亚洲色大成网站www久久九九| 色综合夜色一区| 视频一区二区欧美| 国产视频不卡一区| 日本精品一级二级| 国产在线精品一区二区三区不卡| 中文字幕av一区二区三区| 欧美日韩黄色影视| 国产精品综合网| 一区二区三区小说| 日韩欧美一区二区在线视频| 国产不卡免费视频| 亚洲国产精品精华液网站| 欧美一区二区在线看| 国产成人av福利| 久久精品视频网| 日本道免费精品一区二区三区| 日韩精品亚洲专区| 久久婷婷国产综合国色天香| 欧美三级视频在线| 国产乱子伦视频一区二区三区| 中文字幕一区二区日韩精品绯色| 制服丝袜亚洲网站| 92精品国产成人观看免费| 日本sm残虐另类| 一区二区三区视频在线看| 久久免费视频一区| 欧美一区欧美二区| 欧美在线观看18| 成人国产视频在线观看| 激情六月婷婷综合| 青青草国产精品97视觉盛宴| 亚洲桃色在线一区| 国产精品视频你懂的| 欧美成人性战久久| 6080日韩午夜伦伦午夜伦| 99久久99久久久精品齐齐| 国产美女一区二区| 亚洲图片自拍偷拍| 美女视频黄频大全不卡视频在线播放| 国产精品热久久久久夜色精品三区| 亚洲精品视频在线观看网站| 久久影音资源网| 极品尤物av久久免费看| 亚洲国产一区视频| 一区二区视频在线| 精品久久久久久久久久久久包黑料 | 亚洲欧美偷拍另类a∨色屁股| 91看片淫黄大片一级| 丝袜美腿高跟呻吟高潮一区| 久久久国际精品| 日本电影亚洲天堂一区| 秋霞午夜av一区二区三区| 久99久精品视频免费观看| 国产精品你懂的在线| 777久久久精品| 成熟亚洲日本毛茸茸凸凹| 亚洲大片免费看| 国产亚洲精品免费| 欧美高清视频在线高清观看mv色露露十八| 久久国产人妖系列| 一区二区三区中文在线| 26uuu另类欧美亚洲曰本| 在线观看欧美日本| 成人av动漫在线| 国产在线不卡视频| 成人福利视频网站| 色综合久久天天| 欧美综合一区二区| 777色狠狠一区二区三区| 日韩免费高清视频| 国产欧美一区二区三区在线看蜜臀| 国产日产欧美一区| 亚洲精品视频在线看| 午夜精品久久久久久久久久久| 免费成人在线网站| 国产传媒久久文化传媒| 成人污视频在线观看| 91视频免费播放| 91精品国产综合久久婷婷香蕉| 日韩女优av电影在线观看| 国产精品久久夜| 国产精品系列在线| www亚洲一区| 精品美女被调教视频大全网站| 欧美日韩mp4| 欧美日韩dvd在线观看| 色噜噜夜夜夜综合网| 91视频精品在这里| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 久久色中文字幕| 91精品国产综合久久香蕉的特点 | 欧美一区二区三区在线视频| 91麻豆swag| 99精品欧美一区| 972aa.com艺术欧美| proumb性欧美在线观看| 福利电影一区二区| 国产黄人亚洲片| 成人午夜av在线| 91一区一区三区| 欧美亚洲免费在线一区| 欧美亚洲另类激情小说| 欧美色图在线观看| 欧美裸体bbwbbwbbw| 欧美一区二区在线播放| 日韩一级黄色大片| 精品福利一区二区三区免费视频| 久久久久久免费| 欧美激情一区在线| 中文字幕精品一区| 中文字幕中文乱码欧美一区二区| 日韩美女视频19| 亚洲成人第一页| 国产一区不卡在线| 99久久免费精品高清特色大片| 91视频xxxx| 日韩欧美一区二区在线视频| 欧美国产综合色视频| 亚洲国产精品自拍| 久久国产人妖系列| 99麻豆久久久国产精品免费优播| 成人高清在线视频| 国产在线国偷精品免费看| 国产成人一级电影| 91在线视频免费观看| 欧美天天综合网| 久久亚洲精品国产精品紫薇| 中文字幕一区二区三区精华液 | 7799精品视频| 国产欧美视频一区二区| 偷窥少妇高潮呻吟av久久免费 | 亚洲色图视频免费播放| 丝袜脚交一区二区| 99久久99久久精品国产片果冻| 欧美女孩性生活视频| 欧美国产日韩亚洲一区| 日韩av在线免费观看不卡| 高清shemale亚洲人妖| 欧美日韩成人在线一区| 中文字幕一区二区三区不卡| 久久国产麻豆精品|