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

📄 manual_calling_universal_driver_api_functions.html

📁 Diamond公司Dscud通用驱动使用说明手册
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"        "http://www.w3.org/TR/html4/loose.dtd"><html lang="en"><head><title>Calling Universal Driver API Functions - Universal Driver Documentation</title><meta http-equiv="Content-type" content="text/html; charset=iso-8859-1"><meta name="robots" content="index,follow"><link rel="shortcut icon" href="/favicon.ico"><link rel="stylesheet" href="/dscud/style/wikiprintable.css"><script type="text/javascript" src="/dscud/style/wikibits.js"></script><style type='text/css'><!--a.new, #quickbar a.new { color: #CC2200; }#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }#article { margin-left: 152px; margin-right: 4px; }//--></style></head><body bgcolor='#FFFFFF'><div class='titlebox'><h1 class='pagetitle'>Calling Universal Driver API Functions</h1><span class='subtitle'>Universal Driver Documentation</span></div><div class='navbox'><a href="manual_Main_Page.html" class='printable' title ="Main Page">Main Page</a> || <a href="manual_Table_of_Contents.html" class='printable' title ="Table of Contents">Table_of_Contents</a> || <a href="http://www.diamondsystems.com/">Diamond Systems Website</a></div></div><div class='bodytext'>When using Universal Driver, you must always place four specific function calls in your program. Any application using the DSCUD API should always start with calls to <tt><a href="manual_DscInit.html" class='printable' title ="DscInit">dscInit</a>()</tt> and <tt><a href="manual_DscInitBoard.html" class='printable' title ="DscInitBoard">dscInitBoard</a>()</tt> and end with calls to <tt><a href="manual_DscFreeBoard.html" class='printable' title ="DscFreeBoard">dscFreeBoard</a>()</tt> and <tt><a href="manual_DscFree.html" class='printable' title ="DscFree">dscFree</a>()</tt>. These calls are important in initializing and freeing resources used by the driver. Here is a example of the framework for an application using the driver:
<p>
<pre>#include &quot;dscud.h&quot;

DSCB dscb;
DSCCB dsccb;

int main()
{
	if ((result = dscInit(DSC_VERSION)) != DE_NONE)
		return result;

	dsccb.base_address = 0x300;
	dsccb.int_level = 5;
	dsccb.dma_level = 1;
	dsccb.clock_freq = 10000000L;

	if ((result = dscInitBoard(DSC_DMM32, &dsccb, &dscb)) != DE_NONE)
		return result;

	/* Application code goes here */

	if ((result = dscFreeBoard(dscb)) != DE_NONE)
		return result;

	if ((result = dscFree()) != DE_NONE)
		return result;

	return 0;
}</pre>
<p>
In the above example, <tt>DSC_VERSION</tt>, <tt>DSC_DMM32</tt>, and <tt>DE_NONE</tt> are macros defined in the included header file, <em>dscud.h</em>. Calls to any DSCUD API function are always of the form, <tt>dsc[...]</tt>, where <tt>[...]</tt> is a specific function (i.e., <tt>ADSample</tt> as in <tt><a href="manual_DscADSample.html" class='printable' title ="DscADSample">dscADSample</a></tt>). Most function calls using the driver require the initialization of a DSCUD-specific structure (i.e. <tt><a href="manual_DSCCB.html" class='printable' title ="DSCCB">DSCCB</a></tt>, or <tt><a href="manual_DSCAIOINT.html" class='printable' title ="DSCAIOINT">DSCAIOINT</a></tt>) that is defined in <em>dscud.h</em> and described in the <a href="manual_Data_Type_Reference.html" class='printable' title ="Data Type Reference">Data Type Reference</a>.
<p>
Each board must be initialized separately, and each board must also have its own unique base address and I/O address range that is different from all other boards in the system and does not overlap with any other board or system resource (such as COM port or parallel port). 
<p>
Universal Driver can control up to 10 boards simultaneously. Each board has its own unique handle generated by <tt><a href="manual_DscInitBoard.html" class='printable' title ="DscInitBoard">dscInitBoard</a>()</tt>. Most PC/104 systems will not support 10 boards simultaneously, so this limit should be satisfactory for all applications.
<p></div><p><em> <br> This page was last modified 21:08, 2 Feb 2004.<br>Copyright (c) 2004 Diamond Systems.  All Rights Reserved.</em><!-- Time since request: 0.16 secs. --></body></html>

⌨️ 快捷键说明

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