#ifndef __G45LCD_H #define __G45LCD_H #ifdef __cplusplus extern "C" { #endif void LCD_Init(void); /* Initialize parameters about LCD functions in the library */ void LCD_BackLight_On(void); /* Turn on the LCD backlight */ void LCD_BackLight_Off(void); /* Turn off the LCD backlight */ void LCD_ShowText(uchar Text); /* Display one character on the LCD panel, and the cursor will right-shifted by one character position automatically Parameters: Text: Display character */ void LCD_ClrScrn(void); /* Clear the graphic display and the text display */ #define LCD_NormalMode() LCD_StandByMode(0) void LCD_StandByMode(int mode); /* Stand-by mode/Normal mode Parameters: mode: 1 -> Enter the stand-by mode 2 -> Enter the normal mode while in the stand-by mode */ void LCD_GotoPosition(int Line, int Offset); /* Move the cursor to the specified position Parameters: Line: One of four line numbers (0 to 3) Offset: Cursor position (0 to 7) */ void LCD_CursorDisplay(int Display, int Blink); /* Set the Cursor display status Parameters: Display: 0 -> Cursor display off 1 -> Cursor display on Blink: 0 -> Cursor blink off 1 -> Cursor blink on */ void LCD_LineReverse(int Line); /* Select one out of four line and reverse the display Parameters: Line: One of four line numbers (0 to 3) */ void LCD_LineRestore(int Line); /* Select one out of four line and restore the display Parameters: Line: One of four line numbers (0 to 3) */ void pascal LCD_ClrScrn_G(void); /* Clear the graphic display on the LCD */ void pascal LCD_UpdateGraphic(void); /* Update the LCD with data from the graphic buffer This function should be called after calling the LCD_Pixel(), LCD_Hline(), LCD_Vline() and LCD_Bmp() function. */ void pascal LCD_Pixel(int x, int y, int mode); /* Turn a pixel on the specific position on or off Parameters: x: The x coordinate of the pixel (0 to 127) y: The y coordinate of the pixel (0 to 63) mode: 0 -> Clear a pixel dot 1 -> Draw a pixel dot 2 -> Draw a pixel dot for Exclusive OR(XOR) */ void pascal LCD_Hline(int x1, int x2, int y, int mode); /* Draw a horizontal line between two points on the LCD Parameters: x1: The starting x position of the line you wish to display (0 to 127) x2: The ending x position of the line you wish to display (0 to 127) y : The starting y position of the line you wish to display (0 to 63) mode: 0 -> Clear a horizontal line 1 -> Draw a horizontal line 2 -> Draw a horizontal line for Exclusive OR(XOR) */ void pascal LCD_Vline(int x, int y1, int y2, int mode); /* Draw a vertical line between two points on the LCD Parameters: x : The starting x position of the line you wish to display (0 to 127) y1: The starting y position of the line you wish to display (0 to 63) y2: The ending y position of the line you wish to display (0 to 63) mode: 0 -> Clear a vertical line 1 -> Draw a vertical line 2 -> Draw a vertical line for Exclusive OR(XOR) */ int LCD_Bmp(unsigned x, unsigned y, char *fname, int mode); /* Take a black-and-white bitmap image and display it on the LCD The image size must be no larger than 128 pixels wide and 64 pixels high Parameters: x: The starting x position of the image (0 to 127) y: The starting y position of the image (0 to 63) fname: File that the function load mode: 0 -> Clear a vertical line 1 -> Draw a vertical line 2 -> Draw a vertical line for Exclusive OR(XOR) Return: 0 -> On sucess, returns 0 1 -> The x or y ordinate of a coordinate is not a valid numeric value 2 -> The specified file is not present 3 -> The specified image file is not a valid black-and-white bitmap file 4 -> The image size is larger than either 128 pixels wide or 64 pixels high */ void LCD_GetLibDate(unsigned char *LibDate); /* Get the create date of funciton library */ unsigned LCD_GetLibVersion(void); /* Get the version number of function library Return: Returns the current version number */ #ifdef __cplusplus } #endif #endif