*
* \brief Configuration file for GFX module.
*
- * \version $Id$
- *
* \author Daniele Basile <asterix@develer.com>
*/
#ifndef CFG_GFX_H
#define CFG_GFX_H
-/// Enable line clipping algorithm.
+
+/**
+ * Enable line clipping algorithm.
+ * $WIZ$ type = "boolean"
+ */
#define CONFIG_GFX_CLIPPING 1
-/// Enable text rendering in bitmaps.
+/**
+ * Enable text rendering in bitmaps.
+ * $WIZ$ type = "boolean"
+ */
#define CONFIG_GFX_TEXT 1
-/// Enable virtual coordinate system.
+/**
+ * Enable virtual coordinate system.
+ * $WIZ$ type = "boolean"
+ */
#define CONFIG_GFX_VCOORDS 1
-/// Select bitmap pixel format.
+/**
+ * Select bitmap pixel format.
+ * $WIZ$ type = "enum"
+ * $WIZ$ value_list = "bitmap_format"
+ */
#define CONFIG_BITMAP_FMT BITMAP_FMT_PLANAR_V_LSB
-
-#define CONFIG_CHART_TYPE_X uint8_t ///< Type for the chart dataset
-#define CONFIG_CHART_TYPE_Y uint8_t ///< Type for the chart dataset
-
-
-/// Enable button bar behind menus
-#define CONFIG_MENU_MENUBAR 0
-
-/// Level Edit Timeout
-#define CONFIG_LEVELEDIT_TIMEOUT 0
-
-/// Menu timeout
-#define CONFIG_MENU_TIMEOUT 0
-
-/// Enable smooth scrolling in menus
-#define CONFIG_MENU_SMOOTH 1
-
-
#endif /* CFG_GFX_H */
*
* \brief dot-matrix LCD test.
*
- * \version $Id$
- *
* \author Bernie Innocenti <bernie@codewiz.org>
*
*/
/**
* \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
* Copyright 2003, 2004, 2005, 2006 Develer S.r.l. (http://www.develer.com/)
* Copyright 1999 Bernie Innocenti <bernie@codewiz.org>
*
*
- * \version $Id$
- *
* \author Bernie Innocenti <bernie@codewiz.org>
* \author Stefano Fedrigo <aleph@develer.com>
*
* \brief General pourpose graphics routines
+ *
+ * $WIZ$ module_name = "gfx"
+ * $WIZ$ module_configuration = "bertos/cfg/cfg_gfx.h"
*/
#ifndef GFX_GFX_H
#include <cpu/attr.h> /* CPU_HARVARD */
+#define CONFIG_CHART_TYPE_X uint8_t ///< Type for the chart dataset
+#define CONFIG_CHART_TYPE_Y uint8_t ///< Type for the chart dataset
+
/**
* \name Known pixel formats for bitmap representation.
* \{
+ * $WIZ$ bitmap_format = "BITMAP_FMT_PLANAR_H_MSB", "BITMAP_FMT_PLANAR_V_LSB"
*/
#define BITMAP_FMT_PLANAR_H_MSB 1 /**< Planar pixels, horizontal bytes, MSB left. */
#define BITMAP_FMT_PLANAR_V_LSB 2 /**< Planar pixels, vertical bytes, LSB top. */
*
* \author Bernie Innocenti <bernie@codewiz.org>
* \author Stefano Fedrigo <aleph@develer.com>
- * \version $Id$
*
* $WIZ$ module_name = "text"
* $WIZ$ module_harvard = "pgm_memory"
#include "leveledit.h"
-#include "cfg/cfg_gfx.h"
+#include "cfg/cfg_menu.h"
#include <cfg/macros.h> /* MAX() */
#include <drv/kbd.h>
#include "menu.h"
#include "cfg/cfg_gfx.h"
+#include "cfg/cfg_menu.h"
#include "cfg/cfg_arch.h"
#include <cfg/compiler.h>
#include <cfg/debug.h>
#if CONFIG_MENU_SMOOTH
#include <drv/lcd_gfx.h>
+/**
+ * With this you can choose, at compile time, which backend to use.
+ *
+ * $WIZ$ menu_backend_lcd = "LCD_RIT128X96_DRV", "LCD_32122A_DRV"
+ */
+#define LCD_RIT128X96_DRV 0 ///<
+#define LCD_32122A_DRV 1 ///<
+
+
#endif
#if (CONFIG_MENU_TIMEOUT != 0)
* \author Stefano Fedrigo <aleph@develer.com>
*
* \brief Common menu handling API
+ *
+ * $WIZ$ module_name = "menu"
+ * $WIZ$ module_configuration = "bertos/cfg/cfg_menu.h"
+ * $WIZ$ module_depends = "text", "gfx", "timer", "kbd"
*/
#ifndef GUI_MENU_H
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
- * All Rights Reserved.
- * -->
- *
- * \brief Configuration file for lcd display module.
- *
- * \version $Id$
- *
- * \author Daniele Basile <asterix@develer.com>
- */
-
-#ifndef CFG_LCD_H
-#define CFG_LCD_H
-
-/**
- * Use 4 bit addressing mode.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_4BIT 0
-
-/**
- * Use a table to speed up LCD memory addressing.
- * This will use about 100 bytes of RAM.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_ADDRESS_FAST 1
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_SOFTINT_REFRESH 0
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_WAIT 1
-
-
-#endif /* CFG_LCD_H */
-
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2006, 2010 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief Displaytech 32122A LCD driver configuration file.
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+#ifndef CFG_LCD_32122A_H
+#define CFG_LCD_32122A_H
+
+/**
+ * Enable soft interrupt to refresh the LCD.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_SOFTINT_REFRESH 0
+
+/**
+ * Enable wait macro when display is busy.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_WAIT 0
+
+/**
+ * Display refresh time 32122a.
+ * $WIZ$ type = "int"
+ * $WIZ$ min = 0
+ */
+#define CONFIG_LCD_REFRESH 100
+
+#endif /* CFG_LCD_32122A_H */
+
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
+ * All Rights Reserved.
+ * -->
+ *
+ * \brief Configuration file for lcd display module.
+ *
+ * \author Daniele Basile <asterix@develer.com>
+ */
+
+#ifndef CFG_LCD_H
+#define CFG_LCD_H
+
+/**
+ * Use 4 bit addressing mode.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_4BIT 0
+
+/**
+ * Use a table to speed up LCD memory addressing.
+ * This will use about 100 bytes of RAM.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_ADDRESS_FAST 1
+
+#endif /* CFG_LCD_H */
+
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2003, 2004, 2005, 2008 Develer S.r.l. (http://www.develer.com/)
- * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
- *
- * -->
- *
- * \brief LCD low-level hardware macros
- *
- * \version $Id$
- *
- * \author Bernie Innocenti <bernie@codewiz.org>
- * \author Stefano Fedrigo <aleph@develer.com>
- *
- */
-
-#ifndef HW_LCD_H
-#define HW_LCD_H
-
-#include "cfg/cfg_lcd.h" /* CONFIG_LCD_4BIT */
-#include <cfg/macros.h> /* BV() */
-#include <cfg/debug.h>
-
-#include <cpu/attr.h>
-#include <cpu/irq.h>
-#include <cpu/types.h>
-
-#warning TODO:This is an example implementation, you must implement it!
-
-/**
- * \name LCD I/O pins/ports
- * @{
- */
-#define LCD_RS /* Implement me! */
-#define LCD_RW /* Implement me! */
-#define LCD_E /* Implement me! */
-#define LCD_DB0 /* Implement me! */
-#define LCD_DB1 /* Implement me! */
-#define LCD_DB2 /* Implement me! */
-#define LCD_DB3 /* Implement me! */
-#define LCD_DB4 /* Implement me! */
-#define LCD_DB5 /* Implement me! */
-#define LCD_DB6 /* Implement me! */
-#define LCD_DB7 /* Implement me! */
-/*@}*/
-
-/**
- * \name DB high nibble (DB[4-7])
- * @{
- */
-
-#if CONFIG_LCD_4BIT
- #define LCD_MASK (LCD_DB7 | LCD_DB6 | LCD_DB5 | LCD_DB4)
- #define LCD_SHIFT 4
-#else
- #define LCD_MASK (uint8_t)0xff
- #define LCD_SHIFT 0
-#endif
-/*@}*/
-
-/**
- * \name LCD bus control macros
- * @{
- */
-#define LCD_CLR_RS /* Implement me! */
-#define LCD_SET_RS /* Implement me! */
-#define LCD_CLR_RD /* Implement me! */
-#define LCD_SET_RD /* Implement me! */
-#define LCD_CLR_E /* Implement me! */
-#define LCD_SET_E /* Implement me! */
-
-#if CONFIG_LCD_4BIT
- #define LCD_WRITE_H(x) ((void)x)/* Implement me! */
- #define LCD_WRITE_L(x) ((void)x)/* Implement me! */
- #define LCD_READ_H ( 0 /* Implement me! */ )
- #define LCD_READ_L ( 0 /* Implement me! */ )
-#else
- #define LCD_WRITE(x) ((void)x)/* Implement me! */
- #define LCD_READ (0 /* Implement me! */ )
-#endif
-/*@}*/
-
-/** Set data bus direction to output (write to display) */
-#define LCD_DB_OUT /* Implement me! */
-
-/** Set data bus direction to input (read from display) */
-#define LCD_DB_IN /* Implement me! */
-
-/** Delay for write (Enable pulse width, 220ns) */
-#define LCD_DELAY_WRITE \
- do { \
- NOP; \
- NOP; \
- NOP; \
- NOP; \
- NOP; \
- } while (0)
-
-/** Delay for read (Data ouput delay time, 120ns) */
-#define LCD_DELAY_READ \
- do { \
- NOP; \
- NOP; \
- NOP; \
- NOP; \
- } while (0)
-
-
-INLINE void lcd_bus_init(void)
-{
- cpu_flags_t flags;
- IRQ_SAVE_DISABLE(flags);
-
- /*
- * Here set bus pin!
- * to init a lcd device.
- *
- */
-
- /*
- * Data bus is in output state most of the time:
- * LCD r/w functions assume it is left in output state
- */
- LCD_DB_OUT;
-
-
- IRQ_RESTORE(flags);
-}
-
-#endif /* HW_LCD_H */
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2006, 2010 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief Displaytech 32122A LCD driver
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+
+#ifndef HW_LCD_32122A_H
+#define HW_LCD_32122A_H
+
+#include <cpu/types.h>
+#include <cpu/irq.h>
+
+#warning TODO:This is an example implementation, you must implement it!
+
+/**
+ * Predefined LCD PWM contrast values
+ */
+#define LCD_DEF_PWM 145
+#define LCD_MAX_PWM 505
+#define LCD_MIN_PWM 130
+#define LCD_PWM_CH 0
+
+
+/**
+ * \name LCD I/O pins/ports
+ * @{
+ */
+#define LCD_RS /* Implement me! */
+#define LCD_RW /* Implement me! */
+#define LCD_PE_E1 /* Implement me! */
+#define LCD_PE_E2 /* Implement me! */
+#define LCD_DB0 /* Implement me! */
+#define LCD_DB1 /* Implement me! */
+#define LCD_DB2 /* Implement me! */
+#define LCD_DB3 /* Implement me! */
+#define LCD_DB4 /* Implement me! */
+#define LCD_DB5 /* Implement me! */
+#define LCD_DB6 /* Implement me! */
+#define LCD_DB7 /* Implement me! */
+#define LCD_PF_DB0 /* Implment me! */
+/*@}*/
+
+/**
+ * \name LCD bus control macros
+ * @{
+ */
+#define LCD_CLR_A0 do { /* Implement me! */ } while (0)
+#define LCD_SET_A0 do { /* Implement me! */ } while (0)
+#define LCD_CLR_RD do { /* Implement me! */ } while (0)
+#define LCD_SET_RD do { /* Implement me! */ } while (0)
+#define LCD_CLR_E1 do { /* Implement me! */ } while (0)
+#define LCD_SET_E1 do { /* Implement me! */ } while (0)
+#define LCD_CLR_E2 do { /* Implement me! */ } while (0)
+#define LCD_SET_E2 do { /* Implement me! */ } while (0)
+#define LCD_SET_E(x) do { (void)x; /* Implement me! */ } while (0)
+#define LCD_CLR_E(x) do { (void)x; /* Implement me! */ } while (0)
+/*@}*/
+
+/**
+ * \name Chip select bits for LCD_SET_E()
+ * @{
+ */
+#define LCDF_E1 ( 0/* Implement me! */)
+#define LCDF_E2 ( 0/* Implement me! */)
+/*@}*/
+/** Read from the LCD data bus (DB[0-7]) */
+#define LCD_WRITE(x) ((void)x)/* Implement me! */
+/** Write to the LCD data bus (DB[0-7]) */
+#define LCD_READ (0 /* Implement me! */ )
+
+/** Set data bus direction to output (write to display) */
+#define LCD_DB_OUT /* Implement me! */
+
+/** Set data bus direction to input (read from display) */
+#define LCD_DB_IN /* Implement me! */
+
+/** Delay for write (Enable pulse width, 220ns) */
+#define LCD_DELAY_WRITE \
+ do { \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ } while (0)
+
+/** Delay for read (Data ouput delay time, 120ns) */
+#define LCD_DELAY_READ \
+ do { \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ } while (0)
+
+
+#define LCD_32122_RESET() do { /* Implement me! */ } while (0)
+
+INLINE void lcd_32122a_hw_bus_init(void)
+{
+ cpu_flags_t flags;
+ IRQ_SAVE_DISABLE(flags);
+
+ /*
+ * Here set bus pin!
+ * to init a lcd device.
+ *
+ */
+
+ /*
+ * Data bus is in output state most of the time:
+ * LCD r/w functions assume it is left in output state
+ */
+ LCD_DB_OUT;
+
+
+ IRQ_RESTORE(flags);
+}
+
+#endif /* HW_LCD_32122A_H */
+
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2008 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief LCD low-level hardware macros
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+
+#ifndef HW_LCD_HD44_H
+#define HW_LCD_HD44_H
+
+#include "cfg/cfg_lcd_hd44.h" /* CONFIG_LCD_4BIT */
+
+#include <cpu/types.h>
+#include <cpu/irq.h>
+
+#warning TODO:This is an example implementation, you must implement it!
+
+/**
+ * \name LCD I/O pins/ports
+ * @{
+ */
+#define LCD_RS /* Implement me! */
+#define LCD_RW /* Implement me! */
+#define LCD_E /* Implement me! */
+#define LCD_DB0 /* Implement me! */
+#define LCD_DB1 /* Implement me! */
+#define LCD_DB2 /* Implement me! */
+#define LCD_DB3 /* Implement me! */
+#define LCD_DB4 /* Implement me! */
+#define LCD_DB5 /* Implement me! */
+#define LCD_DB6 /* Implement me! */
+#define LCD_DB7 /* Implement me! */
+/*@}*/
+
+/**
+ * \name DB high nibble (DB[4-7])
+ * @{
+ */
+
+#if CONFIG_LCD_4BIT
+ #define LCD_MASK (LCD_DB7 | LCD_DB6 | LCD_DB5 | LCD_DB4)
+ #define LCD_SHIFT 4
+#else
+ #define LCD_MASK (uint8_t)0xff
+ #define LCD_SHIFT 0
+#endif
+/*@}*/
+
+/**
+ * \name LCD bus control macros
+ * @{
+ */
+#define LCD_CLR_RS /* Implement me! */
+#define LCD_SET_RS /* Implement me! */
+#define LCD_CLR_RD /* Implement me! */
+#define LCD_SET_RD /* Implement me! */
+#define LCD_CLR_E /* Implement me! */
+#define LCD_SET_E /* Implement me! */
+
+/* Enter command mode */
+#define LCD_SET_COMMAND() /* Implement me! */
+
+/* Enter data mode */
+#define LCD_SET_DATA() /* Implement me! */
+
+#if CONFIG_LCD_4BIT
+ #define LCD_WRITE_H(x) ((void)x)/* Implement me! */
+ #define LCD_WRITE_L(x) ((void)x)/* Implement me! */
+ #define LCD_READ_H ( 0 /* Implement me! */ )
+ #define LCD_READ_L ( 0 /* Implement me! */ )
+#else
+ #define LCD_WRITE(x) ((void)x)/* Implement me! */
+ #define LCD_READ (0 /* Implement me! */ )
+#endif
+/*@}*/
+
+/** Set data bus direction to output (write to display) */
+#define LCD_DB_OUT /* Implement me! */
+
+/** Set data bus direction to input (read from display) */
+#define LCD_DB_IN /* Implement me! */
+/** Delay for write (Enable pulse width, 220ns) */
+#define LCD_DELAY_WRITE \
+ do { \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ } while (0)
+
+/** Delay for read (Data ouput delay time, 120ns) */
+#define LCD_DELAY_READ \
+ do { \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ } while (0)
+
+
+
+INLINE void lcd_hd44_hw_bus_init(void)
+{
+ cpu_flags_t flags;
+ IRQ_SAVE_DISABLE(flags);
+
+ /*
+ * Here set bus pin!
+ * to init a lcd device.
+ *
+ */
+
+ /*
+ * Data bus is in output state most of the time:
+ * LCD r/w functions assume it is left in output state
+ */
+ LCD_DB_OUT;
+
+
+ IRQ_RESTORE(flags);
+}
+
+#endif /* HW_LCD_HD44_H */
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
- * All Rights Reserved.
- * -->
- *
- * \brief Configuration file for lcd display module.
- *
- * \version $Id$
- *
- * \author Daniele Basile <asterix@develer.com>
- */
-
-#ifndef CFG_LCD_H
-#define CFG_LCD_H
-
-/**
- * Use 4 bit addressing mode.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_4BIT 0
-
-/**
- * Use a table to speed up LCD memory addressing.
- * This will use about 100 bytes of RAM.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_ADDRESS_FAST 1
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_SOFTINT_REFRESH 0
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_WAIT 1
-
-
-#endif /* CFG_LCD_H */
-
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2006, 2010 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief Displaytech 32122A LCD driver configuration file.
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+#ifndef CFG_LCD_32122A_H
+#define CFG_LCD_32122A_H
+
+/**
+ * Enable soft interrupt to refresh the LCD.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_SOFTINT_REFRESH 0
+
+/**
+ * Enable wait macro when display is busy.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_WAIT 0
+
+/**
+ * Display refresh time 32122a.
+ * $WIZ$ type = "int"
+ * $WIZ$ min = 0
+ */
+#define CONFIG_LCD_REFRESH 100
+
+#endif /* CFG_LCD_32122A_H */
+
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
+ * All Rights Reserved.
+ * -->
+ *
+ * \brief Configuration file for lcd display module.
+ *
+ * \author Daniele Basile <asterix@develer.com>
+ */
+
+#ifndef CFG_LCD_H
+#define CFG_LCD_H
+
+/**
+ * Use 4 bit addressing mode.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_4BIT 0
+
+/**
+ * Use a table to speed up LCD memory addressing.
+ * This will use about 100 bytes of RAM.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_ADDRESS_FAST 1
+
+#endif /* CFG_LCD_H */
+
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
- * All Rights Reserved.
- * -->
- *
- * \brief Configuration file for lcd display module.
- *
- * \version $Id$
- *
- * \author Daniele Basile <asterix@develer.com>
- */
-
-#ifndef CFG_LCD_H
-#define CFG_LCD_H
-
-/**
- * Use 4 bit addressing mode.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_4BIT 0
-
-/**
- * Use a table to speed up LCD memory addressing.
- * This will use about 100 bytes of RAM.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_ADDRESS_FAST 1
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_SOFTINT_REFRESH 0
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_WAIT 1
-
-
-#endif /* CFG_LCD_H */
-
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2006, 2010 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief Displaytech 32122A LCD driver configuration file.
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+#ifndef CFG_LCD_32122A_H
+#define CFG_LCD_32122A_H
+
+/**
+ * Enable soft interrupt to refresh the LCD.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_SOFTINT_REFRESH 0
+
+/**
+ * Enable wait macro when display is busy.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_WAIT 0
+
+/**
+ * Display refresh time 32122a.
+ * $WIZ$ type = "int"
+ * $WIZ$ min = 0
+ */
+#define CONFIG_LCD_REFRESH 100
+
+#endif /* CFG_LCD_32122A_H */
+
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
+ * All Rights Reserved.
+ * -->
+ *
+ * \brief Configuration file for lcd display module.
+ *
+ * \author Daniele Basile <asterix@develer.com>
+ */
+
+#ifndef CFG_LCD_H
+#define CFG_LCD_H
+
+/**
+ * Use 4 bit addressing mode.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_4BIT 0
+
+/**
+ * Use a table to speed up LCD memory addressing.
+ * This will use about 100 bytes of RAM.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_ADDRESS_FAST 1
+
+#endif /* CFG_LCD_H */
+
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
- * All Rights Reserved.
- * -->
- *
- * \brief Configuration file for lcd display module.
- *
- * \version $Id$
- *
- * \author Daniele Basile <asterix@develer.com>
- */
-
-#ifndef CFG_LCD_H
-#define CFG_LCD_H
-
-/**
- * Use 4 bit addressing mode.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_4BIT 0
-
-/**
- * Use a table to speed up LCD memory addressing.
- * This will use about 100 bytes of RAM.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_ADDRESS_FAST 1
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_SOFTINT_REFRESH 0
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_WAIT 1
-
-
-#endif /* CFG_LCD_H */
-
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2006, 2010 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief Displaytech 32122A LCD driver configuration file.
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+#ifndef CFG_LCD_32122A_H
+#define CFG_LCD_32122A_H
+
+/**
+ * Enable soft interrupt to refresh the LCD.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_SOFTINT_REFRESH 0
+
+/**
+ * Enable wait macro when display is busy.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_WAIT 0
+
+/**
+ * Display refresh time 32122a.
+ * $WIZ$ type = "int"
+ * $WIZ$ min = 0
+ */
+#define CONFIG_LCD_REFRESH 100
+
+#endif /* CFG_LCD_32122A_H */
+
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
+ * All Rights Reserved.
+ * -->
+ *
+ * \brief Configuration file for lcd display module.
+ *
+ * \author Daniele Basile <asterix@develer.com>
+ */
+
+#ifndef CFG_LCD_H
+#define CFG_LCD_H
+
+/**
+ * Use 4 bit addressing mode.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_4BIT 0
+
+/**
+ * Use a table to speed up LCD memory addressing.
+ * This will use about 100 bytes of RAM.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_ADDRESS_FAST 1
+
+#endif /* CFG_LCD_H */
+
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2003, 2004, 2005, 2008 Develer S.r.l. (http://www.develer.com/)
- * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
- *
- * -->
- *
- * \brief LCD low-level hardware macros
- *
- * \version $Id$
- *
- * \author Bernie Innocenti <bernie@codewiz.org>
- * \author Stefano Fedrigo <aleph@develer.com>
- *
- */
-
-#ifndef HW_LCD_H
-#define HW_LCD_H
-
-#include "cfg/cfg_lcd.h" /* CONFIG_LCD_4BIT */
-#include <cfg/macros.h> /* BV() */
-#include <cfg/debug.h>
-
-#include <cpu/attr.h>
-#include <cpu/irq.h>
-#include <cpu/types.h>
-
-#warning TODO:This is an example implementation, you must implement it!
-
-/**
- * \name LCD I/O pins/ports
- * @{
- */
-#define LCD_RS /* Implement me! */
-#define LCD_RW /* Implement me! */
-#define LCD_E /* Implement me! */
-#define LCD_DB0 /* Implement me! */
-#define LCD_DB1 /* Implement me! */
-#define LCD_DB2 /* Implement me! */
-#define LCD_DB3 /* Implement me! */
-#define LCD_DB4 /* Implement me! */
-#define LCD_DB5 /* Implement me! */
-#define LCD_DB6 /* Implement me! */
-#define LCD_DB7 /* Implement me! */
-/*@}*/
-
-/**
- * \name DB high nibble (DB[4-7])
- * @{
- */
-
-#if CONFIG_LCD_4BIT
- #define LCD_MASK (LCD_DB7 | LCD_DB6 | LCD_DB5 | LCD_DB4)
- #define LCD_SHIFT 4
-#else
- #define LCD_MASK (uint8_t)0xff
- #define LCD_SHIFT 0
-#endif
-/*@}*/
-
-/**
- * \name LCD bus control macros
- * @{
- */
-#define LCD_CLR_RS /* Implement me! */
-#define LCD_SET_RS /* Implement me! */
-#define LCD_CLR_RD /* Implement me! */
-#define LCD_SET_RD /* Implement me! */
-#define LCD_CLR_E /* Implement me! */
-#define LCD_SET_E /* Implement me! */
-
-/* Enter command mode */
-#define LCD_SET_COMMAND() /* Implement me! */
-
-/* Enter data mode */
-#define LCD_SET_DATA() /* Implement me! */
-
-#if CONFIG_LCD_4BIT
- #define LCD_WRITE_H(x) ((void)x)/* Implement me! */
- #define LCD_WRITE_L(x) ((void)x)/* Implement me! */
- #define LCD_READ_H ( 0 /* Implement me! */ )
- #define LCD_READ_L ( 0 /* Implement me! */ )
-#else
- #define LCD_WRITE(x) ((void)x)/* Implement me! */
- #define LCD_READ (0 /* Implement me! */ )
-#endif
-/*@}*/
-
-/** Set data bus direction to output (write to display) */
-#define LCD_DB_OUT /* Implement me! */
-
-/** Set data bus direction to input (read from display) */
-#define LCD_DB_IN /* Implement me! */
-
-/** Delay for write (Enable pulse width, 220ns) */
-#define LCD_DELAY_WRITE \
- do { \
- NOP; \
- NOP; \
- NOP; \
- NOP; \
- NOP; \
- } while (0)
-
-/** Delay for read (Data ouput delay time, 120ns) */
-#define LCD_DELAY_READ \
- do { \
- NOP; \
- NOP; \
- NOP; \
- NOP; \
- } while (0)
-
-
-INLINE void lcd_bus_init(void)
-{
- cpu_flags_t flags;
- IRQ_SAVE_DISABLE(flags);
-
- /*
- * Here set bus pin!
- * to init a lcd device.
- *
- */
-
- /*
- * Data bus is in output state most of the time:
- * LCD r/w functions assume it is left in output state
- */
- LCD_DB_OUT;
-
-
- IRQ_RESTORE(flags);
-}
-
-#endif /* HW_LCD_H */
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2006, 2010 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief Displaytech 32122A LCD driver
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+
+#ifndef HW_LCD_32122A_H
+#define HW_LCD_32122A_H
+
+#include <cpu/types.h>
+#include <cpu/irq.h>
+
+#warning TODO:This is an example implementation, you must implement it!
+
+/**
+ * Predefined LCD PWM contrast values
+ */
+#define LCD_DEF_PWM 145
+#define LCD_MAX_PWM 505
+#define LCD_MIN_PWM 130
+#define LCD_PWM_CH 0
+
+
+/**
+ * \name LCD I/O pins/ports
+ * @{
+ */
+#define LCD_RS /* Implement me! */
+#define LCD_RW /* Implement me! */
+#define LCD_PE_E1 /* Implement me! */
+#define LCD_PE_E2 /* Implement me! */
+#define LCD_DB0 /* Implement me! */
+#define LCD_DB1 /* Implement me! */
+#define LCD_DB2 /* Implement me! */
+#define LCD_DB3 /* Implement me! */
+#define LCD_DB4 /* Implement me! */
+#define LCD_DB5 /* Implement me! */
+#define LCD_DB6 /* Implement me! */
+#define LCD_DB7 /* Implement me! */
+#define LCD_PF_DB0 /* Implment me! */
+/*@}*/
+
+/**
+ * \name LCD bus control macros
+ * @{
+ */
+#define LCD_CLR_A0 do { /* Implement me! */ } while (0)
+#define LCD_SET_A0 do { /* Implement me! */ } while (0)
+#define LCD_CLR_RD do { /* Implement me! */ } while (0)
+#define LCD_SET_RD do { /* Implement me! */ } while (0)
+#define LCD_CLR_E1 do { /* Implement me! */ } while (0)
+#define LCD_SET_E1 do { /* Implement me! */ } while (0)
+#define LCD_CLR_E2 do { /* Implement me! */ } while (0)
+#define LCD_SET_E2 do { /* Implement me! */ } while (0)
+#define LCD_SET_E(x) do { (void)x; /* Implement me! */ } while (0)
+#define LCD_CLR_E(x) do { (void)x; /* Implement me! */ } while (0)
+/*@}*/
+
+/**
+ * \name Chip select bits for LCD_SET_E()
+ * @{
+ */
+#define LCDF_E1 ( 0/* Implement me! */)
+#define LCDF_E2 ( 0/* Implement me! */)
+/*@}*/
+/** Read from the LCD data bus (DB[0-7]) */
+#define LCD_WRITE(x) ((void)x)/* Implement me! */
+/** Write to the LCD data bus (DB[0-7]) */
+#define LCD_READ (0 /* Implement me! */ )
+
+/** Set data bus direction to output (write to display) */
+#define LCD_DB_OUT /* Implement me! */
+
+/** Set data bus direction to input (read from display) */
+#define LCD_DB_IN /* Implement me! */
+
+/** Delay for write (Enable pulse width, 220ns) */
+#define LCD_DELAY_WRITE \
+ do { \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ } while (0)
+
+/** Delay for read (Data ouput delay time, 120ns) */
+#define LCD_DELAY_READ \
+ do { \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ } while (0)
+
+
+#define LCD_32122_RESET() do { /* Implement me! */ } while (0)
+
+INLINE void lcd_32122a_hw_bus_init(void)
+{
+ cpu_flags_t flags;
+ IRQ_SAVE_DISABLE(flags);
+
+ /*
+ * Here set bus pin!
+ * to init a lcd device.
+ *
+ */
+
+ /*
+ * Data bus is in output state most of the time:
+ * LCD r/w functions assume it is left in output state
+ */
+ LCD_DB_OUT;
+
+
+ IRQ_RESTORE(flags);
+}
+
+#endif /* HW_LCD_32122A_H */
+
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2008 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief LCD low-level hardware macros
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+
+#ifndef HW_LCD_HD44_H
+#define HW_LCD_HD44_H
+
+#include "cfg/cfg_lcd_hd44.h" /* CONFIG_LCD_4BIT */
+
+#include <cpu/types.h>
+#include <cpu/irq.h>
+
+#warning TODO:This is an example implementation, you must implement it!
+
+/**
+ * \name LCD I/O pins/ports
+ * @{
+ */
+#define LCD_RS /* Implement me! */
+#define LCD_RW /* Implement me! */
+#define LCD_E /* Implement me! */
+#define LCD_DB0 /* Implement me! */
+#define LCD_DB1 /* Implement me! */
+#define LCD_DB2 /* Implement me! */
+#define LCD_DB3 /* Implement me! */
+#define LCD_DB4 /* Implement me! */
+#define LCD_DB5 /* Implement me! */
+#define LCD_DB6 /* Implement me! */
+#define LCD_DB7 /* Implement me! */
+/*@}*/
+
+/**
+ * \name DB high nibble (DB[4-7])
+ * @{
+ */
+
+#if CONFIG_LCD_4BIT
+ #define LCD_MASK (LCD_DB7 | LCD_DB6 | LCD_DB5 | LCD_DB4)
+ #define LCD_SHIFT 4
+#else
+ #define LCD_MASK (uint8_t)0xff
+ #define LCD_SHIFT 0
+#endif
+/*@}*/
+
+/**
+ * \name LCD bus control macros
+ * @{
+ */
+#define LCD_CLR_RS /* Implement me! */
+#define LCD_SET_RS /* Implement me! */
+#define LCD_CLR_RD /* Implement me! */
+#define LCD_SET_RD /* Implement me! */
+#define LCD_CLR_E /* Implement me! */
+#define LCD_SET_E /* Implement me! */
+
+/* Enter command mode */
+#define LCD_SET_COMMAND() /* Implement me! */
+
+/* Enter data mode */
+#define LCD_SET_DATA() /* Implement me! */
+
+#if CONFIG_LCD_4BIT
+ #define LCD_WRITE_H(x) ((void)x)/* Implement me! */
+ #define LCD_WRITE_L(x) ((void)x)/* Implement me! */
+ #define LCD_READ_H ( 0 /* Implement me! */ )
+ #define LCD_READ_L ( 0 /* Implement me! */ )
+#else
+ #define LCD_WRITE(x) ((void)x)/* Implement me! */
+ #define LCD_READ (0 /* Implement me! */ )
+#endif
+/*@}*/
+
+/** Set data bus direction to output (write to display) */
+#define LCD_DB_OUT /* Implement me! */
+
+/** Set data bus direction to input (read from display) */
+#define LCD_DB_IN /* Implement me! */
+/** Delay for write (Enable pulse width, 220ns) */
+#define LCD_DELAY_WRITE \
+ do { \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ } while (0)
+
+/** Delay for read (Data ouput delay time, 120ns) */
+#define LCD_DELAY_READ \
+ do { \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ } while (0)
+
+
+
+INLINE void lcd_hd44_hw_bus_init(void)
+{
+ cpu_flags_t flags;
+ IRQ_SAVE_DISABLE(flags);
+
+ /*
+ * Here set bus pin!
+ * to init a lcd device.
+ *
+ */
+
+ /*
+ * Data bus is in output state most of the time:
+ * LCD r/w functions assume it is left in output state
+ */
+ LCD_DB_OUT;
+
+
+ IRQ_RESTORE(flags);
+}
+
+#endif /* HW_LCD_HD44_H */
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
- * All Rights Reserved.
- * -->
- *
- * \brief Configuration file for lcd display module.
- *
- * \version $Id$
- *
- * \author Daniele Basile <asterix@develer.com>
- */
-
-#ifndef CFG_LCD_H
-#define CFG_LCD_H
-
-/**
- * Use 4 bit addressing mode.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_4BIT 0
-
-/**
- * Use a table to speed up LCD memory addressing.
- * This will use about 100 bytes of RAM.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_ADDRESS_FAST 1
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_SOFTINT_REFRESH 0
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_WAIT 1
-
-
-#endif /* CFG_LCD_H */
-
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2006, 2010 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief Displaytech 32122A LCD driver configuration file.
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+#ifndef CFG_LCD_32122A_H
+#define CFG_LCD_32122A_H
+
+/**
+ * Enable soft interrupt to refresh the LCD.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_SOFTINT_REFRESH 0
+
+/**
+ * Enable wait macro when display is busy.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_WAIT 0
+
+/**
+ * Display refresh time 32122a.
+ * $WIZ$ type = "int"
+ * $WIZ$ min = 0
+ */
+#define CONFIG_LCD_REFRESH 100
+
+#endif /* CFG_LCD_32122A_H */
+
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
+ * All Rights Reserved.
+ * -->
+ *
+ * \brief Configuration file for lcd display module.
+ *
+ * \author Daniele Basile <asterix@develer.com>
+ */
+
+#ifndef CFG_LCD_H
+#define CFG_LCD_H
+
+/**
+ * Use 4 bit addressing mode.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_4BIT 0
+
+/**
+ * Use a table to speed up LCD memory addressing.
+ * This will use about 100 bytes of RAM.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_ADDRESS_FAST 1
+
+#endif /* CFG_LCD_H */
+
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
- * All Rights Reserved.
- * -->
- *
- * \brief Configuration file for lcd display module.
- *
- * \version $Id$
- *
- * \author Daniele Basile <asterix@develer.com>
- */
-
-#ifndef CFG_LCD_H
-#define CFG_LCD_H
-
-/**
- * Use 4 bit addressing mode.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_4BIT 0
-
-/**
- * Use a table to speed up LCD memory addressing.
- * This will use about 100 bytes of RAM.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_ADDRESS_FAST 1
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_SOFTINT_REFRESH 0
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_WAIT 1
-
-
-#endif /* CFG_LCD_H */
-
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2006, 2010 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief Displaytech 32122A LCD driver configuration file.
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+#ifndef CFG_LCD_32122A_H
+#define CFG_LCD_32122A_H
+
+/**
+ * Enable soft interrupt to refresh the LCD.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_SOFTINT_REFRESH 0
+
+/**
+ * Enable wait macro when display is busy.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_WAIT 0
+
+/**
+ * Display refresh time 32122a.
+ * $WIZ$ type = "int"
+ * $WIZ$ min = 0
+ */
+#define CONFIG_LCD_REFRESH 100
+
+#endif /* CFG_LCD_32122A_H */
+
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
+ * All Rights Reserved.
+ * -->
+ *
+ * \brief Configuration file for lcd display module.
+ *
+ * \author Daniele Basile <asterix@develer.com>
+ */
+
+#ifndef CFG_LCD_H
+#define CFG_LCD_H
+
+/**
+ * Use 4 bit addressing mode.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_4BIT 0
+
+/**
+ * Use a table to speed up LCD memory addressing.
+ * This will use about 100 bytes of RAM.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_ADDRESS_FAST 1
+
+#endif /* CFG_LCD_H */
+
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
- * All Rights Reserved.
- * -->
- *
- * \brief Configuration file for lcd display module.
- *
- * \version $Id$
- *
- * \author Daniele Basile <asterix@develer.com>
- */
-
-#ifndef CFG_LCD_H
-#define CFG_LCD_H
-
-/**
- * Use 4 bit addressing mode.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_4BIT 0
-
-/**
- * Use a table to speed up LCD memory addressing.
- * This will use about 100 bytes of RAM.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_ADDRESS_FAST 1
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_SOFTINT_REFRESH 0
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_WAIT 1
-
-
-#endif /* CFG_LCD_H */
-
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2006, 2010 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief Displaytech 32122A LCD driver configuration file.
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+#ifndef CFG_LCD_32122A_H
+#define CFG_LCD_32122A_H
+
+/**
+ * Enable soft interrupt to refresh the LCD.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_SOFTINT_REFRESH 0
+
+/**
+ * Enable wait macro when display is busy.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_WAIT 0
+
+/**
+ * Display refresh time 32122a.
+ * $WIZ$ type = "int"
+ * $WIZ$ min = 0
+ */
+#define CONFIG_LCD_REFRESH 100
+
+#endif /* CFG_LCD_32122A_H */
+
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
+ * All Rights Reserved.
+ * -->
+ *
+ * \brief Configuration file for lcd display module.
+ *
+ * \author Daniele Basile <asterix@develer.com>
+ */
+
+#ifndef CFG_LCD_H
+#define CFG_LCD_H
+
+/**
+ * Use 4 bit addressing mode.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_4BIT 0
+
+/**
+ * Use a table to speed up LCD memory addressing.
+ * This will use about 100 bytes of RAM.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_ADDRESS_FAST 1
+
+#endif /* CFG_LCD_H */
+
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2003, 2004, 2005, 2008 Develer S.r.l. (http://www.develer.com/)
- * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
- *
- * -->
- *
- * \brief LCD low-level hardware macros
- *
- * \version $Id$
- *
- * \author Bernie Innocenti <bernie@codewiz.org>
- * \author Stefano Fedrigo <aleph@develer.com>
- *
- */
-
-#ifndef HW_LCD_H
-#define HW_LCD_H
-
-#include "cfg/cfg_lcd.h" /* CONFIG_LCD_4BIT */
-#include <cfg/macros.h> /* BV() */
-#include <cfg/debug.h>
-
-#include <cpu/attr.h>
-#include <cpu/irq.h>
-#include <cpu/types.h>
-
-#warning TODO:This is an example implementation, you must implement it!
-
-/**
- * \name LCD I/O pins/ports
- * @{
- */
-#define LCD_RS /* Implement me! */
-#define LCD_RW /* Implement me! */
-#define LCD_E /* Implement me! */
-#define LCD_DB0 /* Implement me! */
-#define LCD_DB1 /* Implement me! */
-#define LCD_DB2 /* Implement me! */
-#define LCD_DB3 /* Implement me! */
-#define LCD_DB4 /* Implement me! */
-#define LCD_DB5 /* Implement me! */
-#define LCD_DB6 /* Implement me! */
-#define LCD_DB7 /* Implement me! */
-/*@}*/
-
-/**
- * \name DB high nibble (DB[4-7])
- * @{
- */
-
-#if CONFIG_LCD_4BIT
- #define LCD_MASK (LCD_DB7 | LCD_DB6 | LCD_DB5 | LCD_DB4)
- #define LCD_SHIFT 4
-#else
- #define LCD_MASK (uint8_t)0xff
- #define LCD_SHIFT 0
-#endif
-/*@}*/
-
-/**
- * \name LCD bus control macros
- * @{
- */
-#define LCD_CLR_RS /* Implement me! */
-#define LCD_SET_RS /* Implement me! */
-#define LCD_CLR_RD /* Implement me! */
-#define LCD_SET_RD /* Implement me! */
-#define LCD_CLR_E /* Implement me! */
-#define LCD_SET_E /* Implement me! */
-
-/* Enter command mode */
-#define LCD_SET_COMMAND() /* Implement me! */
-
-/* Enter data mode */
-#define LCD_SET_DATA() /* Implement me! */
-
-#if CONFIG_LCD_4BIT
- #define LCD_WRITE_H(x) ((void)x)/* Implement me! */
- #define LCD_WRITE_L(x) ((void)x)/* Implement me! */
- #define LCD_READ_H ( 0 /* Implement me! */ )
- #define LCD_READ_L ( 0 /* Implement me! */ )
-#else
- #define LCD_WRITE(x) ((void)x)/* Implement me! */
- #define LCD_READ (0 /* Implement me! */ )
-#endif
-/*@}*/
-
-/** Set data bus direction to output (write to display) */
-#define LCD_DB_OUT /* Implement me! */
-
-/** Set data bus direction to input (read from display) */
-#define LCD_DB_IN /* Implement me! */
-
-/** Delay for write (Enable pulse width, 220ns) */
-#define LCD_DELAY_WRITE \
- do { \
- NOP; \
- NOP; \
- NOP; \
- NOP; \
- NOP; \
- } while (0)
-
-/** Delay for read (Data ouput delay time, 120ns) */
-#define LCD_DELAY_READ \
- do { \
- NOP; \
- NOP; \
- NOP; \
- NOP; \
- } while (0)
-
-
-INLINE void lcd_bus_init(void)
-{
- cpu_flags_t flags;
- IRQ_SAVE_DISABLE(flags);
-
- /*
- * Here set bus pin!
- * to init a lcd device.
- *
- */
-
- /*
- * Data bus is in output state most of the time:
- * LCD r/w functions assume it is left in output state
- */
- LCD_DB_OUT;
-
-
- IRQ_RESTORE(flags);
-}
-
-#endif /* HW_LCD_H */
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2006, 2010 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief Displaytech 32122A LCD driver
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+
+#ifndef HW_LCD_32122A_H
+#define HW_LCD_32122A_H
+
+#include <cpu/types.h>
+#include <cpu/irq.h>
+
+#warning TODO:This is an example implementation, you must implement it!
+
+/**
+ * Predefined LCD PWM contrast values
+ */
+#define LCD_DEF_PWM 145
+#define LCD_MAX_PWM 505
+#define LCD_MIN_PWM 130
+#define LCD_PWM_CH 0
+
+
+/**
+ * \name LCD I/O pins/ports
+ * @{
+ */
+#define LCD_RS /* Implement me! */
+#define LCD_RW /* Implement me! */
+#define LCD_PE_E1 /* Implement me! */
+#define LCD_PE_E2 /* Implement me! */
+#define LCD_DB0 /* Implement me! */
+#define LCD_DB1 /* Implement me! */
+#define LCD_DB2 /* Implement me! */
+#define LCD_DB3 /* Implement me! */
+#define LCD_DB4 /* Implement me! */
+#define LCD_DB5 /* Implement me! */
+#define LCD_DB6 /* Implement me! */
+#define LCD_DB7 /* Implement me! */
+#define LCD_PF_DB0 /* Implment me! */
+/*@}*/
+
+/**
+ * \name LCD bus control macros
+ * @{
+ */
+#define LCD_CLR_A0 do { /* Implement me! */ } while (0)
+#define LCD_SET_A0 do { /* Implement me! */ } while (0)
+#define LCD_CLR_RD do { /* Implement me! */ } while (0)
+#define LCD_SET_RD do { /* Implement me! */ } while (0)
+#define LCD_CLR_E1 do { /* Implement me! */ } while (0)
+#define LCD_SET_E1 do { /* Implement me! */ } while (0)
+#define LCD_CLR_E2 do { /* Implement me! */ } while (0)
+#define LCD_SET_E2 do { /* Implement me! */ } while (0)
+#define LCD_SET_E(x) do { (void)x; /* Implement me! */ } while (0)
+#define LCD_CLR_E(x) do { (void)x; /* Implement me! */ } while (0)
+/*@}*/
+
+/**
+ * \name Chip select bits for LCD_SET_E()
+ * @{
+ */
+#define LCDF_E1 ( 0/* Implement me! */)
+#define LCDF_E2 ( 0/* Implement me! */)
+/*@}*/
+/** Read from the LCD data bus (DB[0-7]) */
+#define LCD_WRITE(x) ((void)x)/* Implement me! */
+/** Write to the LCD data bus (DB[0-7]) */
+#define LCD_READ (0 /* Implement me! */ )
+
+/** Set data bus direction to output (write to display) */
+#define LCD_DB_OUT /* Implement me! */
+
+/** Set data bus direction to input (read from display) */
+#define LCD_DB_IN /* Implement me! */
+
+/** Delay for write (Enable pulse width, 220ns) */
+#define LCD_DELAY_WRITE \
+ do { \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ } while (0)
+
+/** Delay for read (Data ouput delay time, 120ns) */
+#define LCD_DELAY_READ \
+ do { \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ } while (0)
+
+
+#define LCD_32122_RESET() do { /* Implement me! */ } while (0)
+
+INLINE void lcd_32122a_hw_bus_init(void)
+{
+ cpu_flags_t flags;
+ IRQ_SAVE_DISABLE(flags);
+
+ /*
+ * Here set bus pin!
+ * to init a lcd device.
+ *
+ */
+
+ /*
+ * Data bus is in output state most of the time:
+ * LCD r/w functions assume it is left in output state
+ */
+ LCD_DB_OUT;
+
+
+ IRQ_RESTORE(flags);
+}
+
+#endif /* HW_LCD_32122A_H */
+
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2008 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief LCD low-level hardware macros
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+
+#ifndef HW_LCD_HD44_H
+#define HW_LCD_HD44_H
+
+#include "cfg/cfg_lcd_hd44.h" /* CONFIG_LCD_4BIT */
+
+#include <cpu/types.h>
+#include <cpu/irq.h>
+
+#warning TODO:This is an example implementation, you must implement it!
+
+/**
+ * \name LCD I/O pins/ports
+ * @{
+ */
+#define LCD_RS /* Implement me! */
+#define LCD_RW /* Implement me! */
+#define LCD_E /* Implement me! */
+#define LCD_DB0 /* Implement me! */
+#define LCD_DB1 /* Implement me! */
+#define LCD_DB2 /* Implement me! */
+#define LCD_DB3 /* Implement me! */
+#define LCD_DB4 /* Implement me! */
+#define LCD_DB5 /* Implement me! */
+#define LCD_DB6 /* Implement me! */
+#define LCD_DB7 /* Implement me! */
+/*@}*/
+
+/**
+ * \name DB high nibble (DB[4-7])
+ * @{
+ */
+
+#if CONFIG_LCD_4BIT
+ #define LCD_MASK (LCD_DB7 | LCD_DB6 | LCD_DB5 | LCD_DB4)
+ #define LCD_SHIFT 4
+#else
+ #define LCD_MASK (uint8_t)0xff
+ #define LCD_SHIFT 0
+#endif
+/*@}*/
+
+/**
+ * \name LCD bus control macros
+ * @{
+ */
+#define LCD_CLR_RS /* Implement me! */
+#define LCD_SET_RS /* Implement me! */
+#define LCD_CLR_RD /* Implement me! */
+#define LCD_SET_RD /* Implement me! */
+#define LCD_CLR_E /* Implement me! */
+#define LCD_SET_E /* Implement me! */
+
+/* Enter command mode */
+#define LCD_SET_COMMAND() /* Implement me! */
+
+/* Enter data mode */
+#define LCD_SET_DATA() /* Implement me! */
+
+#if CONFIG_LCD_4BIT
+ #define LCD_WRITE_H(x) ((void)x)/* Implement me! */
+ #define LCD_WRITE_L(x) ((void)x)/* Implement me! */
+ #define LCD_READ_H ( 0 /* Implement me! */ )
+ #define LCD_READ_L ( 0 /* Implement me! */ )
+#else
+ #define LCD_WRITE(x) ((void)x)/* Implement me! */
+ #define LCD_READ (0 /* Implement me! */ )
+#endif
+/*@}*/
+
+/** Set data bus direction to output (write to display) */
+#define LCD_DB_OUT /* Implement me! */
+
+/** Set data bus direction to input (read from display) */
+#define LCD_DB_IN /* Implement me! */
+/** Delay for write (Enable pulse width, 220ns) */
+#define LCD_DELAY_WRITE \
+ do { \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ } while (0)
+
+/** Delay for read (Data ouput delay time, 120ns) */
+#define LCD_DELAY_READ \
+ do { \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ } while (0)
+
+
+
+INLINE void lcd_hd44_hw_bus_init(void)
+{
+ cpu_flags_t flags;
+ IRQ_SAVE_DISABLE(flags);
+
+ /*
+ * Here set bus pin!
+ * to init a lcd device.
+ *
+ */
+
+ /*
+ * Data bus is in output state most of the time:
+ * LCD r/w functions assume it is left in output state
+ */
+ LCD_DB_OUT;
+
+
+ IRQ_RESTORE(flags);
+}
+
+#endif /* HW_LCD_HD44_H */
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
- * All Rights Reserved.
- * -->
- *
- * \brief Configuration file for lcd display module.
- *
- * \version $Id$
- *
- * \author Daniele Basile <asterix@develer.com>
- */
-
-#ifndef CFG_LCD_H
-#define CFG_LCD_H
-
-/**
- * Use 4 bit addressing mode.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_4BIT 0
-
-/**
- * Use a table to speed up LCD memory addressing.
- * This will use about 100 bytes of RAM.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_ADDRESS_FAST 1
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_SOFTINT_REFRESH 0
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_WAIT 1
-
-
-#endif /* CFG_LCD_H */
-
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2006, 2010 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief Displaytech 32122A LCD driver configuration file.
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+#ifndef CFG_LCD_32122A_H
+#define CFG_LCD_32122A_H
+
+/**
+ * Enable soft interrupt to refresh the LCD.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_SOFTINT_REFRESH 0
+
+/**
+ * Enable wait macro when display is busy.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_WAIT 0
+
+/**
+ * Display refresh time 32122a.
+ * $WIZ$ type = "int"
+ * $WIZ$ min = 0
+ */
+#define CONFIG_LCD_REFRESH 100
+
+#endif /* CFG_LCD_32122A_H */
+
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
+ * All Rights Reserved.
+ * -->
+ *
+ * \brief Configuration file for lcd display module.
+ *
+ * \author Daniele Basile <asterix@develer.com>
+ */
+
+#ifndef CFG_LCD_H
+#define CFG_LCD_H
+
+/**
+ * Use 4 bit addressing mode.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_4BIT 0
+
+/**
+ * Use a table to speed up LCD memory addressing.
+ * This will use about 100 bytes of RAM.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_ADDRESS_FAST 1
+
+#endif /* CFG_LCD_H */
+
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
- * All Rights Reserved.
- * -->
- *
- * \brief Configuration file for lcd display module.
- *
- * \version $Id$
- *
- * \author Daniele Basile <asterix@develer.com>
- */
-
-#ifndef CFG_LCD_H
-#define CFG_LCD_H
-
-/**
- * Use 4 bit addressing mode.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_4BIT 0
-
-/**
- * Use a table to speed up LCD memory addressing.
- * This will use about 100 bytes of RAM.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_ADDRESS_FAST 1
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_SOFTINT_REFRESH 0
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_WAIT 1
-
-
-#endif /* CFG_LCD_H */
-
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2006, 2010 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief Displaytech 32122A LCD driver configuration file.
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+#ifndef CFG_LCD_32122A_H
+#define CFG_LCD_32122A_H
+
+/**
+ * Enable soft interrupt to refresh the LCD.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_SOFTINT_REFRESH 0
+
+/**
+ * Enable wait macro when display is busy.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_WAIT 0
+
+/**
+ * Display refresh time 32122a.
+ * $WIZ$ type = "int"
+ * $WIZ$ min = 0
+ */
+#define CONFIG_LCD_REFRESH 100
+
+#endif /* CFG_LCD_32122A_H */
+
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
+ * All Rights Reserved.
+ * -->
+ *
+ * \brief Configuration file for lcd display module.
+ *
+ * \author Daniele Basile <asterix@develer.com>
+ */
+
+#ifndef CFG_LCD_H
+#define CFG_LCD_H
+
+/**
+ * Use 4 bit addressing mode.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_4BIT 0
+
+/**
+ * Use a table to speed up LCD memory addressing.
+ * This will use about 100 bytes of RAM.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_ADDRESS_FAST 1
+
+#endif /* CFG_LCD_H */
+
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2003, 2004, 2005, 2008 Develer S.r.l. (http://www.develer.com/)
- * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
- *
- * -->
- *
- * \brief LCD low-level hardware macros
- *
- * \version $Id: hw_lcd.h 2506 2009-04-15 08:29:07Z duplo $
- *
- * \author Bernie Innocenti <bernie@codewiz.org>
- * \author Stefano Fedrigo <aleph@develer.com>
- *
- */
-
-#ifndef HW_LCD_H
-#define HW_LCD_H
-
-#include "cfg/cfg_lcd.h" /* CONFIG_LCD_4BIT */
-#include <cfg/macros.h> /* BV() */
-#include <cfg/debug.h>
-
-#include <cpu/attr.h>
-#include <cpu/irq.h>
-#include <cpu/types.h>
-
-#warning TODO:This is an example implementation, you must implement it!
-
-/**
- * \name LCD I/O pins/ports
- * @{
- */
-#define LCD_RS /* Implement me! */
-#define LCD_RW /* Implement me! */
-#define LCD_E /* Implement me! */
-#define LCD_DB0 /* Implement me! */
-#define LCD_DB1 /* Implement me! */
-#define LCD_DB2 /* Implement me! */
-#define LCD_DB3 /* Implement me! */
-#define LCD_DB4 /* Implement me! */
-#define LCD_DB5 /* Implement me! */
-#define LCD_DB6 /* Implement me! */
-#define LCD_DB7 /* Implement me! */
-/*@}*/
-
-/**
- * \name DB high nibble (DB[4-7])
- * @{
- */
-
-#if CONFIG_LCD_4BIT
- #define LCD_MASK (LCD_DB7 | LCD_DB6 | LCD_DB5 | LCD_DB4)
- #define LCD_SHIFT 4
-#else
- #define LCD_MASK (uint8_t)0xff
- #define LCD_SHIFT 0
-#endif
-/*@}*/
-
-/**
- * \name LCD bus control macros
- * @{
- */
-#define LCD_CLR_RS /* Implement me! */
-#define LCD_SET_RS /* Implement me! */
-#define LCD_CLR_RD /* Implement me! */
-#define LCD_SET_RD /* Implement me! */
-#define LCD_CLR_E /* Implement me! */
-#define LCD_SET_E /* Implement me! */
-
-#if CONFIG_LCD_4BIT
- #define LCD_WRITE_H(x) ((void)x)/* Implement me! */
- #define LCD_WRITE_L(x) ((void)x)/* Implement me! */
- #define LCD_READ_H ( 0 /* Implement me! */ )
- #define LCD_READ_L ( 0 /* Implement me! */ )
-#else
- #define LCD_WRITE(x) ((void)x)/* Implement me! */
- #define LCD_READ (0 /* Implement me! */ )
-#endif
-/*@}*/
-
-/** Set data bus direction to output (write to display) */
-#define LCD_DB_OUT /* Implement me! */
-
-/** Set data bus direction to input (read from display) */
-#define LCD_DB_IN /* Implement me! */
-
-/** Delay for write (Enable pulse width, 220ns) */
-#define LCD_DELAY_WRITE \
- do { \
- NOP; \
- NOP; \
- NOP; \
- NOP; \
- NOP; \
- } while (0)
-
-/** Delay for read (Data ouput delay time, 120ns) */
-#define LCD_DELAY_READ \
- do { \
- NOP; \
- NOP; \
- NOP; \
- NOP; \
- } while (0)
-
-
-INLINE void lcd_bus_init(void)
-{
- cpu_flags_t flags;
- IRQ_SAVE_DISABLE(flags);
-
- /*
- * Here set bus pin!
- * to init a lcd device.
- *
- */
-
- /*
- * Data bus is in output state most of the time:
- * LCD r/w functions assume it is left in output state
- */
- LCD_DB_OUT;
-
-
- IRQ_RESTORE(flags);
-}
-
-#endif /* HW_LCD_H */
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2006, 2010 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief Displaytech 32122A LCD driver
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+
+#ifndef HW_LCD_32122A_H
+#define HW_LCD_32122A_H
+
+#include <cpu/types.h>
+#include <cpu/irq.h>
+
+#warning TODO:This is an example implementation, you must implement it!
+
+/**
+ * Predefined LCD PWM contrast values
+ */
+#define LCD_DEF_PWM 145
+#define LCD_MAX_PWM 505
+#define LCD_MIN_PWM 130
+#define LCD_PWM_CH 0
+
+
+/**
+ * \name LCD I/O pins/ports
+ * @{
+ */
+#define LCD_RS /* Implement me! */
+#define LCD_RW /* Implement me! */
+#define LCD_PE_E1 /* Implement me! */
+#define LCD_PE_E2 /* Implement me! */
+#define LCD_DB0 /* Implement me! */
+#define LCD_DB1 /* Implement me! */
+#define LCD_DB2 /* Implement me! */
+#define LCD_DB3 /* Implement me! */
+#define LCD_DB4 /* Implement me! */
+#define LCD_DB5 /* Implement me! */
+#define LCD_DB6 /* Implement me! */
+#define LCD_DB7 /* Implement me! */
+#define LCD_PF_DB0 /* Implment me! */
+/*@}*/
+
+/**
+ * \name LCD bus control macros
+ * @{
+ */
+#define LCD_CLR_A0 do { /* Implement me! */ } while (0)
+#define LCD_SET_A0 do { /* Implement me! */ } while (0)
+#define LCD_CLR_RD do { /* Implement me! */ } while (0)
+#define LCD_SET_RD do { /* Implement me! */ } while (0)
+#define LCD_CLR_E1 do { /* Implement me! */ } while (0)
+#define LCD_SET_E1 do { /* Implement me! */ } while (0)
+#define LCD_CLR_E2 do { /* Implement me! */ } while (0)
+#define LCD_SET_E2 do { /* Implement me! */ } while (0)
+#define LCD_SET_E(x) do { (void)x; /* Implement me! */ } while (0)
+#define LCD_CLR_E(x) do { (void)x; /* Implement me! */ } while (0)
+/*@}*/
+
+/**
+ * \name Chip select bits for LCD_SET_E()
+ * @{
+ */
+#define LCDF_E1 ( 0/* Implement me! */)
+#define LCDF_E2 ( 0/* Implement me! */)
+/*@}*/
+/** Read from the LCD data bus (DB[0-7]) */
+#define LCD_WRITE(x) ((void)x)/* Implement me! */
+/** Write to the LCD data bus (DB[0-7]) */
+#define LCD_READ (0 /* Implement me! */ )
+
+/** Set data bus direction to output (write to display) */
+#define LCD_DB_OUT /* Implement me! */
+
+/** Set data bus direction to input (read from display) */
+#define LCD_DB_IN /* Implement me! */
+
+/** Delay for write (Enable pulse width, 220ns) */
+#define LCD_DELAY_WRITE \
+ do { \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ } while (0)
+
+/** Delay for read (Data ouput delay time, 120ns) */
+#define LCD_DELAY_READ \
+ do { \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ } while (0)
+
+
+#define LCD_32122_RESET() do { /* Implement me! */ } while (0)
+
+INLINE void lcd_32122a_hw_bus_init(void)
+{
+ cpu_flags_t flags;
+ IRQ_SAVE_DISABLE(flags);
+
+ /*
+ * Here set bus pin!
+ * to init a lcd device.
+ *
+ */
+
+ /*
+ * Data bus is in output state most of the time:
+ * LCD r/w functions assume it is left in output state
+ */
+ LCD_DB_OUT;
+
+
+ IRQ_RESTORE(flags);
+}
+
+#endif /* HW_LCD_32122A_H */
+
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2008 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief LCD low-level hardware macros
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+
+#ifndef HW_LCD_HD44_H
+#define HW_LCD_HD44_H
+
+#include "cfg/cfg_lcd_hd44.h" /* CONFIG_LCD_4BIT */
+
+#include <cpu/types.h>
+#include <cpu/irq.h>
+
+#warning TODO:This is an example implementation, you must implement it!
+
+/**
+ * \name LCD I/O pins/ports
+ * @{
+ */
+#define LCD_RS /* Implement me! */
+#define LCD_RW /* Implement me! */
+#define LCD_E /* Implement me! */
+#define LCD_DB0 /* Implement me! */
+#define LCD_DB1 /* Implement me! */
+#define LCD_DB2 /* Implement me! */
+#define LCD_DB3 /* Implement me! */
+#define LCD_DB4 /* Implement me! */
+#define LCD_DB5 /* Implement me! */
+#define LCD_DB6 /* Implement me! */
+#define LCD_DB7 /* Implement me! */
+/*@}*/
+
+/**
+ * \name DB high nibble (DB[4-7])
+ * @{
+ */
+
+#if CONFIG_LCD_4BIT
+ #define LCD_MASK (LCD_DB7 | LCD_DB6 | LCD_DB5 | LCD_DB4)
+ #define LCD_SHIFT 4
+#else
+ #define LCD_MASK (uint8_t)0xff
+ #define LCD_SHIFT 0
+#endif
+/*@}*/
+
+/**
+ * \name LCD bus control macros
+ * @{
+ */
+#define LCD_CLR_RS /* Implement me! */
+#define LCD_SET_RS /* Implement me! */
+#define LCD_CLR_RD /* Implement me! */
+#define LCD_SET_RD /* Implement me! */
+#define LCD_CLR_E /* Implement me! */
+#define LCD_SET_E /* Implement me! */
+
+/* Enter command mode */
+#define LCD_SET_COMMAND() /* Implement me! */
+
+/* Enter data mode */
+#define LCD_SET_DATA() /* Implement me! */
+
+#if CONFIG_LCD_4BIT
+ #define LCD_WRITE_H(x) ((void)x)/* Implement me! */
+ #define LCD_WRITE_L(x) ((void)x)/* Implement me! */
+ #define LCD_READ_H ( 0 /* Implement me! */ )
+ #define LCD_READ_L ( 0 /* Implement me! */ )
+#else
+ #define LCD_WRITE(x) ((void)x)/* Implement me! */
+ #define LCD_READ (0 /* Implement me! */ )
+#endif
+/*@}*/
+
+/** Set data bus direction to output (write to display) */
+#define LCD_DB_OUT /* Implement me! */
+
+/** Set data bus direction to input (read from display) */
+#define LCD_DB_IN /* Implement me! */
+/** Delay for write (Enable pulse width, 220ns) */
+#define LCD_DELAY_WRITE \
+ do { \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ } while (0)
+
+/** Delay for read (Data ouput delay time, 120ns) */
+#define LCD_DELAY_READ \
+ do { \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ } while (0)
+
+
+
+INLINE void lcd_hd44_hw_bus_init(void)
+{
+ cpu_flags_t flags;
+ IRQ_SAVE_DISABLE(flags);
+
+ /*
+ * Here set bus pin!
+ * to init a lcd device.
+ *
+ */
+
+ /*
+ * Data bus is in output state most of the time:
+ * LCD r/w functions assume it is left in output state
+ */
+ LCD_DB_OUT;
+
+
+ IRQ_RESTORE(flags);
+}
+
+#endif /* HW_LCD_HD44_H */
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
- * All Rights Reserved.
- * -->
- *
- * \brief Configuration file for lcd display module.
- *
- * \version $Id$
- *
- * \author Daniele Basile <asterix@develer.com>
- */
-
-#ifndef CFG_LCD_H
-#define CFG_LCD_H
-
-/**
- * Use 4 bit addressing mode.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_4BIT 0
-
-/**
- * Use a table to speed up LCD memory addressing.
- * This will use about 100 bytes of RAM.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_ADDRESS_FAST 1
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_SOFTINT_REFRESH 0
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_WAIT 1
-
-
-#endif /* CFG_LCD_H */
-
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2006, 2010 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief Displaytech 32122A LCD driver configuration file.
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+#ifndef CFG_LCD_32122A_H
+#define CFG_LCD_32122A_H
+
+/**
+ * Enable soft interrupt to refresh the LCD.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_SOFTINT_REFRESH 0
+
+/**
+ * Enable wait macro when display is busy.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_WAIT 0
+
+/**
+ * Display refresh time 32122a.
+ * $WIZ$ type = "int"
+ * $WIZ$ min = 0
+ */
+#define CONFIG_LCD_REFRESH 100
+
+#endif /* CFG_LCD_32122A_H */
+
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
+ * All Rights Reserved.
+ * -->
+ *
+ * \brief Configuration file for lcd display module.
+ *
+ * \author Daniele Basile <asterix@develer.com>
+ */
+
+#ifndef CFG_LCD_H
+#define CFG_LCD_H
+
+/**
+ * Use 4 bit addressing mode.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_4BIT 0
+
+/**
+ * Use a table to speed up LCD memory addressing.
+ * This will use about 100 bytes of RAM.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_ADDRESS_FAST 1
+
+#endif /* CFG_LCD_H */
+
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
- * All Rights Reserved.
- * -->
- *
- * \brief Configuration file for lcd display module.
- *
- * \version $Id$
- *
- * \author Daniele Basile <asterix@develer.com>
- */
-
-#ifndef CFG_LCD_H
-#define CFG_LCD_H
-
-/**
- * Use 4 bit addressing mode.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_4BIT 0
-
-/**
- * Use a table to speed up LCD memory addressing.
- * This will use about 100 bytes of RAM.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_ADDRESS_FAST 1
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_SOFTINT_REFRESH 0
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_WAIT 1
-
-
-#endif /* CFG_LCD_H */
-
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2006, 2010 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief Displaytech 32122A LCD driver configuration file.
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+#ifndef CFG_LCD_32122A_H
+#define CFG_LCD_32122A_H
+
+/**
+ * Enable soft interrupt to refresh the LCD.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_SOFTINT_REFRESH 0
+
+/**
+ * Enable wait macro when display is busy.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_WAIT 0
+
+/**
+ * Display refresh time 32122a.
+ * $WIZ$ type = "int"
+ * $WIZ$ min = 0
+ */
+#define CONFIG_LCD_REFRESH 100
+
+#endif /* CFG_LCD_32122A_H */
+
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
+ * All Rights Reserved.
+ * -->
+ *
+ * \brief Configuration file for lcd display module.
+ *
+ * \author Daniele Basile <asterix@develer.com>
+ */
+
+#ifndef CFG_LCD_H
+#define CFG_LCD_H
+
+/**
+ * Use 4 bit addressing mode.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_4BIT 0
+
+/**
+ * Use a table to speed up LCD memory addressing.
+ * This will use about 100 bytes of RAM.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_ADDRESS_FAST 1
+
+#endif /* CFG_LCD_H */
+
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
- * All Rights Reserved.
- * -->
- *
- * \brief Configuration file for lcd display module.
- *
- * \version $Id$
- *
- * \author Daniele Basile <asterix@develer.com>
- */
-
-#ifndef CFG_LCD_H
-#define CFG_LCD_H
-
-/**
- * Use 4 bit addressing mode.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_4BIT 0
-
-/**
- * Use a table to speed up LCD memory addressing.
- * This will use about 100 bytes of RAM.
- * $WIZ$ type = "boolean"
- */
-#define CONFIG_LCD_ADDRESS_FAST 1
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_SOFTINT_REFRESH 0
-
-/**
- * LCD setting for 32122A (AVR implementation).
- * $WIZ$ type = "boolean"
- * $WIZ$ supports = "avr and False"
- */
-#define CONFIG_LCD_WAIT 1
-
-
-#endif /* CFG_LCD_H */
-
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2006, 2010 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief Displaytech 32122A LCD driver configuration file.
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+#ifndef CFG_LCD_32122A_H
+#define CFG_LCD_32122A_H
+
+/**
+ * Enable soft interrupt to refresh the LCD.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_SOFTINT_REFRESH 0
+
+/**
+ * Enable wait macro when display is busy.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_WAIT 0
+
+/**
+ * Display refresh time 32122a.
+ * $WIZ$ type = "int"
+ * $WIZ$ min = 0
+ */
+#define CONFIG_LCD_REFRESH 100
+
+#endif /* CFG_LCD_32122A_H */
+
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
+ * All Rights Reserved.
+ * -->
+ *
+ * \brief Configuration file for lcd display module.
+ *
+ * \author Daniele Basile <asterix@develer.com>
+ */
+
+#ifndef CFG_LCD_H
+#define CFG_LCD_H
+
+/**
+ * Use 4 bit addressing mode.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_4BIT 0
+
+/**
+ * Use a table to speed up LCD memory addressing.
+ * This will use about 100 bytes of RAM.
+ * $WIZ$ type = "boolean"
+ */
+#define CONFIG_LCD_ADDRESS_FAST 1
+
+#endif /* CFG_LCD_H */
+
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2003, 2004, 2005, 2008 Develer S.r.l. (http://www.develer.com/)
- * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
- *
- * -->
- *
- * \brief LCD low-level hardware macros
- *
- * \version $Id$
- *
- * \author Bernie Innocenti <bernie@codewiz.org>
- * \author Stefano Fedrigo <aleph@develer.com>
- *
- */
-
-#ifndef HW_LCD_H
-#define HW_LCD_H
-
-#include "cfg/cfg_lcd.h" /* CONFIG_LCD_4BIT */
-#include <cfg/macros.h> /* BV() */
-#include <cfg/debug.h>
-
-#include <cpu/attr.h>
-#include <cpu/irq.h>
-#include <cpu/types.h>
-
-#warning TODO:This is an example implementation, you must implement it!
-
-/**
- * \name LCD I/O pins/ports
- * @{
- */
-#define LCD_RS /* Implement me! */
-#define LCD_RW /* Implement me! */
-#define LCD_E /* Implement me! */
-#define LCD_DB0 /* Implement me! */
-#define LCD_DB1 /* Implement me! */
-#define LCD_DB2 /* Implement me! */
-#define LCD_DB3 /* Implement me! */
-#define LCD_DB4 /* Implement me! */
-#define LCD_DB5 /* Implement me! */
-#define LCD_DB6 /* Implement me! */
-#define LCD_DB7 /* Implement me! */
-/*@}*/
-
-/**
- * \name DB high nibble (DB[4-7])
- * @{
- */
-
-#if CONFIG_LCD_4BIT
- #define LCD_MASK (LCD_DB7 | LCD_DB6 | LCD_DB5 | LCD_DB4)
- #define LCD_SHIFT 4
-#else
- #define LCD_MASK (uint8_t)0xff
- #define LCD_SHIFT 0
-#endif
-/*@}*/
-
-/**
- * \name LCD bus control macros
- * @{
- */
-#define LCD_CLR_RS /* Implement me! */
-#define LCD_SET_RS /* Implement me! */
-#define LCD_CLR_RD /* Implement me! */
-#define LCD_SET_RD /* Implement me! */
-#define LCD_CLR_E /* Implement me! */
-#define LCD_SET_E /* Implement me! */
-
-/* Enter command mode */
-#define LCD_SET_COMMAND() /* Implement me! */
-
-/* Enter data mode */
-#define LCD_SET_DATA() /* Implement me! */
-
-#if CONFIG_LCD_4BIT
- #define LCD_WRITE_H(x) ((void)x)/* Implement me! */
- #define LCD_WRITE_L(x) ((void)x)/* Implement me! */
- #define LCD_READ_H ( 0 /* Implement me! */ )
- #define LCD_READ_L ( 0 /* Implement me! */ )
-#else
- #define LCD_WRITE(x) ((void)x)/* Implement me! */
- #define LCD_READ (0 /* Implement me! */ )
-#endif
-/*@}*/
-
-/** Set data bus direction to output (write to display) */
-#define LCD_DB_OUT /* Implement me! */
-
-/** Set data bus direction to input (read from display) */
-#define LCD_DB_IN /* Implement me! */
-
-/** Delay for write (Enable pulse width, 220ns) */
-#define LCD_DELAY_WRITE \
- do { \
- NOP; \
- NOP; \
- NOP; \
- NOP; \
- NOP; \
- } while (0)
-
-/** Delay for read (Data ouput delay time, 120ns) */
-#define LCD_DELAY_READ \
- do { \
- NOP; \
- NOP; \
- NOP; \
- NOP; \
- } while (0)
-
-
-INLINE void lcd_bus_init(void)
-{
- cpu_flags_t flags;
- IRQ_SAVE_DISABLE(flags);
-
- /*
- * Here set bus pin!
- * to init a lcd device.
- *
- */
-
- /*
- * Data bus is in output state most of the time:
- * LCD r/w functions assume it is left in output state
- */
- LCD_DB_OUT;
-
-
- IRQ_RESTORE(flags);
-}
-
-#endif /* HW_LCD_H */
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2006, 2010 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief Displaytech 32122A LCD driver
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+
+#ifndef HW_LCD_32122A_H
+#define HW_LCD_32122A_H
+
+#include <cpu/types.h>
+#include <cpu/irq.h>
+
+#warning TODO:This is an example implementation, you must implement it!
+
+/**
+ * Predefined LCD PWM contrast values
+ */
+#define LCD_DEF_PWM 145
+#define LCD_MAX_PWM 505
+#define LCD_MIN_PWM 130
+#define LCD_PWM_CH 0
+
+
+/**
+ * \name LCD I/O pins/ports
+ * @{
+ */
+#define LCD_RS /* Implement me! */
+#define LCD_RW /* Implement me! */
+#define LCD_PE_E1 /* Implement me! */
+#define LCD_PE_E2 /* Implement me! */
+#define LCD_DB0 /* Implement me! */
+#define LCD_DB1 /* Implement me! */
+#define LCD_DB2 /* Implement me! */
+#define LCD_DB3 /* Implement me! */
+#define LCD_DB4 /* Implement me! */
+#define LCD_DB5 /* Implement me! */
+#define LCD_DB6 /* Implement me! */
+#define LCD_DB7 /* Implement me! */
+#define LCD_PF_DB0 /* Implment me! */
+/*@}*/
+
+/**
+ * \name LCD bus control macros
+ * @{
+ */
+#define LCD_CLR_A0 do { /* Implement me! */ } while (0)
+#define LCD_SET_A0 do { /* Implement me! */ } while (0)
+#define LCD_CLR_RD do { /* Implement me! */ } while (0)
+#define LCD_SET_RD do { /* Implement me! */ } while (0)
+#define LCD_CLR_E1 do { /* Implement me! */ } while (0)
+#define LCD_SET_E1 do { /* Implement me! */ } while (0)
+#define LCD_CLR_E2 do { /* Implement me! */ } while (0)
+#define LCD_SET_E2 do { /* Implement me! */ } while (0)
+#define LCD_SET_E(x) do { (void)x; /* Implement me! */ } while (0)
+#define LCD_CLR_E(x) do { (void)x; /* Implement me! */ } while (0)
+/*@}*/
+
+/**
+ * \name Chip select bits for LCD_SET_E()
+ * @{
+ */
+#define LCDF_E1 ( 0/* Implement me! */)
+#define LCDF_E2 ( 0/* Implement me! */)
+/*@}*/
+/** Read from the LCD data bus (DB[0-7]) */
+#define LCD_WRITE(x) ((void)x)/* Implement me! */
+/** Write to the LCD data bus (DB[0-7]) */
+#define LCD_READ (0 /* Implement me! */ )
+
+/** Set data bus direction to output (write to display) */
+#define LCD_DB_OUT /* Implement me! */
+
+/** Set data bus direction to input (read from display) */
+#define LCD_DB_IN /* Implement me! */
+
+/** Delay for write (Enable pulse width, 220ns) */
+#define LCD_DELAY_WRITE \
+ do { \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ } while (0)
+
+/** Delay for read (Data ouput delay time, 120ns) */
+#define LCD_DELAY_READ \
+ do { \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ } while (0)
+
+
+#define LCD_32122_RESET() do { /* Implement me! */ } while (0)
+
+INLINE void lcd_32122a_hw_bus_init(void)
+{
+ cpu_flags_t flags;
+ IRQ_SAVE_DISABLE(flags);
+
+ /*
+ * Here set bus pin!
+ * to init a lcd device.
+ *
+ */
+
+ /*
+ * Data bus is in output state most of the time:
+ * LCD r/w functions assume it is left in output state
+ */
+ LCD_DB_OUT;
+
+
+ IRQ_RESTORE(flags);
+}
+
+#endif /* HW_LCD_32122A_H */
+
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2003, 2004, 2005, 2008 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2001 Bernie Innocenti <bernie@codewiz.org>
+ *
+ * -->
+ *
+ * \brief LCD low-level hardware macros
+ *
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Stefano Fedrigo <aleph@develer.com>
+ *
+ */
+
+#ifndef HW_LCD_HD44_H
+#define HW_LCD_HD44_H
+
+#include "cfg/cfg_lcd_hd44.h" /* CONFIG_LCD_4BIT */
+
+#include <cpu/types.h>
+#include <cpu/irq.h>
+
+#warning TODO:This is an example implementation, you must implement it!
+
+/**
+ * \name LCD I/O pins/ports
+ * @{
+ */
+#define LCD_RS /* Implement me! */
+#define LCD_RW /* Implement me! */
+#define LCD_E /* Implement me! */
+#define LCD_DB0 /* Implement me! */
+#define LCD_DB1 /* Implement me! */
+#define LCD_DB2 /* Implement me! */
+#define LCD_DB3 /* Implement me! */
+#define LCD_DB4 /* Implement me! */
+#define LCD_DB5 /* Implement me! */
+#define LCD_DB6 /* Implement me! */
+#define LCD_DB7 /* Implement me! */
+/*@}*/
+
+/**
+ * \name DB high nibble (DB[4-7])
+ * @{
+ */
+
+#if CONFIG_LCD_4BIT
+ #define LCD_MASK (LCD_DB7 | LCD_DB6 | LCD_DB5 | LCD_DB4)
+ #define LCD_SHIFT 4
+#else
+ #define LCD_MASK (uint8_t)0xff
+ #define LCD_SHIFT 0
+#endif
+/*@}*/
+
+/**
+ * \name LCD bus control macros
+ * @{
+ */
+#define LCD_CLR_RS /* Implement me! */
+#define LCD_SET_RS /* Implement me! */
+#define LCD_CLR_RD /* Implement me! */
+#define LCD_SET_RD /* Implement me! */
+#define LCD_CLR_E /* Implement me! */
+#define LCD_SET_E /* Implement me! */
+
+/* Enter command mode */
+#define LCD_SET_COMMAND() /* Implement me! */
+
+/* Enter data mode */
+#define LCD_SET_DATA() /* Implement me! */
+
+#if CONFIG_LCD_4BIT
+ #define LCD_WRITE_H(x) ((void)x)/* Implement me! */
+ #define LCD_WRITE_L(x) ((void)x)/* Implement me! */
+ #define LCD_READ_H ( 0 /* Implement me! */ )
+ #define LCD_READ_L ( 0 /* Implement me! */ )
+#else
+ #define LCD_WRITE(x) ((void)x)/* Implement me! */
+ #define LCD_READ (0 /* Implement me! */ )
+#endif
+/*@}*/
+
+/** Set data bus direction to output (write to display) */
+#define LCD_DB_OUT /* Implement me! */
+
+/** Set data bus direction to input (read from display) */
+#define LCD_DB_IN /* Implement me! */
+/** Delay for write (Enable pulse width, 220ns) */
+#define LCD_DELAY_WRITE \
+ do { \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ } while (0)
+
+/** Delay for read (Data ouput delay time, 120ns) */
+#define LCD_DELAY_READ \
+ do { \
+ NOP; \
+ NOP; \
+ NOP; \
+ NOP; \
+ } while (0)
+
+
+
+INLINE void lcd_hd44_hw_bus_init(void)
+{
+ cpu_flags_t flags;
+ IRQ_SAVE_DISABLE(flags);
+
+ /*
+ * Here set bus pin!
+ * to init a lcd device.
+ *
+ */
+
+ /*
+ * Data bus is in output state most of the time:
+ * LCD r/w functions assume it is left in output state
+ */
+ LCD_DB_OUT;
+
+
+ IRQ_RESTORE(flags);
+}
+
+#endif /* HW_LCD_HD44_H */