Nut/OS  4.10.3
API Reference
hd44780_bus.h
Go to the documentation of this file.
00001 #ifndef _DEV_HD44780_BUS_H_
00002 #define _DEV_HD44780_BUS_H_
00003 /*
00004  * Copyright (C) 2004 by Ole Reinhardt <ole.reinhardt@kernelconcepts.de>,
00005  *                       Kernelconcepts http://www.kernelconcepts.de
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions
00009  * are met:
00010  *
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  * 2. Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in the
00015  *    documentation and/or other materials provided with the distribution.
00016  * 3. All advertising materials mentioning features or use of this
00017  *    software must display the following acknowledgement:
00018  *
00019  *    This product includes software developed by egnite Software GmbH
00020  *    and its contributors.
00021  *
00022  * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
00023  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00024  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00025  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
00026  * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00027  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00028  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00029  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00030  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00031  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00032  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00033  * SUCH DAMAGE.
00034  *
00035  * For additional information see http://www.ethernut.de/
00036  */
00037  
00038 /*
00039  * $Log$
00040  * Revision 1.4  2007/08/29 07:43:53  haraldkipp
00041  * Documentation updated and corrected.
00042  *
00043  * Revision 1.3  2004/05/27 15:03:54  olereinhardt
00044  * Changed copyright notice
00045  *
00046  * Revision 1.2  2004/05/25 17:33:32  drsung
00047  * Added 'log' keyword for CVS.
00048  *
00049  */
00050 
00051 #include <sys/device.h>
00052 
00053 
00058 
00059 // HD44780 Commandset
00060 #define LCD_CLR             0      // DB0: clear display
00061 #define LCD_HOME            1      // DB1: return to home position
00062 #define LCD_ENTRY_MODE      2      // DB2: set entry mode
00063 #define LCD_ENTRY_INC       1      //   DB1: increment
00064 #define LCD_ENTRY_SHIFT     0      //   DB2: shift
00065 #define LCD_ON_CTRL         3      // DB3: turn lcd/cursor on
00066 #define LCD_ON_DISPLAY      2      //   DB2: turn display on
00067 #define LCD_ON_CURSOR       1      //   DB1: turn cursor on
00068 #define LCD_ON_BLINK        0      //   DB0: blinking cursor
00069 #define LCD_MOVE            4      // DB4: move cursor/display
00070 #define LCD_MOVE_DISP       3      //   DB3: move display (0-> move cursor)
00071 #define LCD_MOVE_RIGHT      2      //   DB2: move right (0-> left)
00072 #define LCD_FUNCTION        5      // DB5: function set
00073 #define LCD_FUNCTION_8BIT   4      //   DB4: set 8BIT mode (0->4BIT mode)
00074 #define LCD_FUNCTION_2LINES 3      //   DB3: two lines (0->one line)
00075 #define LCD_FUNCTION_RE     2      //   DB2: KS0073 Controller: Extended Register
00076 #define LCD_FUNCTION_10DOTS 2      //   DB2: 5x10 font (0->5x7 font)
00077 #define LCD_FUNCTION_DS     1      //   DB1: DisplayShift / DotScroll
00078 #define LCD_FUNCTION_REV    0      //   DB0: Reverse Display
00079 #define LCD_EXT             3      // DB3: Extended Register Set
00080 #define LCD_EXT_FONT        2      //   DB2: Fontwidth: 5 / 6 Pixel
00081 #define LCD_EXT_INVCURS     1      //   DB1: Normal / Inverted Cursor
00082 #define LCD_EXT_4LINES      0      //   DB0: 1/2 Lines (normal) or 4Lines
00083 #define LCD_CGRAM           6      // DB6: set CG RAM address
00084 #define LCD_DDRAM           7      // DB7: set DD RAM address
00085 // reading:
00086 #define LCD_BUSY            7      // DB7: LCD is busy
00087 
00088 #define LCD_CTRL_ADDR   (lcd_base + 0x0000)
00089 #define LCD_DATA_ADDR   (lcd_base + 0x0001)
00090 #define LCD_READ_OFFSET 0x0002
00091 
00092 
00095 extern NUTDEVICE devLcdBus;
00096 
00097 #endif