?? ks0108_8h-source.html
字號(hào):
<!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.3.6 --><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="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a></div><h1>ks0108.h</h1><a href="ks0108_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>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>00017 <span class="comment">// This code is distributed under the GNU Public License</span>00018 <span class="comment">// which can be found at http://www.gnu.org/licenses/gpl.txt</span>00019 <span class="comment">//</span>00020 <span class="comment">//*****************************************************************************</span>00021 00022 00023 <span class="preprocessor">#ifndef KS0108_H</span>00024 <span class="preprocessor"></span><span class="preprocessor">#define KS0108_H</span>00025 <span class="preprocessor"></span>00026 <span class="preprocessor">#include "<a class="code" href="global_8h.html">global.h</a>"</span>00027 00028 <span class="preprocessor">#include "<a class="code" href="ks0108conf_8h.html">ks0108conf.h</a>"</span>00029 00030 <span class="comment">// HD61202/KS0108 command set</span>00031 <span class="preprocessor">#define GLCD_ON_CTRL 0x3E // 0011111X: lcd on/off control</span>00032 <span class="preprocessor"></span><span class="preprocessor">#define GLCD_ON_DISPLAY 0x01 // DB0: turn display on</span>00033 <span class="preprocessor"></span>00034 <span class="preprocessor">#define GLCD_START_LINE 0xC0 // 11XXXXXX: set lcd start line</span>00035 <span class="preprocessor"></span>00036 <span class="preprocessor">#define GLCD_SET_PAGE 0xB8 // 10111XXX: set lcd page (X) address</span>00037 <span class="preprocessor"></span><span class="preprocessor">#define GLCD_SET_Y_ADDR 0x40 // 01YYYYYY: set lcd Y address</span>00038 <span class="preprocessor"></span>00039 <span class="preprocessor">#define GLCD_STATUS_BUSY 0x80 // (1)->LCD IS BUSY</span>00040 <span class="preprocessor"></span><span class="preprocessor">#define GLCD_STATUS_ONOFF 0x20 // (0)->LCD IS ON</span>00041 <span class="preprocessor"></span><span class="preprocessor">#define GLCD_STATUS_RESET 0x10 // (1)->LCD IS RESET</span>00042 <span class="preprocessor"></span>00043 <span class="comment">// determine the number of controllers</span>00044 <span class="comment">// (make sure we round up for partial use of more than one controller)</span>00045 <span class="preprocessor">#define GLCD_NUM_CONTROLLERS ((GLCD_XPIXELS+GLCD_CONTROLLER_XPIXELS-1)/GLCD_CONTROLLER_XPIXELS)</span>00046 <span class="preprocessor"></span>00047 <span class="comment">// typedefs/structures</span>00048 <span class="keyword">typedef</span> <span class="keyword">struct </span>struct_GrLcdCtrlrStateType00049 {00050 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> xAddr;00051 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> yAddr;00052 } GrLcdCtrlrStateType;00053 00054 <span class="keyword">typedef</span> <span class="keyword">struct </span>struct_GrLcdStateType00055 {00056 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> lcdXAddr;00057 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> lcdYAddr;00058 GrLcdCtrlrStateType ctrlr[GLCD_NUM_CONTROLLERS];00059 } GrLcdStateType;00060 00061 <span class="comment">// function prototypes</span>00062 <span class="keywordtype">void</span> glcdInitHW(<span class="keywordtype">void</span>);00063 <span class="keywordtype">void</span> glcdBusyWait(u08 controller);00064 <span class="keywordtype">void</span> glcdControlWrite(u08 controller, u08 data);00065 u08 glcdControlRead(u08 controller);00066 <span class="keywordtype">void</span> glcdDataWrite(u08 data);00067 u08 glcdDataRead(<span class="keywordtype">void</span>);00068 <span class="keywordtype">void</span> glcdSetXAddress(u08 xAddr);00069 <span class="keywordtype">void</span> glcdSetYAddress(u08 yAddr);00070 00071 <span class="comment"></span>00072 <span class="comment">//! Initialize the display, clear it, and prepare it for access</span>00073 <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>00074 <span class="comment">//! Clear the display</span>00075 <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>00076 <span class="comment">//! Set display memory access point back to upper,left corner</span>00077 <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>00078 <span class="comment">//! Set display memory access point to row [line] and column [col] assuming 5x7 font</span>00079 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="ks0108_8h.html#a22">glcdGotoChar</a>(u08 line, u08 col);<span class="comment"></span>00080 <span class="comment">//! Set display memory access point to [x] horizontal pixel and [y] vertical line</span>00081 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="ks0108_8h.html#a23">glcdSetAddress</a>(u08 x, u08 yLine);<span class="comment"></span>00082 <span class="comment">//! Set display memory access point to row [line] and column [col] assuming 5x7 font</span>00083 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="ks0108_8h.html#a24">glcdStartLine</a>(u08 start);<span class="comment"></span>00084 <span class="comment">//! Generic delay routine for timed glcd access</span>00085 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="ks0108_8h.html#a25">glcdDelay</a>(u16 p);00086 <span class="preprocessor">#endif</span></pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri Oct 15 03:50:22 2004 for Procyon AVRlib by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 > </a>1.3.6 </small></address></body></html>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -