?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: i2c.h File Reference</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>i2c.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
<p>
Definition in file <a class="el" href="i2c_8h-source.html">i2c.h</a>.
<p>
<code>#include "<a class="el" href="global_8h-source.html">global.h</a>"</code><br>
<code>#include "<a class="el" href="i2cconf_8h-source.html">i2cconf.h</a>"</code><br>
<p>
<a href="i2c_8h-source.html">Go to the source code of this file.</a><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="a0" doxytag="i2c.h::TW_START"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_START</b> 0x08</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a1" doxytag="i2c.h::TW_REP_START"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_REP_START</b> 0x10</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a2" doxytag="i2c.h::TW_MT_SLA_ACK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_MT_SLA_ACK</b> 0x18</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a3" doxytag="i2c.h::TW_MT_SLA_NACK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_MT_SLA_NACK</b> 0x20</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a4" doxytag="i2c.h::TW_MT_DATA_ACK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_MT_DATA_ACK</b> 0x28</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a5" doxytag="i2c.h::TW_MT_DATA_NACK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_MT_DATA_NACK</b> 0x30</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a6" doxytag="i2c.h::TW_MT_ARB_LOST"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_MT_ARB_LOST</b> 0x38</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a7" doxytag="i2c.h::TW_MR_ARB_LOST"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_MR_ARB_LOST</b> 0x38</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a8" doxytag="i2c.h::TW_MR_SLA_ACK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_MR_SLA_ACK</b> 0x40</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a9" doxytag="i2c.h::TW_MR_SLA_NACK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_MR_SLA_NACK</b> 0x48</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a10" doxytag="i2c.h::TW_MR_DATA_ACK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_MR_DATA_ACK</b> 0x50</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a11" doxytag="i2c.h::TW_MR_DATA_NACK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_MR_DATA_NACK</b> 0x58</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a12" doxytag="i2c.h::TW_ST_SLA_ACK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_ST_SLA_ACK</b> 0xA8</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a13" doxytag="i2c.h::TW_ST_ARB_LOST_SLA_ACK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_ST_ARB_LOST_SLA_ACK</b> 0xB0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a14" doxytag="i2c.h::TW_ST_DATA_ACK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_ST_DATA_ACK</b> 0xB8</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a15" doxytag="i2c.h::TW_ST_DATA_NACK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_ST_DATA_NACK</b> 0xC0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a16" doxytag="i2c.h::TW_ST_LAST_DATA"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_ST_LAST_DATA</b> 0xC8</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a17" doxytag="i2c.h::TW_SR_SLA_ACK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_SR_SLA_ACK</b> 0x60</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a18" doxytag="i2c.h::TW_SR_ARB_LOST_SLA_ACK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_SR_ARB_LOST_SLA_ACK</b> 0x68</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a19" doxytag="i2c.h::TW_SR_GCALL_ACK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_SR_GCALL_ACK</b> 0x70</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a20" doxytag="i2c.h::TW_SR_ARB_LOST_GCALL_ACK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_SR_ARB_LOST_GCALL_ACK</b> 0x78</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a21" doxytag="i2c.h::TW_SR_DATA_ACK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_SR_DATA_ACK</b> 0x80</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a22" doxytag="i2c.h::TW_SR_DATA_NACK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_SR_DATA_NACK</b> 0x88</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a23" doxytag="i2c.h::TW_SR_GCALL_DATA_ACK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_SR_GCALL_DATA_ACK</b> 0x90</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a24" doxytag="i2c.h::TW_SR_GCALL_DATA_NACK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_SR_GCALL_DATA_NACK</b> 0x98</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a25" doxytag="i2c.h::TW_SR_STOP"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_SR_STOP</b> 0xA0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a26" doxytag="i2c.h::TW_NO_INFO"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_NO_INFO</b> 0xF8</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a27" doxytag="i2c.h::TW_BUS_ERROR"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TW_BUS_ERROR</b> 0x00</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a28" doxytag="i2c.h::TWCR_CMD_MASK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TWCR_CMD_MASK</b> 0x0F</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a29" doxytag="i2c.h::TWSR_STATUS_MASK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TWSR_STATUS_MASK</b> 0xF8</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a30" doxytag="i2c.h::I2C_OK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>I2C_OK</b> 0x00</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a31" doxytag="i2c.h::I2C_ERROR_NODEV"></a>
#define </td><td class="memItemRight" valign="bottom"><b>I2C_ERROR_NODEV</b> 0x01</td></tr>
<tr><td colspan="2"><br><h2>Enumerations</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><b>eI2cStateType</b> { <br>
<b>I2C_IDLE</b> = 0,
<b>I2C_BUSY</b> = 1,
<b>I2C_MASTER_TX</b> = 2,
<b>I2C_MASTER_RX</b> = 3,
<br>
<b>I2C_SLAVE_TX</b> = 4,
<b>I2C_SLAVE_RX</b> = 5
<br>
}</td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a38" doxytag="i2c.h::i2cInit"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8h.html#a38">i2cInit</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize I2C (TWI) interface. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a39" doxytag="i2c.h::i2cSetBitrate"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8h.html#a39">i2cSetBitrate</a> (u16 bitrateKHz)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the I2C transaction bitrate (in KHz). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a40" doxytag="i2c.h::i2cSetLocalDeviceAddr"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8h.html#a40">i2cSetLocalDeviceAddr</a> (u08 deviceAddr, u08 genCallEn)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the local (AVR processor's) I2C device address. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a41" doxytag="i2c.h::i2cSetSlaveReceiveHandler"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8h.html#a41">i2cSetSlaveReceiveHandler</a> (void(*i2cSlaveRx_func)(u08 receiveDataLength, u08 *recieveData))</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the user function which handles receiving (incoming) data as a slave. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a42" doxytag="i2c.h::i2cSetSlaveTransmitHandler"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8h.html#a42">i2cSetSlaveTransmitHandler</a> (u08(*i2cSlaveTx_func)(u08 transmitDataLengthMax, u08 *transmitData))</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the user function which handles transmitting (outgoing) data as a slave. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a43" doxytag="i2c.h::i2cSendStart"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8h.html#a43">i2cSendStart</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Send an I2C start condition in Master mode. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a44" doxytag="i2c.h::i2cSendStop"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8h.html#a44">i2cSendStop</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Send an I2C stop condition in Master mode. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a45" doxytag="i2c.h::i2cWaitForComplete"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8h.html#a45">i2cWaitForComplete</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Wait for current I2C operation to complete. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a46" doxytag="i2c.h::i2cSendByte"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8h.html#a46">i2cSendByte</a> (u08 data)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Send an (address|R/W) combination or a data byte over I2C. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a47" doxytag="i2c.h::i2cReceiveByte"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8h.html#a47">i2cReceiveByte</a> (u08 ackFlag)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Receive a data byte over I2C. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a48" doxytag="i2c.h::i2cGetReceivedByte"></a>
u08 </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8h.html#a48">i2cGetReceivedByte</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Pick up the data that was received with <a class="el" href="i2c_8c.html#a19">i2cReceiveByte()</a>. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a49" doxytag="i2c.h::i2cGetStatus"></a>
u08 </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8h.html#a49">i2cGetStatus</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get current I2c bus status from TWSR. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a50" doxytag="i2c.h::i2cMasterSend"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8h.html#a50">i2cMasterSend</a> (u08 deviceAddr, u08 length, u08 *data)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">send I2C data to a device on the bus <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a51" doxytag="i2c.h::i2cMasterReceive"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8h.html#a51">i2cMasterReceive</a> (u08 deviceAddr, u08 length, u08 *data)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">receive I2C data from a device on the bus <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a52" doxytag="i2c.h::i2cMasterSendNI"></a>
u08 </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8h.html#a52">i2cMasterSendNI</a> (u08 deviceAddr, u08 length, u08 *data)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">send I2C data to a device on the bus (non-interrupt based) <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a53" doxytag="i2c.h::i2cMasterReceiveNI"></a>
u08 </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8h.html#a53">i2cMasterReceiveNI</a> (u08 deviceAddr, u08 length, u08 *data)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">receive I2C data from a device on the bus (non-interrupt based) <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a54" doxytag="i2c.h::i2cGetState"></a>
eI2cStateType </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8h.html#a54">i2cGetState</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the current high-level state of the I2C interface. <br></td></tr>
</table>
<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