?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: Spyglass Control Panel UI Board Driver (spyglass.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>Spyglass Control Panel UI Board Driver (spyglass.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="lcd_8h.html">lcd.h</a>"</span>
<span class="preprocessor"> #include "<a class="code" href="i2c_8h.html">i2c.h</a>"</span>
<span class="preprocessor"> #include "<a class="code" href="spyglass_8h.html">spyglass.h</a>"</span>
</pre></div> <dl compact><dt><b>Overview</b></dt><dd>This library supports the 'Spyglass' I2C-controlled User Interface board. The Spyglass board has a standard 4x20 character LCD and a convenient array of pushbuttons for a user interface. The board also has a user-controllable piezo beeper. All of these functions are accessible via I2C bus, making it possible to have a complete user interface with just 4 wires (2 I/O and 2 power wires). The Spyglass board runs on 5V power.</dd></dl>
<dl compact><dt><b>Connections:</b></dt><dd><ul>
<li>Connect power to the +5V and ground pins.</li><li>Connect the SCL/SDA pins to the corresponding SCL/SDA pins of your processor's I2C bus.</li><li>If you wish to use the beeper, also connect +5V to pin 8.</li></ul>
</dd></dl>
<div class="fragment"><pre class="fragment"> SPYGLASS PINOUT <span class="keywordflow">for</span> 10-pin I/O header:
----
+5V - 1 |++| 2 - +5V
SCL - 3 |++| 4 - GND
SDA - 5 |++| 6 - GND
7 |++| 8 - BEEPER PWR (+5V)
9 |++| 10
----
</pre></div>
<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="ga13" doxytag="spyglass::PCF8574_I2C_BASE_ADDR"></a>
#define </td><td class="memItemRight" valign="bottom"><b>PCF8574_I2C_BASE_ADDR</b> 0x40</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga14" doxytag="spyglass::MAX517_I2C_BASE_ADDR"></a>
#define </td><td class="memItemRight" valign="bottom"><b>MAX517_I2C_BASE_ADDR</b> 0x58</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga15" doxytag="spyglass::PCF_NODE_BUTTONS"></a>
#define </td><td class="memItemRight" valign="bottom"><b>PCF_NODE_BUTTONS</b> 0x00</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga16" doxytag="spyglass::PCF_NODE_LCD_DATA"></a>
#define </td><td class="memItemRight" valign="bottom"><b>PCF_NODE_LCD_DATA</b> 0x01</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga17" doxytag="spyglass::PCF_NODE_CONTROL"></a>
#define </td><td class="memItemRight" valign="bottom"><b>PCF_NODE_CONTROL</b> 0x02</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga18" doxytag="spyglass::SPYGLASS_LED0"></a>
#define </td><td class="memItemRight" valign="bottom"><b>SPYGLASS_LED0</b> 0x01</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga19" doxytag="spyglass::SPYGLASS_LED1"></a>
#define </td><td class="memItemRight" valign="bottom"><b>SPYGLASS_LED1</b> 0x02</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga20" doxytag="spyglass::SPYGLASS_BEEPER"></a>
#define </td><td class="memItemRight" valign="bottom"><b>SPYGLASS_BEEPER</b> 0x04</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga21" doxytag="spyglass::SPYGLASS_LCD_RS"></a>
#define </td><td class="memItemRight" valign="bottom"><b>SPYGLASS_LCD_RS</b> 0x20</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga22" doxytag="spyglass::SPYGLASS_LCD_RW"></a>
#define </td><td class="memItemRight" valign="bottom"><b>SPYGLASS_LCD_RW</b> 0x40</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga23" doxytag="spyglass::SPYGLASS_LCD_E"></a>
#define </td><td class="memItemRight" valign="bottom"><b>SPYGLASS_LCD_E</b> 0x80</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga24" doxytag="spyglass::lcdInit"></a>
#define </td><td class="memItemRight" valign="bottom"><b>lcdInit</b> spyglassLcdInit</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga25" doxytag="spyglass::lcdHome"></a>
#define </td><td class="memItemRight" valign="bottom"><b>lcdHome</b> spyglassLcdHome</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga26" doxytag="spyglass::lcdClear"></a>
#define </td><td class="memItemRight" valign="bottom"><b>lcdClear</b> spyglassLcdClear</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga27" doxytag="spyglass::lcdGotoXY"></a>
#define </td><td class="memItemRight" valign="bottom"><b>lcdGotoXY</b> spyglassLcdGotoXY</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga28" doxytag="spyglass::lcdDataWrite"></a>
#define </td><td class="memItemRight" valign="bottom"><b>lcdDataWrite</b> spyglassLcdWriteChar</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="ga0" doxytag="spyglass::spyglassInit"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__spyglass.html#ga0">spyglassInit</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">initialize the I2C bus for communication with the spyglass UI. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">u08 </td><td class="memItemRight" valign="bottom"><a class="el" href="group__spyglass.html#ga1">spyglassGetPushbuttons</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__spyglass.html#ga2">spyglassSetLeds</a> (u08 leds)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__spyglass.html#ga3">spyglassSetBeeper</a> (u08 state)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">u08 </td><td class="memItemRight" valign="bottom"><a class="el" href="group__spyglass.html#ga4">spyglassSetLcdContrast</a> (u08 contrast)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga5" doxytag="spyglass::spyglassLcdInit"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__spyglass.html#ga5">spyglassLcdInit</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize LCD for operation. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga6" doxytag="spyglass::spyglassLcdHome"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__spyglass.html#ga6">spyglassLcdHome</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set write/cursor position to upper left. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga7" doxytag="spyglass::spyglassLcdClear"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__spyglass.html#ga7">spyglassLcdClear</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Clear LCD display. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga8" doxytag="spyglass::spyglassLcdGotoXY"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__spyglass.html#ga8">spyglassLcdGotoXY</a> (u08 x, u08 y)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set write/cursor posision on LCD display (x=col, y=line). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga9" doxytag="spyglass::spyglassLcdWrite"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__spyglass.html#ga9">spyglassLcdWrite</a> (u08 rs, u08 data)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Write control or display data to LCD. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga10" doxytag="spyglass::spyglassLcdWriteChar"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__spyglass.html#ga10">spyglassLcdWriteChar</a> (u08 c)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Write character to LCD. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga11" doxytag="spyglass::pcf8574Write"></a>
u08 </td><td class="memItemRight" valign="bottom"><a class="el" href="group__spyglass.html#ga11">pcf8574Write</a> (u08 nodeAddr, u08 data)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Write I/O Data to PCF8574 I2C<->Digital I/O chip. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga12" doxytag="spyglass::pcf8574Read"></a>
u08 </td><td class="memItemRight" valign="bottom"><a class="el" href="group__spyglass.html#ga12">pcf8574Read</a> (u08 nodeAddr)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Read I/O Data from PCF8574 I2C<->Digital I/O chip. <br></td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ga1" doxytag="spyglass.h::spyglassGetPushbuttons"></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 spyglassGetPushbuttons </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>
Read the state of pushbuttons on the spyglass UI. Returns an 8-bit number representing the state of buttons S1-S7 in bits 0-6 respectively.<ul>
<li>'0' bit value = button not pressed</li><li>'1' bit value = button is pressed </li></ul>
<p>
Definition at line <a class="el" href="spyglass_8c-source.html#l00051">51</a> of file <a class="el" href="spyglass_8c-source.html">spyglass.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga3" doxytag="spyglass.h::spyglassSetBeeper"></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 spyglassSetBeeper </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">u08 </td>
<td class="mdname1" valign="top" nowrap> <em>state</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>
Sets the state of the beeper on the spyglass UI.<ul>
<li>'0' state => beeper off</li><li>'1' state => beeper on </li></ul>
<p>
Definition at line <a class="el" href="spyglass_8c-source.html#l00062">62</a> of file <a class="el" href="spyglass_8c-source.html">spyglass.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga4" doxytag="spyglass.h::spyglassSetLcdContrast"></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 spyglassSetLcdContrast </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">u08 </td>
<td class="mdname1" valign="top" nowrap> <em>contrast</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>
Sets the contrast voltage of the spyglass LCD. Lower numbers are darker contrast, higher numbers are lighter contrast.
<p>
Definition at line <a class="el" href="spyglass_8c-source.html#l00071">71</a> of file <a class="el" href="spyglass_8c-source.html">spyglass.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga2" doxytag="spyglass.h::spyglassSetLeds"></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 spyglassSetLeds </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">u08 </td>
<td class="mdname1" valign="top" nowrap> <em>leds</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>
Sets the state of LEDs on the spyglass UI. Argument is a 2-bit number representing the desired state of LEDs D2 & D3 respectively.<ul>
<li>'0' bit value = LED off</li><li>'1' bit value = LED on </li></ul>
<p>
Definition at line <a class="el" href="spyglass_8c-source.html#l00056">56</a> of file <a class="el" href="spyglass_8c-source.html">spyglass.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>
|
{FILE END}
{FOOTER START}
Powered by WebSVN v2.8.3