/*#*
*#* $Log$
+ *#* Revision 1.5 2006/09/20 19:55:01 marco
+ *#* Added CONFIG_LCD_4BIT.
+ *#*
*#* Revision 1.4 2006/09/13 18:29:22 bernie
*#* Add a few missing CONFIG_ definitions.
*#*
/// Accept input implicitly after this amount of time.
#define CONFIG_LEVELEDIT_TIMEOUT 3000 /* ms */
+/// LCD bus size. If 0 use 8bit bus.
+#define CONFIG_LCD_4BIT 0
+
#endif /* APPCONFIG_H */
/*#*
*#* $Log$
+ *#* Revision 1.3 2006/09/20 19:55:01 marco
+ *#* Added CONFIG_LCD_4BIT.
+ *#*
*#* Revision 1.2 2006/07/19 12:56:25 bernie
*#* Convert to new Doxygen style.
*#*
*#*/
#include "lcd_hd44.h"
-#include "lcd_bus_pz.h"
-#include <arch_config.h>
+#include "hw_lcd.h"
+#include <cfg/arch_config.h>
#include <drv/timer.h>
-#if defined(LCD_READ_H) && defined(LCD_READ_L) && defined(LCD_WRITE_H) && defined(LCD_WRITE_L)
- #define CONFIG_LCD_4BIT 1
-#elif defined(LCD_READ) && defined(LCD_WRITE)
- #define CONFIG_LCD_4BIT 0
-#else
- #error Incomplete or missing LCD_READ/LCD_WRITE macros
-#endif
-
/** Flag di stato del display */
#define LCDF_BUSY BV(7)
/* Read data */
LCD_SET_E;
LCD_DELAY_READ;
- data |= LCD_READ;
+ data = LCD_READ;
LCD_CLR_E;
LCD_DELAY_READ;
lcd_regWrite(LCD_CMD_CLEAR);
timer_delay(2);
- //lcd_regWrite(LCD_CMD_RESET_DDRAM); 4 bit mode doesn't allow char reprogramming
-
+#if !CONFIG_LCD_4BIT
+ lcd_regWrite(LCD_CMD_RESET_DDRAM); // 4 bit mode doesn't allow char reprogramming
+#endif
lcd_regWrite(LCD_CMD_DISPLAYMODE);
timer_delay(2);
}
/*#*
*#* $Log$
+ *#* Revision 1.3 2006/09/20 19:55:01 marco
+ *#* Added CONFIG_LCD_4BIT.
+ *#*
*#* Revision 1.2 2006/07/19 12:56:25 bernie
*#* Convert to new Doxygen style.
*#*
#ifndef DRV_LCD_HD44_H
#define DRV_LCD_HD44_H
+#include <appconfig.h>
#include <cfg/compiler.h> /* For stdint types */
/**
* \{
*/
#define LCD_CMD_DISPLAY_INI 0x30
-//#define LCD_CMD_SETFUNC 0x38 /**< 8 bits, 2 lines, 5x7 dots */
-#define LCD_CMD_SETFUNC 0x28 /**< 4 bits, 2 lines, 5x7 dots */
+
+#if CONFIG_LCD_4BIT
+ #define LCD_CMD_SETFUNC 0x28 /**< 4 bits, 2 lines, 5x7 dots */
+#else
+ #define LCD_CMD_SETFUNC 0x38 /**< 8 bits, 2 lines, 5x7 dots */
+#endif
+
#define LCD_CMD_DISPLAY_ON 0x0F /**< Switch on display */
#define LCD_CMD_DISPLAY_OFF 0x08 /**< Switch off display */
#define LCD_CMD_CLEAR 0x01 /**< Clear display */