段式液晶模块的驱动
case 2: pSg2->BtL.DA = 1; pSg2->BtL.DB = 1; pSg2->BtL.DC = 0; pSg2-> case 2: pSg2->BtL.DA = 1; pSg2->BtL.DB = 1; pSg2->BtL.DC = 0; pSg2->BtL.DD = 1;
pSg1->BtH.DE = 1; pSg1->BtH.DF = 0; pSg1->BtH.DG = 1; break;
case 3: pSg2->BtL.DA = 1; pSg2->BtL.DB = 1; pSg2->BtL.DC = 1; pSg2->BtL.DD = 1;
pSg1->BtH.DE = 0; pSg1->BtH.DF = 0; pSg1->BtH.DG = 1; break;
case 4: pSg2->BtL.DA = 0; pSg2->BtL.DB = 1; pSg2->BtL.DC = 1; pSg2->BtL.DD = 0;
pSg1->BtH.DE = 0; pSg1->BtH.DF = 1; pSg1->BtH.DG = 1; break;
case 5: pSg2->BtL.DA = 1; pSg2->BtL.DB = 0; pSg2->BtL.DC = 1; pSg2->BtL.DD = 1;
pSg1->BtH.DE = 0; pSg1->BtH.DF = 1; pSg1->BtH.DG = 1; break;
case 6: pSg2->BtL.DA = 1; pSg2->BtL.DB = 0; pSg2->BtL.DC = 1; pSg2->BtL.DD = 1;
pSg1->BtH.DE = 1; pSg1->BtH.DF = 1; pSg1->BtH.DG = 1; break;
case 7: pSg2->BtL.DA = 1; pSg2->BtL.DB = 1; pSg2->BtL.DC = 1; pSg2->BtL.DD = 0;
pSg1->BtH.DE = 0; pSg1->BtH.DF = 0; pSg1->BtH.DG = 0; break;
case 8: pSg2->BtL.DA = 1; pSg2->BtL.DB = 1; pSg2->BtL.DC = 1; pSg2->BtL.DD = 1;
pSg1->BtH.DE = 1; pSg1->BtH.DF = 1; pSg1->BtH.DG = 1; break;
case 9: pSg2->BtL.DA = 1; pSg2->BtL.DB = 1; pSg2->BtL.DC = 1; pSg2->BtL.DD = 1;
pSg1->BtH.DE = 0; pSg1->BtH.DF = 1; pSg1->BtH.DG = 1; break;
case : pSg2->BtL.DA = 0; pSg2->BtL.DB = 0; pSg2->BtL.DC = 0; pSg2->BtL.DD = 0;
pSg1->BtH.DE = 0; pSg1->BtH.DF = 0; pSg1->BtH.DG = 0; break;
default: break;
}
}
/**************************************************************************************
* FunctionName : HTBColon()
* Description : 冒号
* EntryParameter : None
* ReturnValue : None
**************************************************************************************/
void HTBColon(OS_SWT swt)
{
HTBRam.Seg2.BtH.DO = (swt > 0) ? 1 : 0;
}
/**************************************************************************************
* FunctionName : HTBTemStl()
* Description : 温度
* EntryParameter : None
* ReturnValue : None
**************************************************************************************/
void HTBTemStl(u8 stl)
{
HTBRam.Seg7.BtH.K4 = 0;
HTBRam.Seg7.BtH.K5 = 0;
HTBRam.Seg7.BtH.K6 = 0;
HTBRam.Seg7.BtH.K7 = 0;
switch (stl)
{
case 0: HTBRam.Seg7.BtH.K4 = 1; break;
case 1: HTBRam.Seg7.BtH.K5 = 1; break;
case 2: HTBRam.Seg7.BtH.K6 = 1; break;
case 3: HTBRam.Seg7.BtH.K7 = 1; break;
default : break;
}
}
/**************************************************************************************
* FunctionName : HTBWndStl()
* Description : 风速
* EntryParameter : None
* ReturnValue : None
**************************************************************************************/
void HTBWndStl(u8 stl)
{
HTBRam.Seg6.BtL.K1 = 0;
HTBRam.Seg6.BtL.K2 = 0;
HTBRam.Seg6.BtL.K3 = 0;
switch (stl)
{
case 0: HTBRam.Seg6.BtL.K3 = 1; break;
case 1: HTBRam.Seg6.BtL.K2 = 1; break;
case 2: HTBRam.Seg6.BtL.K1 = 1; break;
default : break;
}
}
图标的驱动如上,其实就是根据需要修改每一个寄存器位,这个寄存器修改后,我们还必须得传递给HT1621更新显示,才能真正实现显示的驱动:
/**************************************************************************************
* FunctionName : HTB_SendBitMsb()
* Description : 发送发送多位[高位在前]
* EntryParameter : None
* ReturnValue : None
**************************************************************************************/
void HTB_SendBitMsb(u8 dat, u8 cnt)
{
for (u8 i=0; i { (dat & 0x80) ? GPIO_WriteHigh(HTB_DT_PORT, HTB_DT_PIN) : GPIO_WriteLow(HTB_DT_PORT, HTB_DT_PIN); dat <= 1; GPIO_WriteLow(HTB_WR_PORT, HTB_WR_PIN); HTB_DelayUs(3); GPIO_WriteHig
段式液晶模块驱 相关文章:
- 基于HT1621B段式液晶模块的驱动应用(11-18)
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)