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

📄 usart_8h-source.html

📁 avr32100.zip Embedded demo
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>AVR321000 Communication with the AVR32 USART: usart.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.1 --><div class="tabs">  <ul>    <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>    <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>    <li id="current"><a href="files.html"><span>Files</span></a></li>    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>  </ul></div><div class="tabs">  <ul>    <li><a href="files.html"><span>File&nbsp;List</span></a></li>    <li><a href="globals.html"><span>Globals</span></a></li>  </ul></div><h1>usart.h</h1><a href="usart_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*This file has been prepared for Doxygen automatic documentation generation.*/</span><a name="l00022"></a>00022 <span class="comment">/* *****************************************************************************</span><a name="l00023"></a>00023 <span class="comment">Copyright (c) 2006, Atmel Corporation All rights reserved.</span><a name="l00024"></a>00024 <span class="comment"></span><a name="l00025"></a>00025 <span class="comment">Redistribution and use in source and binary forms, with or without</span><a name="l00026"></a>00026 <span class="comment">modification, are permitted provided that the following conditions are met:</span><a name="l00027"></a>00027 <span class="comment"></span><a name="l00028"></a>00028 <span class="comment">1. Redistributions of source code must retain the above copyright notice,</span><a name="l00029"></a>00029 <span class="comment">this list of conditions and the</span><a name="l00030"></a>00030 <span class="comment">following disclaimer.</span><a name="l00031"></a>00031 <span class="comment"></span><a name="l00032"></a>00032 <span class="comment">2. Redistributions in binary form must reproduce the above copyright notice,</span><a name="l00033"></a>00033 <span class="comment">this list of conditions and the following disclaimer in the documentation</span><a name="l00034"></a>00034 <span class="comment">and/or other materials provided with the distribution.</span><a name="l00035"></a>00035 <span class="comment"></span><a name="l00036"></a>00036 <span class="comment">3. The name of ATMEL may not be used to endorse or promote products</span><a name="l00037"></a>00037 <span class="comment">derived from this software without specific prior written permission.</span><a name="l00038"></a>00038 <span class="comment"></span><a name="l00039"></a>00039 <span class="comment">THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS</span><a name="l00040"></a>00040 <span class="comment">OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span><a name="l00041"></a>00041 <span class="comment">IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A</span><a name="l00042"></a>00042 <span class="comment">PARTICULAR PURPOSE ARE EXPRESSLY AND SPECIFICALLY</span><a name="l00043"></a>00043 <span class="comment">DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,</span><a name="l00044"></a>00044 <span class="comment">INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL</span><a name="l00045"></a>00045 <span class="comment">DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span><a name="l00046"></a>00046 <span class="comment">SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;</span><a name="l00047"></a>00047 <span class="comment">OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY</span><a name="l00048"></a>00048 <span class="comment">THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,</span><a name="l00049"></a>00049 <span class="comment">OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY</span><a name="l00050"></a>00050 <span class="comment">WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span><a name="l00051"></a>00051 <span class="comment"></span><a name="l00052"></a>00052 <span class="comment">POSSIBILITY OF SUCH DAMAGE.</span><a name="l00053"></a>00053 <span class="comment"></span><a name="l00054"></a>00054 <span class="comment">************************************************************************ */</span><a name="l00055"></a>00055 <a name="l00056"></a>00056 <a name="l00057"></a>00057 <span class="preprocessor">#ifndef _USART_H_</span><a name="l00058"></a>00058 <span class="preprocessor"></span><span class="preprocessor">#define _USART_H_</span><a name="l00059"></a>00059 <span class="preprocessor"></span><a name="l00060"></a>00060 <span class="preprocessor">#ifdef __GNUC__</span><a name="l00061"></a>00061 <span class="preprocessor"></span><span class="preprocessor">        #include &lt;avr32/io.h&gt;</span><a name="l00062"></a>00062 <span class="preprocessor">#elif __ICCAVR32__</span><a name="l00063"></a>00063 <span class="preprocessor"></span><span class="preprocessor">        #include &lt;avr32/ioap7000.h&gt;</span><a name="l00064"></a>00064 <span class="preprocessor">#else</span><a name="l00065"></a>00065 <span class="preprocessor"></span><span class="preprocessor">        #error No known compiler used</span><a name="l00066"></a>00066 <span class="preprocessor"></span><span class="preprocessor">#endif</span><a name="l00067"></a>00067 <span class="preprocessor"></span><a name="l00068"></a>00068 <a name="l00072"></a><a class="code" href="structusart__options__t.html">00072</a> <span class="keyword">struct </span><a class="code" href="structusart__options__t.html">usart_options_t</a><a name="l00073"></a>00073 {<a name="l00077"></a><a class="code" href="structusart__options__t.html#276ad428776a25b8247762bd2c82b35b">00077</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="structusart__options__t.html#276ad428776a25b8247762bd2c82b35b">baudrate</a>;<a name="l00078"></a>00078 <a name="l00082"></a><a class="code" href="structusart__options__t.html#a6b77cc05829d2e70ee7f96194c6ce23">00082</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="structusart__options__t.html#a6b77cc05829d2e70ee7f96194c6ce23">charlength</a>;<a name="l00083"></a>00083 <a name="l00089"></a><a class="code" href="structusart__options__t.html#85401f7a6f516a5883adc0538dc27f8e">00089</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="structusart__options__t.html#85401f7a6f516a5883adc0538dc27f8e">paritytype</a>;<a name="l00090"></a>00090 <a name="l00097"></a><a class="code" href="structusart__options__t.html#433a6ede2186d42b4cf19ef4b370cd61">00097</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <a class="code" href="structusart__options__t.html#433a6ede2186d42b4cf19ef4b370cd61">stopbits</a>;<a name="l00098"></a>00098 <a name="l00104"></a><a class="code" href="structusart__options__t.html#0dc365b8779891743180e9b69116f5ea">00104</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="structusart__options__t.html#0dc365b8779891743180e9b69116f5ea">channelmode</a>;<a name="l00105"></a>00105 };<a name="l00106"></a>00106 <a name="l00107"></a>00107 <a name="l00108"></a><a class="code" href="structiso7816__options__t.html">00108</a> <span class="keyword">struct </span><a class="code" href="structiso7816__options__t.html">iso7816_options_t</a><a name="l00109"></a>00109 {<a name="l00110"></a>00110         <span class="comment">/*</span><a name="l00111"></a>00111 <span class="comment">         * Set the frequency of the ISO7816 clock</span><a name="l00112"></a>00112 <span class="comment">         */</span><a name="l00113"></a><a class="code" href="structiso7816__options__t.html#6670bdcae159decd3ff5c00f6f3f4fcc">00113</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="structiso7816__options__t.html#6670bdcae159decd3ff5c00f6f3f4fcc">iso7816_hz</a>;<a name="l00114"></a>00114 <a name="l00115"></a>00115         <span class="comment">/*</span><a name="l00116"></a>00116 <span class="comment">         * The number of ISO7816 clock tick in every bit period (1-2047, 0=disable clock)</span><a name="l00117"></a>00117 <span class="comment">         * Bit rate = iso7816_hz / fidi_ratio</span><a name="l00118"></a>00118 <span class="comment">         */</span><a name="l00119"></a><a class="code" href="structiso7816__options__t.html#bf0d2900a6f8f97c0163176f2600551c">00119</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <a class="code" href="structiso7816__options__t.html#bf0d2900a6f8f97c0163176f2600551c">fidi_ratio</a>;<a name="l00120"></a>00120 <a name="l00121"></a>00121         <span class="comment">/*</span><a name="l00122"></a>00122 <span class="comment">         * Inhibit Non Acknowledge</span><a name="l00123"></a>00123 <span class="comment">         * - 0 - The NACK is generated</span><a name="l00124"></a>00124 <span class="comment">         * - 1 - The NACK is not generated</span><a name="l00125"></a>00125 <span class="comment">         * .</span><a name="l00126"></a>00126 <span class="comment">         * Note: This bit will be used only in ISO7816 mode, protocol T = 0 receiver</span><a name="l00127"></a>00127 <span class="comment">         */</span><a name="l00128"></a><a class="code" href="structiso7816__options__t.html#128f4d404bb0369177a591eb8a0a9269">00128</a>         <span class="keywordtype">int</span> <a class="code" href="structiso7816__options__t.html#128f4d404bb0369177a591eb8a0a9269">inhibit_nack</a>;<a name="l00129"></a>00129 <a name="l00130"></a>00130         <span class="comment">/*</span><a name="l00131"></a>00131 <span class="comment">         * Disable Successive NACK \n\n</span><a name="l00132"></a>00132 <span class="comment">         * Successive parity errors are counted up to the value in the max_iterations field. \n</span><a name="l00133"></a>00133 <span class="comment">         * These parity errors generate a NACK on the ISO line. As soon as this value is reached, \n</span><a name="l00134"></a>00134 <span class="comment">         * no addititional NACK is sent on the ISO line. The flag ITERATION is asserted. \n</span><a name="l00135"></a>00135 <span class="comment">         */</span><a name="l00136"></a><a class="code" href="structiso7816__options__t.html#b8d335e18629f4fcf625e1a7e23e35be">00136</a>         <span class="keywordtype">int</span> <a class="code" href="structiso7816__options__t.html#b8d335e18629f4fcf625e1a7e23e35be">dis_suc_nack</a>;<a name="l00137"></a>00137 <a name="l00138"></a>00138         <span class="comment">/*</span><a name="l00139"></a>00139 <span class="comment">         * Max number of repetitions (0 - 7)</span><a name="l00140"></a>00140 <span class="comment">         */</span><a name="l00141"></a><a class="code" href="structiso7816__options__t.html#4c74df529ed76d2962f54cd1f0f5027f">00141</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="structiso7816__options__t.html#4c74df529ed76d2962f54cd1f0f5027f">max_iterations</a>;<a name="l00142"></a>00142 <a name="l00143"></a>00143         <span class="comment">/*</span><a name="l00144"></a>00144 <span class="comment">         * Bitorder in transmitted characters</span><a name="l00145"></a>00145 <span class="comment">         * - 0 - LSB first</span><a name="l00146"></a>00146 <span class="comment">         * - 1 - MSB first</span><a name="l00147"></a>00147 <span class="comment">         */</span><a name="l00148"></a><a class="code" href="structiso7816__options__t.html#96af893cd6275fd35a063a235f489a82">00148</a>         <span class="keywordtype">int</span> <a class="code" href="structiso7816__options__t.html#96af893cd6275fd35a063a235f489a82">bit_order</a>;<a name="l00149"></a>00149 };<a name="l00150"></a>00150 <a name="l00151"></a>00151  <span class="comment">/*---------------------------------------------------------------------------+</span>

⌨️ 快捷键说明

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