lcd.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /* most of this is taken from the file */
  2. /* hal/powerpc/cogent/current/src/hal_diag.c in the */
  3. /* Cygnus eCos source. Here is the copyright notice: */
  4. /* */
  5. /*============================================================================= */
  6. /* */
  7. /* hal_diag.c */
  8. /* */
  9. /* HAL diagnostic output code */
  10. /* */
  11. /*============================================================================= */
  12. /*####COPYRIGHTBEGIN#### */
  13. /* */
  14. /* ------------------------------------------- */
  15. /* The contents of this file are subject to the Cygnus eCos Public License */
  16. /* Version 1.0 (the "License"); you may not use this file except in */
  17. /* compliance with the License. You may obtain a copy of the License at */
  18. /* http://sourceware.cygnus.com/ecos */
  19. /* */
  20. /* Software distributed under the License is distributed on an "AS IS" */
  21. /* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the */
  22. /* License for the specific language governing rights and limitations under */
  23. /* the License. */
  24. /* */
  25. /* The Original Code is eCos - Embedded Cygnus Operating System, released */
  26. /* September 30, 1998. */
  27. /* */
  28. /* The Initial Developer of the Original Code is Cygnus. Portions created */
  29. /* by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. */
  30. /* ------------------------------------------- */
  31. /* */
  32. /*####COPYRIGHTEND#### */
  33. /*============================================================================= */
  34. /*#####DESCRIPTIONBEGIN#### */
  35. /* */
  36. /* Author(s): nickg, jskov */
  37. /* Contributors: nickg, jskov */
  38. /* Date: 1999-03-23 */
  39. /* Purpose: HAL diagnostic output */
  40. /* Description: Implementations of HAL diagnostic output support. */
  41. /* */
  42. /*####DESCRIPTIONEND#### */
  43. /* */
  44. /*============================================================================= */
  45. /* FEMA 162B 16 character x 2 line LCD */
  46. /* status register bit definitions */
  47. #define LCD_STAT_BUSY 0x80 /* 1 = display busy */
  48. #define LCD_STAT_ADD 0x7F /* bits 0-6 return current display address */
  49. /* command register definitions */
  50. #define LCD_CMD_RST 0x01 /* clear entire display and reset display addr */
  51. #define LCD_CMD_HOME 0x02 /* reset display address and reset any shifting */
  52. #define LCD_CMD_ECL 0x04 /* move cursor left one pos on next data write */
  53. #define LCD_CMD_ESL 0x05 /* shift display left one pos on next data write */
  54. #define LCD_CMD_ECR 0x06 /* move cursor right one pos on next data write */
  55. #define LCD_CMD_ESR 0x07 /* shift disp right one pos on next data write */
  56. #define LCD_CMD_DOFF 0x08 /* display off, cursor off, blinking off */
  57. #define LCD_CMD_BL 0x09 /* blink character at current cursor position */
  58. #define LCD_CMD_CUR 0x0A /* enable cursor on */
  59. #define LCD_CMD_DON 0x0C /* turn display on */
  60. #define LCD_CMD_CL 0x10 /* move cursor left one position */
  61. #define LCD_CMD_SL 0x14 /* shift display left one position */
  62. #define LCD_CMD_CR 0x18 /* move cursor right one position */
  63. #define LCD_CMD_SR 0x1C /* shift display right one position */
  64. #define LCD_CMD_MODE 0x38 /* sets 8 bits, 2 lines, 5x7 characters */
  65. #define LCD_CMD_ACG 0x40 /* bits 0-5 sets character generator address */
  66. #define LCD_CMD_ADD 0x80 /* bits 0-6 sets display data addr to line 1 + */
  67. /* LCD status values */
  68. #define LCD_OK 0x00
  69. #define LCD_ERR 0x01
  70. #define LCD_LINE0 0x00
  71. #define LCD_LINE1 0x40
  72. #define LCD_LINE_LENGTH 16
  73. extern void lcd_init(void);
  74. extern void lcd_write_char(const char);
  75. extern void lcd_flush(void);
  76. extern void lcd_write_string(const char *);
  77. extern void lcd_printf(const char *, ...);