root / trunk / docs / libdragonfly / group__analog.html @ 1371
History | View | Annotate | Download (34.6 KB)
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
---|---|
2 |
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
3 |
<title>libdragonfly: Analog</title> |
4 |
<link href="doxygen.css" rel="stylesheet" type="text/css"> |
5 |
<link href="tabs.css" rel="stylesheet" type="text/css"> |
6 |
</head><body> |
7 |
<!-- Generated by Doxygen 1.5.5 -->
|
8 |
<div class="navigation" id="top"> |
9 |
<div class="tabs"> |
10 |
<ul>
|
11 |
<li><a href="index.html"><span>Main Page</span></a></li> |
12 |
<li><a href="pages.html"><span>Related Pages</span></a></li> |
13 |
<li><a href="modules.html"><span>Modules</span></a></li> |
14 |
<li><a href="annotated.html"><span>Data Structures</span></a></li> |
15 |
<li><a href="files.html"><span>Files</span></a></li> |
16 |
</ul>
|
17 |
</div>
|
18 |
</div>
|
19 |
<div class="contents"> |
20 |
<h1>Analog</h1><table border="0" cellpadding="0" cellspacing="0"> |
21 |
<tr><td></td></tr> |
22 |
<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr> |
23 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structadc__t.html">adc_t</a></td></tr> |
24 |
|
25 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Struct to hold the value of a particular analog port. <a href="structadc__t.html#_details">More...</a><br></td></tr> |
26 |
<tr><td colspan="2"><br><h2>Defines</h2></td></tr> |
27 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g099995994c74b5fff8f7de4ff3eac550"></a><!-- doxytag: member="analog::AN0" ref="g099995994c74b5fff8f7de4ff3eac550" args="" --> |
28 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#g099995994c74b5fff8f7de4ff3eac550">AN0</a> 0x00</td></tr> |
29 |
|
30 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Analog port 0. <br></td></tr> |
31 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g4903de2a52966c8dc2c20faf565d451d"></a><!-- doxytag: member="analog::AN1" ref="g4903de2a52966c8dc2c20faf565d451d" args="" --> |
32 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#g4903de2a52966c8dc2c20faf565d451d">AN1</a> 0x01</td></tr> |
33 |
|
34 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Analog port 1. <br></td></tr> |
35 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g9b0754e893d69a1e69e856853f70da1f"></a><!-- doxytag: member="analog::AN2" ref="g9b0754e893d69a1e69e856853f70da1f" args="" --> |
36 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#g9b0754e893d69a1e69e856853f70da1f">AN2</a> 0x02</td></tr> |
37 |
|
38 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Analog port 2. <br></td></tr> |
39 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g9f593faa38f1023698d74f03a457abe3"></a><!-- doxytag: member="analog::AN3" ref="g9f593faa38f1023698d74f03a457abe3" args="" --> |
40 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#g9f593faa38f1023698d74f03a457abe3">AN3</a> 0x03</td></tr> |
41 |
|
42 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Analog port 3. <br></td></tr> |
43 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gdc95f1e9cdc00268d7bca5885052171f"></a><!-- doxytag: member="analog::AN4" ref="gdc95f1e9cdc00268d7bca5885052171f" args="" --> |
44 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#gdc95f1e9cdc00268d7bca5885052171f">AN4</a> 0x04</td></tr> |
45 |
|
46 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Analog port 4. <br></td></tr> |
47 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g99ed455a0d536be03f12eba18ccff71b"></a><!-- doxytag: member="analog::AN5" ref="g99ed455a0d536be03f12eba18ccff71b" args="" --> |
48 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#g99ed455a0d536be03f12eba18ccff71b">AN5</a> 0x05</td></tr> |
49 |
|
50 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Analog port 5. <br></td></tr> |
51 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gd63d6861c3fa5e606de5c18ada3b4d10"></a><!-- doxytag: member="analog::AN6" ref="gd63d6861c3fa5e606de5c18ada3b4d10" args="" --> |
52 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#gd63d6861c3fa5e606de5c18ada3b4d10">AN6</a> 0x06</td></tr> |
53 |
|
54 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Analog port 6. <br></td></tr> |
55 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g277d706ee82bd70459b63e85489c7074"></a><!-- doxytag: member="analog::AN7" ref="g277d706ee82bd70459b63e85489c7074" args="" --> |
56 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#g277d706ee82bd70459b63e85489c7074">AN7</a> 0x07</td></tr> |
57 |
|
58 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Analog port 7. <br></td></tr> |
59 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g28b64348820dbb25c903d24f2e38a8a7"></a><!-- doxytag: member="analog::AN8" ref="g28b64348820dbb25c903d24f2e38a8a7" args="" --> |
60 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#g28b64348820dbb25c903d24f2e38a8a7">AN8</a> 0x08</td></tr> |
61 |
|
62 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Analog port 8. <br></td></tr> |
63 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g2fb7e4f4e0ea1f172eef79ed1f92e15f"></a><!-- doxytag: member="analog::AN9" ref="g2fb7e4f4e0ea1f172eef79ed1f92e15f" args="" --> |
64 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#g2fb7e4f4e0ea1f172eef79ed1f92e15f">AN9</a> 0x09</td></tr> |
65 |
|
66 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Analog port 9. <br></td></tr> |
67 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gc63caaf5f7a06a02522cb7f90d6c1959"></a><!-- doxytag: member="analog::AN10" ref="gc63caaf5f7a06a02522cb7f90d6c1959" args="" --> |
68 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#gc63caaf5f7a06a02522cb7f90d6c1959">AN10</a> 0x0A</td></tr> |
69 |
|
70 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Analog port 10. <br></td></tr> |
71 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gdfeb79b00aaef4734408a910838f7872"></a><!-- doxytag: member="analog::AN11" ref="gdfeb79b00aaef4734408a910838f7872" args="" --> |
72 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#gdfeb79b00aaef4734408a910838f7872">AN11</a> 0x0B</td></tr> |
73 |
|
74 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Analog port 11. <br></td></tr> |
75 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g7a50a07e69f38b6674b0494dfbc653f9"></a><!-- doxytag: member="analog::AN12" ref="g7a50a07e69f38b6674b0494dfbc653f9" args="" --> |
76 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#g7a50a07e69f38b6674b0494dfbc653f9">AN12</a> 0x0C</td></tr> |
77 |
|
78 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Analog port 12. <br></td></tr> |
79 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gbf80851ae45ddfe4bfdfc10541c255ad"></a><!-- doxytag: member="analog::AN13" ref="gbf80851ae45ddfe4bfdfc10541c255ad" args="" --> |
80 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#gbf80851ae45ddfe4bfdfc10541c255ad">AN13</a> 0x0D</td></tr> |
81 |
|
82 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Analog port 13. <br></td></tr> |
83 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g817772a1db513b734dfe4475c3616061"></a><!-- doxytag: member="analog::AN14" ref="g817772a1db513b734dfe4475c3616061" args="" --> |
84 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#g817772a1db513b734dfe4475c3616061">AN14</a> 0x0E</td></tr> |
85 |
|
86 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Analog port 14. <br></td></tr> |
87 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g797adbadae057ff7aa766d84b4f180f9"></a><!-- doxytag: member="analog::AN15" ref="g797adbadae057ff7aa766d84b4f180f9" args="" --> |
88 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#g797adbadae057ff7aa766d84b4f180f9">AN15</a> 0x0F</td></tr> |
89 |
|
90 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Analog port 15. <br></td></tr> |
91 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga5e4dd5ac995c644e471ed80c706fa0b"></a><!-- doxytag: member="analog::BOM_PORT" ref="ga5e4dd5ac995c644e471ed80c706fa0b" args="" --> |
92 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#ga5e4dd5ac995c644e471ed80c706fa0b">BOM_PORT</a> AN0</td></tr> |
93 |
|
94 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">BOM_PORT analog port for BOM. <br></td></tr> |
95 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g3434ce39eaea22b46a0100b7fd3a6f47"></a><!-- doxytag: member="analog::EXT_MUX" ref="g3434ce39eaea22b46a0100b7fd3a6f47" args="" --> |
96 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#g3434ce39eaea22b46a0100b7fd3a6f47">EXT_MUX</a> AN7</td></tr> |
97 |
|
98 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">EXT_MUX analog port. <br></td></tr> |
99 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga6538d2deb002b8441891dc4e15cd104"></a><!-- doxytag: member="analog::WHEEL_PORT" ref="ga6538d2deb002b8441891dc4e15cd104" args="" --> |
100 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#ga6538d2deb002b8441891dc4e15cd104">WHEEL_PORT</a> AN10</td></tr> |
101 |
|
102 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Analog port for the wheel. <br></td></tr> |
103 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gadcd026a2c91fe96c8134619c87bb72a"></a><!-- doxytag: member="analog::BATT_PORT" ref="gadcd026a2c91fe96c8134619c87bb72a" args="" --> |
104 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#gadcd026a2c91fe96c8134619c87bb72a">BATT_PORT</a> AN11</td></tr> |
105 |
|
106 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Analog port for the battery voltage detector. <br></td></tr> |
107 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gcc93f5a70b7081637be3d30cc04cb4dd"></a><!-- doxytag: member="analog::ADC_START" ref="gcc93f5a70b7081637be3d30cc04cb4dd" args="" --> |
108 |
#define </td><td class="memItemRight" valign="bottom"><b>ADC_START</b> 1</td></tr> |
109 |
|
110 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g23aeca8ff9a59fe5f63da36004038c86"></a><!-- doxytag: member="analog::ADC_STOP" ref="g23aeca8ff9a59fe5f63da36004038c86" args="" --> |
111 |
#define </td><td class="memItemRight" valign="bottom"><b>ADC_STOP</b> 0</td></tr> |
112 |
|
113 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga03e3669bcaf982e6861d3fcb71a9712"></a><!-- doxytag: member="analog::ADMUX_OPT" ref="ga03e3669bcaf982e6861d3fcb71a9712" args="" --> |
114 |
#define </td><td class="memItemRight" valign="bottom"><b>ADMUX_OPT</b> 0x60</td></tr> |
115 |
|
116 |
<tr><td colspan="2"><br><h2>Functions</h2></td></tr> |
117 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#g4be2ba5e4db17e5be950af682f9ad522">analog_init</a> (int start_conversion)</td></tr> |
118 |
|
119 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize analog ports. Will start running a loop if start_conversion is ADC_START. <a href="#g4be2ba5e4db17e5be950af682f9ad522"></a><br></td></tr> |
120 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#gf1211040ce2c54f12f98df7d47a4eb27">analog8</a> (int which)</td></tr> |
121 |
|
122 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns an 8-bit analog value from the look up table. Use this instead of analog_get8. <a href="#gf1211040ce2c54f12f98df7d47a4eb27"></a><br></td></tr> |
123 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#g875bf8cb165a3a288eb1aa2ac06be4f3">analog10</a> (int which)</td></tr> |
124 |
|
125 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns an 10-bit analog value from the look up table. Use this instead of analog_get10. <a href="#g875bf8cb165a3a288eb1aa2ac06be4f3"></a><br></td></tr> |
126 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#g715fe1182216a43efe6c1545a76037cc">analog_start_loop</a> (void)</td></tr> |
127 |
|
128 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">starts the analog loop. Doesn't do anything if the loop is already running. <a href="#g715fe1182216a43efe6c1545a76037cc"></a><br></td></tr> |
129 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#g7261449d6a0a02d5717d62e9015d38a6">analog_stop_loop</a> (void)</td></tr> |
130 |
|
131 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Stops the analog loop. Doesn't do anything if the loop is already stopped. <a href="#g7261449d6a0a02d5717d62e9015d38a6"></a><br></td></tr> |
132 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#g1593f0ee57fea252a5ef0146004d7fa9">analog_get8</a> (int which)</td></tr> |
133 |
|
134 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Read an 8-bit number from an analog port. Loop must be stopped for this to work. <a href="#g1593f0ee57fea252a5ef0146004d7fa9"></a><br></td></tr> |
135 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#g97e97c6d960441518b2572c42c941719">analog_get10</a> (int which)</td></tr> |
136 |
|
137 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Read a 10-bit number from an analog port. Loop must be stopped for this to work. <a href="#g97e97c6d960441518b2572c42c941719"></a><br></td></tr> |
138 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#g973e63eb508819a37efe3231b6a39550">wheel</a> (void)</td></tr> |
139 |
|
140 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Read the position of the wheel. <a href="#g973e63eb508819a37efe3231b6a39550"></a><br></td></tr> |
141 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog.html#gbc63da8e5431c1d15bc9a61749628f35">set_adc_mux</a> (int which)</td></tr> |
142 |
|
143 |
<tr><td colspan="2"><br><h2>Variables</h2></td></tr> |
144 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g96a7975bf790d662c962edbcfbdec746"></a><!-- doxytag: member="analog::adc_loop_running" ref="g96a7975bf790d662c962edbcfbdec746" args="" --> |
145 |
int </td><td class="memItemRight" valign="bottom"><b>adc_loop_running</b> = 0</td></tr> |
146 |
|
147 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g69c9650ecf07399e282fac6ef51baeb5"></a><!-- doxytag: member="analog::adc_current_port" ref="g69c9650ecf07399e282fac6ef51baeb5" args="" --> |
148 |
int </td><td class="memItemRight" valign="bottom"><b>adc_current_port</b> = 0</td></tr> |
149 |
|
150 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g85793ec6742100576da3b4b034dae15f"></a><!-- doxytag: member="analog::an_val" ref="g85793ec6742100576da3b4b034dae15f" args="[11]" --> |
151 |
<a class="el" href="structadc__t.html">adc_t</a> </td><td class="memItemRight" valign="bottom"><b>an_val</b> [11]</td></tr> |
152 |
|
153 |
</table>
|
154 |
<hr><a name="_details"></a><h2>Detailed Description</h2> |
155 |
Functions for manipulation the ADC on the dragonfly board. All definitions may be found in <a class="el" href="analog_8h.html" title="Contains functions and definitions for using the ADC.">analog.h</a>. <hr><h2>Function Documentation</h2> |
156 |
<a class="anchor" name="g875bf8cb165a3a288eb1aa2ac06be4f3"></a><!-- doxytag: member="analog.c::analog10" ref="g875bf8cb165a3a288eb1aa2ac06be4f3" args="(int which)" --> |
157 |
<div class="memitem"> |
158 |
<div class="memproto"> |
159 |
<table class="memname"> |
160 |
<tr>
|
161 |
<td class="memname">unsigned int analog10 </td> |
162 |
<td>(</td> |
163 |
<td class="paramtype">int </td> |
164 |
<td class="paramname"> <em>which</em> </td> |
165 |
<td> ) </td> |
166 |
<td width="100%"></td> |
167 |
</tr>
|
168 |
</table>
|
169 |
</div>
|
170 |
<div class="memdoc"> |
171 |
|
172 |
<p>
|
173 |
Returns an 10-bit analog value from the look up table. Use this instead of analog_get10. |
174 |
<p>
|
175 |
Returns the 10-bit analog conversion of which from the lookup table. If the requested port is the BOM_PORT you will get an automatic 0 since the BOM_PORT is not read in the loop and not stored. If you need that port you should use the functions in <a class="el" href="bom_8c.html" title="Implementation for using the BOM.">bom.c</a>. There is an analog_get10 function which for instant lookups but should be avoided unless you know what you are doing.<p> |
176 |
<dl compact><dt><b>Parameters:</b></dt><dd> |
177 |
<table border="0" cellspacing="2" cellpadding="0"> |
178 |
<tr><td valign="top"></td><td valign="top"><em>which</em> </td><td>the port that you want to read</td></tr> |
179 |
</table>
|
180 |
</dl>
|
181 |
<dl compact><dt><b><a class="el" href="bug.html#_bug000002">Bug:</a></b></dt><dd>may cause a seg fault if which is a larger value than exists in an_val table. Not sure if we should fix this or not since it would add overhead.</dd></dl> |
182 |
<dl class="return" compact><dt><b>Returns:</b></dt><dd>10-bit analog value for the which port requested</dd></dl> |
183 |
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__analog.html#gf1211040ce2c54f12f98df7d47a4eb27" title="Returns an 8-bit analog value from the look up table. Use this instead of analog_get8...">analog8</a>, <a class="el" href="group__analog.html#g1593f0ee57fea252a5ef0146004d7fa9" title="Read an 8-bit number from an analog port. Loop must be stopped for this to work.">analog_get8</a>, <a class="el" href="group__analog.html#g97e97c6d960441518b2572c42c941719" title="Read a 10-bit number from an analog port. Loop must be stopped for this to work.">analog_get10</a> </dd></dl> |
184 |
|
185 |
<p>References <a class="el" href="analog_8h-source.html#l00102">adc_t::adc10</a>, and <a class="el" href="analog_8h-source.html#l00086">BOM_PORT</a>.</p> |
186 |
|
187 |
</div>
|
188 |
</div><p> |
189 |
<a class="anchor" name="gf1211040ce2c54f12f98df7d47a4eb27"></a><!-- doxytag: member="analog.c::analog8" ref="gf1211040ce2c54f12f98df7d47a4eb27" args="(int which)" --> |
190 |
<div class="memitem"> |
191 |
<div class="memproto"> |
192 |
<table class="memname"> |
193 |
<tr>
|
194 |
<td class="memname">unsigned int analog8 </td> |
195 |
<td>(</td> |
196 |
<td class="paramtype">int </td> |
197 |
<td class="paramname"> <em>which</em> </td> |
198 |
<td> ) </td> |
199 |
<td width="100%"></td> |
200 |
</tr>
|
201 |
</table>
|
202 |
</div>
|
203 |
<div class="memdoc"> |
204 |
|
205 |
<p>
|
206 |
Returns an 8-bit analog value from the look up table. Use this instead of analog_get8. |
207 |
<p>
|
208 |
Returns the 8-bit analog conversion of which from the lookup table. If the requested port is the BOM_PORT you will get an automatic 0 since the BOM_PORT is not read in the loop and not stored. If you need that port you should use the functions in <a class="el" href="bom_8c.html" title="Implementation for using the BOM.">bom.c</a>. There is an analog_get8 function which for instant lookups but should be avoided unless you know what you're doing.<p> |
209 |
<dl compact><dt><b>Parameters:</b></dt><dd> |
210 |
<table border="0" cellspacing="2" cellpadding="0"> |
211 |
<tr><td valign="top"></td><td valign="top"><em>which</em> </td><td>the port that you want to read</td></tr> |
212 |
</table>
|
213 |
</dl>
|
214 |
<dl compact><dt><b><a class="el" href="bug.html#_bug000001">Bug:</a></b></dt><dd>may cause a seg fault if which is a larger value than exists in an_val table. Not sure if we should fix this or not since it would add overhead.</dd></dl> |
215 |
<dl class="return" compact><dt><b>Returns:</b></dt><dd>8-bit analog value for the which port requested</dd></dl> |
216 |
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__analog.html#g875bf8cb165a3a288eb1aa2ac06be4f3" title="Returns an 10-bit analog value from the look up table. Use this instead of analog_get10...">analog10</a>, <a class="el" href="group__analog.html#g1593f0ee57fea252a5ef0146004d7fa9" title="Read an 8-bit number from an analog port. Loop must be stopped for this to work.">analog_get8</a>, <a class="el" href="group__analog.html#g97e97c6d960441518b2572c42c941719" title="Read a 10-bit number from an analog port. Loop must be stopped for this to work.">analog_get10</a> </dd></dl> |
217 |
|
218 |
<p>References <a class="el" href="analog_8h-source.html#l00101">adc_t::adc8</a>, and <a class="el" href="analog_8h-source.html#l00086">BOM_PORT</a>.</p> |
219 |
|
220 |
<p>Referenced by <a class="el" href="battery_8c-source.html#l00082">battery()</a>, <a class="el" href="battery_8c-source.html#l00069">battery8()</a>, <a class="el" href="rangefinder_8c-source.html#l00135">range_read_distance()</a>, and <a class="el" href="analog_8c-source.html#l00269">wheel()</a>.</p> |
221 |
|
222 |
</div>
|
223 |
</div><p> |
224 |
<a class="anchor" name="g97e97c6d960441518b2572c42c941719"></a><!-- doxytag: member="analog.c::analog_get10" ref="g97e97c6d960441518b2572c42c941719" args="(int which)" --> |
225 |
<div class="memitem"> |
226 |
<div class="memproto"> |
227 |
<table class="memname"> |
228 |
<tr>
|
229 |
<td class="memname">unsigned int analog_get10 </td> |
230 |
<td>(</td> |
231 |
<td class="paramtype">int </td> |
232 |
<td class="paramname"> <em>which</em> </td> |
233 |
<td> ) </td> |
234 |
<td width="100%"></td> |
235 |
</tr>
|
236 |
</table>
|
237 |
</div>
|
238 |
<div class="memdoc"> |
239 |
|
240 |
<p>
|
241 |
Read a 10-bit number from an analog port. Loop must be stopped for this to work. |
242 |
<p>
|
243 |
Reads an 10-bit number from an analog port. analog_init must be called before using this function. The analog loop must also be stopped before using this function or you will mess up the lookup table. You must also reenabled the loop when you are done unless you are doing more instant reads. See analog_stop_loop and analog_start_loop for more information about the loop.<p>
|
244 |
<dl compact><dt><b>Parameters:</b></dt><dd> |
245 |
<table border="0" cellspacing="2" cellpadding="0"> |
246 |
<tr><td valign="top"></td><td valign="top"><em>which</em> </td><td>the analog port to read from. Typically a constant, one of AN0 - AN7.</td></tr> |
247 |
</table>
|
248 |
</dl>
|
249 |
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the 10-bit number input to the specified port</dd></dl> |
250 |
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__analog.html#g4be2ba5e4db17e5be950af682f9ad522" title="Initialize analog ports. Will start running a loop if start_conversion is ADC_START...">analog_init</a>, <a class="el" href="group__analog.html#g1593f0ee57fea252a5ef0146004d7fa9" title="Read an 8-bit number from an analog port. Loop must be stopped for this to work.">analog_get8</a>, <a class="el" href="group__analog.html#g875bf8cb165a3a288eb1aa2ac06be4f3" title="Returns an 10-bit analog value from the look up table. Use this instead of analog_get10...">analog10</a>, <a class="el" href="group__analog.html#g7261449d6a0a02d5717d62e9015d38a6" title="Stops the analog loop. Doesn't do anything if the loop is already stopped.">analog_stop_loop</a>, <a class="el" href="group__analog.html#g715fe1182216a43efe6c1545a76037cc" title="starts the analog loop. Doesn't do anything if the loop is already running.">analog_start_loop</a> </dd></dl> |
251 |
|
252 |
<p>References <a class="el" href="analog_8h-source.html#l00088">EXT_MUX</a>, and <a class="el" href="analog_8c-source.html#l00288">set_adc_mux()</a>.</p> |
253 |
|
254 |
</div>
|
255 |
</div><p> |
256 |
<a class="anchor" name="g1593f0ee57fea252a5ef0146004d7fa9"></a><!-- doxytag: member="analog.c::analog_get8" ref="g1593f0ee57fea252a5ef0146004d7fa9" args="(int which)" --> |
257 |
<div class="memitem"> |
258 |
<div class="memproto"> |
259 |
<table class="memname"> |
260 |
<tr>
|
261 |
<td class="memname">unsigned int analog_get8 </td> |
262 |
<td>(</td> |
263 |
<td class="paramtype">int </td> |
264 |
<td class="paramname"> <em>which</em> </td> |
265 |
<td> ) </td> |
266 |
<td width="100%"></td> |
267 |
</tr>
|
268 |
</table>
|
269 |
</div>
|
270 |
<div class="memdoc"> |
271 |
|
272 |
<p>
|
273 |
Read an 8-bit number from an analog port. Loop must be stopped for this to work. |
274 |
<p>
|
275 |
Reads an 8-bit number from an analog port. analog_init must be called before using this function. The analog loop must also be stopped before using this function or you will mess up the lookup table. You must also reenabled the loop when you are done unless you are doing more instant reads. See analog_stop_loop and analog_start_loop for more information about the loop.<p>
|
276 |
<dl compact><dt><b>Parameters:</b></dt><dd> |
277 |
<table border="0" cellspacing="2" cellpadding="0"> |
278 |
<tr><td valign="top"></td><td valign="top"><em>which</em> </td><td>the analog port to read from. One of the constants AN0 - AN7.</td></tr> |
279 |
</table>
|
280 |
</dl>
|
281 |
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the 8-bit input to the specified port</dd></dl> |
282 |
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__analog.html#g4be2ba5e4db17e5be950af682f9ad522" title="Initialize analog ports. Will start running a loop if start_conversion is ADC_START...">analog_init</a>, <a class="el" href="group__analog.html#g97e97c6d960441518b2572c42c941719" title="Read a 10-bit number from an analog port. Loop must be stopped for this to work.">analog_get10</a>, <a class="el" href="group__analog.html#gf1211040ce2c54f12f98df7d47a4eb27" title="Returns an 8-bit analog value from the look up table. Use this instead of analog_get8...">analog8</a>, <a class="el" href="group__analog.html#g7261449d6a0a02d5717d62e9015d38a6" title="Stops the analog loop. Doesn't do anything if the loop is already stopped.">analog_stop_loop</a>, <a class="el" href="group__analog.html#g715fe1182216a43efe6c1545a76037cc" title="starts the analog loop. Doesn't do anything if the loop is already running.">analog_start_loop</a> </dd></dl> |
283 |
|
284 |
<p>References <a class="el" href="analog_8h-source.html#l00088">EXT_MUX</a>, and <a class="el" href="analog_8c-source.html#l00288">set_adc_mux()</a>.</p> |
285 |
|
286 |
<p>Referenced by <a class="el" href="bom_8c-source.html#l00168">bom_refresh()</a>.</p> |
287 |
|
288 |
</div>
|
289 |
</div><p> |
290 |
<a class="anchor" name="g4be2ba5e4db17e5be950af682f9ad522"></a><!-- doxytag: member="analog.c::analog_init" ref="g4be2ba5e4db17e5be950af682f9ad522" args="(int start_conversion)" --> |
291 |
<div class="memitem"> |
292 |
<div class="memproto"> |
293 |
<table class="memname"> |
294 |
<tr>
|
295 |
<td class="memname">void analog_init </td> |
296 |
<td>(</td> |
297 |
<td class="paramtype">int </td> |
298 |
<td class="paramname"> <em>start_conversion</em> </td> |
299 |
<td> ) </td> |
300 |
<td width="100%"></td> |
301 |
</tr>
|
302 |
</table>
|
303 |
</div>
|
304 |
<div class="memdoc"> |
305 |
|
306 |
<p>
|
307 |
Initialize analog ports. Will start running a loop if start_conversion is ADC_START. |
308 |
<p>
|
309 |
Initializes the ADC. Call analog_init before reading from the analog ports.<p>
|
310 |
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__analog.html#gf1211040ce2c54f12f98df7d47a4eb27" title="Returns an 8-bit analog value from the look up table. Use this instead of analog_get8...">analog8</a>, <a class="el" href="group__analog.html#g875bf8cb165a3a288eb1aa2ac06be4f3" title="Returns an 10-bit analog value from the look up table. Use this instead of analog_get10...">analog10</a>, <a class="el" href="group__analog.html#g1593f0ee57fea252a5ef0146004d7fa9" title="Read an 8-bit number from an analog port. Loop must be stopped for this to work.">analog_get8</a>, <a class="el" href="group__analog.html#g97e97c6d960441518b2572c42c941719" title="Read a 10-bit number from an analog port. Loop must be stopped for this to work.">analog_get10</a> </dd></dl> |
311 |
|
312 |
<p>References <a class="el" href="analog_8h-source.html#l00102">adc_t::adc10</a>, <a class="el" href="analog_8h-source.html#l00101">adc_t::adc8</a>, <a class="el" href="analog_8h-source.html#l00055">AN1</a>, <a class="el" href="analog_8c-source.html#l00160">analog_start_loop()</a>, <a class="el" href="analog_8c-source.html#l00174">analog_stop_loop()</a>, and <a class="el" href="analog_8c-source.html#l00288">set_adc_mux()</a>.</p> |
313 |
|
314 |
<p>Referenced by <a class="el" href="dragonfly__lib_8c-source.html#l00068">dragonfly_init()</a>.</p> |
315 |
|
316 |
</div>
|
317 |
</div><p> |
318 |
<a class="anchor" name="g715fe1182216a43efe6c1545a76037cc"></a><!-- doxytag: member="analog.c::analog_start_loop" ref="g715fe1182216a43efe6c1545a76037cc" args="(void)" --> |
319 |
<div class="memitem"> |
320 |
<div class="memproto"> |
321 |
<table class="memname"> |
322 |
<tr>
|
323 |
<td class="memname">void analog_start_loop </td> |
324 |
<td>(</td> |
325 |
<td class="paramtype">void </td> |
326 |
<td class="paramname"> </td> |
327 |
<td> ) </td> |
328 |
<td width="100%"></td> |
329 |
</tr>
|
330 |
</table>
|
331 |
</div>
|
332 |
<div class="memdoc"> |
333 |
|
334 |
<p>
|
335 |
starts the analog loop. Doesn't do anything if the loop is already running. |
336 |
<p>
|
337 |
Starts the analog update loop. Will continue to run until analog_stop_loop is called.<p>
|
338 |
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__analog.html#g7261449d6a0a02d5717d62e9015d38a6" title="Stops the analog loop. Doesn't do anything if the loop is already stopped.">analog_stop_loop</a> </dd></dl> |
339 |
|
340 |
<p>Referenced by <a class="el" href="analog_8c-source.html#l00061">analog_init()</a>, and <a class="el" href="bom_8c-source.html#l00168">bom_refresh()</a>.</p> |
341 |
|
342 |
</div>
|
343 |
</div><p> |
344 |
<a class="anchor" name="g7261449d6a0a02d5717d62e9015d38a6"></a><!-- doxytag: member="analog.c::analog_stop_loop" ref="g7261449d6a0a02d5717d62e9015d38a6" args="(void)" --> |
345 |
<div class="memitem"> |
346 |
<div class="memproto"> |
347 |
<table class="memname"> |
348 |
<tr>
|
349 |
<td class="memname">void analog_stop_loop </td> |
350 |
<td>(</td> |
351 |
<td class="paramtype">void </td> |
352 |
<td class="paramname"> </td> |
353 |
<td> ) </td> |
354 |
<td width="100%"></td> |
355 |
</tr>
|
356 |
</table>
|
357 |
</div>
|
358 |
<div class="memdoc"> |
359 |
|
360 |
<p>
|
361 |
Stops the analog loop. Doesn't do anything if the loop is already stopped. |
362 |
<p>
|
363 |
Stops the analog update loop. If there is a current read, it will finish up and be stored before the loop is interrupted. No further updates will be made until the loop is started again.<p>
|
364 |
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__analog.html#g715fe1182216a43efe6c1545a76037cc" title="starts the analog loop. Doesn't do anything if the loop is already running.">analog_start_loop</a> </dd></dl> |
365 |
|
366 |
<p>Referenced by <a class="el" href="analog_8c-source.html#l00061">analog_init()</a>, and <a class="el" href="bom_8c-source.html#l00168">bom_refresh()</a>.</p> |
367 |
|
368 |
</div>
|
369 |
</div><p> |
370 |
<a class="anchor" name="gbc63da8e5431c1d15bc9a61749628f35"></a><!-- doxytag: member="analog.c::set_adc_mux" ref="gbc63da8e5431c1d15bc9a61749628f35" args="(int which)" --> |
371 |
<div class="memitem"> |
372 |
<div class="memproto"> |
373 |
<table class="memname"> |
374 |
<tr>
|
375 |
<td class="memname">void set_adc_mux </td> |
376 |
<td>(</td> |
377 |
<td class="paramtype">int </td> |
378 |
<td class="paramname"> <em>which</em> </td> |
379 |
<td> ) </td> |
380 |
<td width="100%"></td> |
381 |
</tr>
|
382 |
</table>
|
383 |
</div>
|
384 |
<div class="memdoc"> |
385 |
|
386 |
<p>
|
387 |
Sets the value of the external analog mux. Values are read on AN7 physical port. (AN8 - AN15 are "virtual" ports).<p>
|
388 |
<dl compact><dt><b>Parameters:</b></dt><dd> |
389 |
<table border="0" cellspacing="2" cellpadding="0"> |
390 |
<tr><td valign="top"></td><td valign="top"><em>which</em> </td><td>which analog mux port (0-7) which corresponds to AN8-AN15.</td></tr> |
391 |
</table>
|
392 |
</dl>
|
393 |
<dl compact><dt><b><a class="el" href="bug.html#_bug000003">Bug:</a></b></dt><dd>FIX THIS IN THE NEXT BOARD REVISION: ADDR2 ADDR1 ADDR0 G2.G4.G3 set mux to port 0-7 via vinary selection math would be much cleaner if it was G4.G3.G2</dd></dl> |
394 |
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__analog.html#g4be2ba5e4db17e5be950af682f9ad522" title="Initialize analog ports. Will start running a loop if start_conversion is ADC_START...">analog_init</a> </dd></dl> |
395 |
|
396 |
<p>Referenced by <a class="el" href="analog_8c-source.html#l00233">analog_get10()</a>, <a class="el" href="analog_8c-source.html#l00195">analog_get8()</a>, and <a class="el" href="analog_8c-source.html#l00061">analog_init()</a>.</p> |
397 |
|
398 |
</div>
|
399 |
</div><p> |
400 |
<a class="anchor" name="g973e63eb508819a37efe3231b6a39550"></a><!-- doxytag: member="analog.c::wheel" ref="g973e63eb508819a37efe3231b6a39550" args="(void)" --> |
401 |
<div class="memitem"> |
402 |
<div class="memproto"> |
403 |
<table class="memname"> |
404 |
<tr>
|
405 |
<td class="memname">int wheel </td> |
406 |
<td>(</td> |
407 |
<td class="paramtype">void </td> |
408 |
<td class="paramname"> </td> |
409 |
<td> ) </td> |
410 |
<td width="100%"></td> |
411 |
</tr>
|
412 |
</table>
|
413 |
</div>
|
414 |
<div class="memdoc"> |
415 |
|
416 |
<p>
|
417 |
Read the position of the wheel. |
418 |
<p>
|
419 |
Returns the current position of the wheel, as an integer in the range 0 - 255. analog_init must be called before using this function.<p>
|
420 |
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the orientation of the wheel, as an integer in the range 0 - 255.</dd></dl> |
421 |
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__analog.html#g4be2ba5e4db17e5be950af682f9ad522" title="Initialize analog ports. Will start running a loop if start_conversion is ADC_START...">analog_init</a> </dd></dl> |
422 |
|
423 |
<p>References <a class="el" href="analog_8c-source.html#l00119">analog8()</a>, and <a class="el" href="analog_8h-source.html#l00090">WHEEL_PORT</a>.</p> |
424 |
|
425 |
</div>
|
426 |
</div><p> |
427 |
</div>
|
428 |
<hr size="1"><address style="text-align: right;"><small>Generated on Wed Sep 2 23:20:08 2009 for libdragonfly by |
429 |
<a href="http://www.doxygen.org/index.html"> |
430 |
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address> |
431 |
</body>
|
432 |
</html>
|