?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: ks0108.h Source File</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>ks0108.h</h1><a href="ks0108_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/*! \file ks0108.h \brief Graphic LCD driver for HD61202/KS0108 displays. */</span>
00002 <span class="comment">//*****************************************************************************</span>
00003 <span class="comment">//</span>
00004 <span class="comment">// File Name    : 'ks0108.h'</span>
00005 <span class="comment">// Title        : Graphic LCD driver for HD61202/KS0108 displays</span>
00006 <span class="comment">// Author       : Pascal Stang - Copyright (C) 2001-2003</span>
00007 <span class="comment">// Date         : 10/19/2002</span>
00008 <span class="comment">// Revised      : 5/1/2003</span>
00009 <span class="comment">// Version      : 0.5</span>
00010 <span class="comment">// Target MCU   : Atmel AVR</span>
00011 <span class="comment">// Editor Tabs  : 4</span>
00012 <span class="comment">//</span>
00013 <span class="comment">// NOTE: This code is currently below version 1.0, and therefore is considered</span>
00014 <span class="comment">// to be lacking in some functionality or documentation, or may not be fully</span>
00015 <span class="comment">// tested.  Nonetheless, you can expect most functions to work.</span>
00016 <span class="comment">//</span><span class="comment"></span>
00017 <span class="comment">/// \ingroup driver_hw</span>
00018 <span class="comment">/// \defgroup ks0108 Graphic LCD Driver for HD61202/KS0108-based Displays (ks0108.c)</span>
00019 <span class="comment">/// \code #include "ks0108.h" \endcode</span>
00020 <span class="comment">/// \par Overview</span>
00021 <span class="comment">///     This display driver performs the basic functions necessary to access</span>
00022 <span class="comment">/// any graphic LCD based on the KS0108 or HD61202 controller chip.  For more</span>
00023 <span class="comment">/// advanced functions, use this driver in conjunction with glcd.c.</span>
00024 <span class="comment">/// KS0108/HD61202 displays typically range in size from 64x32 pixels to</span>
00025 <span class="comment">/// 128x128 pixels and up to 3" square.  To determine whether a display is</span>
00026 <span class="comment">/// compatible, you should look for the above controller chips to be mounted</span>
00027 <span class="comment">/// on the PC board attached to the display glass.  The controller chips are</span>
00028 <span class="comment">/// about 1/2" x 3/4" and have 80+ pins. On larger displays, you may also see</span>
00029 <span class="comment">/// slave LCD driver chips with the numbers KS0107 or HD61203.  The display</span>
00030 <span class="comment">/// will likely have an 18 or 20-pin interface.  The interface from the LCD</span>
00031 <span class="comment">/// to an AVR processor does not require any additional hardware.  If you can</span>
00032 <span class="comment">/// locate a datasheet for your display, that plus the information in the</span>
00033 <span class="comment">/// ks0108conf.h file should be all you need to get hooked up.</span>
00034 <span class="comment"></span><span class="comment">//</span>
00035 <span class="comment">// This code is distributed under the GNU Public License</span>
00036 <span class="comment">//      which can be found at http://www.gnu.org/licenses/gpl.txt</span>
00037 <span class="comment">//</span>
00038 <span class="comment">//*****************************************************************************</span>
00039 
00040 
00041 <span class="preprocessor">#ifndef KS0108_H</span>
00042 <span class="preprocessor"></span><span class="preprocessor">#define KS0108_H</span>
00043 <span class="preprocessor"></span>
00044 <span class="preprocessor">#include "<a class="code" href="global_8h.html">global.h</a>"</span>
00045 
00046 <span class="preprocessor">#include "<a class="code" href="ks0108conf_8h.html">ks0108conf.h</a>"</span>
00047 
00048 <span class="comment">// HD61202/KS0108 command set</span>
00049 <span class="preprocessor">#define GLCD_ON_CTRL        0x3E    // 0011111X: lcd on/off control</span>
00050 <span class="preprocessor"></span><span class="preprocessor">#define GLCD_ON_DISPLAY     0x01    //      DB0: turn display on</span>
00051 <span class="preprocessor"></span>
00052 <span class="preprocessor">#define GLCD_START_LINE     0xC0    // 11XXXXXX: set lcd start line</span>
00053 <span class="preprocessor"></span>
00054 <span class="preprocessor">#define GLCD_SET_PAGE       0xB8    // 10111XXX: set lcd page (X) address</span>
00055 <span class="preprocessor"></span><span class="preprocessor">#define GLCD_SET_Y_ADDR     0x40    // 01YYYYYY: set lcd Y address</span>
00056 <span class="preprocessor"></span>
00057 <span class="preprocessor">#define GLCD_STATUS_BUSY    0x80    // (1)-&gt;LCD IS BUSY</span>
00058 <span class="preprocessor"></span><span class="preprocessor">#define GLCD_STATUS_ONOFF   0x20    // (0)-&gt;LCD IS ON</span>
00059 <span class="preprocessor"></span><span class="preprocessor">#define GLCD_STATUS_RESET   0x10    // (1)-&gt;LCD IS RESET</span>
00060 <span class="preprocessor"></span>
00061 <span class="comment">// determine the number of controllers</span>
00062 <span class="comment">// (make sure we round up for partial use of more than one controller)</span>
00063 <span class="preprocessor">#define GLCD_NUM_CONTROLLERS    ((GLCD_XPIXELS+GLCD_CONTROLLER_XPIXELS-1)/GLCD_CONTROLLER_XPIXELS)</span>
00064 <span class="preprocessor"></span>
00065 <span class="comment">// typedefs/structures</span>
00066 <span class="keyword">typedef</span> <span class="keyword">struct </span>struct_GrLcdCtrlrStateType
00067 {
00068     <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> xAddr;
00069     <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> yAddr;
00070 } GrLcdCtrlrStateType;
00071 
00072 <span class="keyword">typedef</span> <span class="keyword">struct </span>struct_GrLcdStateType
00073 {
00074     <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> lcdXAddr;
00075     <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> lcdYAddr;
00076     GrLcdCtrlrStateType ctrlr[GLCD_NUM_CONTROLLERS];
00077 } GrLcdStateType;
00078 
00079 <span class="comment">// function prototypes</span>
00080 <span class="keywordtype">void</span> glcdInitHW(<span class="keywordtype">void</span>);
00081 <span class="keywordtype">void</span> glcdBusyWait(u08 controller);
00082 <span class="keywordtype">void</span> glcdControlWrite(u08 controller, u08 data);
00083 u08  glcdControlRead(u08 controller);
00084 <span class="keywordtype">void</span> glcdDataWrite(u08 data);
00085 u08  glcdDataRead(<span class="keywordtype">void</span>);
00086 <span class="keywordtype">void</span> glcdSetXAddress(u08 xAddr);
00087 <span class="keywordtype">void</span> glcdSetYAddress(u08 yAddr);
00088 
00089 <span class="comment"></span>
00090 <span class="comment">//! Initialize the display, clear it, and prepare it for access</span>
00091 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="ks0108_8c.html#a11">glcdInit</a>(<span class="keywordtype">void</span>);<span class="comment"></span>
00092 <span class="comment">//! Clear the display</span>
00093 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="ks0108_8c.html#a13">glcdClearScreen</a>(<span class="keywordtype">void</span>);<span class="comment"></span>
00094 <span class="comment">//! Set display memory access point back to upper,left corner</span>
00095 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="ks0108_8c.html#a12">glcdHome</a>(<span class="keywordtype">void</span>);<span class="comment"></span>
00096 <span class="comment">//! Set display memory access point to row [line] and column [col] assuming 5x7 font</span>
00097 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="ks0108_8c.html#a16">glcdGotoChar</a>(u08 line, u08 col);<span class="comment"></span>
00098 <span class="comment">//! Set display memory access point to [x] horizontal pixel and [y] vertical line</span>
00099 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="ks0108_8c.html#a15">glcdSetAddress</a>(u08 x, u08 yLine);<span class="comment"></span>
00100 <span class="comment">//! Set display memory access point to row [line] and column [col] assuming 5x7 font</span>
00101 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="ks0108_8c.html#a14">glcdStartLine</a>(u08 start);<span class="comment"></span>
00102 <span class="comment">//! Generic delay routine for timed glcd access</span>
00103 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="ks0108_8c.html#a17">glcdDelay</a>(u16 p);
00104 <span class="preprocessor">#endif</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Sun Oct 29 03:41:07 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