液晶显示在嵌入式系统中的应用
来源:深圳电子技术网
作者:不详
时间:2007-03-04
Tag:
点击:
if ?*head?
{
/* The list is not empty. Add the new
node to the end of the list. */
new node->cs previous=?*head?
->cs previous?
(new node ->cs previous)->cs
next=new node?
new node-> cs next =?*head??
(new node->cs next)->cs previous
=new node;
}?
else
{
/* The list is empty? setup the head and
the new node. */
?*head? = new node?
new node -> cs previous = new node?
new node -> cs next = new node?
}
}
在建立了上述结构后,便可以得出行队列和页队列的组成方法:
lcdLine lcdLine?30??
lcdPage lcdPage?10?; //初始化列
lcdLine?0?..lcdseg?0?=0x80?
lcdLine?0?..lcdseg?1?=0x80?
lcdLine?0?..lcdseg?2?=0x80?
lcdLine?0?..lcdseg?3?=0xBC?
lcdLine?0?..lcdseg?4?=0x80?
lcdLine?0?..lcdseg?5?=0x97?
lcdLine?0?..lcdseg?6?=0x80?
lcdLine?0?..lcdseg?7?=0x98?
lcdLine?0?..lcdseg?8?=0x80?
lcdLine?0?..lcdseg?9?=0x99?
lcdLine?0?..lcdseg?10?=0x00?
lcdLine?0?..lcdseg?11?=0x00?
lcdLine?0?..lcdseg?12?=0x00?
lcdLine?0?..lcdseg?13?=0x00?
lcdLine?0?..lcdseg?14?=0x00?
lcdLine?0?..lcdseg?15?=0x00?
lcdLine?0?..start =1? //第二行起
lcdLine?0?..showflag =1? //汉字
lcdLine?0?.lineId =1001; //行标识
?firstlcdLine 1?=NULL?
CSC Place On List ?&firstlcdLine 1? &lcdLine?0??? //第一页中的第一行
CSC Place On List?&firstlcdLine 1?&lcdLine?1???
CSC Place On List ?&firstlcdLine 1? &lcdLine?2???
CSC Place On List ?&firstlcdLine 1? &lcdLine?3???由于四行即可组成一个循环队列,其中lcdLine?0?指定为第一页的第一个入口行,FirstlcdLine 1与lcdLine为同一行,lcdPage?0?页的入口行为firstlcd-Line;lcdPage?0?.firstLine=firstlcdLine 1?lcdPage?0?.pageID =1001,这样,依据该方法便可以生成任意多的页。具体方法如下:
lcdpage 1=NULL?
lcdPage Place On List?&lcdpage 1? &lcdpage?0???
lcdPage Place On List?&lcdpage 1? &lcdpage?1???
lcdPage Place On List?&lcdpage 1? &lcdpage?2???
lcdPage Place On List?&lcdpage 1? &lcdpage?3???
lcdPage Place On List?&lcdpage 1? &lcdpage?4???
lcdPage Place On List?&lcdpage 1? &lcdpage?5???
这样,用五页即可组成一个循环队列,其中lcd-page_1与lcdpage?0?为同一页。
对于行的显示,最基础的行显示方法如下:
void disp lcd Line?lcdMenu *lcdm?unsigned char start? //START为行号
{
unsigned char i?loop?
unsigned char zt?zt1?
unsigned char sign?
unsigned char offset?
unsigned char offlen?
unsigned char *phz?
unsigned char z0?
phz=?unsigned char *?&hz code table?
/汉字代码初地址
offset=start*16? //显示的位置 行号 *列号
offlen =0?
loop=0?
z0=0x00?
sign=lcdm->showflag? //是否为汉字
while?loop<16? //在同一行中从0列到15列
{
zt=lcdm->lcdseg?loop?? //取第一个代码
1.部分资源来自网络,经ET电子归类整理,旨在服务电子爱好者并无商业目的,不保证正确性与完整性.
2.如果您觉得本站资源对您有用,请告知您的好友,用搜索引擎搜"ET电子"即可.
0
最新评论共有 0 位网友发表了评论
查看所有评论
发表评论

