4 * Copyright 2005 Develer S.r.l. (http://www.develer.com/)
5 * This file is part of DevLib - See README.devlib for information.
8 * \brief Hitachi HD44780 and clones LCD module (interface)
11 * \author Bernardo Innocenti <bernie@develer.com>
12 * \author Stefano Fedrigo <aleph@develer.com>
17 *#* Revision 1.1 2005/11/04 18:00:42 bernie
18 *#* Import into DevLib.
20 *#* Revision 1.2 2005/06/14 14:43:43 bernie
21 *#* Add DevLib headers.
23 *#* Revision 1.1 2005/05/24 09:17:58 batt
24 *#* Move drivers to top-level.
26 *#* Revision 1.3 2005/04/22 13:14:58 batt
27 *#* Better lcd rows and cols definition.
29 *#* Revision 1.2 2005/04/17 22:41:39 bernie
30 *#* lcd_test(): Rename to lcd_hw_test() and conditionalize on CONFIG_TEST.
32 *#* Revision 1.1 2005/04/16 19:48:35 aleph
36 #ifndef DRV_LCD_HD44_H
37 #define DRV_LCD_HD44_H
39 #include <cfg/compiler.h> /* For stdint types */
42 * \name Display dimensions (in chars)
50 * \name Hitachi HD44 commands.
53 #define LCD_CMD_DISPLAY_INI 0x30
54 //#define LCD_CMD_SETFUNC 0x38 /*!< 8 bits, 2 lines, 5x7 dots */
55 #define LCD_CMD_SETFUNC 0x28 /*!< 4 bits, 2 lines, 5x7 dots */
56 #define LCD_CMD_DISPLAY_ON 0x0F /*!< Switch on display */
57 #define LCD_CMD_DISPLAY_OFF 0x08 /*!< Switch off display */
58 #define LCD_CMD_CLEAR 0x01 /*!< Clear display */
59 #define LCD_CMD_CURSOR_BLOCK 0x0D /*!< Show cursor (block) */
60 #define LCD_CMD_CURSOR_LINE 0x0F /*!< Show cursor (line) */
61 #define LCD_CMD_CURSOR_OFF 0x0C /*!< Hide cursor */
62 #define LCD_CMD_DISPLAYMODE 0x06
63 #define LCD_CMD_SET_CGRAMADDR 0x40
64 #define LCD_CMD_RESET_DDRAM 0x80
65 #define LCD_CMD_SET_DDRAMADDR 0x80
66 #define LCD_CMD_DISPLAY_SHIFT 0x18
67 #define LCD_CMD_MOVESHIFT_LEFT 0x00
68 #define LCD_CMD_MOVESHIFT_RIGHT 0x04
71 /*! Type for combined LCD cursor position (x,y). */
72 typedef uint8_t lcdpos_t;
74 void lcd_waitBusy(void);
75 void lcd_moveTo(uint8_t addr);
76 void lcd_setReg(uint8_t val);
77 void lcd_putc(uint8_t a, uint8_t c);
78 void lcd_remapChar(const char *glyph, char code);
79 void lcd_hw_init(void);
80 void lcd_hw_test(void);
82 #endif /* DRV_LCD_HD44_H */