?lang_form? ?lang_select? ?lang_submit? ?lang_endform?
{HEADER END}
{BLAME START}

library

?curdirlinks? -

Blame information for rev 6

Line No. Rev Author Line
1 6 kaklik <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3 <title>Procyon AVRlib: uartsw2.h Source File</title>
4 <link href="dox.css" rel="stylesheet" type="text/css">
5 </head><body>
6 <!-- Generated by Doxygen 1.4.2 -->
7 <div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
8 <h1>uartsw2.h</h1><a href="uartsw2_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/*! \file uartsw2.h \brief Software Interrupt-driven UART Driver. */</span>
9 00002 <span class="comment">//*****************************************************************************</span>
10 00003 <span class="comment">//</span>
11 00004 <span class="comment">// File Name : 'uartsw2.h'</span>
12 00005 <span class="comment">// Title : Software Interrupt-driven UART Driver</span>
13 00006 <span class="comment">// Author : Pascal Stang - Copyright (C) 2002-2003</span>
14 00007 <span class="comment">// Created : 7/20/2002</span>
15 00008 <span class="comment">// Revised : 4/27/2004</span>
16 00009 <span class="comment">// Version : 0.6</span>
17 00010 <span class="comment">// Target MCU : Atmel AVR Series (intended for the ATmega16 and ATmega32)</span>
18 00011 <span class="comment">// Editor Tabs : 4</span>
19 00012 <span class="comment">//</span><span class="comment"></span>
20 00013 <span class="comment">/// \ingroup driver_sw</span>
21 00014 <span class="comment">/// \defgroup uartsw2 Software Interrupt-driven UART Driver (uartsw2.c)</span>
22 00015 <span class="comment">/// \code #include "uartsw2.h" \endcode</span>
23 00016 <span class="comment">/// \par Overview</span>
24 00017 <span class="comment">/// This uart library emulates the operation of a UART (serial port) using</span>
25 00018 <span class="comment">/// the AVR's hardware timers, I/O pins, and some software.</span>
26 00019 <span class="comment">///</span>
27 00020 <span class="comment">/// Specifically, this code uses:</span>
28 00021 <span class="comment">/// -Timer 2 Output Capture for transmit timing</span>
29 00022 <span class="comment">/// -Timer 0 Output Capture for receive timing</span>
30 00023 <span class="comment">/// -External Interrupt 2 for receive triggering</span>
31 00024 <span class="comment">///</span>
32 00025 <span class="comment">/// The above resources cannot be used for other purposes while this software</span>
33 00026 <span class="comment">/// UART is enabled. The overflow interrupts from Timer0 and Timer2 can still</span>
34 00027 <span class="comment">/// be used for other timing, but the prescalers for these timers must not be</span>
35 00028 <span class="comment">/// changed.</span>
36 00029 <span class="comment">///</span>
37 00030 <span class="comment">/// Serial output from this UART can be routed to any I/O pin. Serial input</span>
38 00031 <span class="comment">/// for this UART must come from the External Interrupt 2 (INT2) I/O pin.</span>
39 00032 <span class="comment">/// These options should be configured by editing your local copy of</span>
40 00033 <span class="comment">/// "uartsw2conf.h".</span>
41 00034 <span class="comment"></span><span class="comment">//</span>
42 00035 <span class="comment">// This code is distributed under the GNU Public License</span>
43 00036 <span class="comment">// which can be found at http://www.gnu.org/licenses/gpl.txt</span>
44 00037 <span class="comment">//</span>
45 00038 <span class="comment">//*****************************************************************************</span>
46 00039
47 00040 <span class="preprocessor">#ifndef UARTSW2_H</span>
48 00041 <span class="preprocessor"></span><span class="preprocessor">#define UARTSW2_H</span>
49 00042 <span class="preprocessor"></span>
50 00043 <span class="preprocessor">#include "<a class="code" href="global_8h.html">global.h</a>"</span>
51 00044 <span class="preprocessor">#include "<a class="code" href="buffer_8h.html">buffer.h</a>"</span>
52 00045
53 00046 <span class="comment">// include configuration</span>
54 00047 <span class="preprocessor">#include "<a class="code" href="uartsw2conf_8h.html">uartsw2conf.h</a>"</span>
55 00048
56 00049 <span class="comment">// constants/macros/typdefs</span>
57 00050
58 00051 <span class="comment">// functions</span>
59 00052 <span class="comment"></span>
60 00053 <span class="comment">//! enable and initialize the software uart</span>
61 00054 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="uartsw_8c.html#a9">uartswInit</a>(<span class="keywordtype">void</span>);<span class="comment"></span>
62 00055 <span class="comment">//! create and initialize the uart buffers</span>
63 00056 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="uartsw_8c.html#a10">uartswInitBuffers</a>(<span class="keywordtype">void</span>);<span class="comment"></span>
64 00057 <span class="comment">//! turns off software UART</span>
65 00058 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="uartsw_8c.html#a11">uartswOff</a>(<span class="keywordtype">void</span>);<span class="comment"></span>
66 00059 <span class="comment">//! returns the receive buffer structure </span>
67 00060 <span class="comment"></span><a class="code" href="structstruct__cBuffer.html">cBuffer</a>* <a class="code" href="uartsw_8c.html#a13">uartswGetRxBuffer</a>(<span class="keywordtype">void</span>);<span class="comment"></span>
68 00061 <span class="comment">//! sets the uart baud rate</span>
69 00062 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="uartsw_8c.html#a12">uartswSetBaudRate</a>(u32 baudrate);<span class="comment"></span>
70 00063 <span class="comment">//! sends a single byte over the uart</span>
71 00064 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="uartsw_8c.html#a14">uartswSendByte</a>(u08 data);
72 00065 <span class="comment"></span>
73 00066 <span class="comment">//! gets a single byte from the uart receive buffer</span>
74 00067 <span class="comment"></span><span class="comment">// Function returns TRUE if data was available, FALSE if not.</span>
75 00068 <span class="comment">// Actual data is returned in variable pointed to by "data".</span>
76 00069 <span class="comment">// example usage:</span>
77 00070 <span class="comment">// char myReceivedByte;</span>
78 00071 <span class="comment">// uartswReceiveByte( &amp;myReceivedByte );</span>
79 00072 u08 <a class="code" href="uartsw_8c.html#a15">uartswReceiveByte</a>(u08* rxData);
80 00073 <span class="comment"></span>
81 00074 <span class="comment">//! internal transmit bit handler</span>
82 00075 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="uartsw_8c.html#a16">uartswTxBitService</a>(<span class="keywordtype">void</span>);<span class="comment"></span>
83 00076 <span class="comment">//! internal receive bit handler</span>
84 00077 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="uartsw_8c.html#a17">uartswRxBitService</a>(<span class="keywordtype">void</span>);
85 00078
86 00079 <span class="preprocessor">#endif</span>
87 </pre></div><hr size="1"><address style="align: right;"><small>Generated on Sun Oct 29 03:41:08 2006 for Procyon AVRlib by&nbsp;
88 <a href="http://www.doxygen.org/index.html">
89 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.2 </small></address>
90 </body>
91 </html>
{BLAME END}
{FOOTER START}

Powered by WebSVN v2.8.3