hw_lcd.h

Go to the documentation of this file.
00001 
00043 #ifndef HW_LCD_H
00044 #define HW_LCD_H
00045 
00046 #include "cfg/cfg_lcd.h"  /* CONFIG_LCD_4BIT */
00047 #include <cfg/macros.h>   /* BV() */
00048 #include <cfg/debug.h>
00049 
00050 #include <cpu/attr.h>
00051 #include <cpu/irq.h>
00052 #include <cpu/types.h>
00053 
00054 #warning TODO:This is an example implementation, you must implement it!
00055 
00060 #define LCD_RS    /* Implement me! */
00061 #define LCD_RW    /* Implement me! */
00062 #define LCD_E     /* Implement me! */
00063 #define LCD_DB0   /* Implement me! */
00064 #define LCD_DB1   /* Implement me! */
00065 #define LCD_DB2   /* Implement me! */
00066 #define LCD_DB3   /* Implement me! */
00067 #define LCD_DB4   /* Implement me! */
00068 #define LCD_DB5   /* Implement me! */
00069 #define LCD_DB6   /* Implement me! */
00070 #define LCD_DB7   /* Implement me! */
00071 
00078 #if CONFIG_LCD_4BIT
00079     #define LCD_MASK    (LCD_DB7 | LCD_DB6 | LCD_DB5 | LCD_DB4)
00080     #define LCD_SHIFT   4
00081 #else
00082     #define LCD_MASK (uint8_t)0xff
00083     #define LCD_SHIFT 0
00084 #endif
00085 
00091 #define LCD_CLR_RS      /* Implement me! */
00092 #define LCD_SET_RS      /* Implement me! */
00093 #define LCD_CLR_RD      /* Implement me! */
00094 #define LCD_SET_RD      /* Implement me! */
00095 #define LCD_CLR_E       /* Implement me! */
00096 #define LCD_SET_E       /* Implement me! */
00097 
00098 #if CONFIG_LCD_4BIT
00099     #define LCD_WRITE_H(x)  ((void)x)/* Implement me! */
00100     #define LCD_WRITE_L(x)  ((void)x)/* Implement me! */
00101     #define LCD_READ_H      ( 0 /* Implement me! */ )
00102     #define LCD_READ_L      ( 0 /* Implement me! */ )
00103 #else
00104     #define LCD_WRITE(x)    ((void)x)/* Implement me! */
00105     #define LCD_READ        (0 /* Implement me! */ )
00106 #endif
00107 
00110 #define LCD_DB_OUT          /* Implement me! */
00111 
00113 #define LCD_DB_IN           /* Implement me! */
00114 
00116 #define LCD_DELAY_WRITE \
00117     do { \
00118         NOP; \
00119         NOP; \
00120         NOP; \
00121         NOP; \
00122         NOP; \
00123     } while (0)
00124 
00126 #define LCD_DELAY_READ \
00127     do { \
00128         NOP; \
00129         NOP; \
00130         NOP; \
00131         NOP; \
00132     } while (0)
00133 
00134 
00135 INLINE void lcd_bus_init(void)
00136 {
00137     cpu_flags_t flags;
00138     IRQ_SAVE_DISABLE(flags);
00139 
00140     /*
00141      * Here set bus pin!
00142      * to init a lcd device.
00143      *
00144      */
00145 
00146     /*
00147      * Data bus is in output state most of the time:
00148      * LCD r/w functions assume it is left in output state
00149      */
00150     LCD_DB_OUT;
00151 
00152 
00153     IRQ_RESTORE(flags);
00154 }
00155 
00156 #endif /* HW_LCD_H */