📄 lcd_s6b0724.c
字号:
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xF8,0x9C,0x8C,0x0C,
0x0C,0x0C,0x1C,0x38,0x30,0x00,0x00,0x00,0x80,0xC0,0xC0,0xC0,0xC0,0xC0,0x80,0x00,
0x00,0x00,0xC0,0xC0,0x80,0xC0,0xC0,0xC0,0xC0,0x80,0x00,0x00,0x00,0x80,0xC0,0xC0,
0xC0,0xC0,0xC0,0x80,0x00,0x00,0x00,0x80,0xC0,0xC0,0xC0,0xC0,0xC0,0x80,0x00,0x00,
0x0C,0x7C,0xF0,0x80,0x00,0x00,0x00,0x00,0x00,0x80,0xF0,0x7C,0x0C,0x00,0xCC,0xCC,
0x00,0x00,0x80,0xC0,0xC0,0xC0,0xC0,0xC0,0x80,0x00,0x00,0xCC,0xCC,0x00,0x00,0x00,
0x80,0xC0,0xC0,0xC0,0xC0,0xC0,0x80,0x00,0x00,0x00,0xC0,0xC0,0x80,0xC0,0xC0,0xC0,
0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x70,0xE1,0xC1,0xC3,
0xC3,0xC3,0xE6,0x7E,0x3C,0x00,0x00,0x3F,0x7F,0xED,0xCC,0xCC,0xCC,0xCD,0x6F,0x2F,
0x00,0x00,0xFF,0xFF,0x01,0x00,0x00,0x00,0x01,0xFF,0xFF,0x00,0x00,0x63,0xE7,0xC6,
0xCC,0xCC,0xF9,0x79,0x00,0x00,0x3F,0x7F,0xED,0xCC,0xCC,0xCC,0xCD,0x6F,0x2F,0x00,
0x00,0x00,0x01,0x0F,0x3E,0xF0,0xC0,0xF0,0x3E,0x0F,0x01,0x00,0x00,0x00,0xFF,0xFF,
0x00,0x00,0x63,0xE7,0xC6,0xCC,0xCC,0xF9,0x79,0x00,0x00,0xFF,0xFF,0x00,0x00,0x3F,
0x7F,0xE1,0xC0,0xC0,0xC0,0xE1,0x7F,0x3F,0x00,0x00,0xFF,0xFF,0x01,0x00,0x00,0x00,
0x01,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
*/
};
void send2LCM(uchar rs,uchar dat )/* rs=0时写入控制指令,rs=1时写入显示数据 */
{
uchar i;
if(rs==0)mLcd_A0_COM;
else mLcd_A0_DAT;
mLcd_CS_EN;
for (i=0;i<8;i++)
{
mLcd_SCL_0;
if ((dat & 0x80)!=0)mLcd_SI_1;
else mLcd_SI_0;
mLcd_SCL_1;
dat = dat<<1;
}
mLcd_CS_DIS;
}
void lcdclear(uchar dat1,uchar dat2)/*写测试数据到LCD全屏*/
{
uchar i,j;
for(i = 0xb0;i<0xb8;i++)
{
send2LCM(0,i); //写页地址
send2LCM(0,0x10); //写初始列地址
send2LCM(0,0x00);
for(j = 0x00;j<0x41;j++)
{
send2LCM(1,dat1); //写显示数据
send2LCM(1,dat2);
}
}
}
void initlcm(void) /*初始化LCM*/
{
mLcd_RES_0; //硬复位
vIdledelay_B(200);
mLcd_RES_1;
send2LCM(0,0xe2); /*软件复位*/
vIdledelay_B(200);
send2LCM(0,0xa2); /*LCD BIAS=1/9*/
send2LCM(0,0xa0); /*列地址移动方向:ADC=0(SEG1->SEG132)*/
send2LCM(0,0xc8); /*行扫描方向:SHL=1(COM64->COM1)*/
vIdledelay_B(200);
send2LCM(0,0x2f); /*电源控制模式:VC,VR,VF=111*/
vIdledelay_B(200);
send2LCM(0,0x26); /*内部调整电阻比率:R2,R1,R0=111*/
vIdledelay_B(200);
send2LCM(0,0x81); /*对比度寄存器模式*/
//send2LCM(0,0x10); /*对比度寄存器值 修改这个值就可以调节对比度了 */
send2LCM(0,0x08); /*对比度寄存器值 修改这个值就可以调节对比度了 */
send2LCM(0,0x40); /*起始行*/
send2LCM(0,0xe0); /*写入数据时列地址自动加1,但读时不变*/
send2LCM(0,0xaf); /*开显示*/
}
void dishz(uchar x_add,uchar y_add,uchar ucStartAdd)
{/*x_add 页地址 y_add 列地址 *p 字模数据地址*/
uchar i,pag,colh,coll;
pag = x_add*2+0xb0;
colh = y_add>>4; /*取y_add的高4位*/
colh = colh | 0xf0;
colh = colh & 0x1f;
coll = y_add & 0x0f; /*取y_add的低4位*/
send2LCM(0,colh);
send2LCM(0,coll);
send2LCM(0,pag);
for (i=0;i<32;i++)
{
if (i == 16)
{
send2LCM(0,pag+1);
send2LCM(0,colh);
send2LCM(0,coll);
}
send2LCM(1,mucHZ[ucStartAdd++]);
}
}
void disbmp(void)/*显示一幅128*64的图片*/
{
uchar i,j;
uint uiAdd = 0;
for (i = 0xb0;i<0xb8;i++)
{
send2LCM(0,i);
send2LCM(0,0x10);
send2LCM(0,0x00);
for (j=0x02;j<0x82;j++)
send2LCM(1,mucPIC[uiAdd++]);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -