Convert to new Doxygen style.
[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.2  2006/07/19 12:56:25  bernie
18  *#* Convert to new Doxygen style.
19  *#*
20  *#* Revision 1.1  2005/11/04 18:00:42  bernie
21  *#* Import into DevLib.
22  *#*
23  *#* Revision 1.2  2005/06/14 14:43:43  bernie
24  *#* Add DevLib headers.
25  *#*
26  *#* Revision 1.1  2005/05/24 09:17:58  batt
27  *#* Move drivers to top-level.
28  *#*
29  *#* Revision 1.3  2005/04/22 13:14:58  batt
30  *#* Better lcd rows and cols definition.
31  *#*
32  *#* Revision 1.2  2005/04/17 22:41:39  bernie
33  *#* lcd_test(): Rename to lcd_hw_test() and conditionalize on CONFIG_TEST.
34  *#*
35  *#* Revision 1.1  2005/04/16 19:48:35  aleph
36  *#* Rename lcd driver
37  *#*/
38
39 #ifndef DRV_LCD_HD44_H
40 #define DRV_LCD_HD44_H
41
42 #include <cfg/compiler.h> /* For stdint types */
43
44 /**
45  * \name Display dimensions (in chars)
46  * \{
47  */
48 #define LCD_ROWS  2
49 #define LCD_COLS  16
50 /* \} */
51
52 /**
53  * \name Hitachi HD44 commands.
54  * \{
55  */
56 #define LCD_CMD_DISPLAY_INI      0x30
57 //#define LCD_CMD_SETFUNC        0x38   /**< 8 bits, 2 lines, 5x7 dots */
58 #define LCD_CMD_SETFUNC          0x28   /**< 4 bits, 2 lines, 5x7 dots */
59 #define LCD_CMD_DISPLAY_ON       0x0F   /**< Switch on display */
60 #define LCD_CMD_DISPLAY_OFF      0x08   /**< Switch off display */
61 #define LCD_CMD_CLEAR            0x01   /**< Clear display */
62 #define LCD_CMD_CURSOR_BLOCK     0x0D   /**< Show cursor (block) */
63 #define LCD_CMD_CURSOR_LINE      0x0F   /**< Show cursor (line) */
64 #define LCD_CMD_CURSOR_OFF       0x0C   /**< Hide cursor */
65 #define LCD_CMD_DISPLAYMODE      0x06
66 #define LCD_CMD_SET_CGRAMADDR    0x40
67 #define LCD_CMD_RESET_DDRAM      0x80
68 #define LCD_CMD_SET_DDRAMADDR    0x80
69 #define LCD_CMD_DISPLAY_SHIFT    0x18
70 #define LCD_CMD_MOVESHIFT_LEFT   0x00
71 #define LCD_CMD_MOVESHIFT_RIGHT  0x04
72 /*\}*/
73
74 /** Type for combined LCD cursor position (x,y). */
75 typedef uint8_t lcdpos_t;
76
77 void lcd_waitBusy(void);
78 void lcd_moveTo(uint8_t addr);
79 void lcd_setReg(uint8_t val);
80 void lcd_putc(uint8_t a, uint8_t c);
81 void lcd_remapChar(const char *glyph, char code);
82 void lcd_hw_init(void);
83 void lcd_hw_test(void);
84
85 #endif /* DRV_LCD_HD44_H */