<!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: UART Driver/Function Library for dual-UART processors (uart2.c)</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>UART Driver/Function Library for dual-UART processors (uart2.c)<br>
<small>
[<a class="el" href="group__driver__avr.html">Drivers (for AVR peripherals)</a>]</small>
</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include "<a class="code" href="uart2_8h.html">uart2.h</a>"</span>
</pre></div> <dl compact><dt><b>Overview</b></dt><dd>This is a UART driver for AVR-series processors with two hardware UARTs such as the mega161 and mega128. This library provides both buffered and unbuffered transmit and receive functions for the AVR processor UART. Buffered access means that the UART can transmit and receive data in the "background", while your code continues executing. Also included are functions to initialize the UARTs, set the baud rate, flush the buffers, and check buffer status.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>For full text output functionality, you may wish to use the rprintf functions along with this driver.</dd></dl>
<dl compact><dt><b>About UART operations</b></dt><dd>Most Atmel AVR-series processors contain one or more hardware UARTs (aka, serial ports). UART serial ports can communicate with other serial ports of the same type, like those used on PCs. In general, UARTs are used to communicate with devices that are RS-232 compatible (RS-232 is a certain kind of serial port). </dd></dl>
<dl compact><dt><b></b></dt><dd>By far, the most common use for serial communications on AVR processors is for sending information and data to a PC running a terminal program. Here is an exmaple: <div class="fragment"><pre class="fragment"> <a class="code" href="group__uart.html#ga0">uartInit</a>(); <span class="comment">// initialize UARTs (serial ports)</span>
<a class="code" href="group__uart.html#ga3">uartSetBaudRate</a>(0, 9600); <span class="comment">// set UART0 speed to 9600 baud</span>
<a class="code" href="group__uart.html#ga3">uartSetBaudRate</a>(1, 115200); <span class="comment">// set UART1 speed to 115200 baud</span>
<a class="code" href="group__rprintf.html#ga0">rprintfInit</a>(<a class="code" href="group__uart2.html#ga10">uart0SendByte</a>); <span class="comment">// configure rprintf to use UART0 for output</span>
rprintf(<span class="stringliteral">"Hello UART0\r\n"</span>); <span class="comment">// send "hello world" message via UART0</span>
<a class="code" href="group__rprintf.html#ga0">rprintfInit</a>(uart1SendByte); <span class="comment">// configure rprintf to use UART1 for output</span>
rprintf(<span class="stringliteral">"Hello UART1\r\n"</span>); <span class="comment">// send "hello world" message via UART1</span>
</pre></div></dd></dl>
<dl compact><dt><b>Warning:</b></dt><dd>The CPU frequency (F_CPU) must be set correctly in <code><a class="el" href="global_8h.html">global.h</a></code> for the UART library to calculate correct baud rates. Furthermore, certain CPU frequencies will not produce exact baud rates due to integer frequency division round-off. See your AVR processor's datasheet for full details. </dd></dl>
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga24">UART0_DEFAULT_BAUD_RATE</a> 9600</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">default baud rate for UART0 <a href="#ga24"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga25" doxytag="uart2::UART1_DEFAULT_BAUD_RATE"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga25">UART1_DEFAULT_BAUD_RATE</a> 9600</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">default baud rate for UART1 <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga26" doxytag="uart2::UART0_TX_BUFFER_SIZE"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga26">UART0_TX_BUFFER_SIZE</a> 0x0010</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">number of bytes for uart0 transmit buffer <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga27" doxytag="uart2::UART0_RX_BUFFER_SIZE"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga27">UART0_RX_BUFFER_SIZE</a> 0x0080</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">number of bytes for uart0 receive buffer <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga28" doxytag="uart2::UART1_TX_BUFFER_SIZE"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga28">UART1_TX_BUFFER_SIZE</a> 0x0010</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">number of bytes for uart1 transmit buffer <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga29" doxytag="uart2::UART1_RX_BUFFER_SIZE"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga29">UART1_RX_BUFFER_SIZE</a> 0x0080</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">number of bytes for uart1 receive buffer <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga30">UART_INTERRUPT_HANDLER</a> SIGNAL</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga31" doxytag="uart2::RXCIE"></a>
#define </td><td class="memItemRight" valign="bottom"><b>RXCIE</b> RXCIE0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga32" doxytag="uart2::TXCIE"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TXCIE</b> TXCIE0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga33" doxytag="uart2::UDRIE"></a>
#define </td><td class="memItemRight" valign="bottom"><b>UDRIE</b> UDRIE0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga34" doxytag="uart2::RXEN"></a>
#define </td><td class="memItemRight" valign="bottom"><b>RXEN</b> RXEN0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga35" doxytag="uart2::TXEN"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TXEN</b> TXEN0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga36" doxytag="uart2::CHR9"></a>
#define </td><td class="memItemRight" valign="bottom"><b>CHR9</b> CHR90</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga37" doxytag="uart2::RXB8"></a>
#define </td><td class="memItemRight" valign="bottom"><b>RXB8</b> RXB80</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga38" doxytag="uart2::TXB8"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TXB8</b> TXB80</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga39" doxytag="uart2::UBRR0L"></a>
#define </td><td class="memItemRight" valign="bottom"><b>UBRR0L</b> UBRR0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga40" doxytag="uart2::UBRR1L"></a>
#define </td><td class="memItemRight" valign="bottom"><b>UBRR1L</b> UBRR1</td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga0">uartInit</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga1" doxytag="uart2::uart0Init"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga1">uart0Init</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initializes UART0 only. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga2" doxytag="uart2::uart1Init"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga2">uart1Init</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initializes UART1 only. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga3">uart0InitBuffers</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga4" doxytag="uart2::uart1InitBuffers"></a>
void </td><td class="memItemRight" valign="bottom"><b>uart1InitBuffers</b> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga5">uartSetRxHandler</a> (u08 nUart, void(*rx_func)(unsigned char c))</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga6">uartSetBaudRate</a> (u08 nUart, u32 baudrate)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structstruct__cBuffer.html">cBuffer</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga7">uartGetRxBuffer</a> (u08 nUart)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structstruct__cBuffer.html">cBuffer</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga8">uartGetTxBuffer</a> (u08 nUart)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga9">uartSendByte</a> (u08 nUart, u08 data)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga10">uart0SendByte</a> (u08 data)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga11" doxytag="uart2::uart1SendByte"></a>
void </td><td class="memItemRight" valign="bottom"><b>uart1SendByte</b> (u08 data)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga12">uart0GetByte</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga13" doxytag="uart2::uart1GetByte"></a>
int </td><td class="memItemRight" valign="bottom"><b>uart1GetByte</b> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">u08 </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga14">uartReceiveByte</a> (u08 nUart, u08 *data)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">u08 </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga15">uartReceiveBufferIsEmpty</a> (u08 nUart)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga16">uartFlushReceiveBuffer</a> (u08 nUart)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga17">uartAddToTxBuffer</a> (u08 nUart, u08 data)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga18">uart0AddToTxBuffer</a> (u08 data)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga19" doxytag="uart2::uart1AddToTxBuffer"></a>
void </td><td class="memItemRight" valign="bottom"><b>uart1AddToTxBuffer</b> (u08 data)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga20">uartSendTxBuffer</a> (u08 nUart)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">u08 </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga21">uartSendBuffer</a> (u08 nUart, char *buffer, u16 nBytes)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga22" doxytag="uart2::uartTransmitService"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart2.html#ga22">uartTransmitService</a> (u08 nUart)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">interrupt service handlers <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga23" doxytag="uart2::uartReceiveService"></a>
void </td><td class="memItemRight" valign="bottom"><b>uartReceiveService</b> (u08 nUart)</td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="ga24" doxytag="uart2.h::UART0_DEFAULT_BAUD_RATE"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define UART0_DEFAULT_BAUD_RATE 9600 </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Default uart baud rate. This is the default speed after a <a class="el" href="group__uart.html#ga0">uartInit()</a> command, and can be changed by using <a class="el" href="group__uart.html#ga3">uartSetBaudRate()</a>.
<p>
Definition at line <a class="el" href="uart2_8h-source.html#l00071">71</a> of file <a class="el" href="uart2_8h-source.html">uart2.h</a>. </td>
</tr>
</table>
<a class="anchor" name="ga30" doxytag="uart2.h::UART_INTERRUPT_HANDLER"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define UART_INTERRUPT_HANDLER SIGNAL </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Type of interrupt handler to use for uart interrupts. Value may be SIGNAL or INTERRUPT. <dl compact><dt><b>Warning:</b></dt><dd>Do not change unless you know what you're doing. </dd></dl>
<p>
Definition at line <a class="el" href="uart2_8h-source.html#l00105">105</a> of file <a class="el" href="uart2_8h-source.html">uart2.h</a>. </td>
</tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ga18" doxytag="uart2.h::uart0AddToTxBuffer"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void uart0AddToTxBuffer </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">u08 </td>
<td class="mdname1" valign="top" nowrap> <em>data</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
AddToTxBuffer commands with the UART number hardcoded Use this with printfInit() - example: <code>printfInit(uart0AddToTxBuffer)</code>;
<p>
Definition at line <a class="el" href="uart2_8c-source.html#l00248">248</a> of file <a class="el" href="uart2_8c-source.html">uart2.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga12" doxytag="uart2.h::uart0GetByte"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int uart0GetByte </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Gets a single byte from the uart receive buffer. Returns the byte, or -1 if no byte is available (getchar-style).
<p>
Definition at line <a class="el" href="uart2_8c-source.html#l00191">191</a> of file <a class="el" href="uart2_8c-source.html">uart2.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga3" doxytag="uart2.h::uart0InitBuffers"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void uart0InitBuffers </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Initializes transmit and receive buffers. Automatically called from <a class="el" href="group__uart.html#ga0">uartInit()</a>
<p>
Definition at line <a class="el" href="uart2_8c-source.html#l00092">92</a> of file <a class="el" href="uart2_8c-source.html">uart2.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga10" doxytag="uart2.h::uart0SendByte"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void uart0SendByte </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">u08 </td>
<td class="mdname1" valign="top" nowrap> <em>data</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
SendByte commands with the UART number hardcoded Use these with printfInit() - example: <code>printfInit(uart0SendByte)</code>;
<p>
Definition at line <a class="el" href="uart2_8c-source.html#l00179">179</a> of file <a class="el" href="uart2_8c-source.html">uart2.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga17" doxytag="uart2.h::uartAddToTxBuffer"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void uartAddToTxBuffer </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">u08 </td>
<td class="mdname" nowrap> <em>nUart</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>u08 </td>
<td class="mdname" nowrap> <em>data</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Add byte to end of uart Tx buffer.
<p>
Definition at line <a class="el" href="uart2_8c-source.html#l00242">242</a> of file <a class="el" href="uart2_8c-source.html">uart2.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga16" doxytag="uart2.h::uartFlushReceiveBuffer"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void uartFlushReceiveBuffer </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">u08 </td>
<td class="mdname1" valign="top" nowrap> <em>nUart</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Flushes (deletes) all data from receive buffer.
<p>
Definition at line <a class="el" href="uart2_8c-source.html#l00231">231</a> of file <a class="el" href="uart2_8c-source.html">uart2.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga7" doxytag="uart2.h::uartGetRxBuffer"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="structstruct__cBuffer.html">cBuffer</a>* uartGetRxBuffer </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">u08 </td>
<td class="mdname1" valign="top" nowrap> <em>nUart</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Returns pointer to the receive buffer structure.
<p>
Definition at line <a class="el" href="uart2_8c-source.html#l00148">148</a> of file <a class="el" href="uart2_8c-source.html">uart2.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga8" doxytag="uart2.h::uartGetTxBuffer"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="structstruct__cBuffer.html">cBuffer</a>* uartGetTxBuffer </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">u08 </td>
<td class="mdname1" valign="top" nowrap> <em>nUart</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Returns pointer to the transmit buffer structure.
<p>
Definition at line <a class="el" href="uart2_8c-source.html#l00154">154</a> of file <a class="el" href="uart2_8c-source.html">uart2.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga0" doxytag="uart2.h::uartInit"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void uartInit </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Initializes uart. <dl compact><dt><b>Note:</b></dt><dd>After running this init function, the processor I/O pins that used for uart communications (RXD, TXD) are no long available for general purpose I/O. </dd></dl>
<p>
Definition at line <a class="el" href="uart_8c-source.html#l00044">44</a> of file <a class="el" href="uart_8c-source.html">uart.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga15" doxytag="uart2.h::uartReceiveBufferIsEmpty"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">u08 uartReceiveBufferIsEmpty </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">u08 </td>
<td class="mdname1" valign="top" nowrap> <em>nUart</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Returns TRUE/FALSE if receive buffer is empty/not-empty.
<p>
Definition at line <a class="el" href="uart2_8c-source.html#l00237">237</a> of file <a class="el" href="uart2_8c-source.html">uart2.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga14" doxytag="uart2.h::uartReceiveByte"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">u08 uartReceiveByte </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">u08 </td>
<td class="mdname" nowrap> <em>nUart</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>u08 * </td>
<td class="mdname" nowrap> <em>data</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Gets a single byte from the uart receive buffer. Function returns TRUE if data was available, FALSE if not. Actual data is returned in variable pointed to by "data". Example usage: <div class="fragment"><pre class="fragment"> <span class="keywordtype">char</span> myReceivedByte;
<a class="code" href="group__uart.html#ga8">uartReceiveByte</a>(0, &myReceivedByte );
</pre></div>
<p>
Definition at line <a class="el" href="uart2_8c-source.html#l00212">212</a> of file <a class="el" href="uart2_8c-source.html">uart2.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga21" doxytag="uart2.h::uartSendBuffer"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">u08 uartSendBuffer </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">u08 </td>
<td class="mdname" nowrap> <em>nUart</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>char * </td>
<td class="mdname" nowrap> <em>buffer</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>u16 </td>
<td class="mdname" nowrap> <em>nBytes</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
sends a buffer of length nBytes via the uart using interrupt control.
<p>
Definition at line <a class="el" href="uart2_8c-source.html#l00266">266</a> of file <a class="el" href="uart2_8c-source.html">uart2.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga9" doxytag="uart2.h::uartSendByte"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void uartSendByte </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">u08 </td>
<td class="mdname" nowrap> <em>nUart</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>u08 </td>
<td class="mdname" nowrap> <em>data</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Sends a single byte over the uart.
<p>
Definition at line <a class="el" href="uart2_8c-source.html#l00160">160</a> of file <a class="el" href="uart2_8c-source.html">uart2.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga20" doxytag="uart2.h::uartSendTxBuffer"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void uartSendTxBuffer </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">u08 </td>
<td class="mdname1" valign="top" nowrap> <em>nUart</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Begins transmission of the transmit buffer under interrupt control.
<p>
Definition at line <a class="el" href="uart2_8c-source.html#l00258">258</a> of file <a class="el" href="uart2_8c-source.html">uart2.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga6" doxytag="uart2.h::uartSetBaudRate"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void uartSetBaudRate </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">u08 </td>
<td class="mdname" nowrap> <em>nUart</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>u32 </td>
<td class="mdname" nowrap> <em>baudrate</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Sets the uart baud rate. Argument should be in bits-per-second, like <code>uartSetBaudRate(9600)</code>;
<p>
Definition at line <a class="el" href="uart2_8c-source.html#l00128">128</a> of file <a class="el" href="uart2_8c-source.html">uart2.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga5" doxytag="uart2.h::uartSetRxHandler"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void uartSetRxHandler </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">u08 </td>
<td class="mdname" nowrap> <em>nUart</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>void(*)(unsigned char c) </td>
<td class="mdname" nowrap> <em>rx_func</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Redirects received data to a user function.
<p>
Definition at line <a class="el" href="uart2_8c-source.html#l00118">118</a> of file <a class="el" href="uart2_8c-source.html">uart2.c</a>. </td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Sun Oct 29 03:41:09 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>
|