User Tools

Site Tools


ips

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ips [2018/01/20 02:46] – [修改代码] adminips [2025/10/14 06:22] (current) – external edit 127.0.0.1
Line 1: Line 1:
-==== IPS/TFT液晶屏 ==== +==== SPI驱动液晶屏(framebuffer方式) ==== 
-这个页面讲述如何使用MT7688A驱动液晶屏幕。 8-)+这个页面讲述如何使用MT7688A驱动液晶屏幕。 8-) ,据了解,在MT7688上用FB方法驱动彩屏,WIDORA首当其冲。 
 + 
 +教程做好的固件:  {{ ::openwrt-ramips-mt7688-widora32m-9341.bin |}}
  
 ===准备=== ===准备===
Line 23: Line 25:
 | 3V3 电源 | BL 背光控制,高电平点亮 | | 3V3 电源 | BL 背光控制,高电平点亮 |
  
-{{ ::wechatimg42.jpeg |}}+{{ ::wechatimg42.jpeg?600 |}}
  
-====修改代码====+===修改代码===
 首先,保证有openwrt_widora的代码并且编译过,因为涉及到内核代码修改,不编译是找不到内核源码的。 首先,保证有openwrt_widora的代码并且编译过,因为涉及到内核代码修改,不编译是找不到内核源码的。
  
Line 45: Line 47:
 4 回到openwrt_widora根目录,运行make kernel_menuconfig,找 4 回到openwrt_widora根目录,运行make kernel_menuconfig,找
   Device Drivers  --->   Device Drivers  --->
 +    Character devices  ---> 
 +
 +{{::屏幕快照_2018-01-20_上午11.18.18.png|}}   
 +   
     Graphics support  --->     Graphics support  --->
-    [*] VGA Arbitration                                                                 +     
-            (16)  Maximum number of GPUs                                                        +{{::屏幕快照_2018-01-20_上午11.19.04.png|}} 
-                 Direct Rendering Manager  --->                                                 + 
-                 Frame buffer Devices  ---                                                     +分别展开看:  
-                 -*- Backlight & LCD device support  --->                                           +   Direct Rendering Manager  --->  
-                 Console display driver support  --->                                           +      < Direct Rendering Manager (XFree86 4.1.0 and higher DRI support ---- 
-             [*] Bootup logo  --->  +    
-   +
-  +
   Frame buffer Devices  --->    Frame buffer Devices  ---> 
-     <*> Support for small TFT LCD display modules  ---> +      <*> Support for small TFT LCD display modules  ---> 
-       <*>   FB driver for the ILI9341 LCD Controller +        <*>   FB driver for the ILI9341 LCD Controller
-       +
                
-  Bootup logo                                                                            +   
-                         [*]   Standard black and white Linux logo (NEW)      +   
 +  -*- Backlight & LCD device support  ---> 这一项无需关心 
 + 
 +  Console display driver support  --->  
 +{{::屏幕快照_2018-01-20_上午11.21.39.png|}}   
 +      
 +  Bootup logo  --->                                                                          
 +                         [ ]   Standard black and white Linux logo (NEW)      
                          [*]   Standard 16-color Linux logo (NEW)                                      [*]   Standard 16-color Linux logo (NEW)            
                          [*]   Standard 224-color Linux logo (NEW)                          [*]   Standard 224-color Linux logo (NEW)
Line 90: Line 100:
 由于配置内核后,会和openwrt里个别选项冲突,例如有如下需要手动选择的情况,按照正常平台选择即可。 由于配置内核后,会和openwrt里个别选项冲突,例如有如下需要手动选择的情况,按照正常平台选择即可。
 {{::屏幕快照_2018-01-20_上午10.44.21.png|}} {{::屏幕快照_2018-01-20_上午10.44.21.png|}}
 +
 +===颜色反了===
 +修改fb_ili9341.c,在0x11前增加一条0x21指令:
 +    write_reg(par, 0x21);
 +    write_reg(par, 0x11); /* sleep out */
 +修改后编译,刷入NEO。
 +
 +===自动关屏幕问题===
 +在drivers/tty/vt.c中设定了自动关屏时间为10分钟,LCD在执行了关屏动作后可能出现错误,不能再恢复正常. 找到其中 static int blankinterval = 10*60; 这一句, 将数值改为0,自动关屏功能就会失效.
 +
 +===测试===
 +
 +不出意外,可以看到启动logo了:
 +
 +{{::wechatimg43.jpeg?600|}}
 +
 +终端,可以看到/dev/下有了fb0设备:
 +
 +{{::屏幕快照_2018-01-20_上午11.29.02.png|}}
 +
 +把随机数打印到屏幕,不出意外看到花屏,root@Widora:~# cat /dev/urandom > /dev/fb0
 +
 +{{::wechatimg44.jpeg|}}
 +
 +把屏幕例化成了很多tty设备,所以也可以往屏幕打印字符了: 
 +  root@Widora:~# echo hello > /dev/tty0
 +  root@Widora:~# echo hello > /dev/tty0
 +  root@Widora:~# echo hello > /dev/tty0
 +  root@Widora:~# echo hello > /dev/tty0
 +  root@Widora:~# echo hello > /dev/tty0
 +  
 +效果:
 +
 +{{::wechatimg45.jpeg|}}
ips.1516416378.txt.gz · Last modified: (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki