#ifdef __cplusplus
extern "C" {
#endif

void LCD_Init(void);
/*
Initialize parameters about LCD functions in the library
*/


void pascal LCD_SetCursor(int mode);
/*
Set the Cursor display status

Parameters:
    mode: Cursor display on/off
        1: Display on
        0: Display off
*/

void pascal LCD_BlinkCursor(int mode);
/*
Set the Cursor blink status when cursor status is on

Parameters:
    mode: Character blink on/off
             1: blink on
             0: blink off
*/

void LCD_DisplayCursor(void);
/*
Show the cursor
*/
int pascal LCD_Gotoxy(unsigned x, unsigned y);
/*
Move the cursor to the specific position

Parameters:
    x: Cursor x-position (0 to 15)
    y: Cursor y-position (0 to 3)
    
return:
    on sucess return 0.
    on fail return 1: x or y is not correct

*/


void pascal LCD_Putch(uchar Text,unsigned mode);
/*
Display one character on the LCD panel, and the cursor will right-shifted by one character position automatically

Parameters:
    Text: Display character
    mode : The character display status
         0 : The character will the display
         1 : The character will the reverse display

*/

int pascal LCD_Puts(uchar *str,unsigned mode);
/*
Display string that the length does not exceed 64 Half-Width or 32 Full-Width
The Full-Width have to begin at x postion 0,2,4,6,8...14.
The cursor will right-shifted by the string position automatically

Parameters:
    str: The string ((ending with '\0') to be displayed
    mode : The String display status
         0 : The String will the display
         1 : The String will the reverse display

return:
    on sucess return 0.
    on fail return 5: The Full-Width begin postion is not correct
*/

int pascal LCD_PutsAt(unsigned x, unsigned y,uchar *str,unsigned mode);
/*
Display string on the specific position, the string length does not exceed 64 Half-Width or 32 Full-Width
The Full-Width have to begin at x postion 0,2,4,6,8...14.
The cursor will not shift

Parameters:
    x: Cursor x-position (0 to 15)
    y: Cursor y-position (0 to 3)
    str: The string ((ending with '\0') to be displayed
    mode : The String display status
         0 : The String will the display
         1 : The String will the reverse display

return:
    on sucess return 0.
    on fail return:
        1: x or y is not correct
        5: The Full-Width begin postion is not correct
*/

void LCD_LineReverse(unsigned y);
/*
Select one out of four line and reverse the display

Parameters:
    y: y means line number, 0 ~ 3
*/

void LCD_LineRestore(unsigned y);
/*
Select one out of four line and restore the display

Parameters:
    y: y means line number, 0 ~ 3
*/


void LCD_StandByMode(int mode);
/*
Set the LCD mode

Parameters:
      mode = 1, go to standby mode
      mode = 0, go to normal mode
*/


void LCD_Clear(void);
/*
Clear the LCD panel
*/

void pascal LCD_UpdateGraphic(void);
/*
  Redraw the LCD panel after LCD_Pixel(),LCD_Hline(),LCD_Vline()....
  

*/

void pascal LCD_Pixel(int x,int y,int mode);
/*
  Draw a pixel dot on the specific position

Parameters:
    x: x-position (0 to 127)
    y: y-position (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 on the specific position

Parameters:
    x1: x-position (0 to 127)
    x2: x-position (0 to 127)
    y : y-position (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 on the specific position

Parameters:
    x : x-position (0 to 127)
    y1: y-position (0 to 63)
    y2: y-position (0 to 63)
    mode :
         0 : Clear a vertical line
         1 : Draw a vertical line
         2 : Draw a vertical line for Exclusive OR(XOR)
*/

void pascal LCD_Line(int x1,int y1,int x2,int y2,int mode);
/*
  Draw a line between the two specific position

Parameters:
    x1: x-position (0 to 127)
    y1: y-position (0 to 63)
    x2: x-position (0 to 127)
    y2: y-position (0 to 63)
    mode :
         0 : Clear a line
         1 : Draw a line
         2 : Draw a line for Exclusive OR(XOR)
*/

void pascal LCD_Rectangle(int x1,int y1,int x2,int y2,int mode);
/*
  Draw a Rectangle between the two specific position

Parameters:
    x1: x-position (0 to 127)
    y1: y-position (0 to 63)
    x2: x-position (0 to 127)
    y2: y-position (0 to 63)
    mode :
         0 : Clear a Rectangle
         1 : Draw a Rectangle
         2 : Draw a Rectangle for Exclusive OR(XOR)
*/

void pascal LCD_Circle(int ox,int oy,int r,int mode);
/*
  Draw a Circle/Arc on the specific position

Parameters:
    ox: x-position (0 to 127)
    oy: y-position (0 to 63)
    r : r means radius
    mode :
         0 : Clear a Circle/Arc
         1 : Draw a Circle/Arc
         2 : Draw a Circle/Arc for Exclusive OR(XOR)
*/

int LCD_Bmp(unsigned x, unsigned y, char *fname ,int mode);
/*
  Draw a BMP file on the beginning position. The BMP file name does not exceed 8 characters.
  The Bitmap attribute is black & white , pixel size 128*64.
  User has to download  BMP file to ViewPAC

Parameters:
    x: x-position (0 to 127)
    y: y-position (0 to 63)
    fname: file name
    mode :
         0 : Clear a BMP
         1 : Draw a BMP
         2 : Draw a BMP for Exclusive OR(XOR)
*/


#ifdef __cplusplus
}
#endif
