hd44780_bus.h 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 THE COPYRIGHT HOLDERS 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 THE
  26. * COPYRIGHT OWNER 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$
  39. * Revision 1.4 2007/08/29 07:43:53 haraldkipp
  40. * Documentation updated and corrected.
  41. *
  42. * Revision 1.3 2004/05/27 15:03:54 olereinhardt
  43. * Changed copyright notice
  44. *
  45. * Revision 1.2 2004/05/25 17:33:32 drsung
  46. * Added 'log' keyword for CVS.
  47. *
  48. */
  49. #include <sys/device.h>
  50. /*!
  51. * \addtogroup xgDevDisplay
  52. */
  53. /*@{*/
  54. // HD44780 Commandset
  55. #define LCD_CLR 0 // DB0: clear display
  56. #define LCD_HOME 1 // DB1: return to home position
  57. #define LCD_ENTRY_MODE 2 // DB2: set entry mode
  58. #define LCD_ENTRY_INC 1 // DB1: increment
  59. #define LCD_ENTRY_SHIFT 0 // DB2: shift
  60. #define LCD_ON_CTRL 3 // DB3: turn lcd/cursor on
  61. #define LCD_ON_DISPLAY 2 // DB2: turn display on
  62. #define LCD_ON_CURSOR 1 // DB1: turn cursor on
  63. #define LCD_ON_BLINK 0 // DB0: blinking cursor
  64. #define LCD_MOVE 4 // DB4: move cursor/display
  65. #define LCD_MOVE_DISP 3 // DB3: move display (0-> move cursor)
  66. #define LCD_MOVE_RIGHT 2 // DB2: move right (0-> left)
  67. #define LCD_FUNCTION 5 // DB5: function set
  68. #define LCD_FUNCTION_8BIT 4 // DB4: set 8BIT mode (0->4BIT mode)
  69. #define LCD_FUNCTION_2LINES 3 // DB3: two lines (0->one line)
  70. #define LCD_FUNCTION_RE 2 // DB2: KS0073 Controller: Extended Register
  71. #define LCD_FUNCTION_10DOTS 2 // DB2: 5x10 font (0->5x7 font)
  72. #define LCD_FUNCTION_DS 1 // DB1: DisplayShift / DotScroll
  73. #define LCD_FUNCTION_REV 0 // DB0: Reverse Display
  74. #define LCD_EXT 3 // DB3: Extended Register Set
  75. #define LCD_EXT_FONT 2 // DB2: Fontwidth: 5 / 6 Pixel
  76. #define LCD_EXT_INVCURS 1 // DB1: Normal / Inverted Cursor
  77. #define LCD_EXT_4LINES 0 // DB0: 1/2 Lines (normal) or 4Lines
  78. #define LCD_CGRAM 6 // DB6: set CG RAM address
  79. #define LCD_DDRAM 7 // DB7: set DD RAM address
  80. // reading:
  81. #define LCD_BUSY 7 // DB7: LCD is busy
  82. #define LCD_CTRL_ADDR (lcd_base + 0x0000)
  83. #define LCD_DATA_ADDR (lcd_base + 0x0001)
  84. #define LCD_READ_OFFSET 0x0002
  85. /*@}*/
  86. extern NUTDEVICE devLcdBus;
  87. #endif