彩屏MMI 黑白屏显示的驱动修改
时间:10-02
整理:3721RD
点击:
彩屏MMI 黑白屏显示的驱动修改,例子如下 128X32
void LCD_BlockWrite_SSD1306Z(kal_uint16 startx,kal_uint16 starty,kal_uint16 endx,kal_uint16 endy)
{
kal_uint8* buff_ptr;
kal_uint8 temp;
kal_uint16 buffer_tmp;
kal_uint16 i,j,p,b,x;
ASSERT(lcd_assert_fail==KAL_FALSE);
lcd_assert_fail = KAL_TRUE;
gdi_layer_get_buffer_ptr(&buff_ptr);
while (LCD_IS_RUNNING){};
#if 1
//kal_pROMpt_led_leo_trace(0,"startx=%d,endx=%d,starty=%d,endy=%d",startx,endx,starty,endy);
for(p=0;p<=1;p++)
{
Set_Start_Page_SSD1306Z(p);
Set_Start_Column_SSD1306Z(0x00);
for(x=0;x<LCD_WIDTH;x++)
{
temp=0;
for(b=0;b<8;b++)
{
buffer_tmp = (kal_uint16)*((kal_uint16*)buff_ptr+((((p<<3)+b)*LCD_WIDTH)+x));
if(buffer_tmp==0xffff)
{
temp|= 1<<b;
}
else
{
temp&= ~(1<<b);
}
}
Write_Data(temp);
}
}
#else
display_white();
#endif
ENABLE_LCD_TRANSFER_COMPLETE_INT;
DISABLE_LCD_ROI_CTRL_CMD_FIRST;
START_LCD_TRANSFER;
lcd_assert_fail = KAL_FALSE;
}
void LCD_BlockWrite_SSD1306Z(kal_uint16 startx,kal_uint16 starty,kal_uint16 endx,kal_uint16 endy)
{
kal_uint8* buff_ptr;
kal_uint8 temp;
kal_uint16 buffer_tmp;
kal_uint16 i,j,p,b,x;
ASSERT(lcd_assert_fail==KAL_FALSE);
lcd_assert_fail = KAL_TRUE;
gdi_layer_get_buffer_ptr(&buff_ptr);
while (LCD_IS_RUNNING){};
#if 1
//kal_pROMpt_led_leo_trace(0,"startx=%d,endx=%d,starty=%d,endy=%d",startx,endx,starty,endy);
for(p=0;p<=1;p++)
{
Set_Start_Page_SSD1306Z(p);
Set_Start_Column_SSD1306Z(0x00);
for(x=0;x<LCD_WIDTH;x++)
{
temp=0;
for(b=0;b<8;b++)
{
buffer_tmp = (kal_uint16)*((kal_uint16*)buff_ptr+((((p<<3)+b)*LCD_WIDTH)+x));
if(buffer_tmp==0xffff)
{
temp|= 1<<b;
}
else
{
temp&= ~(1<<b);
}
}
Write_Data(temp);
}
}
#else
display_white();
#endif
ENABLE_LCD_TRANSFER_COMPLETE_INT;
DISABLE_LCD_ROI_CTRL_CMD_FIRST;
START_LCD_TRANSFER;
lcd_assert_fail = KAL_FALSE;
}
高手啊,真厉害,学习了
Set_Start_Page_SSD1306Z Set_Start_Column_SSD1306Z Write_Data 请问这几个函数是自己写的吗? 我似乎找不到类似的
收藏下 以后看
学习。学习
128x64的也可以这么写吗?
这是屏驱动部分 不同的屏 是不一样的 具体根据你的屏而定
都可以这么写 ,只是驱动部分要和你的屏一致就可以了
程序不走这段呀 不修改宏能行吗?
学习,路过
支持,早日成为苹果
今天刚学功能机,有调屏的资料吗,求分享
make ....................