?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: TI ADS7828 I2C A/D Converter Driver (ads7828.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>TI ADS7828 I2C A/D Converter Driver (ads7828.c)<br>
<small>
[<a class="el" href="group__driver__hw.html">Drivers (for external hardware)</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="ads7828_8h.html">ads7828.h</a>"</span> 
</pre></div> <dl compact><dt><b>Overview</b></dt><dd>This library provides high-level functions for accessing the Texas Instruments ADS7828 I2C A/D Converter.</dd></dl>
The basic specs of the ADS7828 are:<ul>
<li>12-bit results</li><li>8 input channels</li><li>up to 50KHz conversion rate</li><li>External reference or internal 2.5V reference </li></ul>

<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="ga5" doxytag="ads7828::ADS7828_I2C_ADDR"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga5">ADS7828_I2C_ADDR</a>&nbsp;&nbsp;&nbsp;0x90</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Base I2C address of ADS7828 devices. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga6" doxytag="ads7828::ADS7828_CMD_PD0"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga6">ADS7828_CMD_PD0</a>&nbsp;&nbsp;&nbsp;0x04</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ADS7828 Power-down bit 0. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga7" doxytag="ads7828::ADS7828_CMD_PD1"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga7">ADS7828_CMD_PD1</a>&nbsp;&nbsp;&nbsp;0x08</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ADS7828 Power-down bit 1. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga8" doxytag="ads7828::ADS7828_CMD_C0"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga8">ADS7828_CMD_C0</a>&nbsp;&nbsp;&nbsp;0x10</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ADS7828 Channel Select bit 0. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga9" doxytag="ads7828::ADS7828_CMD_C1"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga9">ADS7828_CMD_C1</a>&nbsp;&nbsp;&nbsp;0x20</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ADS7828 Channel Select bit 1. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga10" doxytag="ads7828::ADS7828_CMD_C2"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga10">ADS7828_CMD_C2</a>&nbsp;&nbsp;&nbsp;0x40</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ADS7828 Channel Select bit 2. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga11" doxytag="ads7828::ADS7828_CMD_SD"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga11">ADS7828_CMD_SD</a>&nbsp;&nbsp;&nbsp;0x80</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ADS7828 Single-ended/Differential Select bit. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga12" doxytag="ads7828::ADS7828_CMD_CH0"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga12">ADS7828_CMD_CH0</a>&nbsp;&nbsp;&nbsp;0x00</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ADS7828 Convert Channel 0. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga13" doxytag="ads7828::ADS7828_CMD_CH1"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga13">ADS7828_CMD_CH1</a>&nbsp;&nbsp;&nbsp;0x04</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ADS7828 Convert Channel 1. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga14" doxytag="ads7828::ADS7828_CMD_CH2"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga14">ADS7828_CMD_CH2</a>&nbsp;&nbsp;&nbsp;0x01</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ADS7828 Convert Channel 2. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga15" doxytag="ads7828::ADS7828_CMD_CH3"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga15">ADS7828_CMD_CH3</a>&nbsp;&nbsp;&nbsp;0x05</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ADS7828 Convert Channel 3. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga16" doxytag="ads7828::ADS7828_CMD_CH4"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga16">ADS7828_CMD_CH4</a>&nbsp;&nbsp;&nbsp;0x02</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ADS7828 Convert Channel 4. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga17" doxytag="ads7828::ADS7828_CMD_CH5"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga17">ADS7828_CMD_CH5</a>&nbsp;&nbsp;&nbsp;0x06</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ADS7828 Convert Channel 5. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga18" doxytag="ads7828::ADS7828_CMD_CH6"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga18">ADS7828_CMD_CH6</a>&nbsp;&nbsp;&nbsp;0x03</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ADS7828 Convert Channel 6. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga19" doxytag="ads7828::ADS7828_CMD_CH7"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga19">ADS7828_CMD_CH7</a>&nbsp;&nbsp;&nbsp;0x07</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ADS7828 Convert Channel 7. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga20" doxytag="ads7828::ADS7828_CMD_PDMODE0"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga20">ADS7828_CMD_PDMODE0</a>&nbsp;&nbsp;&nbsp;0x00</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ADS7828 Power-down Mode 0. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga21" doxytag="ads7828::ADS7828_CMD_PDMODE1"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga21">ADS7828_CMD_PDMODE1</a>&nbsp;&nbsp;&nbsp;0x04</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ADS7828 Power-down Mode 1. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga22" doxytag="ads7828::ADS7828_CMD_PDMODE2"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga22">ADS7828_CMD_PDMODE2</a>&nbsp;&nbsp;&nbsp;0x08</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ADS7828 Power-down Mode 2. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga23" doxytag="ads7828::ADS7828_CMD_PDMODE3"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga23">ADS7828_CMD_PDMODE3</a>&nbsp;&nbsp;&nbsp;0x0C</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ADS7828 Power-down Mode 3. <br></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">u08&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga0">ads7828Init</a> (u08 i2cAddr)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga1">ads7828SetReference</a> (u08 ref)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga2" doxytag="ads7828::ads7828Convert"></a>
u16&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga2">ads7828Convert</a> (u08 i2cAddr, u08 channel)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Begin single-ended conversion on given logical channel#, and return result. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga3" doxytag="ads7828::ads7828ConvertDiff"></a>
u16&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga3">ads7828ConvertDiff</a> (u08 i2cAddr, u08 channel)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Begin differential conversion on given channel pair, and return result. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga4" doxytag="ads7828::ads7828ConvertRaw"></a>
u16&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ads7828.html#ga4">ads7828ConvertRaw</a> (u08 i2cAddr, u08 channel)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Begin conversion on given raw channel#, and return result. <br></td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ga0" doxytag="ads7828.h::ads7828Init"></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 ads7828Init           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">u08&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>i2cAddr</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>
Initialize the ADS7828 chip. Returns: TRUE if successful, FALSE if unsuccessful (chip not present). 
<p>
Definition at line <a class="el" href="ads7828_8c-source.html#l00033">33</a> of file <a class="el" href="ads7828_8c-source.html">ads7828.c</a>.    </td>
  </tr>
</table>
<a class="anchor" name="ga1" doxytag="ads7828.h::ads7828SetReference"></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 ads7828SetReference           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">u08&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>ref</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>
Set the voltage reference to use for A/D conversion.<ul>
<li>ref = 0 =&gt; External reference voltage on Ref pin.</li><li>ref = 1 =&gt; Internal 2.5V reference voltage (Ref pin left open). </li></ul>

<p>
Definition at line <a class="el" href="ads7828_8c-source.html#l00080">80</a> of file <a class="el" href="ads7828_8c-source.html">ads7828.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