📄 ssd1852(ref).c
字号:
}
/****************************************************
* con_dec Function*
****************************************************/
void con_dec(int i)
{
if (--i <0)
i = 0;
comm_out(0x81);// Set contrast 1
comm_out(0x00+i); // Set contrast 2
}
/****************************************************
* write_demo1 Function*
****************************************************/
void write_demo1()
{
int i, j;
for(i=0xBD;i<=0xBF;i++)
{
comm_out(i); // Set page address
comm_out(0x00); // Lower col address = 0000
comm_out(0x10); // Higher col address = 0000
for(j=0;j<256;j++)
data_out(0x00);
}
i=0;
comm_out(0xB0); // Set page address
comm_out(0x00); // Lower col address = 0000
comm_out(0x10); // Higher col address = 0000
for(j=0;j<256;j++)
data_out(Logo_SSL[i*256+j]);
i++;
comm_out(0xB7); // Set page address
comm_out(0x00); // Lower col address = 0000
comm_out(0x10); // Higher col address = 0000
Solomon Systech Aug 2002 P 12 Rev 0.2 SSD1852T2
for(j=0;j<256;j++)
data_out(Logo_SSL[i*256+j]);
i++;
comm_out(0xB8); // Set page address
comm_out(0x00); // Lower col address = 0000
comm_out(0x10); // Higher col address = 0000
for(j=0;j<256;j++)
data_out(Logo_SSL[i*256+j]);
i++;
comm_out(0xB9); // Set page address
comm_out(0x00); // Lower col address = 0000
comm_out(0x10); // Higher col address = 0000
for(j=0;j<256;j++)
data_out(Logo_SSL[i*256+j]);
i++;
comm_out(0xBA); // Set page address
comm_out(0x00); // Lower col address = 0000
comm_out(0x10); // Higher col address = 0000
for(j=0;j<256;j++)
data_out(Logo_SSL[i*256+j]);
i++;
comm_out(0xBB); // Set page address
comm_out(0x00); // Lower col address = 0000
comm_out(0x10); // Higher col address = 0000
for(j=0;j<256;j++)
data_out(Logo_SSL[i*256+j]);
i++;
comm_out(0xBC); // Set page address
comm_out(0x00); // Lower col address = 0000
comm_out(0x10); // Higher col address = 0000
for(j=0;j<256;j++)
data_out(Logo_SSL[i*256+j]);
i++;
comm_out(0xB1); // Set page address
comm_out(0x00); // Lower col address = 0000
comm_out(0x10); // Higher col address = 0000
for(j=0;j<256;j++)
data_out(Logo_SSL[i*256+j]);
i++;
comm_out(0xB2); // Set page address
comm_out(0x00); // Lower col address = 0000
comm_out(0x10); // Higher col address = 0000
for(j=0;j<256;j++)
data_out(Logo_SSL[i*256+j]);
}
/****************************************************
* scroll_color Function*
****************************************************/
void scroll_color(void)
{
unsigned char i;
for (i=0;i<20;i++)
{
comm_out(0x88);
comm_out(0x0c);
comm_out(0x89);
comm_out(0x00);
comm_out(0x8a);
comm_out(0xcc);
comm_out(0x8b);
comm_out(0x00);
comm_out(0x8c);
comm_out(0xcc);
comm_out(0x8d);
comm_out(0xcc);
comm_out(0x8e);
comm_out(0x00);
comm_out(0x8f);
comm_out(0x00);
delay(1);
comm_out(0x88);
comm_out(0x00);
comm_out(0x89);
comm_out(0xcc);
comm_out(0x8a);
comm_out(0xcc);
comm_out(0x8b);
comm_out(0xcc);
comm_out(0x8c);
comm_out(0x00);
comm_out(0x8d);
comm_out(0x00);
comm_out(0x8e);
comm_out(0x0c);
comm_out(0x8e);
comm_out(0x00);
delay(1);
comm_out(0x88);
comm_out(0xcc);
comm_out(0x89);
comm_out(0xcc);
comm_out(0x8a);
comm_out(0x00);
comm_out(0x8b);
comm_out(0x00);
comm_out(0x8c);
comm_out(0x0c);
comm_out(0x8d);
comm_out(0x00);
comm_out(0x8e);
comm_out(0x00);
comm_out(0x8f);
comm_out(0xcc);
delay(1);
comm_out(0x88);
comm_out(0x00);
comm_out(0x89);
comm_out(0x00);
comm_out(0x8a);
comm_out(0x0c);
comm_out(0x8b);
comm_out(0x00);
comm_out(0x8c);
comm_out(0x00);
comm_out(0x8d);
comm_out(0xcc);
comm_out(0x8e);
comm_out(0xcc);
comm_out(0x8f);
comm_out(0xcc);
delay(1);
}
}
/****************************************************
* color_inc Function*
****************************************************/
void color_inc(void)
{
unsigned int i, j;
for(i=0;i<=0x0c;i++)
{
comm_out(0x8a);
comm_out(i);
comm_out(0x8c);
comm_out(0x11*i);
comm_out(0x8e);
comm_out(0x11*i);
comm_out(0x8f);
comm_out(0x11*i);
delay(0);
}
}
/****************************************************
* color_dec Function*
****************************************************/
void color_dec(void)
{
int i;
for(i=0;i<=0x0c;i++)
{
comm_out(0x8a);
comm_out(0x0c-i);
comm_out(0x8c);
comm_out(0xcc-(i*0x11));
comm_out(0x8e);
comm_out(0xcc-(i*0x11));
comm_out(0x8f);
comm_out(0xcc-(i*0x11));
delay(0);
}
}
/****************************************************
* blink Function*
****************************************************/
void blink(char color)
{ unsigned char i;
for (i=0;i<2;i++)
{
comm_out(0x88+(2*color));
comm_out(0x00);
comm_out(0x89+(2*color));
comm_out(0x00);
delay(delay_time/8);
comm_out(0x88+(2*color));
comm_out(0xcc);
comm_out(0x89+(2*color));
comm_out(0xcc);
delay(delay_time/8);
}
}
/****************************************************
* wall_patt Function*
****************************************************/
void wall_patt()
{
unsigned int i, j;
for(i=0;i<page;i++)
{
comm_out(0xB0+i); // Set page address
comm_out(0x00); // Lower col address = 0000
comm_out(0x10); // Higher col address = 0000
for(j=0;j<256;j++)
data_out(title0[i*256+j]);
}
delay(delay_time);
blink(3);
delay(delay_time);
for(i=0;i<page;i++)
{
comm_out(0xB0+i); // Set page address
comm_out(0x00); // Lower col address = 0000
comm_out(0x10); // Higher col address = 0000
for(j=0;j<256;j++)
data_out(title1[i*256+j]);
}
delay(delay_time);
}
/****************************************************
* write_pack Function*
****************************************************/
void write_pack()
{
int i, j, k;
for(i=0;i<page;i++)
{
comm_out(0xB0+i); // Set page address
comm_out(0x00); // Lower col address = 0000
comm_out(0x10); // Higher col address = 0000
for(j=0;j<256;j++)
data_out(pack[i*256+j]);
}
}
/****************************************************
* write_web Function*
****************************************************/
void write_web()
{
int i, j, k;
for(i=0;i<page;i++)
{
comm_out(0xB0+i); // Set page address
comm_out(0x00); // Lower col address = 0000
comm_out(0x10); // Higher col address = 0000
for(j=0;j<256;j++)
data_out(web[i*256+j]);
}
}
/****************************************************
* write_thank Function*
****************************************************/
void write_thank()
{
int i, j, k;
for(i=0;i<page;i++)
{
comm_out(0xB0+i); // Set page address
comm_out(0x00); // Lower col address = 0000
comm_out(0x10); // Higher col address = 0000
for(j=0;j<256;j++)
data_out(thank[i*256+j]);
}
}
/****************************************************
* write_chk Function*
****************************************************/
void write_chk(void)
{
int i, j;
f
or (i=0;i<16;i++)
{
comm_out(0xb0+i);
comm_out(0x10);
comm_out(0x00);
for(j=0;j<64;j++)
{
data_out(0xAA);
data_out(0xAA);
data_out(0x55);
data_out(0x55);
}
}
}
/****************************************************
* write_bar Function*
****************************************************/
void write_bar(void)
{
unsigned char i, j, k;
for(i=0;i<16;i++)
{
Comm_out(0xb0+i);
Comm_out(0x00);
Comm_out(0x10);
for(k=0;k<4;k++)
{
for(j=0;j<16;j++) data_out(0x00);
for(j=0;j<8;j++)
{
data_out(0x00);
data_out(0xFF);
}
for(j=0;j<8;j++)
{
data_out(0xFF);
data_out(0x00);
}
for(j=0;j<8;j++)
{
data_out(0xFF);
data_out(0xFF);
}
}
}
}
/****************************************************
* write_star Function*
****************************************************/
void write_star(void)
{
int i, j;
f
or (i=0;i<page;i++)
{
comm_out(0xb0+i);
comm_out(0x10);
comm_out(0x00);
for(j=0;j<256;j++)
{
data_out(star[i*256+j]);
}
}
}
/****************************************************
* Main Function*
****************************************************/
void main (void)
{
Char all, z;
int i, j;
All=0;
outport(CNTL_PORT, 0x80); // Initiate the operation mode of 82C55
do
{
init_lcd();
Comm_out(0x8a);
Comm_out(0x00);
Comm_out(0x8b);
Comm_out(0x00);
Comm_out(0x8c);
Comm_out(0x00);
Comm_out(0x8d);
Comm_out(0x00);
Comm_out(0x8e);
Comm_out(0x00);
Comm_out(0x8f);
Comm_out(0x00);
write_logo();
Color_inc();
delay(delay_time/2);
wall_patt();
Color_dec();
write_resol();
Color_inc();
delay(delay_time/2);
Color_dec();
Color_inc();
write_chk();
delay(delay_time);
Color_dec();
Color_inc();
write_bar();
delay(delay_time);
Color_dec();
Color_inc();
write_star();
delay(delay_time);
Color_dec();
Color_inc();
write_level();
write_smap();
write_cmap();
write_lchk();
scroll_color();
write_pack();
delay(delay_time);
write_web();
delay(delay_time);
write_thank();
delay(delay_time);
} while (-1);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -