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

📄 manual_instructions_for_solo_type_user_interrupts.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>Instructions for Solo Type User Interrupts - 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'>Instructions for Solo Type User Interrupts</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'>The "solo" type user interrupt does not call a standard driver interrupt function like <tt><a href="manual_DscADSampleInt.html" class='printable' title ="DscADSampleInt">dscADSampleInt</a>()</tt>. Instead it has its own function named <tt><a href="manual_DscUserInt.html" class='printable' title ="DscUserInt">dscUserInt</a>()</tt> that simply passes control to the user interrupt function when the interrupt occurs. This function may be triggered either by a counter/timer on the board or by an external signal, depending on the available features on the board.
<p>
The solo type user interrupt also uses its own data structure, <tt><a href="manual_Struct_DSCUSERINT.html" class='printable' title ="Struct DSCUSERINT">DSCUSERINT</a></tt>, that provides interrupt and counter/timer configuration data for the board.
<p>
The <tt><a href="manual_DscUserInt.html" class='printable' title ="DscUserInt">dscUserInt</a>()</tt> function does not call any kernel-mode routines or provide any extra monitoring features. The user is in charge of monitoring the interrupt and turning it off with <tt><a href="manual_DscCancelOp.html" class='printable' title ="DscCancelOp">dscCancelOp</a>()</tt> when desired.
<p>
When using "Solo" mode user interrupts, the function <tt><a href="manual_DscGetStatus.html" class='printable' title ="DscGetStatus">dscGetStatus</a>()</tt> does not function properly because it uses an internal operation counter that is not accessible by the user interrupt function.
<p>
To start the user interrupts, call <tt><a href="manual_DscUserInt.html" class='printable' title ="DscUserInt">dscUserInt</a>()</tt> by passing in your <tt><a href="manual_Struct_DSCUSERINT.html" class='printable' title ="Struct DSCUSERINT">DSCUSERINT</a></tt> structure and the handle to your user interrupt function.
<p>
<strong>IMPORTANT:</strong> <tt><a href="manual_DscUserInt.html" class='printable' title ="DscUserInt">dscUserInt</a>()</tt> performs a hidden <tt><a href="manual_DscSetUserInterruptFunction.html" class='printable' title ="DscSetUserInterruptFunction">dscSetUserInterruptFunction</a>()</tt> on the user's interrupt function with mode <tt>USER_INT_INSTEAD</tt> (see section on "after" and "instead" interrupts.) This means that any previous calls to <tt><a href="manual_DscSetUserInterruptFunction.html" class='printable' title ="DscSetUserInterruptFunction">dscSetUserInterruptFunction</a>()</tt> will be invalidated.
<p>
The user interrupt function is not automatically uninstalled when <tt><a href="manual_DscCancelOp.html" class='printable' title ="DscCancelOp">dscCancelOp</a>()</tt> is called. To uninstall the function, you must call <tt><a href="manual_DscClearUserInterruptFunction.html" class='printable' title ="DscClearUserInterruptFunction">dscClearUserInterruptFunction</a>()</tt> before any subsequent interrupt operations.
<p>
<strong>Example code for solo-type user interrupts driven by on-board counter/timer with driver-programmed sample rate on a DMM-32-AT:</strong>
<p>
<pre>void UserIntSample1()
{
	DSCUSERINT dscuserint;
	dscuserint.intsource = USER_INT_SOURCE_INTERNAL;
	dscuserint.rate = 100.0;	// 100Hz rate
	dscuserint.clksource = 0;	// use 10MHz on-board clock source
	dscuserint.counter = 0;
	dscUserInt(board, &dscuserint,
	(DSCUserInterruptFunction) MyUserInterruptFunction);
}</pre>
<p>
This will call <tt>MyUserInterruptFunction()</tt> at a rate of 100Hz.
<p>
<strong>Example code for solo-type user interrupts driven by on-board counter/timer with user-programmed sample rate on a DMM-32-AT:</strong>
<p>
<pre>void UserIntSample2()
{
	dscCounterDirectSet(...);	// separate call to program counter 0
	DSCUSERINT dscuserint;
	dscuserint.intsource = USER_INT_SOURCE_INTERNAL;
	dscuserint.rate = 0.0;		// 0 means don't program the counter here
	dscuserint.clksource = 0;
	dscuserint.counter = 0;
	dscUserInt(board, &dscuserint,
	(DSCUserInterruptFunction) MyUserInterruptFunction);
}</pre>
<p>
This will call <tt>MyUserInterruptFunction()</tt> at a rate determined by the <tt><a href="manual_DscCounterDirectSet.html" class='printable' title ="DscCounterDirectSet">dscCounterDirectSet</a>()</tt> function call.
<p>
<strong>Example code for solo-type user interrupts driven by external signal on a DMM-32-AT:</strong>
<p>
<pre>void UserIntSample3()
{
	DSCUSERINT dscuserint;
	dscuserint.intsource = USER_INT_SOURCE_EXTERNAL;
	dscuserint.rate = 0.0; 		// not used since source is external
	dscuserint.clksource = 0;	// not used since source is external
	dscuserint.counter = 0; 	// not used since source is external
	dscUserInt(board, &dscuserint,
	(DSCUserInterruptFunction) MyUserInterruptFunction);
}</pre>
<p>
This will call <tt>MyUserInterruptFunction()</tt> in response to an external TTL signal applied to the board's external trigger input.
<p>
To stop the user interrupts, you must cancel them with dscCancelOp():
<p>
<pre>void UserIntCancel()
{
	dscCancelOp(board);
}</pre>
<p></div><p><em> <br> This page was last modified 16:20, 12 Feb 2004.<br>Copyright (c) 2004 Diamond Systems.  All Rights Reserved.</em><!-- Time since request: 0.17 secs. --></body></html>

⌨️ 快捷键说明

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