| Line No. | Rev | Author | Line |
|---|---|---|---|
| 1 | 6 | kaklik | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> |
||
| 3 | <title>Procyon AVRlib: i2c.c File Reference</title> |
||
| 4 | <link href="dox.css" rel="stylesheet" type="text/css"> |
||
| 5 | </head><body> |
||
| 6 | <!-- Generated by Doxygen 1.4.2 --> |
||
| 7 | <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> |
||
| 8 | <h1>i2c.c File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2> |
||
| 9 | |||
| 10 | <p> |
||
| 11 | Definition in file <a class="el" href="i2c_8c-source.html">i2c.c</a>. |
||
| 12 | <p> |
||
| 13 | <code>#include <avr/io.h></code><br> |
||
| 14 | <code>#include <avr/interrupt.h></code><br> |
||
| 15 | <code>#include "<a class="el" href="i2c_8h-source.html">i2c.h</a>"</code><br> |
||
| 16 | <code>#include "<a class="el" href="rprintf_8h-source.html">rprintf.h</a>"</code><br> |
||
| 17 | <code>#include "<a class="el" href="uart2_8h-source.html">uart2.h</a>"</code><br> |
||
| 18 | |||
| 19 | <p> |
||
| 20 | <a href="i2c_8c-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> |
||
| 21 | <tr><td></td></tr> |
||
| 22 | <tr><td colspan="2"><br><h2>Functions</h2></td></tr> |
||
| 23 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a10" doxytag="i2c.c::i2cInit"></a> |
||
| 24 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8c.html#a10">i2cInit</a> (void)</td></tr> |
||
| 25 | |||
| 26 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize I2C (TWI) interface. <br></td></tr> |
||
| 27 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a11" doxytag="i2c.c::i2cSetBitrate"></a> |
||
| 28 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8c.html#a11">i2cSetBitrate</a> (u16 bitrateKHz)</td></tr> |
||
| 29 | |||
| 30 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the I2C transaction bitrate (in KHz). <br></td></tr> |
||
| 31 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a12" doxytag="i2c.c::i2cSetLocalDeviceAddr"></a> |
||
| 32 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8c.html#a12">i2cSetLocalDeviceAddr</a> (u08 deviceAddr, u08 genCallEn)</td></tr> |
||
| 33 | |||
| 34 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the local (AVR processor's) I2C device address. <br></td></tr> |
||
| 35 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a13" doxytag="i2c.c::i2cSetSlaveReceiveHandler"></a> |
||
| 36 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8c.html#a13">i2cSetSlaveReceiveHandler</a> (void(*i2cSlaveRx_func)(u08 receiveDataLength, u08 *recieveData))</td></tr> |
||
| 37 | |||
| 38 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the user function which handles receiving (incoming) data as a slave. <br></td></tr> |
||
| 39 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a14" doxytag="i2c.c::i2cSetSlaveTransmitHandler"></a> |
||
| 40 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8c.html#a14">i2cSetSlaveTransmitHandler</a> (u08(*i2cSlaveTx_func)(u08 transmitDataLengthMax, u08 *transmitData))</td></tr> |
||
| 41 | |||
| 42 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the user function which handles transmitting (outgoing) data as a slave. <br></td></tr> |
||
| 43 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a15" doxytag="i2c.c::i2cSendStart"></a> |
||
| 44 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8c.html#a15">i2cSendStart</a> (void)</td></tr> |
||
| 45 | |||
| 46 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Send an I2C start condition in Master mode. <br></td></tr> |
||
| 47 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a16" doxytag="i2c.c::i2cSendStop"></a> |
||
| 48 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8c.html#a16">i2cSendStop</a> (void)</td></tr> |
||
| 49 | |||
| 50 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Send an I2C stop condition in Master mode. <br></td></tr> |
||
| 51 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a17" doxytag="i2c.c::i2cWaitForComplete"></a> |
||
| 52 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8c.html#a17">i2cWaitForComplete</a> (void)</td></tr> |
||
| 53 | |||
| 54 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Wait for current I2C operation to complete. <br></td></tr> |
||
| 55 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a18" doxytag="i2c.c::i2cSendByte"></a> |
||
| 56 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8c.html#a18">i2cSendByte</a> (u08 data)</td></tr> |
||
| 57 | |||
| 58 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Send an (address|R/W) combination or a data byte over I2C. <br></td></tr> |
||
| 59 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a19" doxytag="i2c.c::i2cReceiveByte"></a> |
||
| 60 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8c.html#a19">i2cReceiveByte</a> (u08 ackFlag)</td></tr> |
||
| 61 | |||
| 62 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Receive a data byte over I2C. <br></td></tr> |
||
| 63 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a20" doxytag="i2c.c::i2cGetReceivedByte"></a> |
||
| 64 | u08 </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8c.html#a20">i2cGetReceivedByte</a> (void)</td></tr> |
||
| 65 | |||
| 66 | <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> |
||
| 67 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a21" doxytag="i2c.c::i2cGetStatus"></a> |
||
| 68 | u08 </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8c.html#a21">i2cGetStatus</a> (void)</td></tr> |
||
| 69 | |||
| 70 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Get current I2c bus status from TWSR. <br></td></tr> |
||
| 71 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a22" doxytag="i2c.c::i2cMasterSend"></a> |
||
| 72 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8c.html#a22">i2cMasterSend</a> (u08 deviceAddr, u08 length, u08 *data)</td></tr> |
||
| 73 | |||
| 74 | <tr><td class="mdescLeft"> </td><td class="mdescRight">send I2C data to a device on the bus <br></td></tr> |
||
| 75 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a23" doxytag="i2c.c::i2cMasterReceive"></a> |
||
| 76 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8c.html#a23">i2cMasterReceive</a> (u08 deviceAddr, u08 length, u08 *data)</td></tr> |
||
| 77 | |||
| 78 | <tr><td class="mdescLeft"> </td><td class="mdescRight">receive I2C data from a device on the bus <br></td></tr> |
||
| 79 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a24" doxytag="i2c.c::i2cMasterSendNI"></a> |
||
| 80 | u08 </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8c.html#a24">i2cMasterSendNI</a> (u08 deviceAddr, u08 length, u08 *data)</td></tr> |
||
| 81 | |||
| 82 | <tr><td class="mdescLeft"> </td><td class="mdescRight">send I2C data to a device on the bus (non-interrupt based) <br></td></tr> |
||
| 83 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a25" doxytag="i2c.c::i2cMasterReceiveNI"></a> |
||
| 84 | u08 </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8c.html#a25">i2cMasterReceiveNI</a> (u08 deviceAddr, u08 length, u08 *data)</td></tr> |
||
| 85 | |||
| 86 | <tr><td class="mdescLeft"> </td><td class="mdescRight">receive I2C data from a device on the bus (non-interrupt based) <br></td></tr> |
||
| 87 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a26" doxytag="i2c.c::SIGNAL"></a> |
||
| 88 | </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8c.html#a26">SIGNAL</a> (SIG_2WIRE_SERIAL)</td></tr> |
||
| 89 | |||
| 90 | <tr><td class="mdescLeft"> </td><td class="mdescRight">I2C (TWI) interrupt service routine. <br></td></tr> |
||
| 91 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a27" doxytag="i2c.c::i2cGetState"></a> |
||
| 92 | eI2cStateType </td><td class="memItemRight" valign="bottom"><a class="el" href="i2c_8c.html#a27">i2cGetState</a> (void)</td></tr> |
||
| 93 | |||
| 94 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the current high-level state of the I2C interface. <br></td></tr> |
||
| 95 | </table> |
||
| 96 | <hr size="1"><address style="align: right;"><small>Generated on Sun Oct 29 03:41:08 2006 for Procyon AVRlib by |
||
| 97 | <a href="http://www.doxygen.org/index.html"> |
||
| 98 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.2 </small></address> |
||
| 99 | </body> |
||
| 100 | </html> |
Powered by WebSVN v2.8.3