Update preset.
[bertos.git] / bertos / hw / hw_lcd.h
index 9ce56347afa20e622e580aa24edc87e6584aa8fd..e6657dd0c63835856ab67b886afe19f8600ec636 100644 (file)
  * 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 Bernardo Innocenti <bernie@codewiz.org>
+ * Copyright 2010 Develer S.r.l. (http://www.develer.com/)
  *
  * -->
  *
- * \brief LCD low-level hardware macros
- *
- * \version $Id$
- *
- * \author Bernardo Innocenti <bernie@develer.com>
- * \author Stefano Fedrigo <aleph@develer.com>
+ * \brief Atmel SAM3N-EK testcase
  *
+ * \author Luca Ottaviano <lottaviano@develer.com>
+ * \author Daniele Basile <asterix@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>
+#warning FIXME: This is an example implementation, you must implement it
+
+#include <io/cm3.h>
 
 #include <cpu/attr.h>
-#include <cpu/irq.h>
 #include <cpu/types.h>
 
-#warning TODO:This is an example implementation, you must implement it!
+#define LCD_BACKLIGHT_MAX    // Max backlight level
+#define LCD_BACKLIGHT_PIN    // Port C
+#define LCD_SPICLOCK         // Minimum cycle len = 80 ns according specs
 
-/**
- * \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! */
+#define LCD_BACKLIGHT_LEVEL_UP() do { /* Implement me! */ } while(0)
 
-#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)
+INLINE void lcd_setBacklight(uint8_t level)
 {
-       cpuflags_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);
+       (void)level;
+       /* Implement me! */
 }
 
+#define LCD_BACKLIGHT_INIT() do { /* Implement me! */ } while(0)
+
 #endif /* HW_LCD_H */