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"
00047 #include <cfg/macros.h>
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
00061 #define LCD_RW
00062 #define LCD_E
00063 #define LCD_DB0
00064 #define LCD_DB1
00065 #define LCD_DB2
00066 #define LCD_DB3
00067 #define LCD_DB4
00068 #define LCD_DB5
00069 #define LCD_DB6
00070 #define LCD_DB7
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
00092 #define LCD_SET_RS
00093 #define LCD_CLR_RD
00094 #define LCD_SET_RD
00095 #define LCD_CLR_E
00096 #define LCD_SET_E
00097
00098 #if CONFIG_LCD_4BIT
00099 #define LCD_WRITE_H(x) ((void)x)
00100 #define LCD_WRITE_L(x) ((void)x)
00101 #define LCD_READ_H ( 0 )
00102 #define LCD_READ_L ( 0 )
00103 #else
00104 #define LCD_WRITE(x) ((void)x)
00105 #define LCD_READ (0 )
00106 #endif
00107
00110 #define LCD_DB_OUT
00111
00113 #define LCD_DB_IN
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
00142
00143
00144
00145
00146
00147
00148
00149
00150 LCD_DB_OUT;
00151
00152
00153 IRQ_RESTORE(flags);
00154 }
00155
00156 #endif