|
发表于 2013-3-5 09:21:48
|
显示全部楼层
小哥你在么 你在的么,我最近也在搞个SSD1322的显示屏,你这个程序里面的注释不够清楚,
那个位转化函数式什么意思啊 没有看懂,能帮忙解释下么
void pic_1()
{
unsigned char x,y;
unsigned int i=0;
Write_Command(0x15);
Write_Data(0x1c); //
Write_Data(0x5b); //91 91-28=63
Write_Command(0x75);
Write_Data(0x00); //0
Write_Data(0x3f); //63 63-0=63
Write_Command(0x5C);
for(y=0;y<64;y++)
{
for(x=0;x<32;x++)
{
unsigned char code_buf,code_buf2;
code_buf=pic_code[i++];
code_buf2=code_buf&0xc0;
send_2bit(code_buf2);
code_buf2=code_buf&0x30;
code_buf2<<=2;
send_2bit(code_buf2);
code_buf2=code_buf&0x0c;
code_buf2<<=4;
send_2bit(code_buf2);
code_buf2=code_buf&0x03;
code_buf2<<=6;
send_2bit(code_buf2);
}
}
}
void send_2bit(unsigned char two_bit_data)
{
if(two_bit_data==0x00)
Write_Data(0x00);
else if(two_bit_data==0x40)
Write_Data(0x0f);
else if(two_bit_data==0x80)
Write_Data(0xf0);
else
Write_Data(0xff);
} |
|