nokia7110 LCD 显示汉字
d all points on
delay_ms(500);
nokia_write_command(0xAE); // lcd off
nokia_cls();
nokia_write_command(0xAF); // lcd on
nokia_write_command(0xA4); // lcd normal display mode
}
/**********************************************************
sent 8 bit data to LCD by series
**********************************************************/
void nokia_write_dorc(uchar bytefornokia)
{
SPI_sendB(bytefornokia);
}
/**********************************************************
Sent Command to LCD Function
**********************************************************/
void nokia_write_command(uchar bytefornokia_command)
{
CLR_DC; // lcd command mode
CLR_CS; // chip enabled
nokia_write_dorc(bytefornokia_command);
SET_CS; // chip disabled
}
/**********************************************************
Sent Data to LCD Function
**********************************************************/
void nokia_write_data(uchar bytefornokia_data) {
SET_DC; // display data mode
CLR_CS; // chip enabled
nokia_write_dorc(bytefornokia_data);
SET_CS; // chip disabled
}
/**********************************************************
goto xy position on LCD Function
**********************************************************/
void nokia_gotoxy(uchar lcd_row, uchar lcd_col)
{ //lcy_row: 0 - 8 (8th column has only 1 line / D0, lcd_col: 0 -15
char col_addr;
nokia_write_command(0xB0 + lcd_row); // page address set. pg 8-48 in the datasheet.
col_addr = 0x12+(lcd_col); // each FONT has five columns + 1 blank column. xaddr: 0 - 95 on noki
//a 7110. no offset.
//lcd_1st_col=0x12: the first column of display starts here. Weird! the datasheet didnt mention it.
nokia_write_command(0x10 | (col_addr>>4)); // column address 4 most bit set
nokia_write_command(0x0f & col_addr); // column address 4 least bit set
}
/**********************************************************
在xy位置xie一个字节
**********************************************************/
void lcdpixel(uchar x, uchar y,uchar d)// 左下角为(0,0) x 0-75 有个bug
// y 0-63
{
nokia_gotoxy(x,y);
nokia_write_data(d);
}
void lcd_HZ(uchar x,uchar y,uchar *s)
{
uchar i;
y=y*16;
for(i=0;i<16;i++)
{
lcdpixel(x,y+i,s[i]);
}
for(i=16;i<32;i++)
{
lcdpixel(x+1,y+i-16,s[i]);
}
}
void main()
{
uchar i;
DDRD=0XFF;
SPI_init();
nokia_init();
//lcdpixel(1,0,0xaa);
for(i=0;i<8;i++)
lcd_HZ(0,i,HZ[i]);
//nokia_write_command(0xa5); //diaplay all points on
//while(1);
}
字模的提取还是用的PCtoLCD2000


######################################################################
上面的“家”,没显示出来

void main()
{
uchar i;
DDRD=0XFF;
SPI_init();
nokia_init();
//lcdpixel(1,0,0xaa);
for(i=0;i<6;i++)
lcd_HZ(0,i,HZ[i]);
lcd_HZ(2,0,HZ[6]);
//nokia_write_command(0xa5); //diaplay all points on
//while(1);
}
nokia7110LCD显示汉 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)
