hd44780_bus.h 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #ifndef _DEV_HD44780_BUS_H_
  2. #define _DEV_HD44780_BUS_H_
  3. /*
  4. * Copyright (C) 2004 by Ole Reinhardt <ole.reinhardt@kernelconcepts.de>,
  5. * Kernelconcepts http://www.kernelconcepts.de
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions
  9. * are met:
  10. *
  11. * 1. Redistributions of source code must retain the above copyright
  12. * notice, this list of conditions and the following disclaimer.
  13. * 2. Redistributions in binary form must reproduce the above copyright
  14. * notice, this list of conditions and the following disclaimer in the
  15. * documentation and/or other materials provided with the distribution.
  16. * 3. All advertising materials mentioning features or use of this
  17. * software must display the following acknowledgement:
  18. *
  19. * This product includes software developed by egnite Software GmbH
  20. * and its contributors.
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
  23. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  24. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  25. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
  26. * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  27. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  28. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  29. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  30. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  31. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  32. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  33. * SUCH DAMAGE.
  34. *
  35. * For additional information see http://www.ethernut.de/
  36. */
  37. /*
  38. * $Log: hd44780_bus.h,v $
  39. * Revision 1.3 2004/05/27 15:03:54 olereinhardt
  40. * Changed copyright notice
  41. *
  42. * Revision 1.2 2004/05/25 17:33:32 drsung
  43. * Added 'log' keyword for CVS.
  44. *
  45. */
  46. #include <sys/device.h>
  47. /*!
  48. * \addgroup xgDevDisplay
  49. */
  50. /*@{*/
  51. // HD44780 Commandset
  52. #define LCD_CLR 0 // DB0: clear display
  53. #define LCD_HOME 1 // DB1: return to home position
  54. #define LCD_ENTRY_MODE 2 // DB2: set entry mode
  55. #define LCD_ENTRY_INC 1 // DB1: increment
  56. #define LCD_ENTRY_SHIFT 0 // DB2: shift
  57. #define LCD_ON_CTRL 3 // DB3: turn lcd/cursor on
  58. #define LCD_ON_DISPLAY 2 // DB2: turn display on
  59. #define LCD_ON_CURSOR 1 // DB1: turn cursor on
  60. #define LCD_ON_BLINK 0 // DB0: blinking cursor
  61. #define LCD_MOVE 4 // DB4: move cursor/display
  62. #define LCD_MOVE_DISP 3 // DB3: move display (0-> move cursor)
  63. #define LCD_MOVE_RIGHT 2 // DB2: move right (0-> left)
  64. #define LCD_FUNCTION 5 // DB5: function set
  65. #define LCD_FUNCTION_8BIT 4 // DB4: set 8BIT mode (0->4BIT mode)
  66. #define LCD_FUNCTION_2LINES 3 // DB3: two lines (0->one line)
  67. #define LCD_FUNCTION_RE 2 // DB2: KS0073 Controller: Extended Register
  68. #define LCD_FUNCTION_10DOTS 2 // DB2: 5x10 font (0->5x7 font)
  69. #define LCD_FUNCTION_DS 1 // DB1: DisplayShift / DotScroll
  70. #define LCD_FUNCTION_REV 0 // DB0: Reverse Display
  71. #define LCD_EXT 3 // DB3: Extended Register Set
  72. #define LCD_EXT_FONT 2 // DB2: Fontwidth: 5 / 6 Pixel
  73. #define LCD_EXT_INVCURS 1 // DB1: Normal / Inverted Cursor
  74. #define LCD_EXT_4LINES 0 // DB0: 1/2 Lines (normal) or 4Lines
  75. #define LCD_CGRAM 6 // DB6: set CG RAM address
  76. #define LCD_DDRAM 7 // DB7: set DD RAM address
  77. // reading:
  78. #define LCD_BUSY 7 // DB7: LCD is busy
  79. #define LCD_CTRL_ADDR (lcd_base + 0x0000)
  80. #define LCD_DATA_ADDR (lcd_base + 0x0001)
  81. #define LCD_READ_OFFSET 0x0002
  82. /*@}*/
  83. extern NUTDEVICE devLcdBus;
  84. #endif