Nut/OS  4.10.3
API Reference
hd44780.h
Go to the documentation of this file.
00001 #ifndef _DEV_HD44780_H_
00002 #define _DEV_HD44780_H_
00003 /*
00004  * Copyright (C) 2001-2006 by egnite Software GmbH. All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions
00008  * are met:
00009  *
00010  * 1. Redistributions of source code must retain the above copyright
00011  *    notice, this list of conditions and the following disclaimer.
00012  * 2. Redistributions in binary form must reproduce the above copyright
00013  *    notice, this list of conditions and the following disclaimer in the
00014  *    documentation and/or other materials provided with the distribution.
00015  * 3. All advertising materials mentioning features or use of this
00016  *    software must display the following acknowledgement:
00017  *
00018  *    This product includes software developed by egnite Software GmbH
00019  *    and its contributors.
00020  *
00021  * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
00022  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00023  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00024  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
00025  * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00026  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00027  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00028  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00029  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00030  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00031  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00032  * SUCH DAMAGE.
00033  *
00034  * For additional information see http://www.ethernut.de/
00035  *
00036  * -
00037  * Portions Copyright (C) 2001 Jesper Hansen <jesperh@telia.com>.
00038  * 
00039  * This file is part of the yampp system.
00040  * 
00041  * This program is free software; you can redistribute it and/or
00042  * modify it under the terms of the GNU General Public License
00043  * as published by the Free Software Foundation; either version 2
00044  * of the License, or (at your option) any later version.
00045  * 
00046  * This program is distributed in the hope that it will be useful,
00047  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00048  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00049  * GNU General Public License for more details.
00050  *
00051  * You should have received a copy of the GNU General Public License
00052  * along with this program; if not, write to the Free Software Foundation,
00053  * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00054  */
00055 
00056 /*
00057  * $Log$
00058  * Revision 1.4  2007/08/29 07:43:53  haraldkipp
00059  * Documentation updated and corrected.
00060  *
00061  * Revision 1.3  2006/04/07 12:58:34  haraldkipp
00062  * Target specific delay defaults moved from global header to AVR specific
00063  * file.
00064  *
00065  * Revision 1.2  2005/05/27 14:02:01  olereinhardt
00066  * Added support for new display sizes configurable by macros
00067  * LCD_4x20, LCD_4x16, LCD_2x40, LCD_2x20, LCD_2x16, LCD_2x8,
00068  * LCD_1x20, LCD_1x16, LCD_1x8, KS0078_CONTROLLER (4x20))
00069  * Also added support for different delay types.
00070  * For not to wait busy too long, I added support for busy bit
00071  * read back and use NutSleep instead NutDelay if NUT_CPU_FREQ
00072  * is defined.
00073  *
00074  * Revision 1.1.1.1  2003/05/09 14:41:05  haraldkipp
00075  * Initial using 3.2.1
00076  *
00077  * Revision 1.2  2003/05/06 18:40:43  harald
00078  * Cleanup
00079  *
00080  * Revision 1.1  2003/03/31 14:53:23  harald
00081  * Prepare release 3.1
00082  *
00083  */
00084 
00085 #include <sys/device.h>
00086 
00087 
00092 
00093 // HD44780 Commandset
00094 #define LCD_CLR             0      // DB0: clear display
00095 #define LCD_HOME            1      // DB1: return to home position
00096 #define LCD_ENTRY_MODE      2      // DB2: set entry mode
00097 #define LCD_ENTRY_INC       1      //   DB1: increment
00098 #define LCD_ENTRY_SHIFT     0      //   DB2: shift
00099 #define LCD_ON_CTRL         3      // DB3: turn lcd/cursor on
00100 #define LCD_ON_DISPLAY      2      //   DB2: turn display on
00101 #define LCD_ON_CURSOR       1      //   DB1: turn cursor on
00102 #define LCD_ON_BLINK        0      //   DB0: blinking cursor
00103 #define LCD_MOVE            4      // DB4: move cursor/display
00104 #define LCD_MOVE_DISP       3      //   DB3: move display (0-> move cursor)
00105 #define LCD_MOVE_RIGHT      2      //   DB2: move right (0-> left)
00106 #define LCD_FUNCTION        5      // DB5: function set
00107 #define LCD_FUNCTION_8BIT   4      //   DB4: set 8BIT mode (0->4BIT mode)
00108 #define LCD_FUNCTION_2LINES 3      //   DB3: two lines (0->one line)
00109 #define LCD_FUNCTION_RE     2      //   DB2: KS0073 Controller: Extended Register
00110 #define LCD_FUNCTION_10DOTS 2      //   DB2: 5x10 font (0->5x7 font)
00111 #define LCD_FUNCTION_DS     1      //   DB1: DisplayShift / DotScroll
00112 #define LCD_FUNCTION_REV    0      //   DB0: Reverse Display
00113 #define LCD_EXT             3      // DB3: Extended Register Set
00114 #define LCD_EXT_FONT        2      //   DB2: Fontwidth: 5 / 6 Pixel
00115 #define LCD_EXT_INVCURS     1      //   DB1: Normal / Inverted Cursor
00116 #define LCD_EXT_4LINES      0      //   DB0: 1/2 Lines (normal) or 4Lines
00117 #define LCD_CGRAM           6      // DB6: set CG RAM address
00118 #define LCD_DDRAM           7      // DB7: set DD RAM address
00119 // reading:
00120 #define LCD_BUSY            7      // DB7: LCD is busy
00121 
00124 extern NUTDEVICE devLcd;
00125 
00126 #endif