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"
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
00056 #define LCD_RW
00057 #define LCD_E
00058 #define LCD_DB0
00059 #define LCD_DB1
00060 #define LCD_DB2
00061 #define LCD_DB3
00062 #define LCD_DB4
00063 #define LCD_DB5
00064 #define LCD_DB6
00065 #define LCD_DB7
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
00087 #define LCD_SET_RS
00088 #define LCD_CLR_RD
00089 #define LCD_SET_RD
00090 #define LCD_CLR_E
00091 #define LCD_SET_E
00092
00093
00094 #define LCD_SET_COMMAND()
00095
00096
00097 #define LCD_SET_DATA()
00098
00099 #if CONFIG_LCD_4BIT
00100 #define LCD_WRITE_H(x) ((void)x)
00101 #define LCD_WRITE_L(x) ((void)x)
00102 #define LCD_READ_H ( 0 )
00103 #define LCD_READ_L ( 0 )
00104 #else
00105 #define LCD_WRITE(x) ((void)x)
00106 #define LCD_READ (0 )
00107 #endif
00108
00111 #define LCD_DB_OUT
00112
00114 #define LCD_DB_IN
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
00143
00144
00145
00146
00147
00148
00149
00150
00151 LCD_DB_OUT;
00152
00153
00154 IRQ_RESTORE(flags);
00155 }
00156
00157 #endif