/*
	MGLCDCG.C
	
	BL14xx/MicroG or BL15xx/MicroG2

	Use PIOA to drive an LCD. This sample program creates special characters
	on the LCD and prints it to the LCD.

	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

char special_lcd[] =
{
    64,    
    0x04, 0x02, 0x1f, 0x02, 0x04, 0x00, 0x00, 0x00, // 08 right arrow
    0x00, 0x00, 0x00, 0x04, 0x04, 0x15, 0x0e, 0x04, // 09 down arrow
    0x04, 0x0e, 0x15, 0x04, 0x04, 0x00, 0x00, 0x00, // 02 up arrow
    0x04, 0x08, 0x1f, 0x08, 0x04, 0x00, 0x00, 0x00, // 0b left arrow
    0x08, 0x0c, 0x0e, 0x0f, 0x0e, 0x0c, 0x08, 0x00, // 0c arrow cursor
    0x02, 0x07, 0x02, 0x0a, 0x0a, 0x08, 0x1c, 0x08, // 0d up down symbol
    0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, // 0e vertical line
    0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00  // 0f horizontal line
};


main()
{
	int i;
	lc_init();							// initialize the LCD
	lc_cgram(special_lcd);

	for(i=0;i<8;i++) lc_char(i);	// print 8 special characters on line 1

	lc_printf("\x1bp100 %c %c %c %c %c %c %c %c", 0,1,2,3,4,5,6,7);
					// print 8 special characters on line2.
}