Main Page   Data Structures   File List   Data Fields   Globals  

ks0108.h

Go to the documentation of this file.
00001 /*! \file ks0108.h \brief Graphic LCD driver for HD61202/KS0108 displays. */
00002 //*****************************************************************************
00003 //
00004 // File Name    : 'ks0108.h'
00005 // Title        : Graphic LCD driver for HD61202/KS0108 displays
00006 // Author       : Pascal Stang - Copyright (C) 2001-2002
00007 // Date         : 10/19/2002
00008 // Revised      : 5/30/2002
00009 // Version      : 0.5
00010 // Target MCU   : Atmel AVR
00011 // Editor Tabs  : 4
00012 //
00013 // NOTE: This code is currently below version 1.0, and therefore is considered
00014 // to be lacking in some functionality or documentation, or may not be fully
00015 // tested.  Nonetheless, you can expect most functions to work.
00016 //
00017 // This code is distributed under the GNU Public License
00018 //      which can be found at http://www.gnu.org/licenses/gpl.txt
00019 //
00020 //*****************************************************************************
00021 
00022 
00023 #ifndef KS0108_H
00024 #define KS0108_H
00025 
00026 #include "global.h"
00027 
00028 #include "ks0108conf.h"
00029 
00030 // HD61202/KS0108 command set
00031 #define GLCD_ON_CTRL        0x3E    // 0011111X: lcd on/off control
00032 #define GLCD_ON_DISPLAY     0x01    //      DB0: turn display on
00033 
00034 #define GLCD_START_LINE     0xC0    // 11XXXXXX: set lcd start line
00035 
00036 #define GLCD_SET_PAGE       0xB8    // 10111XXX: set lcd page (X) address
00037 #define GLCD_Y_ADDR         0x40    // 01YYYYYY: set lcd Y address
00038 
00039 #define GLCD_STATUS_BUSY    0x80    // (1)->LCD IS BUSY
00040 #define GLCD_STATUS_ONOFF   0x20    // (0)->LCD IS ON
00041 #define GLCD_STATUS_RESET   0x10    // (1)->LCD IS RESET
00042 
00043 // typedefs/structures
00044 typedef struct struct_GrLcdCtrlrStateType
00045 {
00046     unsigned char xAddr;
00047     unsigned char yAddr;
00048 } GrLcdCtrlrStateType;
00049 
00050 typedef struct struct_GrLcdStateType
00051 {
00052     unsigned char lcdXAddr;
00053     unsigned char lcdYAddr;
00054     GrLcdCtrlrStateType ctrlr[2];
00055 } GrLcdStateType;
00056 
00057 // prototypes
00058 void glcdInitHW(void);
00059 void glcdBusyWait(u08 controller);
00060 void glcdControlWrite(u08 controller, u08 data);
00061 u08  glcdControlRead(u08 controller);
00062 void glcdDataWrite(u08 data);
00063 u08  glcdDataRead(void);
00064 void glcdSetXAddress(u08 xAddr);
00065 void glcdSetYAddress(u08 yAddr);
00066 
00067 
00068 void glcdInit(void);
00069 void glcdClearScreen(void);
00070 void glcdHome(void);
00071 void glcdGotoChar(u08 line, u08 col);
00072 void glcdSetAddress(u08 x, u08 yLine);
00073 void glcdStartLine(u08 start);
00074 
00075 void glcd1WriteChar(u08 asciiIdx);
00076 void glcd1WriteCharGr(u08 grIdx);
00077 
00078 void glcdDelay(u16 p);
00079 #endif

Generated on Tue Feb 4 20:18:37 2003 for Procyon AVRlib by doxygen1.3-rc2