hi,
am using tms320c6745 kit , now planning to interface the SPI BASED TFT. I have sample driver code ., the only thing is i want to know how to transmit 8 bit data through SIMO pin. if possible please write the spi code data transfer.please refer the following code to solve my problem
void GLCD_Write_Command(unsigned char GLCD_Command)
{
TFT_CS_LOW(); // Enable GLCD Interface
GLCD_SPI_Read_Write(0x70); // Sent Byte 1 = [Device ID Code:01110[0]]+[RS:0] + [R/W:0]
GLCD_SPI_Read_Write(0x00); // Sent Byte 2 = data 8 bit High Index Reg.: 0x00
GLCD_SPI_Read_Write(GLCD_Command); // Sent Byte 3 = data 8 bit Low index reg. : cmm
TFT_CS_HIGH(); // Disable GLCD Interface
}
void GLCD_Write_Data(unsigned int GLCD_Data)
{
TFT_CS_LOW(); // Enable GLCD Interface
GLCD_SPI_Read_Write(0x72); // Byte 1 = [Device ID Code:01110[0]]+[RS:1] + [R/W:0]
GLCD_SPI_Read_Write(GLCD_Data >> 8); // Byte 2 = Data 8 bit High
GLCD_SPI_Read_Write(GLCD_Data); // Byte 3 = Data 8 bit Low
TFT_CS_HIGH(); // Disable GLCD Interface
}
/********************************/
/* Initial GLCD : */
/* (Driver SPFD5408A) */
/********************************/
void Initial_GLCD_Hor(void)
{
unsigned long cnt;
GLCD_Write_Command(0x00); // Command Start Oscillater
GLCD_Write_Data(0x0001); // Enable the oscillator.
delay_ms(10); // Delay for 10ms while the oscillator stabilizes.
// Display Setting
GLCD_Write_Command(0x01); // Configure the output drivers.
GLCD_Write_Data(0x0100);
.......................
................
.............
TFT_BL_ON(); //Back Light ON
delay_ms(20); //Delay for 20ms, which is equivalent to two frames.
}
To transmit the above command we have to write the spi read write function? can anyone help me in this ? the following is SPI read / write function.
/****************************/
/* GLCD SPI Sent Data 8 bit */
/****************************/
unsigned char GLCD_SPI_Read_Write(unsigned char DataByte)
{
.............................
.........................
........................................ i need the some body has to fill this function to successfully transfer the command to GLCD of TFT.
}
Many Thanks,
S..Thiyagarajan.