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

📄 usart__example_8c.html

📁 avr32100.zip Embedded demo
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<p><p>Here is the call graph for this function:<p><center><img src="usart__example_8c_840291bc02cba5474a4cb46a9b9566fe_cgraph.png" border="0" usemap="#usart__example_8c_840291bc02cba5474a4cb46a9b9566fe_cgraph_map" alt=""></center><map name="usart__example_8c_840291bc02cba5474a4cb46a9b9566fe_cgraph_map"><area href="usart__example_8c.html#0789f45a4ff69e0f650c2d3e2fdf35bb" shape="rect" coords="111,6,263,30" alt=""><area href="usart__example_8c.html#2929a2158663c710a90f2d760007397a" shape="rect" coords="160,54,214,78" alt=""><area href="usart_8c.html#48c8d76fc9fdde84b94a6e09184a6446" shape="rect" coords="122,102,252,126" alt=""><area href="usart_8c.html#908695fc913f77a6c1ab2a89e201a1fd" shape="rect" coords="331,54,446,78" alt=""><area href="usart_8c.html#26a849327e3bccdef17734f30667d9bd" shape="rect" coords="512,54,646,78" alt=""><area href="usart_8c.html#e994c1e7797dda76388176f208a2e6f2" shape="rect" coords="340,102,436,126" alt=""><area href="usart_8c.html#6f965be9b52e86ba6f47f12a0b6d08e7" shape="rect" coords="312,150,464,174" alt=""></map></div></div><p><a class="anchor" name="0789f45a4ff69e0f650c2d3e2fdf35bb"></a><!-- doxytag: member="usart_example.c::pio_enable_module" ref="0789f45a4ff69e0f650c2d3e2fdf35bb" args="(avr32_piomap_t piomap, unsigned int size)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">int pio_enable_module           </td>          <td>(</td>          <td class="paramtype"><a class="el" href="usart__example_8c.html#8a26ea9b2ab943a38ada2d6ca9282231">avr32_piomap_t</a>&nbsp;</td>          <td class="paramname"> <em>piomap</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">unsigned int&nbsp;</td>          <td class="paramname"> <em>size</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>Set the pins under module control. <p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>piomap</em>&nbsp;</td><td>a map describing how the setup of the PIO </td></tr>    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>number of elements in the map</td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>Status or error code </dd></dl><dl compact><dt><b>Return values:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>SUCCESS</em>&nbsp;</td><td>on success </td></tr>    <tr><td valign="top"></td><td valign="top"><em>FAILURE</em>&nbsp;</td><td>on bad values in piomap </td></tr>  </table></dl><p>Definition at line <a class="el" href="usart__example_8c-source.html#l00150">150</a> of file <a class="el" href="usart__example_8c-source.html">usart_example.c</a>.<p>References <a class="el" href="usart__example_8c-source.html#l00062">FAILURE</a>.<p>Referenced by <a class="el" href="usart__example_8c-source.html#l00096">main()</a>.<div class="fragment"><pre class="fragment"><a name="l00151"></a>00151 {<a name="l00152"></a>00152   <span class="keywordtype">int</span> i;<a name="l00153"></a>00153   <span class="keyword">volatile</span> <span class="keyword">struct </span>avr32_pio_t *pio;<a name="l00154"></a>00154 <a name="l00155"></a>00155   <span class="comment">/* get the base address for the port */</span><a name="l00156"></a>00156   <span class="keywordflow">switch</span> (**piomap/32) {<a name="l00157"></a>00157 <a name="l00158"></a>00158   <span class="keywordflow">case</span> 0:<a name="l00159"></a>00159     pio = &amp;AVR32_PIOA;<a name="l00160"></a>00160     <span class="keywordflow">break</span>;<a name="l00161"></a>00161   <span class="keywordflow">case</span> 1:<a name="l00162"></a>00162     pio = &amp;AVR32_PIOB;<a name="l00163"></a>00163     <span class="keywordflow">break</span>;<a name="l00164"></a>00164   <span class="keywordflow">case</span> 2:<a name="l00165"></a>00165     pio = &amp;AVR32_PIOC;<a name="l00166"></a>00166     <span class="keywordflow">break</span>;<a name="l00167"></a>00167   <span class="keywordflow">case</span> 3:<a name="l00168"></a>00168     pio = &amp;AVR32_PIOD;<a name="l00169"></a>00169     <span class="keywordflow">break</span>;<a name="l00170"></a>00170   <span class="keywordflow">case</span> 4:<a name="l00171"></a>00171     pio = &amp;AVR32_PIOE;<a name="l00172"></a>00172     <span class="keywordflow">break</span>;<a name="l00173"></a>00173   <span class="keywordflow">default</span> :<a name="l00174"></a>00174     <span class="keywordflow">return</span> <a class="code" href="usart__example_8c.html#6d58f9ac447476b4e084d7ca383f5183">FAILURE</a>;<a name="l00175"></a>00175 <a name="l00176"></a>00176   }<a name="l00177"></a>00177 <a name="l00178"></a>00178   <span class="keywordflow">for</span>(i=0; i&lt;size; i++){<a name="l00179"></a>00179 <a name="l00180"></a>00180     pio-&gt;pdr |= ( 1&lt;&lt;( (**piomap) % 32) );<a name="l00181"></a>00181     pio-&gt;pudr |= ( 1&lt;&lt;( (**piomap) % 32) );<a name="l00182"></a>00182 <a name="l00183"></a>00183     <span class="keywordflow">switch</span>( *(*piomap+1) ){    <a name="l00184"></a>00184     <span class="keywordflow">case</span> 0:<a name="l00185"></a>00185       pio-&gt;asr |= ( 1&lt;&lt;( (**piomap) % 32) );<a name="l00186"></a>00186       <span class="keywordflow">break</span>;<a name="l00187"></a>00187     <span class="keywordflow">case</span> 1:<a name="l00188"></a>00188       pio-&gt;bsr |= ( 1&lt;&lt;( (**piomap) % 32) );<a name="l00189"></a>00189       <span class="keywordflow">break</span>;<a name="l00190"></a>00190     <span class="keywordflow">default</span>:<a name="l00191"></a>00191       <span class="keywordflow">return</span> <a class="code" href="usart__example_8c.html#6d58f9ac447476b4e084d7ca383f5183">FAILURE</a>;<a name="l00192"></a>00192     }<a name="l00193"></a>00193 <a name="l00194"></a>00194     ++piomap;<a name="l00195"></a>00195 <a name="l00196"></a>00196   }<a name="l00197"></a>00197   <a name="l00198"></a>00198   <span class="keywordflow">return</span> <a class="code" href="usart__example_8c.html#a90cac659d18e8ef6294c7ae337f6b58">SUCCESS</a>;<a name="l00199"></a>00199 }</pre></div><p></div></div><p><a class="anchor" name="2929a2158663c710a90f2d760007397a"></a><!-- doxytag: member="usart_example.c::print" ref="2929a2158663c710a90f2d760007397a" args="(volatile struct avr32_usart_t *usart, char *str)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">void print           </td>          <td>(</td>          <td class="paramtype">volatile struct avr32_usart_t *&nbsp;</td>          <td class="paramname"> <em>usart</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">char *&nbsp;</td>          <td class="paramname"> <em>str</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>Print a string of characters to an usart. <p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>*usart</em>&nbsp;</td><td>The usart to write to </td></tr>    <tr><td valign="top"></td><td valign="top"><em>*str</em>&nbsp;</td><td>The string of characters</td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>; </dd></dl><p>Definition at line <a class="el" href="usart__example_8c-source.html#l00134">134</a> of file <a class="el" href="usart__example_8c-source.html">usart_example.c</a>.<p>References <a class="el" href="usart_8c-source.html#l00538">usart_putchar()</a>.<p>Referenced by <a class="el" href="usart__example_8c-source.html#l00096">main()</a>.<div class="fragment"><pre class="fragment"><a name="l00135"></a>00135 {<a name="l00136"></a>00136         <span class="keywordflow">while</span> (*str != <span class="charliteral">'\0'</span>)<a name="l00137"></a>00137                 <a class="code" href="usart_8c.html#908695fc913f77a6c1ab2a89e201a1fd">usart_putchar</a>(usart, *str++);<a name="l00138"></a>00138 }</pre></div><p><p>Here is the call graph for this function:<p><center><img src="usart__example_8c_2929a2158663c710a90f2d760007397a_cgraph.png" border="0" usemap="#usart__example_8c_2929a2158663c710a90f2d760007397a_cgraph_map" alt=""></center><map name="usart__example_8c_2929a2158663c710a90f2d760007397a_cgraph_map"><area href="usart_8c.html#908695fc913f77a6c1ab2a89e201a1fd" shape="rect" coords="108,6,223,30" alt=""><area href="usart_8c.html#26a849327e3bccdef17734f30667d9bd" shape="rect" coords="272,6,406,30" alt=""></map></div></div><p><hr size="1"><address style="align: right;"><small>Generated on Thu May 10 14:17:57 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 + -