lcd_text.h

Go to the documentation of this file.
00001 
00040 /*#*
00041  *#* $Log$
00042  *#* Revision 1.3  2006/07/19 12:56:26  bernie
00043  *#* Convert to new Doxygen style.
00044  *#*
00045  *#* Revision 1.2  2006/02/23 10:59:14  bernie
00046  *#* Documentation fixes.
00047  *#*
00048  *#* Revision 1.1  2005/11/04 18:00:42  bernie
00049  *#* Import into DevLib.
00050  *#*
00051  *#* Revision 1.5  2005/06/14 14:43:43  bernie
00052  *#* Add DevLib headers.
00053  *#*
00054  *#* Revision 1.4  2005/06/06 17:41:57  batt
00055  *#* Add lcd_layerSet function.
00056  *#*
00057  *#* Revision 1.3  2005/06/01 10:36:23  batt
00058  *#* Layer: Rename member variables and Doxygenize.
00059  *#*
00060  *#* Revision 1.2  2005/05/26 08:31:23  batt
00061  *#* Add layer hiding/showing.
00062  *#*
00063  *#* Revision 1.1  2005/05/24 09:17:58  batt
00064  *#* Move drivers to top-level.
00065  *#*/
00066 
00067 #ifndef DRV_LCD_H
00068 #define DRV_LCD_H
00069 
00070 #include "lcd_hd44.h"
00071 
00072 #include <cfg/macros.h>
00073 #include <cfg/compiler.h>
00074 #include <mware/list.h>
00075 
00076 #include <stdarg.h> // vprintf()
00077 
00078 
00079 /* flags for lcd_printf() */
00080 #define LCD_NORMAL     0       /* Scrittura normale */
00081 #define LCD_FILL       BV(0)   /* Fill rest of line with spaces */
00082 #define LCD_CENTER     BV(1)   /* Center string in line */
00083 #define LCD_NOCURSOR   BV(2)   /* Scrittura senza spostamento cursore */
00084 
00086 #define LAYER_HIDDEN   -128
00087 
00088 /* Compute LCD address from x/y coordinates */
00089 #define LCD_POS(x,y)  ((lcdpos_t)((uint8_t)(x) + (uint8_t)(y) * (uint8_t)LCD_COLS))
00090 #define LCD_ROW0  (LCD_COLS * 0)
00091 #define LCD_ROW1  (LCD_COLS * 1)
00092 #define LCD_ROW2  (LCD_COLS * 2)
00093 #define LCD_ROW3  (LCD_COLS * 3)
00094 
00098 typedef struct _Layer
00099 {
00104     DECLARE_NODE_ANON(struct _Layer)
00105 
00106     
00107     lcdpos_t addr;
00108 
00110     char pri;
00111 
00119     char buf[LCD_COLS * LCD_ROWS];
00120 } Layer;
00121 
00122 
00123 /* Global variables */
00124 extern Layer *lcd_DefLayer;
00125 
00126 /* Function prototypes */
00127 extern void lcd_init(void);
00128 extern void lcd_test(void);
00129 
00130 extern void lcd_moveCursor(lcdpos_t addr);
00131 extern char lcd_setCursor(char state);
00132 
00133 extern void lcd_setAddr(Layer *layer, lcdpos_t addr);
00134 extern void lcd_putChar(char c, Layer *layer);
00135 extern int  lcd_vprintf(Layer *layer, lcdpos_t addr, uint8_t mode, const char *format, va_list ap) FORMAT(printf, 4, 0);
00136 extern int  lcd_printf(Layer *layer, lcdpos_t addr, uint8_t mode, const char *format, ...) FORMAT(printf, 4, 5);
00137 extern void lcd_clear(Layer *layer);
00138 extern void lcd_layerSet(Layer *layer, char c);
00139 extern void lcd_clearLine(Layer *layer, int y);
00140 
00141 extern void lcd_setLayerDepth(Layer *layer, char pri);
00142 extern Layer *lcd_newLayer(char pri);
00143 extern void lcd_deleteLayer(Layer *layer);
00144 extern void lcd_lock(void);
00145 extern void lcd_unlock(void);
00146 
00147 #endif /* DRV_LCD_H */