WVGA/LCD

Hi, 

I am trying to program a TFT LCD by using BF706-kit board and I have found an example project:

 /cfs-file/__key/communityserver-discussions-components-files/399/EPPI_5F00_Tx_5F00_Auto_5F00_Buffer_5F00_mode.zip

I am using this project as a reference to my processor BF706 to initialize the LCD in SPI mode. I have a question regarding the code :

There are two functions in the code, the first one is "Configure_LCD()" and the second one is called "Write_LCD_Data()". 

I understand the functionality of the "Write_LCD_Data". It writes add/data into SPI controller to initialize the SPI LCD, based on the table on page 12 in datasheet for "NL8048HL11-01B". 

The function "Configure_LCD" also write some command IDs into the SPI controller :

void Configure_LCD(void)
{
	Init_SPI();
	*pREG_SPI2_SLVSEL= ENUM_SPI_SLVSEL_SSEL3_HI | ENUM_SPI_SLVSEL_SSEL3_EN;
	*pREG_SPI2_CTL 	 |= ENUM_SPI_CTL_EN;

	*pREG_SPI2_SLVSEL &= ~ENUM_SPI_SLVSEL_SSEL3_HI ;			//	select device
	*pREG_SPI2_SLVSEL &= ~ENUM_SPI_SLVSEL_SSEL3_HI ;			//	select device
	device_access_short(0xE402);								//	command ID
	unsigned short Reset_Reg_val = device_access_short(0x0000);
	*pREG_SPI2_SLVSEL |= ENUM_SPI_SLVSEL_SSEL3_HI ;				//	deselct_device
	*pREG_SPI2_SLVSEL |= ENUM_SPI_SLVSEL_SSEL3_HI ;				//	deselct_device

	*pREG_SPI2_SLVSEL &= ~ENUM_SPI_SLVSEL_SSEL3_HI ;			//	select device
	*pREG_SPI2_SLVSEL &= ~ENUM_SPI_SLVSEL_SSEL3_HI ;			//	select device
	device_access_short(0xE002);								//	command ID
	device_access_short(Reset_Reg_val | 0x200 | 0x10);
	*pREG_SPI2_SLVSEL |= ENUM_SPI_SLVSEL_SSEL3_HI ;				//	deselct_device
	*pREG_SPI2_SLVSEL |= ENUM_SPI_SLVSEL_SSEL3_HI ;				//	deselct_device

	int i;
	for (i=0;i<100000;i++)
		asm("nop;");

	*pREG_SPI2_SLVSEL &= ~ENUM_SPI_SLVSEL_SSEL3_HI ;			//	select device
	*pREG_SPI2_SLVSEL &= ~ENUM_SPI_SLVSEL_SSEL3_HI ;			//	select device
	device_access_short(0xE002);								//	command ID
	device_access_short(Reset_Reg_val|0x2000);
	*pREG_SPI2_SLVSEL |= ENUM_SPI_SLVSEL_SSEL3_HI ;				//	deselct_device
	*pREG_SPI2_SLVSEL |= ENUM_SPI_SLVSEL_SSEL3_HI ;				//	deselct_device

	*pREG_SPI2_RXCTL = 0;
	*pREG_SPI2_TXCTL = 0;
	*pREG_SPI2_CTL	 = 0;

	Write_LCD_Data();

	Disable_LCD_SPI();
}
 

I can't understand the command IDs from this function. I mean, where these command IDs are coming from? What are they doing?

 

Thank you.