Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

lcd.h

00001 #ifndef _DEV_LCD_H_
00002 #define _DEV_LCD_H_
00003 
00004 #include <sys/device.h>
00005 
00030 /*
00031  * Offset from base address of lcd data register
00032  */
00033 #define LCD_DATA 1
00034 
00035 /*
00036  * Offset from base address of lcd command register
00037  */
00038 #define LCD_REG  0
00039 
00040 /*
00041  * Max lcd width in bytes represented characters 
00042  */
00043 #define MAX_LCD_WIDTH  0x40
00044 
00045 /*
00046  * Clear command
00047  */
00048 #define LCD_CLEAR               0x01
00049 
00050 /*
00051  * Command to move cursor to start.
00052  */
00053 #define CURSOR_TO_START         0x02
00054 
00055 /*
00056  * Tryb lcd
00057  */
00058 #define LCD_TRYB                0x06
00059 
00060 /*
00061  * Behavior of coursor when write data to lcd
00062  */
00063 #define AUTO_MOVING_CURSOR      0x00
00064 
00065 /*
00066  * Behavior of frame when write data to lcd
00067  */
00068 #define AUTO_MOVING_FRAME       0x01
00069 
00070 
00071 #define LCD_CONFIG              0x08
00072 #define BLINK_ON                0x01
00073 #define BLINK_OFF               0x00
00074 #define CURSOR_ON               0x02
00075 #define CURSOR_OFF              0x00
00076 #define LCD_ON                  0x04
00077 #define LCD_OFF                 0x00
00078 
00079 
00080 #define LCD_COMMAND             0x10
00081 #define MOVE_CURSOR             0x00
00082 #define MOVE_FRAME              0x01
00083 #define MOVE_LEFT               0x00
00084 #define MOVE_RIGHT              0x01
00085 
00086 
00087 
00088 #define INTERFACE_8_BITS        0x38
00089 #define INTERFACE_4_BITS        0x28
00090 
00091 
00092 #define SET_RAM_TO_DEF_CHAR     0x40
00093 
00094 
00095 #define SET_RAM_POINTER         0x80
00096 #define RAM_START_F_LINE        0x00
00097 #define RAM_START_S_LINE        0x40
00098 
00099 
00100 #define BUSY_MASK               0x80
00101 #define BUSY                    0x80
00102 
00103 
00104 //constans
00105 #define INTERFACE_TYPE_8_BITS   0x00
00106 #define INTERFACE_TYPE_4_BITS   0xFF
00107 
00108 #define CHAR_80                 0x80
00109 #define CHAR_40                 0x40
00110 #define CHAR_20                 0x20
00111 #define CHAR_20                 0x20
00112 
00113 #define IS_BLINKING             0x01
00114 #define NOT_BLINKING            0x02
00115 
00116 #define CURSOR_IS_VISIBLE       0x01
00117 #define CURSOR_NOT_VISIBLE      0x02
00118 
00119 #define LCD_IS_ON               0x01
00120 #define LCD_IS_OFF              0x02
00121 
00122 
00123 //constans to ioctl
00124 #define CLEAR_LCD_IOCTL         0x01
00125 #define CURSOR_TO_START_IOCTL   0x02
00126 #define LCD_TRYB_IOCTL          0x03
00127 #define LCD_COMMAND_IOCTL       0x04
00128 #define LCD_MOVING_IOCTL        0x05
00129 #define LCD_MOVING_TRYB_IOCTL   0x06
00130 
00131 
00132 
00133 typedef struct _LCDDCB LCDDCB;
00134 
00138 struct _LCDDCB {
00142         u_int  cursorPosition;
00146         u_char lcdTryb;
00150         u_char cursorVisible;
00154         u_char blinking;
00158         u_char lcdStatus;
00162         u_char interfaceType;
00166         u_char lcdWidth;
00167 
00171         HANDLE output_start;
00172 
00176         HANDLE tx_rdy;
00177 };
00178 
00179 
00183 extern NUTDEVICE devLcd0;
00188 #endif

Generated on Thu Jan 30 22:30:50 2003 for EduNet by doxygen1.2.18