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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Xenomai API: include/analogy/instruction.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<form action="search.php" method="get">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><label> <u>S</u>earch for </label></td>
<td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
</tr>
</table>
</form>
</li>
</ul>
</div>
<h1>include/analogy/instruction.h</h1><a href="instruction_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef __ANALOGY_INSTRUCTION__</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define __ANALOGY_INSTRUCTION__</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include <<a class="code" href="analogy_2types_8h.html" title="Analogy for Linux, misc declarations.">analogy/types.h</a>></span>
<a name="l00027"></a>00027 <span class="preprocessor">#include <<a class="code" href="context_8h.html" title="Analogy for Linux, context structure / macros declarations.">analogy/context.h</a>></span>
<a name="l00028"></a>00028
<a name="l00029"></a>00029 <span class="preprocessor">#define A4L_INSN_MASK_READ 0x8000000</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_MASK_WRITE 0x4000000</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_MASK_SPECIAL 0x2000000</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span>
<a name="l00047"></a><a class="code" href="group__sync1__lib.html#g63e8c577aa294bf49711299240c29354">00047</a> <span class="preprocessor">#define A4L_INSN_READ (0 | A4L_INSN_MASK_READ)</span>
<a name="l00048"></a>00048 <span class="preprocessor"></span>
<a name="l00051"></a><a class="code" href="group__sync1__lib.html#g3039f40be8811e7393a8c1d3e0eebe6e">00051</a> <span class="preprocessor">#define A4L_INSN_WRITE (1 | A4L_INSN_MASK_WRITE)</span>
<a name="l00052"></a>00052 <span class="preprocessor"></span>
<a name="l00055"></a><a class="code" href="group__sync1__lib.html#gd02735fca71fa7e07dad273e4cd957a8">00055</a> <span class="preprocessor">#define A4L_INSN_BITS (2 | A4L_INSN_MASK_READ | \</span>
<a name="l00056"></a>00056 <span class="preprocessor"> A4L_INSN_MASK_WRITE)</span>
<a name="l00057"></a>00057 <span class="preprocessor"></span>
<a name="l00060"></a><a class="code" href="group__sync1__lib.html#ga5e0f8dade0defa8b9c9f0788dbf6e6f">00060</a> <span class="preprocessor">#define A4L_INSN_CONFIG (3 | A4L_INSN_MASK_READ | \</span>
<a name="l00061"></a>00061 <span class="preprocessor"> A4L_INSN_MASK_WRITE)</span>
<a name="l00062"></a>00062 <span class="preprocessor"></span>
<a name="l00065"></a><a class="code" href="group__sync1__lib.html#gd342149a83edc18ca7960274b6775681">00065</a> <span class="preprocessor">#define A4L_INSN_GTOD (4 | A4L_INSN_MASK_READ | \</span>
<a name="l00066"></a>00066 <span class="preprocessor"> A4L_INSN_MASK_SPECIAL)</span>
<a name="l00067"></a>00067 <span class="preprocessor"></span>
<a name="l00070"></a><a class="code" href="group__sync1__lib.html#g1b099a4e1edc630ac74e3e64aa4d479b">00070</a> <span class="preprocessor">#define A4L_INSN_WAIT (5 | A4L_INSN_MASK_WRITE | \</span>
<a name="l00071"></a>00071 <span class="preprocessor"> A4L_INSN_MASK_SPECIAL)</span>
<a name="l00072"></a>00072 <span class="preprocessor"></span>
<a name="l00075"></a><a class="code" href="group__sync1__lib.html#g7ad6aa3c3f85aba61da5335d54c41b56">00075</a> <span class="preprocessor">#define A4L_INSN_INTTRIG (6 | A4L_INSN_MASK_WRITE | \</span>
<a name="l00076"></a>00076 <span class="preprocessor"> A4L_INSN_MASK_SPECIAL)</span>
<a name="l00077"></a>00077 <span class="preprocessor"></span>
<a name="l00083"></a><a class="code" href="group__sync1__lib.html#g976d8de479578a3e1f5d844401fe4153">00083</a> <span class="preprocessor">#define A4L_INSN_WAIT_MAX 100000</span>
<a name="l00084"></a>00084 <span class="preprocessor"></span>
<a name="l00091"></a>00091 <span class="preprocessor">#define A4L_INSN_CONFIG_DIO_INPUT 0</span>
<a name="l00092"></a>00092 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_CONFIG_DIO_OUTPUT 1</span>
<a name="l00093"></a>00093 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_CONFIG_DIO_OPENDRAIN 2</span>
<a name="l00094"></a>00094 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_CONFIG_ANALOG_TRIG 16</span>
<a name="l00095"></a>00095 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_CONFIG_ALT_SOURCE 20</span>
<a name="l00096"></a>00096 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_CONFIG_DIGITAL_TRIG 21</span>
<a name="l00097"></a>00097 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_CONFIG_BLOCK_SIZE 22</span>
<a name="l00098"></a>00098 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_CONFIG_TIMER_1 23</span>
<a name="l00099"></a>00099 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_CONFIG_FILTER 24</span>
<a name="l00100"></a>00100 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_CONFIG_CHANGE_NOTIFY 25</span>
<a name="l00101"></a>00101 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_CONFIG_SERIAL_CLOCK 26</span>
<a name="l00102"></a>00102 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_CONFIG_BIDIRECTIONAL_DATA 27</span>
<a name="l00103"></a>00103 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_CONFIG_DIO_QUERY 28</span>
<a name="l00104"></a>00104 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_CONFIG_PWM_OUTPUT 29</span>
<a name="l00105"></a>00105 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_CONFIG_GET_PWM_OUTPUT 30</span>
<a name="l00106"></a>00106 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_CONFIG_ARM 31</span>
<a name="l00107"></a>00107 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_CONFIG_DISARM 32</span>
<a name="l00108"></a>00108 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_CONFIG_GET_COUNTER_STATUS 33</span>
<a name="l00109"></a>00109 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_CONFIG_RESET 34</span>
<a name="l00110"></a>00110 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_CONFIG_GPCT_SINGLE_PULSE_GENERATOR 1001 </span><span class="comment">/* Use CTR as single pulsegenerator */</span>
<a name="l00111"></a>00111 <span class="preprocessor">#define A4L_INSN_CONFIG_GPCT_PULSE_TRAIN_GENERATOR 1002 </span><span class="comment">/* Use CTR as pulsetraingenerator */</span>
<a name="l00112"></a>00112 <span class="preprocessor">#define A4L_INSN_CONFIG_GPCT_QUADRATURE_ENCODER 1003 </span><span class="comment">/* Use the counter as encoder */</span>
<a name="l00113"></a>00113 <span class="preprocessor">#define A4L_INSN_CONFIG_SET_GATE_SRC 2001 </span><span class="comment">/* Set gate source */</span>
<a name="l00114"></a>00114 <span class="preprocessor">#define A4L_INSN_CONFIG_GET_GATE_SRC 2002 </span><span class="comment">/* Get gate source */</span>
<a name="l00115"></a>00115 <span class="preprocessor">#define A4L_INSN_CONFIG_SET_CLOCK_SRC 2003 </span><span class="comment">/* Set master clock source */</span>
<a name="l00116"></a>00116 <span class="preprocessor">#define A4L_INSN_CONFIG_GET_CLOCK_SRC 2004 </span><span class="comment">/* Get master clock source */</span>
<a name="l00117"></a>00117 <span class="preprocessor">#define A4L_INSN_CONFIG_SET_OTHER_SRC 2005 </span><span class="comment">/* Set other source */</span>
<a name="l00118"></a>00118 <span class="preprocessor">#define A4L_INSN_CONFIG_SET_COUNTER_MODE 4097</span>
<a name="l00119"></a>00119 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_CONFIG_SET_ROUTING 4099</span>
<a name="l00120"></a>00120 <span class="preprocessor"></span><span class="preprocessor">#define A4L_INSN_CONFIG_GET_ROUTING 4109</span>
<a name="l00121"></a>00121 <span class="preprocessor"></span>
<a name="l00130"></a>00130 <span class="preprocessor">#define A4L_COUNTER_ARMED 0x1</span>
<a name="l00131"></a>00131 <span class="preprocessor"></span><span class="preprocessor">#define A4L_COUNTER_COUNTING 0x2</span>
<a name="l00132"></a>00132 <span class="preprocessor"></span><span class="preprocessor">#define A4L_COUNTER_TERMINAL_COUNT 0x4</span>
<a name="l00133"></a>00133 <span class="preprocessor"></span>
<a name="l00142"></a>00142 <span class="preprocessor">#define A4L_INPUT 0</span>
<a name="l00143"></a>00143 <span class="preprocessor"></span><span class="preprocessor">#define A4L_OUTPUT 1</span>
<a name="l00144"></a>00144 <span class="preprocessor"></span><span class="preprocessor">#define A4L_OPENDRAIN 2</span>
<a name="l00145"></a>00145 <span class="preprocessor"></span>
<a name="l00156"></a>00156 <span class="preprocessor">#define A4L_EV_START 0x00040000</span>
<a name="l00157"></a>00157 <span class="preprocessor"></span><span class="preprocessor">#define A4L_EV_SCAN_BEGIN 0x00080000</span>
<a name="l00158"></a>00158 <span class="preprocessor"></span><span class="preprocessor">#define A4L_EV_CONVERT 0x00100000</span>
<a name="l00159"></a>00159 <span class="preprocessor"></span><span class="preprocessor">#define A4L_EV_SCAN_END 0x00200000</span>
<a name="l00160"></a>00160 <span class="preprocessor"></span><span class="preprocessor">#define A4L_EV_STOP 0x00400000</span>
<a name="l00161"></a>00161 <span class="preprocessor"></span>
<a name="l00169"></a><a class="code" href="structa4l__instruction.html">00169</a> <span class="keyword">struct </span><a class="code" href="structa4l__instruction.html" title="Structure describing the synchronous instruction.">a4l_instruction</a> {
<a name="l00170"></a>00170 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structa4l__instruction.html#4dfe466c1efa7b13f6cb408268652e4c" title="Instruction type.">type</a>;
<a name="l00172"></a>00172 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structa4l__instruction.html#2ce723188a437c94b474d62b690d241b" title="Subdevice to which the instruction will be applied.">idx_subd</a>;
<a name="l00174"></a>00174 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structa4l__instruction.html#c13c98dc1071dabdbc02035437c913d1" title="Channel descriptor.">chan_desc</a>;
<a name="l00176"></a>00176 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structa4l__instruction.html#57a3362a9c56de0a3318116eda8583fe" title="Size of the intruction data.">data_size</a>;
<a name="l00178"></a>00178 <span class="keywordtype">void</span> *<a class="code" href="structa4l__instruction.html#ea22840417a04202cd0740515420d467" title="Instruction data.">data</a>;
<a name="l00180"></a>00180 };
<a name="l00181"></a>00181 <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structa4l__instruction.html" title="Structure describing the synchronous instruction.">a4l_instruction</a> <a class="code" href="structa4l__instruction.html" title="Structure describing the synchronous instruction.">a4l_insn_t</a>;
<a name="l00182"></a>00182
<a name="l00188"></a><a class="code" href="structa4l__instruction__list.html">00188</a> <span class="keyword">struct </span><a class="code" href="structa4l__instruction__list.html" title="Structure describing the list of synchronous instructions.">a4l_instruction_list</a> {
<a name="l00189"></a>00189 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structa4l__instruction__list.html#0c5e7ef9613f2493698e5adda0f2dbf4" title="Instructions count.">count</a>;
<a name="l00191"></a>00191 <a class="code" href="structa4l__instruction.html" title="Structure describing the synchronous instruction.">a4l_insn_t</a> *<a class="code" href="structa4l__instruction__list.html#e0da793580d6ad2a8a1be208a1d41b5c" title="Tab containing the instructions pointers.">insns</a>;
<a name="l00193"></a>00193 };
<a name="l00194"></a>00194 <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structa4l__instruction__list.html" title="Structure describing the list of synchronous instructions.">a4l_instruction_list</a> <a class="code" href="structa4l__instruction__list.html" title="Structure describing the list of synchronous instructions.">a4l_insnlst_t</a>;
<a name="l00195"></a>00195
<a name="l00198"></a>00198 <span class="preprocessor">#if defined(__KERNEL__) && !defined(DOXYGEN_CPP)</span>
<a name="l00199"></a>00199 <span class="preprocessor"></span>
<a name="l00200"></a>00200 <span class="keyword">struct </span>a4l_kernel_instruction {
<a name="l00201"></a>00201 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> type;
<a name="l00202"></a>00202 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> idx_subd;
<a name="l00203"></a>00203 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> chan_desc;
<a name="l00204"></a>00204 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> data_size;
<a name="l00205"></a>00205 <span class="keywordtype">void</span> *data;
<a name="l00206"></a>00206 <span class="keywordtype">void</span> *__udata;
<a name="l00207"></a>00207 };
<a name="l00208"></a>00208 <span class="keyword">typedef</span> <span class="keyword">struct </span>a4l_kernel_instruction a4l_kinsn_t;
<a name="l00209"></a>00209
<a name="l00210"></a>00210 <span class="keyword">struct </span>a4l_kernel_instruction_list {
<a name="l00211"></a>00211 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> count;
<a name="l00212"></a>00212 a4l_kinsn_t *insns;
<a name="l00213"></a>00213 <a class="code" href="structa4l__instruction.html" title="Structure describing the synchronous instruction.">a4l_insn_t</a> *__uinsns;
<a name="l00214"></a>00214 };
<a name="l00215"></a>00215 <span class="keyword">typedef</span> <span class="keyword">struct </span>a4l_kernel_instruction_list a4l_kilst_t;
<a name="l00216"></a>00216
<a name="l00217"></a>00217 <span class="comment">/* Instruction related functions */</span>
<a name="l00218"></a>00218
<a name="l00219"></a>00219 <span class="comment">/* Upper layer functions */</span>
<a name="l00220"></a>00220 <span class="keywordtype">int</span> a4l_ioctl_insnlist(a4l_cxt_t * cxt, <span class="keywordtype">void</span> *arg);
<a name="l00221"></a>00221 <span class="keywordtype">int</span> a4l_ioctl_insn(a4l_cxt_t * cxt, <span class="keywordtype">void</span> *arg);
<a name="l00222"></a>00222
<a name="l00223"></a>00223 <span class="preprocessor">#endif </span><span class="comment">/* __KERNEL__ && !DOXYGEN_CPP */</span>
<a name="l00224"></a>00224
<a name="l00225"></a>00225 <span class="preprocessor">#endif </span><span class="comment">/* __ANALOGY_INSTRUCTION__ */</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Mon Aug 2 12:48:36 2010 for Xenomai API by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>
|