?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: printf() Function Library (rprintf.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&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>
<h1>printf() Function Library (rprintf.c)<br>
<small>
[<a class="el" href="group__general.html">General Libraries</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="rprintf_8h.html">rprintf.h</a>"</span> 
</pre></div> <dl compact><dt><b>Overview</b></dt><dd>The rprintf function library provides a simplified (reduced) version of the common C printf() function.  See the code files for details about which printf features are supported.  Also in this library are a variety of functions for fast printing of certain common data types (variable types).  Functions include print string from RAM, print string from ROM, print string snippet, print hex byte/short/long, and a custom-formatted number print, as well as an optional floating-point print routine.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>All output from the rprintf library can be directed to any device or software which accepts characters.  This means that rprintf output can be sent to the UART (serial port) or can be used with the LCD display libraries to print formatted text on the screen. </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"><a class="anchor" name="ga12" doxytag="rprintf::RPRINTF_SIMPLE"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>RPRINTF_SIMPLE</b></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga13" doxytag="rprintf::STRING_IN_RAM"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>STRING_IN_RAM</b>&nbsp;&nbsp;&nbsp;0</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga14" doxytag="rprintf::STRING_IN_ROM"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>STRING_IN_ROM</b>&nbsp;&nbsp;&nbsp;1</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__rprintf.html#ga15">rprintfProgStrM</a>(string)&nbsp;&nbsp;&nbsp;(rprintfProgStr(PSTR(string)))</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga16" doxytag="rprintf::rprintf1"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>rprintf1</b>(format, args...)&nbsp;&nbsp;&nbsp;rprintf1RamRom(STRING_IN_ROM, PSTR(format), ## args)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga17" doxytag="rprintf::rprintf1RAM"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>rprintf1RAM</b>(format, args...)&nbsp;&nbsp;&nbsp;rprintf1RamRom(STRING_IN_RAM, format, ## args)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga18" doxytag="rprintf::rprintf"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>rprintf</b>(format, args...)&nbsp;&nbsp;&nbsp;rprintf1RamRom(STRING_IN_ROM, PSTR(format), ## args)</td></tr>

<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__rprintf.html#ga0">rprintfInit</a> (void(*putchar_func)(unsigned char c))</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga1" doxytag="rprintf::rprintfChar"></a>
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__rprintf.html#ga1">rprintfChar</a> (unsigned char c)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">prints a single character to the current output device <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga2" doxytag="rprintf::rprintfStr"></a>
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__rprintf.html#ga2">rprintfStr</a> (char str[])</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">prints a null-terminated string stored in RAM <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__rprintf.html#ga3">rprintfStrLen</a> (char str[], unsigned int start, unsigned int len)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__rprintf.html#ga4">rprintfProgStr</a> (const prog_char str[])</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__rprintf.html#ga5">rprintfCRLF</a> (void)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga6" doxytag="rprintf::rprintfu04"></a>
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__rprintf.html#ga6">rprintfu04</a> (unsigned char data)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Print 4-bit hex number. Outputs a single hex character. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga7" doxytag="rprintf::rprintfu08"></a>
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__rprintf.html#ga7">rprintfu08</a> (unsigned char data)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Print 8-bit hex number. Outputs two hex characters. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga8" doxytag="rprintf::rprintfu16"></a>
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__rprintf.html#ga8">rprintfu16</a> (unsigned short data)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Print 16-bit hex number. Outputs four hex characters. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga9" doxytag="rprintf::rprintfu32"></a>
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__rprintf.html#ga9">rprintfu32</a> (unsigned long data)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Print 32-bit hex number. Outputs eight hex characters. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__rprintf.html#ga10">rprintfNum</a> (char base, char numDigits, char isSigned, char padchar, long n)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__rprintf.html#ga11">rprintf1RamRom</a> (unsigned char stringInRom, const char *format,...)</td></tr>

</table>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="ga15" doxytag="rprintf.h::rprintfProgStrM"></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 rprintfProgStrM          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">string&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>&nbsp;&nbsp;&nbsp;(rprintfProgStr(PSTR(string)))</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Using the function rprintfProgStrM(...) automatically causes your string to be stored in ROM, thereby not wasting precious RAM. Example usage: <div class="fragment"><pre class="fragment">    <a class="code" href="group__rprintf.html#ga15">rprintfProgStrM</a>(<span class="stringliteral">"Hello, this string is stored in program rom"</span>);
</pre></div> 
<p>
Definition at line <a class="el" href="rprintf_8h-source.html#l00093">93</a> of file <a class="el" href="rprintf_8h-source.html">rprintf.h</a>.    </td>
  </tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ga11" doxytag="rprintf.h::rprintf1RamRom"></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 rprintf1RamRom           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">unsigned char&nbsp;</td>
          <td class="mdname" nowrap> <em>stringInRom</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>format</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>&nbsp;</td>
          <td class="mdname" nowrap> <em>...</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
A simple printf routine. Called by rprintf() - does a simple printf (supports d, x, c). Supports:<ul>
<li>d - decimal</li><li>x - hex</li><li>c - character </li></ul>

<p>
Definition at line <a class="el" href="rprintf_8c-source.html#l00320">320</a> of file <a class="el" href="rprintf_8c-source.html">rprintf.c</a>.    </td>
  </tr>
</table>
<a class="anchor" name="ga5" doxytag="rprintf.h::rprintfCRLF"></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 rprintfCRLF           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Prints a carriage-return and line-feed. Useful when printing to serial ports/terminals. 
<p>
Definition at line <a class="el" href="rprintf_8c-source.html#l00134">134</a> of file <a class="el" href="rprintf_8c-source.html">rprintf.c</a>.    </td>
  </tr>
</table>
<a class="anchor" name="ga0" doxytag="rprintf.h::rprintfInit"></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 rprintfInit           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void(*)(unsigned char c)&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>putchar_func</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Initializes the rprintf library for an output stream. You must call this initializer once before using any other rprintf function. The argument must be a character stream output function.     </td>
  </tr>
</table>
<a class="anchor" name="ga10" doxytag="rprintf.h::rprintfNum"></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 rprintfNum           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">char&nbsp;</td>
          <td class="mdname" nowrap> <em>base</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>char&nbsp;</td>
          <td class="mdname" nowrap> <em>numDigits</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>char&nbsp;</td>
          <td class="mdname" nowrap> <em>isSigned</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>char&nbsp;</td>
          <td class="mdname" nowrap> <em>padchar</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>long&nbsp;</td>
          <td class="mdname" nowrap> <em>n</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
A flexible integer-number printing routine. Print the number "n" in the given "base", using exactly "numDigits". Print +/- if signed flag "isSigned" is TRUE. The character specified in "padchar" will be used to pad extra characters.<p>
Examples: <div class="fragment"><pre class="fragment">    uartPrintfNum(10, 6,  TRUE, <span class="charliteral">' '</span>,   1234);  --&gt;  <span class="stringliteral">" +1234"</span>
    uartPrintfNum(10, 6, FALSE, <span class="charliteral">'0'</span>,   1234);  --&gt;  <span class="stringliteral">"001234"</span>
    uartPrintfNum(16, 6, FALSE, <span class="charliteral">'.'</span>, 0x5AA5);  --&gt;  <span class="stringliteral">"..5AA5"</span>
</pre></div> 
<p>
Definition at line <a class="el" href="rprintf_8c-source.html#l00194">194</a> of file <a class="el" href="rprintf_8c-source.html">rprintf.c</a>.    </td>
  </tr>
</table>
<a class="anchor" name="ga4" doxytag="rprintf.h::rprintfProgStr"></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 rprintfProgStr           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const prog_char&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>str</em>[]          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
prints a string stored in program rom <dl compact><dt><b>Note:</b></dt><dd>This function does not actually store your string in program rom, but merely reads it assuming you stored it properly. </dd></dl>

<p>
Definition at line <a class="el" href="rprintf_8c-source.html#l00119">119</a> of file <a class="el" href="rprintf_8c-source.html">rprintf.c</a>.    </td>
  </tr>
</table>
<a class="anchor" name="ga3" doxytag="rprintf.h::rprintfStrLen"></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 rprintfStrLen           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">char&nbsp;</td>
          <td class="mdname" nowrap> <em>str</em>[], </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>unsigned int&nbsp;</td>
          <td class="mdname" nowrap> <em>start</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>unsigned int&nbsp;</td>
          <td class="mdname" nowrap> <em>len</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Prints a section of a string stored in RAM. Begins printing at position indicated by &lt;start&gt;, and prints number of characters indicated by &lt;len&gt;. 
<p>
Definition at line <a class="el" href="rprintf_8c-source.html#l00089">89</a> of file <a class="el" href="rprintf_8c-source.html">rprintf.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&nbsp;
<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