我给你个3.5的驱动看看:(这是在S3C2440的基础上的驱动)
3.5 的LCM 是RGB 接口的,可以直接接到S3C2440 的LCD 控制器上!
#define SHARP_LCD
#ifdef SHARP_LCD
#define CSB PREG_TCON_CPV1
#define SCK PREG_TCON_OEV1
#define SDI PREG_TCON_OEH
#define LCD_RESET PREG_TCON_STH1
void delay_50ns(unsigned short n)
{
unsigned short i;
for(i=n;i>0;i--)
;
}
void Set_CSB_HIGH(void)
{
gpio_ctrl_mode_tcon(CSB,0); // set CSB ouput mode
gpio_tcon_set(CSB,1); // output high
}
void Set_CSB_LOW(void)
{
gpio_ctrl_mode_tcon(CSB,0); // set CSB ouput mode
gpio_tcon_set(CSB,0); // output LOW
}
void Set_SCK_HIGH(void)
{
gpio_ctrl_mode_tcon(SCK,0); // set SCK ouput mode
gpio_tcon_set(SCK,1); // output high
}
void Set_SCK_LOW(void)
{
gpio_ctrl_mode_tcon(SCK,0); // set SCK ouput mode
gpio_tcon_set(SCK,0); // output LOW
}
void Set_SDI_HIGH(void)
{
gpio_ctrl_mode_tcon(SDI,0); // set SDI ouput mode
gpio_tcon_set(SDI,1); // output high
}
void Set_SDI_LOW(void)
{
gpio_ctrl_mode_tcon(SDI,0); // set SDI ouput mode
gpio_tcon_set(SDI,0); // output LOW
}
/****************************************/
void SPI_Send_OneByte(INT8U comm , INT8U data)
{
INT8U i;
Set_SCK_HIGH();
Set_CSB_HIGH();
Set_CSB_LOW();
// delay_50ns(2);
Set_SCK_LOW(); // clock start
if(comm==0)
Set_SDI_LOW(); // send reg ,the DC bit is low
else
Set_SDI_HIGH();// send data ,the DC bit is high
Set_SCK_HIGH();
Set_SCK_LOW(); // clock start
for(i=0;i8);
SPI_Send_OneByte(1,(data&0x00ff));
}
void Init_SHARP35(void)
{
gpio_ctrl_mode_tcon(LCD_RESET,0); //
gpio_tcon_set(LCD_RESET,1); //reset lcd
delay_50ns(100);
SPI_Send_Data(0x28,0x0006);
SPI_Send_Data(0x2D,0x7F06);
SPI_Send_Data(0x01,0x2AEF); // zheng:0x2AEF, fang:0x29EF
SPI_Send_Data(0x02,0x0300);
SPI_Send_Data(0x03,0x080E);
SPI_Send_Data(0x0B,0xDC00);
SPI_Send_Data(0x16,0x9F86);
SPI_Send_Data(0x17,0x0002);
SPI_Send_Data(0x0C,0x0005);
SPI_Send_Data(0x0D,0x000F);
SPI_Send_Data(0x0E,0x2C00);
SPI_Send_Data(0x1E,0x0000);
SPI_Send_Data(0x2E,0xB945);
SPI_Send_Data(0x30,0x0000);
SPI_Send_Data(0x31,0x0305);
SPI_Send_Data(0x32,0x0001);
SPI_Send_Data(0x33,0x0201);
SPI_Send_Data(0x34,0x0607);
SPI_Send_Data(0x35,0x0204);
SPI_Send_Data(0x36,0x0707);
SPI_Send_Data(0x37,0x0203);
SPI_Send_Data(0x3A,0x0F0F);
SPI_Send_Data(0x3B,0x0F02);
SPI_Send_Data(0x2A,0x0196);
SPI_Send_Data(0x2D,0x7F04);
}
#endif