File: node51.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 (175 lines) | stat: -rw-r--r-- 4,865 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<!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>Creating I/O Drivers</TITLE>
<META NAME="description" CONTENT="Creating I/O Drivers">
<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="previous" HREF="node46.html">
<LINK REL="up" HREF="node45.html">
<LINK REL="next" HREF="node52.html">
</HEAD>

<BODY bgcolor="white">
<!--Navigation Panel-->
<A NAME="tex2html680"
  HREF="node52.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
 SRC="/usr/share/latex2html/icons/next.png"></A> 
<A NAME="tex2html678"
  HREF="node45.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
 SRC="/usr/share/latex2html/icons/up.png"></A> 
<A NAME="tex2html674"
  HREF="node50.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="tex2html681"
  HREF="node52.html">The A/D Driver</A>
<B> Up:</B> <A NAME="tex2html679"
  HREF="node45.html">Enhancing RTiC-Lab</A>
<B> Previous:</B> <A NAME="tex2html675"
  HREF="node50.html">Adding Tokens</A>
<BR>
<BR>
<!--End of Navigation Panel-->

<H1><A NAME="SECTION00520000000000000000">
Writing Modules for the Embedded System (Creating I/O Drivers)</A>
</H1> 

<P>
There are two reasons why you would need to even consider looking at
this section.

<P>

<OL>
<LI>You need to tune the performance of your I/O board such as
setting up the I/O base address, or the gain values for each of the
boards and would like to understand the structure of the I/O driver.

<P>
</LI>
<LI>None of the existent I/O drivers work on your specific I/O
hardware.

<P>
</LI>
</OL>

<P>
Whichever case applies to you, it turns out that writing a device
driver for either RTiC-Lab or RTLinux in general is quite a simple
process.

<P>
All of the files associated with the I/O boards are located under the
directories:

<P>

<UL>
<LI><TT>rtic_*.*.*/rt_tasks/ad_cards</TT>: drivers for A/D boards

<P>
</LI>
<LI><TT>rtic_*.*.*/rt_tasks/da_cards</TT>: drivers for D/A boards
</LI>
</UL>

<P>
The API that the device writer must use, however, is slightly
different that one would be normally used to. The following describes
the API as declared in RTiC-Lab. Generally speaking, the API described
below has the exact same functionality as its Linux-specific lowercase
counterpart. However, the difference is that whenever the user defines
the <TT>noIO</TT> token in the user's <TT>user_GUI.par</TT>, then all I/O
will be blocked. This is especially useful for controller logic
debugging purposes.

<P>
The basic API is defined as follows:

<P>

<UL>
<LI><TT>INW(x)</TT> 
</LI>
<LI><TT>INB(x)</TT> 
</LI>
<LI><TT>OUTB(x,y)</TT> 
</LI>
<LI><TT>OUTW(x,y)</TT>
</LI>
</UL>

<P>
If you create any new device drivers or enhance any of the existing
ones, then you are encouraged to submit it to

		<A NAME="tex2html43"
  HREF="mailto:efhilton@fsmlabs.com"><TT>efhilton@fsmlabs.com</TT></A>

 for
inclusion in future revisions of RTiC-Lab.

<P>
<BR><HR>
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>

<UL>
<LI><A NAME="tex2html682"
  HREF="node52.html">The A/D Driver</A>
<LI><A NAME="tex2html683"
  HREF="node53.html">The D/A Driver</A>
<LI><A NAME="tex2html684"
  HREF="node54.html">Including the New Drivers Onto the Source Tree</A>
<LI><A NAME="tex2html685"
  HREF="node55.html">Using COMEDI</A>
</UL>
<!--End of Table of Child-Links-->
<HR>
<!--Navigation Panel-->
<A NAME="tex2html680"
  HREF="node52.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
 SRC="/usr/share/latex2html/icons/next.png"></A> 
<A NAME="tex2html678"
  HREF="node45.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
 SRC="/usr/share/latex2html/icons/up.png"></A> 
<A NAME="tex2html674"
  HREF="node50.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="tex2html681"
  HREF="node52.html">The A/D Driver</A>
<B> Up:</B> <A NAME="tex2html679"
  HREF="node45.html">Enhancing RTiC-Lab</A>
<B> Previous:</B> <A NAME="tex2html675"
  HREF="node50.html">Adding Tokens</A>
<!--End of Navigation Panel-->
<ADDRESS>
Michael Barabanov
2001-06-19
</ADDRESS>
</BODY>
</HTML>