4 * This file is part of BeRTOS.
6 * Bertos is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 * As a special exception, you may use this file as part of a free software
21 * library without restriction. Specifically, if other files instantiate
22 * templates or use macros or inline functions from this file, or you compile
23 * this file and link it with other files to produce an executable, this
24 * file does not by itself cause the resulting executable to be covered by
25 * the GNU General Public License. This exception does not however
26 * invalidate any other reasons why the executable file might be covered by
27 * the GNU General Public License.
29 * Copyright 2005 Develer S.r.l. (http://www.develer.com/)
33 * \brief Hitachi HD44780 and clones LCD module.
37 * \author Bernie Innocenti <bernie@codewiz.org>
38 * \author Stefano Fedrigo <aleph@develer.com>
40 * $WIZ$ module_name = "lcd_hd44"
41 * $WIZ$ module_depends = "timer"
42 * $WIZ$ module_configuration = "bertos/cfg/cfg_lcd.h"
43 * $WIZ$ module_hw = "bertos/hw/hw_lcd.h"
46 #ifndef DRV_LCD_HD44_H
47 #define DRV_LCD_HD44_H
49 #include "cfg/cfg_lcd.h"
50 #include <cfg/compiler.h> /* For stdint types */
53 * \name Display dimensions (in chars)
61 * \name Hitachi HD44 commands.
64 #define LCD_CMD_DISPLAY_INI 0x30
67 #define LCD_CMD_SETFUNC 0x28 /**< 4 bits, 2 lines, 5x7 dots */
69 #define LCD_CMD_SETFUNC 0x38 /**< 8 bits, 2 lines, 5x7 dots */
72 #define LCD_CMD_DISPLAY_ON 0x0F /**< Switch on display */
73 #define LCD_CMD_DISPLAY_OFF 0x08 /**< Switch off display */
74 #define LCD_CMD_CLEAR 0x01 /**< Clear display */
75 #define LCD_CMD_CURSOR_BLOCK 0x0D /**< Show cursor (block) */
76 #define LCD_CMD_CURSOR_LINE 0x0F /**< Show cursor (line) */
77 #define LCD_CMD_CURSOR_OFF 0x0C /**< Hide cursor */
78 #define LCD_CMD_DISPLAYMODE 0x06
79 #define LCD_CMD_SET_CGRAMADDR 0x40
80 #define LCD_CMD_RESET_DDRAM 0x80
81 #define LCD_CMD_SET_DDRAMADDR 0x80
82 #define LCD_CMD_DISPLAY_SHIFT 0x18
83 #define LCD_CMD_MOVESHIFT_LEFT 0x00
84 #define LCD_CMD_MOVESHIFT_RIGHT 0x04
87 /** Type for combined LCD cursor position (x,y). */
88 typedef uint8_t lcdpos_t;
90 void lcd_waitBusy(void);
91 void lcd_moveTo(uint8_t addr);
92 void lcd_setReg(uint8_t val);
93 void lcd_putc(uint8_t a, uint8_t c);
94 void lcd_remapChar(const char *glyph, char code);
95 void lcd_hw_init(void);
96 void lcd_hw_test(void);
98 #endif /* DRV_LCD_HD44_H */