BeRTOS
hw_lcd_hd44.h
Go to the documentation of this file.
00001 
00041 #ifndef HW_LCD_HD44_H
00042 #define HW_LCD_HD44_H
00043 
00044 #include "cfg/cfg_lcd_hd44.h"  /* CONFIG_LCD_4BIT */
00045 
00046 #include <cpu/types.h>
00047 #include <cpu/irq.h>
00048 
00049 #warning TODO:This is an example implementation, you must implement it!
00050 
00055 #define LCD_RS    /* Implement me! */
00056 #define LCD_RW    /* Implement me! */
00057 #define LCD_E     /* Implement me! */
00058 #define LCD_DB0   /* Implement me! */
00059 #define LCD_DB1   /* Implement me! */
00060 #define LCD_DB2   /* Implement me! */
00061 #define LCD_DB3   /* Implement me! */
00062 #define LCD_DB4   /* Implement me! */
00063 #define LCD_DB5   /* Implement me! */
00064 #define LCD_DB6   /* Implement me! */
00065 #define LCD_DB7   /* Implement me! */
00066 
00073 #if CONFIG_LCD_4BIT
00074     #define LCD_MASK    (LCD_DB7 | LCD_DB6 | LCD_DB5 | LCD_DB4)
00075     #define LCD_SHIFT   4
00076 #else
00077     #define LCD_MASK (uint8_t)0xff
00078     #define LCD_SHIFT 0
00079 #endif
00080 
00086 #define LCD_CLR_RS      /* Implement me! */
00087 #define LCD_SET_RS      /* Implement me! */
00088 #define LCD_CLR_RD      /* Implement me! */
00089 #define LCD_SET_RD      /* Implement me! */
00090 #define LCD_CLR_E       /* Implement me! */
00091 #define LCD_SET_E       /* Implement me! */
00092 
00093 /* Enter command mode */
00094 #define LCD_SET_COMMAND() /* Implement me! */
00095 
00096 /* Enter data mode */
00097 #define LCD_SET_DATA() /* Implement me! */
00098 
00099 #if CONFIG_LCD_4BIT
00100     #define LCD_WRITE_H(x)  ((void)x)/* Implement me! */
00101     #define LCD_WRITE_L(x)  ((void)x)/* Implement me! */
00102     #define LCD_READ_H      ( 0 /* Implement me! */ )
00103     #define LCD_READ_L      ( 0 /* Implement me! */ )
00104 #else
00105     #define LCD_WRITE(x)    ((void)x)/* Implement me! */
00106     #define LCD_READ        (0 /* Implement me! */ )
00107 #endif
00108 
00111 #define LCD_DB_OUT          /* Implement me! */
00112 
00114 #define LCD_DB_IN           /* Implement me! */
00115 
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 
00136 INLINE void lcd_hd44_hw_bus_init(void)
00137 {
00138     cpu_flags_t flags;
00139     IRQ_SAVE_DISABLE(flags);
00140 
00141     /*
00142      * Here set bus pin!
00143      * to init a lcd device.
00144      *
00145      */
00146 
00147     /*
00148      * Data bus is in output state most of the time:
00149      * LCD r/w functions assume it is left in output state
00150      */
00151     LCD_DB_OUT;
00152 
00153 
00154     IRQ_RESTORE(flags);
00155 }
00156 
00157 #endif /* HW_LCD_HD44_H */