hd44780.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. #ifndef _DEV_HD44780_H_
  2. #define _DEV_HD44780_H_
  3. /*
  4. * Copyright (C) 2001-2006 by egnite Software GmbH. All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. All advertising materials mentioning features or use of this
  16. * software must display the following acknowledgement:
  17. *
  18. * This product includes software developed by egnite Software GmbH
  19. * and its contributors.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  24. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  25. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  26. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  27. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  28. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  29. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  30. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  31. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  32. * SUCH DAMAGE.
  33. *
  34. * For additional information see http://www.ethernut.de/
  35. *
  36. * -
  37. * Portions Copyright (C) 2001 Jesper Hansen <jesperh@telia.com>.
  38. *
  39. * This file is part of the yampp system.
  40. *
  41. * This program is free software; you can redistribute it and/or
  42. * modify it under the terms of the GNU General Public License
  43. * as published by the Free Software Foundation; either version 2
  44. * of the License, or (at your option) any later version.
  45. *
  46. * This program is distributed in the hope that it will be useful,
  47. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  48. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  49. * GNU General Public License for more details.
  50. *
  51. * You should have received a copy of the GNU General Public License
  52. * along with this program; if not, write to the Free Software Foundation,
  53. * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  54. */
  55. /*
  56. * $Log$
  57. * Revision 1.4 2007/08/29 07:43:53 haraldkipp
  58. * Documentation updated and corrected.
  59. *
  60. * Revision 1.3 2006/04/07 12:58:34 haraldkipp
  61. * Target specific delay defaults moved from global header to AVR specific
  62. * file.
  63. *
  64. * Revision 1.2 2005/05/27 14:02:01 olereinhardt
  65. * Added support for new display sizes configurable by macros
  66. * LCD_4x20, LCD_4x16, LCD_2x40, LCD_2x20, LCD_2x16, LCD_2x8,
  67. * LCD_1x20, LCD_1x16, LCD_1x8, KS0078_CONTROLLER (4x20))
  68. * Also added support for different delay types.
  69. * For not to wait busy too long, I added support for busy bit
  70. * read back and use NutSleep instead NutDelay if NUT_CPU_FREQ
  71. * is defined.
  72. *
  73. * Revision 1.1.1.1 2003/05/09 14:41:05 haraldkipp
  74. * Initial using 3.2.1
  75. *
  76. * Revision 1.2 2003/05/06 18:40:43 harald
  77. * Cleanup
  78. *
  79. * Revision 1.1 2003/03/31 14:53:23 harald
  80. * Prepare release 3.1
  81. *
  82. */
  83. #include <sys/device.h>
  84. /*!
  85. * \addtogroup xgDevDisplay
  86. */
  87. /*@{*/
  88. // HD44780 Commandset
  89. #define LCD_CLR 0 // DB0: clear display
  90. #define LCD_HOME 1 // DB1: return to home position
  91. #define LCD_ENTRY_MODE 2 // DB2: set entry mode
  92. #define LCD_ENTRY_INC 1 // DB1: increment
  93. #define LCD_ENTRY_SHIFT 0 // DB2: shift
  94. #define LCD_ON_CTRL 3 // DB3: turn lcd/cursor on
  95. #define LCD_ON_DISPLAY 2 // DB2: turn display on
  96. #define LCD_ON_CURSOR 1 // DB1: turn cursor on
  97. #define LCD_ON_BLINK 0 // DB0: blinking cursor
  98. #define LCD_MOVE 4 // DB4: move cursor/display
  99. #define LCD_MOVE_DISP 3 // DB3: move display (0-> move cursor)
  100. #define LCD_MOVE_RIGHT 2 // DB2: move right (0-> left)
  101. #define LCD_FUNCTION 5 // DB5: function set
  102. #define LCD_FUNCTION_8BIT 4 // DB4: set 8BIT mode (0->4BIT mode)
  103. #define LCD_FUNCTION_2LINES 3 // DB3: two lines (0->one line)
  104. #define LCD_FUNCTION_RE 2 // DB2: KS0073 Controller: Extended Register
  105. #define LCD_FUNCTION_10DOTS 2 // DB2: 5x10 font (0->5x7 font)
  106. #define LCD_FUNCTION_DS 1 // DB1: DisplayShift / DotScroll
  107. #define LCD_FUNCTION_REV 0 // DB0: Reverse Display
  108. #define LCD_EXT 3 // DB3: Extended Register Set
  109. #define LCD_EXT_FONT 2 // DB2: Fontwidth: 5 / 6 Pixel
  110. #define LCD_EXT_INVCURS 1 // DB1: Normal / Inverted Cursor
  111. #define LCD_EXT_4LINES 0 // DB0: 1/2 Lines (normal) or 4Lines
  112. #define LCD_CGRAM 6 // DB6: set CG RAM address
  113. #define LCD_DDRAM 7 // DB7: set DD RAM address
  114. // reading:
  115. #define LCD_BUSY 7 // DB7: LCD is busy
  116. /*@}*/
  117. extern NUTDEVICE devLcd;
  118. #endif