/*************************************************
*原型:void write_lcdbit(unsigned char bit)
*功能:LCD送数
*说明:LCD-HT1622 数据在高锁存
*参数:bit
*返回:无
**************************************************/
void write_lcdbit(unsigned char bit)
{
CLR_LCDWD;
if(!bit) CLR_LCDDATA;
SET_LCDWD; //数据在高锁存
SET_LCDDATA;
}
/*************************************************
*原型:void write_lcdbyte(unsigned char addr,unsigned char data)
*功能:LCD送数
*说明:LCD-HT1622 命令:101 100100 0101
*参数:addr 地址,data 数据
*返回:无
**************************************************/
void write_lcdbyte(unsigned char addr,unsigned char data)
{//命令:101?
//地址:000111
//数据:0001
unsigned char i;
CLR_LCDCS;
write_lcdbit(1);
write_lcdbit(0);
write_lcdbit(1);
for(i=0;i<6;i++)//送地址
{
write_lcdbit(addr&0x20);
addr<<=1;
}
for(i=0;i<4;i++)//送数
{
write_lcdbit(data&0x01);
data>>=1;
}
SET_LCDCS;
}
/*************************************************
*原型:void write_lcdcmd(unsigned char cmd)
*功能:LCD送命令
*说明:LCD-HT1622 命令:101 10010 0101
*参数:unsigned char cmd
*返回:无
**************************************************/
void write_lcdcmd(unsigned char cmd)
{
unsigned char i;
CLR_LCDCS;
write_lcdbit(1);
write_lcdbit(0);
write_lcdbit(0);
for(i=0;i<8;i++)
{
write_lcdbit(cmd&0x80);
cmd<<=1;
}
write_lcdbit(1);
SET_LCDCS;
}
/*************************************************
*原型:void update_lcd(unsigned char *p,unsigned char length)
*功能:将显示缓冲区数据写入LCD ,长度为length
*说明:LCD-HT1622
*参数:*p 指向显示缓冲区,length 显示缓冲区长度
*返回:无
**************************************************/
void update_lcd(unsigned char *p,unsigned char length)
{
unsigned char i,j;
CLR_LCDCS;
write_lcdbit(1);
write_lcdbit(0);
write_lcdbit(1);
for(i=0;i<6;i++)
{
write_lcdbit(0);
}
for(i=0;i
{
for(j=0;j<8;j++)
{
write_lcdbit((*p)&0x01);
(*p)>>=1;
}
p++;
}
SET_LCDCS;
}
回复 楼主 maker 的帖子
楼主用的是 什么 单片机 指令周期是多少的
有IC 驱动程序可以提供,完美替代兼容HT1622 LQFP48 LQFP44 LQFP52 LQFP64 QFP64
QQ 191 888 5898 ,另外还有工程技术支持!
联系人:许先生 QQ:1918885898 电话:18898582398 免费样品赠送,工程技术支持,PDF产品资料提供!