0413bed6af27ac9659d82ea4b4ce0cb1c69ec4c3
[bertos.git] / drv / lcd_hd44.h
1 /*!
2  * \file
3  * <!--
4  * Copyright 2005 Develer S.r.l. (http://www.develer.com/)
5  * This file is part of DevLib - See README.devlib for information.
6  * -->
7  *
8  * \brief Hitachi HD44780 and clones LCD module (interface)
9  *
10  * \version $Id$
11  * \author Bernardo Innocenti <bernie@develer.com>
12  * \author Stefano Fedrigo <aleph@develer.com>
13  */
14
15 /*#*
16  *#* $Log$
17  *#* Revision 1.1  2005/11/04 18:00:42  bernie
18  *#* Import into DevLib.
19  *#*
20  *#* Revision 1.2  2005/06/14 14:43:43  bernie
21  *#* Add DevLib headers.
22  *#*
23  *#* Revision 1.1  2005/05/24 09:17:58  batt
24  *#* Move drivers to top-level.
25  *#*
26  *#* Revision 1.3  2005/04/22 13:14:58  batt
27  *#* Better lcd rows and cols definition.
28  *#*
29  *#* Revision 1.2  2005/04/17 22:41:39  bernie
30  *#* lcd_test(): Rename to lcd_hw_test() and conditionalize on CONFIG_TEST.
31  *#*
32  *#* Revision 1.1  2005/04/16 19:48:35  aleph
33  *#* Rename lcd driver
34  *#*/
35
36 #ifndef DRV_LCD_HD44_H
37 #define DRV_LCD_HD44_H
38
39 #include <cfg/compiler.h> /* For stdint types */
40
41 /*!
42  * \name Display dimensions (in chars)
43  * \{
44  */
45 #define LCD_ROWS  2
46 #define LCD_COLS  16
47 /* \} */
48
49 /*!
50  * \name Hitachi HD44 commands.
51  * \{
52  */
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
69 /*\}*/
70
71 /*! Type for combined LCD cursor position (x,y). */
72 typedef uint8_t lcdpos_t;
73
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);
81
82 #endif /* DRV_LCD_HD44_H */