页次: 1
geekchun 说:看下驱动代码里面,开窗偏移量对吗
后来带了一块自带对应驱动的ili9341还是老毛病,换成内核主线4.10一下就好了
我也用的5.x,参考这个链接改了下驱动,
@司徒
如您所说,驱动IC正是GC9306,我参考的初始化序列如下,我记得只修改了旋转方向,您可以先参考下,修改后的我明天发出来
//------------- display control setting -----------------------//
LCD_WR_REG(0xfe);
LCD_WR_REG(0xef);
LCD_WR_REG(0x36);
// LCD_WR_DATA(0x48); // Y=0 X=1 V=0 L=0 0x48
LCD_WR_DATA(0x98); // Y=1 X=0 V=0 L=1 0x98
LCD_WR_REG(0x3a);
LCD_WR_DATA(0x05);
LCD_WR_REG(0x35);
LCD_WR_DATA(0x00);
LCD_WR_REG(0x44);
LCD_WR_DATA(0x00);
LCD_WR_DATA(0x60);
//------end display control setting----//
//------Power Control Registers Initial----//
LCD_WR_REG(0xa4);
LCD_WR_DATA(0x44);
LCD_WR_DATA(0x44);
LCD_WR_REG(0xa5);
LCD_WR_DATA(0x42);
LCD_WR_DATA(0x42);
LCD_WR_REG(0xaa);
LCD_WR_DATA(0x88);
LCD_WR_DATA(0x88);
LCD_WR_REG(0xe8);
LCD_WR_DATA(0x11);
LCD_WR_DATA(0x71);
LCD_WR_REG(0xe3);
LCD_WR_DATA(0x01);
LCD_WR_DATA(0x10);
LCD_WR_REG(0xff);
LCD_WR_DATA(0x61);
LCD_WR_REG(0xAC);
LCD_WR_DATA(0x00);
LCD_WR_REG(0xAe);
LCD_WR_DATA(0x2b);
LCD_WR_REG(0xAd);
LCD_WR_DATA(0x33);
LCD_WR_REG(0xAf);
LCD_WR_DATA(0x55);
LCD_WR_REG(0xa6);
LCD_WR_DATA(0x2a);
LCD_WR_DATA(0x2a);
LCD_WR_REG(0xa7);
LCD_WR_DATA(0x2b);
LCD_WR_DATA(0x2b);
LCD_WR_REG(0xa8);
LCD_WR_DATA(0x18);
LCD_WR_DATA(0x18);
LCD_WR_REG(0xa9);
LCD_WR_DATA(0x2a);
LCD_WR_DATA(0x2a);
//-----display window 240X320---------//
LCD_WR_REG(0x2a);
LCD_WR_DATA(0x00);
LCD_WR_DATA(0x00);
LCD_WR_DATA(0x00);
LCD_WR_DATA(0xef);
LCD_WR_REG(0x2b); // 0x002B = 239
LCD_WR_DATA(0x00);
LCD_WR_DATA(0x00);
LCD_WR_DATA(0x01);
LCD_WR_DATA(0x3f); // 0x013F = 319
// LCD_WR_REG(0x2c);
//--------end display window --------------//
//------------gamma setting------------------//
LCD_WR_REG(0xf0);
LCD_WR_DATA(0x02);
LCD_WR_DATA(0x01);
LCD_WR_DATA(0x00);
LCD_WR_DATA(0x00);
LCD_WR_DATA(0x02);
LCD_WR_DATA(0x09);
LCD_WR_REG(0xf1);
LCD_WR_DATA(0x01);
LCD_WR_DATA(0x02);
LCD_WR_DATA(0x00);
LCD_WR_DATA(0x11);
LCD_WR_DATA(0x1c);
LCD_WR_DATA(0x15);
LCD_WR_REG(0xf2);
LCD_WR_DATA(0x0a);
LCD_WR_DATA(0x07);
LCD_WR_DATA(0x29);
LCD_WR_DATA(0x04);
LCD_WR_DATA(0x04);
LCD_WR_DATA(0x38);//v43n 39
LCD_WR_REG(0xf3);
LCD_WR_DATA(0x15);
LCD_WR_DATA(0x0d);
LCD_WR_DATA(0x55);
LCD_WR_DATA(0x04);
LCD_WR_DATA(0x03);
LCD_WR_DATA(0x65);//v43p 66
LCD_WR_REG(0xf4);
LCD_WR_DATA(0x0f);//v50n
LCD_WR_DATA(0x1d);//v57n
LCD_WR_DATA(0x1e);//v59n
LCD_WR_DATA(0x0a);//v61n 0b
LCD_WR_DATA(0x0d);//v62n 0d
LCD_WR_DATA(0x0f);
LCD_WR_REG(0xf5);
LCD_WR_DATA(0x05);//v50p
LCD_WR_DATA(0x12);//v57p
LCD_WR_DATA(0x11);//v59p
LCD_WR_DATA(0x34);//v61p 35
LCD_WR_DATA(0x34);//v62p 34
LCD_WR_DATA(0x0f);
//-------end gamma setting----//
LCD_WR_REG(0x11); // SleepOut
HAL_Delay(120);
LCD_WR_REG(0x29); // Display ON
LCD_WR_REG(0x2c);
大佬们,可以不可以帮我看下我画(抄)的原理图有啥错误吗?
昨天焊上芯片串口啥输出也没有,晶振有1.7v,搞到两点,心态爆炸了
Schematic_Allwinner_V3x.pdf
酷酷酷 说:542396750@qq.com 说:注释tcon0,fb0就没了
https://blog.csdn.net/qq_46604211/article/details/116449891?spm=1001.2014.3001.5501
可以参考下我这个,最后有写打印console信息目前可以显示画面,就是色彩不对,STM32单片机显示又是正常的
具体什么样子,发个图,伽马校正弄了吗
画了个F1C200S板子,板载了个1.14的IPS屏幕,想用来显示终端。参考这位大神的博客,用licheepi的linux-4.15分支,发现fbtft代码部分有差异,后来在kernel.org上下载了新的版本5.9.1,参照博客修改设备树和驱动后发现屏幕已经点亮了,但是显示不全。查看fb_st7789v.c发现分辨率是320 * 240,我的这块是135 * 240,修改分辨率发现还是显示不全,并且部分花屏。于是下载了STM32的示例代码,发现135*240屏幕较320 *240屏幕在设置反翻转的同时设置了偏移量,在设置窗口的时候加上了这个偏移量,检查fbtft-core.c中的fbtft_set_addr_win函数发现并没有设置偏移量,于是手动修改添加,重新编译kernel后,发现已经显示正常= =
贴出修改后的代码(没有考虑可移植性,只是简单实现正常显示)
static void fbtft_set_addr_win(struct fbtft_par *par, int xs, int ys, int xe,
int ye)
{
switch(par->info->var.rotate)
{
case 0: xs+=53;xe+=53;ys+=40;ye+=40;
break;
case 90: xs+=40;xe+=40;ys+=53;ye+=53;
break;
case 180: xs+=53;xe+=53;ys+=40;ye+=40;
break;
case 270: xs+=40;xe+=40;ys+=53;ye+=53;
break;
default :
break;
}
write_reg(par, MIPI_DCS_SET_COLUMN_ADDRESS,
(xs >> 8) & 0xFF, xs & 0xFF, (xe >> 8) & 0xFF, xe & 0xFF);
write_reg(par, MIPI_DCS_SET_PAGE_ADDRESS,
(ys >> 8) & 0xFF, ys & 0xFF, (ye >> 8) & 0xFF, ye & 0xFF);
write_reg(par, MIPI_DCS_WRITE_MEMORY_START);
}
页次: 1