ini
[aversive.git] / modules / devices / ihm / lcd / lcd.h
1 /*  
2  *  Copyright Droids Corporation, Microb Technology, Eirbot (2005)
3  * 
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  *
18  *  Revision : $Id: lcd.h,v 1.3.4.3 2007-08-19 10:39:31 zer0 Exp $
19  *
20  */
21
22 /* Droids-corp, Eirbot, Microb Technology 2005 - Zer0
23  * Interface for LCD
24  */
25
26 /** \file lcd.c
27  *  \brief Interface for the LCD module.
28  *
29  *  \todo implement ANSI commands for cursor positionning ?
30  *
31  *  \test works on mega32 with all on the same port and old normal wiring, how about more speific connections ?
32  *
33  * This module provides functions for using a standard lcd device
34  * the lcd s intended to be used in 4 bit mode, so don't wire the low nibble, only D4-D7 to 4 CONSECUTIVE port lines
35  * we need the RW, RS and E lines too.
36  * since the last version, you can scramble the wiring, except for D4-D7 who must remain consecutive (see lcd_config.h)
37  * 
38  * in this new version you can use lcd_putc('\f'); to clear the screen. This maintains an easy compatibility 
39  * when you want to use an uart instad (form feed).
40  */
41
42 /**********************************************************/
43
44 #ifndef _LCD_
45 #define _LCD_
46
47 #include <stdio.h>
48
49 #include <aversive.h>
50 #include "lcd_protocol.h"
51
52 /** 
53  * Init the LCD module
54  */
55 extern void lcd_init(uint8_t dispAttr);
56
57 /**
58  * Put a char on screen
59  * if c = \n cursor is positioned on the next line
60  * if c = \f the screen will be cleared
61  */
62 extern void lcd_putc(char c);
63
64 /**
65  * same than lcd_putc but with a prototype that is compliant with
66  * avrlibc > 1.4.0 fdevopen prototype
67  */
68 extern int lcd_dev_putc(char c, FILE* f);
69
70 /**
71  * move the cursor in the screen, x= line, y = char
72  */
73 extern void lcd_gotoxy(uint8_t x, uint8_t y);
74
75 /** 
76  * clear all the screen
77  * avoid using this function, escpecially if you use printf
78  */
79 extern void lcd_clrscr(void);
80
81 #endif // _LCD_