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

📄 pio__example1__rainbow__lights_8c.html

📁 avr32100.zip Embedded demo
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">#define right&nbsp;&nbsp;&nbsp;1          </td>        </tr>      </table></div><div class="memdoc"><p><p>Definition at line <a class="el" href="pio__example1__rainbow__lights_8c-source.html#l00009">9</a> of file <a class="el" href="pio__example1__rainbow__lights_8c-source.html">pio_example1_rainbow_lights.c</a>.<p>Referenced by <a class="el" href="pio__example1__rainbow__lights_8c-source.html#l00034">main()</a>.</div></div><p><a class="anchor" name="85bd03e30e523319b5e069e7a8a0f81d"></a><!-- doxytag: member="pio_example1_rainbow_lights.c::white" ref="85bd03e30e523319b5e069e7a8a0f81d" args="" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">#define white&nbsp;&nbsp;&nbsp;0x15          </td>        </tr>      </table></div><div class="memdoc"><p><p>Definition at line <a class="el" href="pio__example1__rainbow__lights_8c-source.html#l00019">19</a> of file <a class="el" href="pio__example1__rainbow__lights_8c-source.html">pio_example1_rainbow_lights.c</a>.</div></div><p><a class="anchor" name="aa509be08a5019c968f558d628a2a540"></a><!-- doxytag: member="pio_example1_rainbow_lights.c::yellow" ref="aa509be08a5019c968f558d628a2a540" args="" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">#define yellow&nbsp;&nbsp;&nbsp;0x05          </td>        </tr>      </table></div><div class="memdoc"><p><p>Definition at line <a class="el" href="pio__example1__rainbow__lights_8c-source.html#l00015">15</a> of file <a class="el" href="pio__example1__rainbow__lights_8c-source.html">pio_example1_rainbow_lights.c</a>.</div></div><p><hr><h2>Function Documentation</h2><a class="anchor" name="341d33c536d663703208ab568f7d1e0e"></a><!-- doxytag: member="pio_example1_rainbow_lights.c::delay" ref="341d33c536d663703208ab568f7d1e0e" args="(void)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">void delay           </td>          <td>(</td>          <td class="paramname">          </td>          <td>&nbsp;)&nbsp;</td>          <td width="100%"></td>        </tr>      </table></div><div class="memdoc"><p>This function is a delay function that lasts for 1/4 second. <dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>none</em>&nbsp;</td><td></td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>none </dd></dl><p>Definition at line <a class="el" href="pdc__example_8c-source.html#l00054">54</a> of file <a class="el" href="pdc__example_8c-source.html">pdc_example.c</a>.<div class="fragment"><pre class="fragment"><a name="l00055"></a>00055 {<a name="l00056"></a>00056         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> timeout = <a class="code" href="settings_8h.html#45ba202b05caf39795aeca91b0ae547e">TIMEOUT</a>;<a name="l00057"></a>00057 <a name="l00058"></a>00058         <span class="keywordflow">do</span> {<a name="l00059"></a>00059                 --timeout;<a name="l00060"></a>00060         } <span class="keywordflow">while</span> ( timeout &gt; 0 );<a name="l00061"></a>00061 }</pre></div><p></div></div><p><a class="anchor" name="840291bc02cba5474a4cb46a9b9566fe"></a><!-- doxytag: member="pio_example1_rainbow_lights.c::main" ref="840291bc02cba5474a4cb46a9b9566fe" args="(void)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">int main           </td>          <td>(</td>          <td class="paramtype">void&nbsp;</td>          <td class="paramname">          </td>          <td>&nbsp;)&nbsp;</td>          <td width="100%"></td>        </tr>      </table></div><div class="memdoc"><p>This function will run a set of colors on the rgb-leds on the STK1000. To get it to work, connect a 10 pin cable from J1 to J20 on the STK1000. <dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>none</em>&nbsp;</td><td></td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>none </dd></dl><p>Definition at line <a class="el" href="pio__example1__rainbow__lights_8c-source.html#l00034">34</a> of file <a class="el" href="pio__example1__rainbow__lights_8c-source.html">pio_example1_rainbow_lights.c</a>.<p>References <a class="el" href="pdc__example_8c-source.html#l00054">delay()</a>, <a class="el" href="pio__example1__rainbow__lights_8c-source.html#l00008">left</a>, <a class="el" href="pio__example1__rainbow__lights_8c-source.html#l00005">NoCOLORS</a>, <a class="el" href="pdc__example_8c-source.html#l00050">piob</a>, <a class="el" href="pio__example1__rainbow__lights_8c-source.html#l00072">rgb_leds()</a>, and <a class="el" href="pio__example1__rainbow__lights_8c-source.html#l00009">right</a>.<div class="fragment"><pre class="fragment"><a name="l00035"></a>00035 {<a name="l00036"></a>00036   <span class="keywordtype">int</span> i,j;<a name="l00037"></a>00037   avr32_pio_t *<a class="code" href="pdc__example_8c.html#305f96d612af5d9d17a8dd222dd01908">piob</a> = (<span class="keywordtype">void</span> *) AVR32_PIOC_ADDRESS;<a name="l00038"></a>00038 <a name="l00039"></a>00039   piob-&gt;per = 0x000000ff;<a name="l00040"></a>00040   piob-&gt;oer = 0x000000ff;<a name="l00041"></a>00041   piob-&gt;idr = 0x000000ff;<a name="l00042"></a>00042 <a name="l00043"></a>00043 <a name="l00044"></a>00044 <a name="l00045"></a>00045   <span class="keywordflow">while</span>(1){<a name="l00046"></a>00046     <span class="keywordflow">for</span>(i=0; i&lt;<a class="code" href="pio__example1__rainbow__lights_8c.html#3a8611389ef5db2547e5c36b442b6418">NoCOLORS</a>; i++){<a name="l00047"></a>00047       <a class="code" href="pio__example1__rainbow__lights_8c.html#8e32d9c0a4be3b5e4607856d4e843040">rgb_leds</a>(piob, <a class="code" href="pio__example1__rainbow__lights_8c.html#428f8207615465afdfcf1d31547ffef3">left</a>, i);<a name="l00048"></a>00048       <span class="keywordflow">for</span>(j=0; j&lt;NoCOLORS; j++){<a name="l00049"></a>00049         <a class="code" href="pio__example1__rainbow__lights_8c.html#8e32d9c0a4be3b5e4607856d4e843040">rgb_leds</a>(piob, <a class="code" href="pio__example1__rainbow__lights_8c.html#e545bf658b2c876abbbae55a7d12875f">right</a>,j);<a name="l00050"></a>00050         <a class="code" href="pdc__example_8c.html#bb9ee10191569258e0f22bdd0a95ba62">delay</a>();<a name="l00051"></a>00051       }<a name="l00052"></a>00052       <a class="code" href="pdc__example_8c.html#bb9ee10191569258e0f22bdd0a95ba62">delay</a>();<a name="l00053"></a>00053     }<a name="l00054"></a>00054   }<a name="l00055"></a>00055 }</pre></div><p><p>Here is the call graph for this function:</div></div><p><a class="anchor" name="8e32d9c0a4be3b5e4607856d4e843040"></a><!-- doxytag: member="pio_example1_rainbow_lights.c::rgb_leds" ref="8e32d9c0a4be3b5e4607856d4e843040" args="(struct avr32_pio_t *pio, int pos, int color)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">int rgb_leds           </td>          <td>(</td>          <td class="paramtype">struct avr32_pio_t *&nbsp;</td>          <td class="paramname"> <em>pio</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>pos</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>col_pos</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td width="100%"></td>        </tr>      </table></div><div class="memdoc"><p>This function puts out a color on one of the rgb leds. <dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>pio</em>&nbsp;</td><td>The pio struct for the port that you wish to drive </td></tr>    <tr><td valign="top"></td><td valign="top"><em>pos</em>&nbsp;</td><td>Which of the rgb led to drive: <a class="el" href="pio__example1__rainbow__lights_8c.html#428f8207615465afdfcf1d31547ffef3">left(0)</a> or <a class="el" href="pio__example1__rainbow__lights_8c.html#e545bf658b2c876abbbae55a7d12875f">right(0)</a> </td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>none </dd></dl><p>Definition at line <a class="el" href="pio__example1__rainbow__lights_8c-source.html#l00072">72</a> of file <a class="el" href="pio__example1__rainbow__lights_8c-source.html">pio_example1_rainbow_lights.c</a>.<p>References <a class="el" href="advanced__dip__switch__lights_8c-source.html#l00013">color_array</a>, <a class="el" href="pio__example1__rainbow__lights_8c-source.html#l00005">NoCOLORS</a>, and <a class="el" href="pio_8h-source.html#l00008">PIO_INVALID_ARGUMENT</a>.<p>Referenced by <a class="el" href="pio__example1__rainbow__lights_8c-source.html#l00034">main()</a>.<div class="fragment"><pre class="fragment"><a name="l00073"></a>00073 {<a name="l00074"></a>00074         <span class="keywordflow">if</span>( (pos&gt;1) | (pos&lt;0) | (col_pos&gt;<a class="code" href="pio__example1__rainbow__lights_8c.html#3a8611389ef5db2547e5c36b442b6418">NoCOLORS</a>) | (col_pos&lt;0) )<a name="l00075"></a>00075                 <span class="keywordflow">return</span> <a class="code" href="pio_8h.html#28429517612c8802636a443b9d07fd72">PIO_INVALID_ARGUMENT</a>;<a name="l00076"></a>00076 <a name="l00077"></a>00077         pio-&gt;codr = 0x00000015&lt;&lt;pos;<a name="l00078"></a>00078         pio-&gt;sodr = <a class="code" href="advanced__dip__switch__lights_8c.html#1cb9c8afac0f446a3910f0763440bfde">color_array</a>[col_pos]&lt;&lt;pos;<a name="l00079"></a>00079 <a name="l00080"></a>00080         <span class="keywordflow">return</span> 0;<a name="l00081"></a>00081 }</pre></div><p></div></div><p><hr><h2>Variable Documentation</h2><a class="anchor" name="c18e34da7875ffc0b3a06a552795ab0f"></a><!-- doxytag: member="pio_example1_rainbow_lights.c::color_array" ref="c18e34da7875ffc0b3a06a552795ab0f" args="[NoCOLORS]" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">int <a class="el" href="pio__example2__dip__switch__lights_8c.html#1cb9c8afac0f446a3910f0763440bfde">color_array</a>[NoCOLORS] = {black,purple,blue,light_blue,green,yellow,red,white}          </td>        </tr>      </table></div><div class="memdoc"><p><p>Definition at line <a class="el" href="pio__example1__rainbow__lights_8c-source.html#l00021">21</a> of file <a class="el" href="pio__example1__rainbow__lights_8c-source.html">pio_example1_rainbow_lights.c</a>.</div></div><p><hr size="1"><address style="align: right;"><small>Generated on Thu May 10 14:14:48 2007 for AVR321000 Communication with the AVR32 USART by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address></body></html>

⌨️ 快捷键说明

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