Add configurable options for HD44780 LCD display columns and rows.
[bertos.git] / bertos / drv / lcd_text.h
index 53fa53b29b9eaa17b59eeae24cf4ce4ddf1b1abb..09a1c70e7687aa611e65606c75b77cde5034d0b7 100644 (file)
  *
  * \brief Generic text LCD driver (interface).
  *
- * \version $Id$
  * \author Bernie Innocenti <bernie@codewiz.org>
  * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ * $WIZ$ module_name = "lcd_text"
+ * $WIZ$ module_depends = "lcd_hd44", "timer", "formatwr"
  */
 
-/*#*
- *#* $Log$
- *#* Revision 1.3  2006/07/19 12:56:26  bernie
- *#* Convert to new Doxygen style.
- *#*
- *#* Revision 1.2  2006/02/23 10:59:14  bernie
- *#* Documentation fixes.
- *#*
- *#* Revision 1.1  2005/11/04 18:00:42  bernie
- *#* Import into DevLib.
- *#*
- *#* Revision 1.5  2005/06/14 14:43:43  bernie
- *#* Add DevLib headers.
- *#*
- *#* Revision 1.4  2005/06/06 17:41:57  batt
- *#* Add lcd_layerSet function.
- *#*
- *#* Revision 1.3  2005/06/01 10:36:23  batt
- *#* Layer: Rename member variables and Doxygenize.
- *#*
- *#* Revision 1.2  2005/05/26 08:31:23  batt
- *#* Add layer hiding/showing.
- *#*
- *#* Revision 1.1  2005/05/24 09:17:58  batt
- *#* Move drivers to top-level.
- *#*/
-
 #ifndef DRV_LCD_H
 #define DRV_LCD_H
 
@@ -71,7 +46,7 @@
 
 #include <cfg/macros.h>
 #include <cfg/compiler.h>
-#include <mware/list.h>
+#include <struct/list.h>
 
 #include <stdarg.h> // vprintf()
 
 #define LAYER_HIDDEN   -127
 
 /* Compute LCD address from x/y coordinates */
-#define LCD_POS(x,y)  ((lcdpos_t)((uint8_t)(x) + (uint8_t)(y) * (uint8_t)LCD_COLS))
-#define LCD_ROW0  (LCD_COLS * 0)
-#define LCD_ROW1  (LCD_COLS * 1)
-#define LCD_ROW2  (LCD_COLS * 2)
-#define LCD_ROW3  (LCD_COLS * 3)
+#define LCD_POS(x,y)  ((lcdpos_t)((uint8_t)(x) + (uint8_t)(y) * (uint8_t)CONFIG_LCD_COLS))
+#define LCD_ROW0  (CONFIG_LCD_COLS * 0)
+#define LCD_ROW1  (CONFIG_LCD_COLS * 1)
+#define LCD_ROW2  (CONFIG_LCD_COLS * 2)
+#define LCD_ROW3  (CONFIG_LCD_COLS * 3)
 
 /**
  * Overwrapping layer context.
@@ -107,7 +82,7 @@ typedef struct _Layer
        lcdpos_t addr;
 
        /** Priority of this layer (greater in front of lesser). */
-       char pri;
+       signed char pri;
 
        /**
         * Layer backing store buffer.
@@ -116,7 +91,7 @@ typedef struct _Layer
         * Characters cells with value 0 are transparent with respect
         * to other layers in the background.
         */
-       char buf[LCD_COLS * LCD_ROWS];
+       char buf[CONFIG_LCD_COLS * CONFIG_LCD_ROWS];
 } Layer;