?lang_form?
?lang_select?
?lang_submit?
?lang_endform?
{HEADER END}
{FILE START}
library
?curdirlinks? - Rev 6
?prevdifflink? - Blame - ?getfile?
<!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>Procyon AVRlib: uartsw.h Source File</title>
<link href="dox.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.2 -->
<div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div>
<h1>uartsw.h</h1><a href="uartsw_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/*! \file uartsw.h \brief Software Interrupt-driven UART Driver. */</span>
00002 <span class="comment">//*****************************************************************************</span>
00003 <span class="comment">//</span>
00004 <span class="comment">// File Name : 'uartsw.h'</span>
00005 <span class="comment">// Title : Software Interrupt-driven UART Driver</span>
00006 <span class="comment">// Author : Pascal Stang - Copyright (C) 2002-2004</span>
00007 <span class="comment">// Created : 7/20/2002</span>
00008 <span class="comment">// Revised : 4/27/2004</span>
00009 <span class="comment">// Version : 0.1</span>
00010 <span class="comment">// Target MCU : Atmel AVR Series (intended for the ATmega16 and ATmega32)</span>
00011 <span class="comment">// Editor Tabs : 4</span>
00012 <span class="comment">//</span><span class="comment"></span>
00013 <span class="comment">/// \ingroup driver_sw</span>
00014 <span class="comment">/// \defgroup uartsw Software Interrupt-driven UART Driver (uartsw.c)</span>
00015 <span class="comment">/// \code #include "uartsw.h" \endcode</span>
00016 <span class="comment">/// \par Overview</span>
00017 <span class="comment">/// This uart library emulates the operation of a UART (serial port) using</span>
00018 <span class="comment">/// the AVR's hardware timers, I/O pins, and some software.</span>
00019 <span class="comment">///</span>
00020 <span class="comment">/// Specifically, this code uses:</span>
00021 <span class="comment">/// -Timer 1 Output Compare A for transmit timing</span>
00022 <span class="comment">/// -Timer 1 Output Compare B for receive timing</span>
00023 <span class="comment">/// -Timer 1 Input Capture for receive triggering</span>
00024 <span class="comment">///</span>
00025 <span class="comment">/// The above resources cannot be used for other purposes while this software</span>
00026 <span class="comment">/// UART is enabled. The overflow interrupt from Timer1 can still be used for</span>
00027 <span class="comment">/// other timing, but the prescaler for Timer1 must not be changed.</span>
00028 <span class="comment">///</span>
00029 <span class="comment">/// Serial output from this UART can be routed to any I/O pin. Serial input</span>
00030 <span class="comment">/// for this UART must come from the Timer1 Input Capture (IC1) I/O pin.</span>
00031 <span class="comment">/// These options should be configured by editing your local copy of</span>
00032 <span class="comment">/// "uartswconf.h".</span>
00033 <span class="comment"></span><span class="comment">//</span>
00034 <span class="comment">// This code is distributed under the GNU Public License</span>
00035 <span class="comment">// which can be found at http://www.gnu.org/licenses/gpl.txt</span>
00036 <span class="comment">//</span>
00037 <span class="comment">//*****************************************************************************</span>
00038
00039 <span class="preprocessor">#ifndef UARTSW_H</span>
00040 <span class="preprocessor"></span><span class="preprocessor">#define UARTSW_H</span>
00041 <span class="preprocessor"></span>
00042 <span class="preprocessor">#include "<a class="code" href="global_8h.html">global.h</a>"</span>
00043 <span class="preprocessor">#include "<a class="code" href="buffer_8h.html">buffer.h</a>"</span>
00044
00045 <span class="comment">// include configuration</span>
00046 <span class="preprocessor">#include "<a class="code" href="uartswconf_8h.html">uartswconf.h</a>"</span>
00047
00048 <span class="comment">// constants/macros/typdefs</span>
00049
00050 <span class="comment">// functions</span>
00051 <span class="comment"></span>
00052 <span class="comment">//! enable and initialize the software uart</span>
00053 <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>
00054 <span class="comment">//! create and initialize the uart buffers</span>
00055 <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>
00056 <span class="comment">//! turns off software UART</span>
00057 <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>
00058 <span class="comment">//! returns the receive buffer structure </span>
00059 <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>
00060 <span class="comment">//! sets the uart baud rate</span>
00061 <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>
00062 <span class="comment">//! sends a single byte over the uart</span>
00063 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="uartsw_8c.html#a14">uartswSendByte</a>(u08 data);
00064 <span class="comment"></span>
00065 <span class="comment">//! gets a single byte from the uart receive buffer</span>
00066 <span class="comment"></span><span class="comment">// Function returns TRUE if data was available, FALSE if not.</span>
00067 <span class="comment">// Actual data is returned in variable pointed to by "data".</span>
00068 <span class="comment">// example usage:</span>
00069 <span class="comment">// char myReceivedByte;</span>
00070 <span class="comment">// uartswReceiveByte( &myReceivedByte );</span>
00071 u08 <a class="code" href="uartsw_8c.html#a15">uartswReceiveByte</a>(u08* rxData);
00072 <span class="comment"></span>
00073 <span class="comment">//! internal transmit bit handler</span>
00074 <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>
00075 <span class="comment">//! internal receive bit handler</span>
00076 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="uartsw_8c.html#a17">uartswRxBitService</a>(<span class="keywordtype">void</span>);
00077
00078 <span class="preprocessor">#endif</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Sun Oct 29 03:41:08 2006 for Procyon AVRlib by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.2 </small></address>
</body>
</html>
|
{FILE END}
{FOOTER START}
Powered by WebSVN v2.8.3