//***************************************************************//
//			DECLARATIONS AND DEFINITIONS						 //
//***************************************************************//


//---------------------------------------------------------------//
//			    Function Prototypes								 //
//---------------------------------------------------------------//

void GLCD_LcdInit();
void GLCD_ClearScreen();
void GLCD_Rectangle(unsigned char,unsigned char,unsigned char,unsigned char);

//---------------------------------------------------------------//
//				Hardware										 //
//---------------------------------------------------------------//
sbit LCD_RS = P1^4;
sbit LCD_RW = P1^3;
sbit LCD_E = P1^2;
sbit LCD_CS1 = P3^4;
sbit LCD_CS2 = P3^3;
sbit LCD_RST = P3^2;
#define LCD_DATA P0

//---------------------------------------------------------------//
//			      LCD Registers									 //
//---------------------------------------------------------------//

#define X_ADDRESS 0xB8			/* Address for Page 0 */
#define Y_ADDRESS 0x40			/* Address for Column 0 */
#define START_LINE 0xC0			/* Address base for line 0 */
#define DISPLAY_ON 0x3F			/* Turn Display on */
#define DISPLAY_OFF 0x3E		/* Turn Display off */

//---------------------------------------------------------------//
//			General use definitions								 //
//---------------------------------------------------------------//

#define RIGHT 0
#define LEFT 1
#define BUSY 0x80