//http://en.lcdlcd.com/product3/2013-08-30/8456.chtml
//NOTE:VCC=3.3V,使用RGB接口必须要用SPI初始化.
//****************************************************************
void write_command (unsigned char y) // (uchar y,uchar x)
{
unsigned char i;
cs=0;
rs=0;
for(i=0;i<8;i++)
{
scl=0;
if (y&0x80)
sdi=1;
else
sdi=0;
scl=1;
y=y<<1;
}
cs=1;
}
//***************************************************************
void write_data(unsigned char w) // (uchar w, uchar v)
{
unsigned char i;
cs=0;
rs=1;
for(i=0;i<8;i++)
{
scl=0;
if (w&0x80)
sdi=1;
else
sdi=0;
scl=1;
w=w<<1;
}
cs=1;
}
/*************************************************/
void initi(void)
{
res=1;
delay(1);
res=0;
delay(10);
res=1;
delay(120);
/***************************************/
write_command(0xE0);
write_data(0x00);
write_data(0x04);
write_data(0x0E);
write_data(0x08);
write_data(0x17);
write_data(0x0A);
write_data(0x40);
write_data(0x79);
write_data(0x4D);
write_data(0x07);
write_data(0x0E);
- 1
- 2
- 3
- 4
- 5
- 6
前往页