芯片是STM32F103,RA8806控制器240128显示屏,已可以正常显示字符汉字,我现在想显示点、图片都不行,贴出程序,各位帮忙看看,谢谢啦
显示点的函数,我尝试了两个都没显示
画点函数一、
void Dis_Point(u16 px, u8 py,u8 att)
{
u8 x_msb,value,ex_value;
x_msb = px>>3;
value = 1<<(7-px & 0x0007);
setaddress(x_msb,py);
ex_value = LCD_DataRead(0xb1);
if(att)
ex_value |= value;
else
ex_value &= ~value;
LCD_Graphic();
LCD_CmdWrite(0xb0);
LCD_DataWrite(ex_value);
}
画点函数二、
void Dis_Point(u16 px, u8 py)
{
u8 x_msb,value,ex_value;
x_msb = px>>3;//等于px除以8
value = 1<<(7-px & 0x0007);
setaddress(x_msb,py);
LCD_Graphic();
LCD_CmdWrite(0xb0);
LCD_DataWrite(value);
}
画图函数:
void disp_Graphic2() //boxing
{
unsigned char i, j;
LCD_Graphic(); //绘图模式打开
Only_Show_Page2();
Access_Page2() ; //存取DDRAM2
clear(); //清DDRAM2
setaddress(0,0);
LCD_CmdWrite(0Xb0);
for(i=0;i<128;i++)
{
for(j=0;j<30;j++)
{
LCD_DataWrite(pic1[i*30+j]);
}
}
}
void Only_Show_Page2(void)
{
unsigned char temp;
temp=LCD_CmdRead(0x12);
temp &=0xaf;
temp |=0x20;
LCD_CmdWrite(0x12);
LCD_DataWrite(temp);
}
void Access_Page2(void)
{
unsigned char temp;
temp=LCD_CmdRead(0x12);
temp &=0xfe;
temp |=0x02;
LCD_CmdWrite(0x12);
LCD_DataWrite(temp);
}
//*************绘图模式**************************
void LCD_Graphic(void)
{
u8 temp;
temp=LCD_CmdRead(0x00);
temp &=0xf7;
LCD_CmdWrite(0x00);
LCD_DataWrite(temp);
Clear_Snow(); //开启消除雪花功能
}
消除雪花
void Clear_Snow(void) //在文本方式下,无法使用消除雪花模式,在图形模式下可以用
{ unsigned char temp;
temp=LCD_CmdRead(0x01);
temp |=0x80;
LCD_CmdWrite(0x01);
LCD_DataWrite(temp);
} |