File: node53.html

package info (click to toggle)
rtlinux 3.1pre3-2
  • links: PTS
  • area: non-free
  • in suites: sarge, woody
  • size: 4,892 kB
  • ctags: 4,228
  • sloc: ansic: 26,204; sh: 2,069; makefile: 1,414; perl: 855; tcl: 489; asm: 380; cpp: 42
file content (121 lines) | stat: -rw-r--r-- 3,538 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<!--Converted with LaTeX2HTML 2K.1beta (1.48)
original version by:  Nikos Drakos, CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>The D/A Driver</TITLE>
<META NAME="description" CONTENT="The D/A Driver">
<META NAME="keywords" CONTENT="rtic">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="LaTeX2HTML v2K.1beta">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="rtic.css">

<LINK REL="next" HREF="node54.html">
<LINK REL="previous" HREF="node52.html">
<LINK REL="up" HREF="node51.html">
<LINK REL="next" HREF="node54.html">
</HEAD>

<BODY bgcolor="white">
<!--Navigation Panel-->
<A NAME="tex2html704"
  HREF="node54.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
 SRC="/usr/share/latex2html/icons/next.png"></A> 
<A NAME="tex2html702"
  HREF="node51.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
 SRC="/usr/share/latex2html/icons/up.png"></A> 
<A NAME="tex2html696"
  HREF="node52.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
 SRC="/usr/share/latex2html/icons/prev.png"></A>   
<BR>
<B> Next:</B> <A NAME="tex2html705"
  HREF="node54.html">Including the New Drivers</A>
<B> Up:</B> <A NAME="tex2html703"
  HREF="node51.html">Creating I/O Drivers</A>
<B> Previous:</B> <A NAME="tex2html697"
  HREF="node52.html">The A/D Driver</A>
<BR>
<BR>
<!--End of Navigation Panel-->

<H2><A NAME="SECTION00522000000000000000">
The D/A Driver</A>
</H2>

<P>
The D/A driver has almost the same structure as the A/D board, except
that it adds an additional function, reset_DA() and replaces the two
run-time functions with one function. The bare minimum device driver
description is shown in what follows:

<P>
<PRE>
#include ``main.h''
int RTiC_init_DA_card(void)
{
  /* do all card initialization here and do not forget to 
     reset the DA card !! */	

  return(RTIC_SUCCESS);        /* or RTIC_ERROR, depending */
}

void RTiC_DA_run(void)
{
  /* do all periodic jobs here */
}

int RTiC_stop_DA_card(void)
{
  /* do all card ``stopping'' functions here */
  return(RTIC_SUCCESS);        /* or RTIC_ERROR, depending */
}

void RTIC_reset_DA(void)
{
  /* reset the card */
}
</PRE>

<P>
Once again, the first function <TT>RTiC_init_DA_card</TT> is run
immediately after the user releases the ``RUN'' button in <TT>xrtic</TT>
and is used to initialize the D/A board. Similarly, the last function,
<TT>RTiC_stop_DA_card</TT> is run immediately after the user releases
the ``STOP'' button in <TT>xrtic</TT>. In both of these cases, the
functions must return either ``RTIC_ERROR'' or ``RTIC_SUCCESS'',
depending on whether an error was encountered or not, respectively.

<P>
The periodic function <TT>RTiC_stop_DA_card</TT> is run once per
controller cycle and should write out the values stored in the data
pointer (<TT>float *RTiC_control</TT>), for example:

<P><PRE>
for (i=0; i&lt;NUM_CONTROL_OUTPUTS; i++) 
   OUTW(*(RTiC_control+i),DA_BASE);
</PRE>

<P>
The last function, <TT>RTiC_reset_DA</TT> is used to reset the D/A
boards. It takes no arguments and returns none either.

<P>
<BR><HR>
<ADDRESS>
Michael Barabanov
2001-06-19
</ADDRESS>
</BODY>
</HTML>