00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef LCD_H
00020 #define LCD_H
00021
00022 #include "global.h"
00023
00024
00025 #include "lcdconf.h"
00026
00027
00028
00029 #define LCD_CLR 0 // DB0: clear display
00030 #define LCD_HOME 1 // DB1: return to home position
00031 #define LCD_ENTRY_MODE 2 // DB2: set entry mode
00032 #define LCD_ENTRY_INC 1 // DB1: increment
00033 #define LCD_ENTRY_SHIFT 0 // DB2: shift
00034 #define LCD_ON_CTRL 3 // DB3: turn lcd/cursor on
00035 #define LCD_ON_DISPLAY 2 // DB2: turn display on
00036 #define LCD_ON_CURSOR 1 // DB1: turn cursor on
00037 #define LCD_ON_BLINK 0 // DB0: blinking cursor
00038 #define LCD_MOVE 4 // DB4: move cursor/display
00039 #define LCD_MOVE_DISP 3 // DB3: move display (0-> move cursor)
00040 #define LCD_MOVE_RIGHT 2 // DB2: move right (0-> left)
00041 #define LCD_FUNCTION 5 // DB5: function set
00042 #define LCD_FUNCTION_8BIT 4 // DB4: set 8BIT mode (0->4BIT mode)
00043 #define LCD_FUNCTION_2LINES 3 // DB3: two lines (0->one line)
00044 #define LCD_FUNCTION_10DOTS 2 // DB2: 5x10 font (0->5x7 font)
00045 #define LCD_CGRAM 6 // DB6: set CG RAM address
00046 #define LCD_DDRAM 7 // DB7: set DD RAM address
00047
00048 #define LCD_BUSY 7 // DB7: LCD is busy
00049
00050
00051
00052 #ifdef LCD_DATA_4BIT
00053 #define LCD_FDEF_1 (0<<LCD_FUNCTION_8BIT)
00054 #else
00055 #define LCD_FDEF_1 (1<<LCD_FUNCTION_8BIT)
00056 #endif
00057 #define LCD_FDEF_2 (1<<LCD_FUNCTION_2LINES)
00058 #define LCD_FUNCTION_DEFAULT ((1<<LCD_FUNCTION) | LCD_FDEF_1 | LCD_FDEF_2)
00059 #define LCD_MODE_DEFAULT ((1<<LCD_ENTRY_MODE) | (1<<LCD_ENTRY_INC))
00060
00061
00062 #define LCDCHAR_PROGRESS05 0 // 0/5 full progress block
00063 #define LCDCHAR_PROGRESS15 1 // 1/5 full progress block
00064 #define LCDCHAR_PROGRESS25 2 // 2/5 full progress block
00065 #define LCDCHAR_PROGRESS35 3 // 3/5 full progress block
00066 #define LCDCHAR_PROGRESS45 4 // 4/5 full progress block
00067 #define LCDCHAR_PROGRESS55 5 // 5/5 full progress block
00068 #define LCDCHAR_REWINDARROW 6 // rewind arrow
00069 #define LCDCHAR_STOPBLOCK 7 // stop block
00070 #define LCDCHAR_PAUSEBARS 8 // pause bars
00071 #define LCDCHAR_FORWARDARROW 9 // fast-forward arrow
00072 #define LCDCHAR_SCROLLUPARROW 10 // scroll up arrow
00073 #define LCDCHAR_SCROLLDNARROW 11 // scroll down arrow
00074 #define LCDCHAR_BLANK 12 // scroll down arrow
00075 #define LCDCHAR_ANIPLAYICON0 13 // animated play icon frame 0
00076 #define LCDCHAR_ANIPLAYICON1 14 // animated play icon frame 1
00077 #define LCDCHAR_ANIPLAYICON2 15 // animated play icon frame 2
00078 #define LCDCHAR_ANIPLAYICON3 16 // animated play icon frame 3
00079
00080
00081 #define PROGRESSPIXELS_PER_CHAR 6
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092 void lcdInitHW(void);
00093
00094 void lcdBusyWait(void);
00095
00096 void lcdControlWrite(u08 data);
00097
00098 u08 lcdControlRead(void);
00099
00100 void lcdDataWrite(u08 data);
00101
00102 u08 lcdDataRead(void);
00103
00104
00105
00106
00107
00108
00109
00110
00111 void lcdInit(void);
00112
00113
00114 void lcdHome(void);
00115
00116
00117 void lcdClear(void);
00118
00119
00120
00121 void lcdGotoXY(u08 row, u08 col);
00122
00123
00124
00125
00126
00127 void lcdLoadCustomChar(u08* lcdCustomCharArray, u08 romCharNum, u08 lcdCharNum);
00128
00129
00130 void lcdPrintData(char* data, u08 nBytes);
00131
00132
00133
00134
00135
00136 void lcdProgressBar(u16 progress, u16 maxprogress, u08 length);
00137
00138 #endif