/*
	MGLCD.C

	BL14xx/MicroG or BL15xx/MicroG2

	Use 6 bit of the PIOA to talk to an LCD in the 4 bit mode. The R/W line of
	the LCD is tied low to minimize usage of the PIOA bits. Instead of checking
	the busy flag of the LCD, a 40us wait is executed before any write to the
	LCD is done.

	The following wiring is used:

		PA0      not used
		PA1      not used
		PA2      LCD RS
		PA3      LCD EN
		PA4      LCD DB4
		PA5      LCD DB5
		PA6      LCD DB6
		PA7      LCD DB7

		Vcc      Vcc
		Gnd      Vss
		Gnd      Vo          (for better contrast, tie Vo to 0.3 volt)
		Gnd      R/W

	The LCD driver is compatible with the keypad driver provided for the MicroG.
	Look at sample mglcdkey.c to see their usage.

	You may optionally use the MicroG-to-PLCBus/LCD adapter. If so, be sure to
	uncomment the line including the "#define ESSTART_NOTINPUT" statement.
*/

//#define ESSTART_NOTINPUT

main()
{
int i, j, k;

	lc_init();        // initialize the LCD

	hitwd();          // 9-1-95, hit here to prevent timeout
	for(;;)
	{
		lc_printf("\x1be");
		lc_printf("\x1bp000This is line 1.");
		lc_printf("\x1bp100This is line 2.");

		for(i=0;i<30000;i++);
		hitwd();

		i = 0x1234;
		j = 0xabcd;
		k = 0x8678;

		lc_printf("\x1be");  // erase the screen
		lc_printf("\x1bp000%x %x %x", i,j,k);
		lc_printf("\x1bp100%u %u %u", i,j,k);

		for(i=0;i<30000;i++);
		hitwd();
	
		lc_printf("\x1be");  // erase the screen
		lc_printf("\x1bp000Z-World Eng'g");
		lc_printf("\x1bp100(916) 757 3737");

		for(i=0;i<30000;i++);
		hitwd();
	}
}
	
		
